diff --git a/LICENSE b/LICENSE index 737e352..eb76287 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ - Copyright 2016 Aylien, Inc. All Rights Reserved. + Copyright 2019 Aylien, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 3a9f560..9f43603 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,146 @@ -# AYLIEN News API +# AYLIEN News API - PHP SDK -AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. +The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. Sign up at [https://newsapi.aylien.com/](https://newsapi.aylien.com/). For more documentation see [https://newsapi.aylien.com/docs/](https://newsapi.aylien.com/docs/). -## Bug Reports -If you've got a bug report, please contact us at support@aylien.com. \ No newline at end of file +## Requirements + +PHP 5.5 and later + +## Installation & Usage + +### Composer + +To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "require": { + "aylien/newsapi": "~3.0.0" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php + require_once('/path/to/aylien/newsapi/vendor/autoload.php'); +``` + +## Tests + +To run the unit tests: + +```bash +composer install +./vendor/bin/phpunit +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```php +setApiKey('X-AYLIEN-NewsAPI-Application-ID', $_SERVER['NEWSAPI_APP_ID']); + +// Configure API key authorization: app_key +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', $_SERVER['NEWSAPI_APP_KEY']); + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + new GuzzleHttp\Client(), + $config +); + +$opts = array( + 'title' => 'trump', + 'publishedAtStart' => 'NOW-7DAYS', + 'publishedAtEnd' => 'NOW', + 'entitiesBodyLinksDbpedia' => [ + 'http://dbpedia.org/resource/Donald_Trump', + 'http://dbpedia.org/resource/Hillary_Rodham_Clinton' + ], + 'notLanguage' => ['en'], + 'sortBy' => 'social_shares_count.facebook' +); + +try { + $result = $apiInstance->listStories($opts); + for($i = 0; $i < sizeof($result->getStories()); $i++){ + print_r($result->getStories()[$i]->getTitle() . " / " . + $result->getStories()[$i]->getSource()->getName() . "\n"); + } +} catch (Exception $e) { + print_r($e->getResponseObject()->getErrors()); + echo 'Exception when calling DefaultApi->listStories: ', $e->getMessage(), "\n"; +} +?> +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.aylien.com/news* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**listAutocompletes**](docs/Api/DefaultApi.md#listautocompletes) | **GET** /autocompletes | List autocompletes +*DefaultApi* | [**listClusters**](docs/Api/DefaultApi.md#listclusters) | **GET** /clusters | List Clusters +*DefaultApi* | [**listCoverages**](docs/Api/DefaultApi.md#listcoverages) | **GET** /coverages | List coverages +*DefaultApi* | [**listHistograms**](docs/Api/DefaultApi.md#listhistograms) | **GET** /histograms | List histograms +*DefaultApi* | [**listRelatedStories**](docs/Api/DefaultApi.md#listrelatedstories) | **GET** /related_stories | List related stories +*DefaultApi* | [**listStories**](docs/Api/DefaultApi.md#liststories) | **GET** /stories | List Stories +*DefaultApi* | [**listTimeSeries**](docs/Api/DefaultApi.md#listtimeseries) | **GET** /time_series | List time series +*DefaultApi* | [**listTrends**](docs/Api/DefaultApi.md#listtrends) | **GET** /trends | List trends + + +## Documentation For Models + + - [Author](docs/Model/Author.md) + - [Autocomplete](docs/Model/Autocomplete.md) + - [Autocompletes](docs/Model/Autocompletes.md) + - [Category](docs/Model/Category.md) + - [CategoryLinks](docs/Model/CategoryLinks.md) + - [Cluster](docs/Model/Cluster.md) + - [Clusters](docs/Model/Clusters.md) + - [Coverages](docs/Model/Coverages.md) + - [Entities](docs/Model/Entities.md) + - [Entity](docs/Model/Entity.md) + - [EntityLinks](docs/Model/EntityLinks.md) + - [Error](docs/Model/Error.md) + - [ErrorLinks](docs/Model/ErrorLinks.md) + - [Errors](docs/Model/Errors.md) + - [HistogramInterval](docs/Model/HistogramInterval.md) + - [Histograms](docs/Model/Histograms.md) + - [Location](docs/Model/Location.md) + - [Media](docs/Model/Media.md) + - [Rank](docs/Model/Rank.md) + - [Rankings](docs/Model/Rankings.md) + - [RelatedStories](docs/Model/RelatedStories.md) + - [RepresentativeStory](docs/Model/RepresentativeStory.md) + - [Scope](docs/Model/Scope.md) + - [Sentiment](docs/Model/Sentiment.md) + - [Sentiments](docs/Model/Sentiments.md) + - [ShareCount](docs/Model/ShareCount.md) + - [ShareCounts](docs/Model/ShareCounts.md) + - [Source](docs/Model/Source.md) + - [Stories](docs/Model/Stories.md) + - [Story](docs/Model/Story.md) + - [StoryCluster](docs/Model/StoryCluster.md) + - [StoryLinks](docs/Model/StoryLinks.md) + - [StoryTranslations](docs/Model/StoryTranslations.md) + - [StoryTranslationsEn](docs/Model/StoryTranslationsEn.md) + - [Summary](docs/Model/Summary.md) + - [TimeSeries](docs/Model/TimeSeries.md) + - [TimeSeriesList](docs/Model/TimeSeriesList.md) + - [Trend](docs/Model/Trend.md) + - [Trends](docs/Model/Trends.md) diff --git a/autoload.php b/autoload.php deleted file mode 100644 index f386520..0000000 --- a/autoload.php +++ /dev/null @@ -1,63 +0,0 @@ -=5.4", + "php": ">=7.1", "ext-curl": "*", "ext-json": "*", - "ext-mbstring": "*" + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^6.2" }, "require-dev": { - "phpunit/phpunit": "~4.8", - "satooshi/php-coveralls": "~1.0", + "phpunit/phpunit": "^7.4", "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~1.12" + "friendsofphp/php-cs-fixer": "~2.12" }, "autoload": { "psr-4": { "Aylien\\NewsApi\\" : "lib/" } diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index e4ae09f..d6cca0a 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -1,51 +1,61 @@ # Aylien\NewsApi\DefaultApi -All URIs are relative to *https://api.newsapi.aylien.com/api/v1* +All URIs are relative to *https://api.aylien.com/news* Method | HTTP request | Description ------------- | ------------- | ------------- [**listAutocompletes**](DefaultApi.md#listAutocompletes) | **GET** /autocompletes | List autocompletes -[**listCoverages**](DefaultApi.md#listCoverages) | **POST** /coverages | List coverages +[**listClusters**](DefaultApi.md#listClusters) | **GET** /clusters | List Clusters +[**listCoverages**](DefaultApi.md#listCoverages) | **GET** /coverages | List coverages [**listHistograms**](DefaultApi.md#listHistograms) | **GET** /histograms | List histograms -[**listRelatedStories**](DefaultApi.md#listRelatedStories) | **POST** /related_stories | List related stories +[**listRelatedStories**](DefaultApi.md#listRelatedStories) | **GET** /related_stories | List related stories [**listStories**](DefaultApi.md#listStories) | **GET** /stories | List Stories [**listTimeSeries**](DefaultApi.md#listTimeSeries) | **GET** /time_series | List time series [**listTrends**](DefaultApi.md#listTrends) | **GET** /trends | List trends -# **listAutocompletes** -> \Aylien\NewsApi\Models\Autocompletes listAutocompletes($type, $term, $opts) + +## listAutocompletes + +> \Aylien\NewsApi\Models\Autocompletes listAutocompletes($type, $term, $language, $perPage) List autocompletes -This endpoint is used for getting list of autocompletes by providing a specific term and type. +The autocompletes endpoint a string of characters provided to it, and then returns suggested terms that are the most likely full words or strings. The terms returned by the News API are based on parameters the type parameters you can see below. For example, if you provide the autocompletes endpoint with the term `New York C` and select the type `dbpedia_resources`, the API will return links to the DBpedia resources `New_York_City`, `New_York_City_Subway`, `New_York_City_Police_Department`, and so on. ### Example + ```php setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); // Configure API key authorization: app_key -Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); -$api_instance = new Aylien\NewsApi\Api\DefaultApi(); -$type = "type_example"; -$term = "term_example"; - -$opts = array( - 'language' => "en", - 'per_page' => 3 +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config ); +$associate_array['type'] = source_names; // string | This parameter is used for defining the type of autocompletes. +$associate_array['term'] = News; // string | This parameter is used for finding autocomplete objects that contain the specified value. +$associate_array['language'] = 'en'; // string | This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['perPage'] = 3; // int | This parameter is used for specifying number of items in each page. try { - $result = $api_instance->listAutocompletes($type, $term, $opts); + $result = $apiInstance->listAutocompletes($associate_array); print_r($result); } catch (Exception $e) { - print_r($e->getResponseObject()->getErrors()); echo 'Exception when calling DefaultApi->listAutocompletes: ', $e->getMessage(), PHP_EOL; } ?> @@ -53,12 +63,15 @@ try { ### Parameters +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type** | **string**| This parameter is used for defining the type of autocompletes. | [enum: source_names, source_domains, entity_types, dbpedia_resources] + **type** | **string**| This parameter is used for defining the type of autocompletes. | **term** | **string**| This parameter is used for finding autocomplete objects that contain the specified value. | - **language** | **string**| This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [default to en] [enum: en, de, fr, it, es, pt] - **per_page** | **int**| This parameter is used for specifying number of items in each page. | [optional] [default to 3] + **language** | **string**| This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [default to 'en'] + **perPage** | **int**| This parameter is used for specifying number of items in each page. | [optional] [default to 3] ### Return type @@ -66,134 +79,239 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key), [app_id](../../README.md#app_id) +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listClusters + +> \Aylien\NewsApi\Models\Clusters listClusters($id, $notId, $storyCountMin, $storyCountMax, $timeStart, $timeEnd, $earliestStoryStart, $earliestStoryEnd, $latestStoryStart, $latestStoryEnd, $locationCountry, $notLocationCountry) + +List Clusters + +The clusters endpoint is used to return clusters based on parameters you set in your query. + +### Example + +```php +setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); + +// Configure API key authorization: app_key +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); + + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$associate_array['id'] = array(56); // int[] | This parameter is used for finding clusters by cluster id. +$associate_array['notId'] = array(56); // int[] | This parameter is used for excluding clusters by cluster id. +$associate_array['storyCountMin'] = 56; // int | This parameter is used for finding clusters with more than or equal to a specific amount of stories associated with them. +$associate_array['storyCountMax'] = 56; // int | This parameter is used for finding clusters with less than or equal to a specific amount of stories associated with them. +$associate_array['timeStart'] = 'timeStart_example'; // string | This parameter is used for finding clusters whose creation time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['timeEnd'] = 'timeEnd_example'; // string | This parameter is used for finding clusters whose creation time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['earliestStoryStart'] = 'earliestStoryStart_example'; // string | This parameter is used for finding clusters whose publication date of its earliest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['earliestStoryEnd'] = 'earliestStoryEnd_example'; // string | This parameter is used for finding clusters whose publication date of its earliest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['latestStoryStart'] = 'latestStoryStart_example'; // string | This parameter is used for finding clusters whose publication date of its latest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['latestStoryEnd'] = 'latestStoryEnd_example'; // string | This parameter is used for finding clusters whose publication date of its latest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['locationCountry'] = array('locationCountry_example'); // string[] | This parameter is used for finding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notLocationCountry'] = array('locationCountry_example'); // string[] | This parameter is used for excluding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). + +try { + $result = $apiInstance->listClusters($associate_array); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->listClusters: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**int[]**](../Model/int.md)| This parameter is used for finding clusters by cluster id. | [optional] + **notId** | [**int[]**](../Model/int.md)| This parameter is used for excluding clusters by cluster id. | [optional] + **storyCountMin** | **int**| This parameter is used for finding clusters with more than or equal to a specific amount of stories associated with them. | [optional] + **storyCountMax** | **int**| This parameter is used for finding clusters with less than or equal to a specific amount of stories associated with them. | [optional] + **timeStart** | **string**| This parameter is used for finding clusters whose creation time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **timeEnd** | **string**| This parameter is used for finding clusters whose creation time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **earliestStoryStart** | **string**| This parameter is used for finding clusters whose publication date of its earliest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **earliestStoryEnd** | **string**| This parameter is used for finding clusters whose publication date of its earliest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **latestStoryStart** | **string**| This parameter is used for finding clusters whose publication date of its latest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **latestStoryEnd** | **string**| This parameter is used for finding clusters whose publication date of its latest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **locationCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notLocationCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + +### Return type + +[**\Aylien\NewsApi\Models\Clusters**](../Model/Clusters.md) + +### Authorization + +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, text/xml +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **listCoverages** -> \Aylien\NewsApi\Models\Coverages listCoverages($opts) +## listCoverages + +> \Aylien\NewsApi\Models\Coverages listCoverages($id, $notId, $title, $body, $text, $translationsEnTitle, $translationsEnBody, $translationsEnText, $language, $notLanguage, $publishedAtStart, $publishedAtEnd, $categoriesTaxonomy, $categoriesConfident, $categoriesId, $notCategoriesId, $categoriesLevel, $notCategoriesLevel, $entitiesTitleText, $notEntitiesTitleText, $entitiesTitleType, $notEntitiesTitleType, $entitiesTitleLinksDbpedia, $notEntitiesTitleLinksDbpedia, $entitiesBodyText, $notEntitiesBodyText, $entitiesBodyType, $notEntitiesBodyType, $entitiesBodyLinksDbpedia, $notEntitiesBodyLinksDbpedia, $sentimentTitlePolarity, $notSentimentTitlePolarity, $sentimentBodyPolarity, $notSentimentBodyPolarity, $mediaImagesCountMin, $mediaImagesCountMax, $mediaImagesWidthMin, $mediaImagesWidthMax, $mediaImagesHeightMin, $mediaImagesHeightMax, $mediaImagesContentLengthMin, $mediaImagesContentLengthMax, $mediaImagesFormat, $notMediaImagesFormat, $mediaVideosCountMin, $mediaVideosCountMax, $authorId, $notAuthorId, $authorName, $notAuthorName, $sourceId, $notSourceId, $sourceName, $notSourceName, $sourceDomain, $notSourceDomain, $sourceLocationsCountry, $notSourceLocationsCountry, $sourceLocationsState, $notSourceLocationsState, $sourceLocationsCity, $notSourceLocationsCity, $sourceScopesCountry, $notSourceScopesCountry, $sourceScopesState, $notSourceScopesState, $sourceScopesCity, $notSourceScopesCity, $sourceScopesLevel, $notSourceScopesLevel, $sourceLinksInCountMin, $sourceLinksInCountMax, $sourceRankingsAlexaRankMin, $sourceRankingsAlexaRankMax, $sourceRankingsAlexaCountry, $socialSharesCountFacebookMin, $socialSharesCountFacebookMax, $socialSharesCountGooglePlusMin, $socialSharesCountGooglePlusMax, $socialSharesCountLinkedinMin, $socialSharesCountLinkedinMax, $socialSharesCountRedditMin, $socialSharesCountRedditMax, $clusters, $return, $storyId, $storyUrl, $storyTitle, $storyBody, $storyPublishedAt, $storyLanguage, $perPage) List coverages -This endpoint is used for finding story coverages based on the parameters provided. The maximum number of related stories returned is 100. +The coverages endpoint allows you to understand the reach a document has had. For example, you can track the coverage of a press release or a Tweet based on how many times it has been mentioned in stories. ### Example + ```php setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); // Configure API key authorization: app_key -Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY'); - -$api_instance = new Aylien\NewsApi\Api\DefaultApi(); - - -$opts = array( - 'id' => array(56), - 'not_id' => array(56), - 'title' => "title_example", - 'body' => "body_example", - 'text' => "text_example", - 'language' => array("language_example"), - 'not_language' => array("not_language_example"), - 'published_at_start' => "published_at_start_example", - 'published_at_end' => "published_at_end_example", - 'categories_taxonomy' => "categories_taxonomy_example", - 'categories_confident' => true, - 'categories_id' => array("categories_id_example"), - 'not_categories_id' => array("not_categories_id_example"), - 'categories_level' => array(56), - 'not_categories_level' => array(56), - 'entities_title_text' => array("entities_title_text_example"), - 'not_entities_title_text' => array("not_entities_title_text_example"), - 'entities_title_type' => array("entities_title_type_example"), - 'not_entities_title_type' => array("not_entities_title_type_example"), - 'entities_title_links_dbpedia' => array("entities_title_links_dbpedia_example"), - 'not_entities_title_links_dbpedia' => array("not_entities_title_links_dbpedia_example"), - 'entities_body_text' => array("entities_body_text_example"), - 'not_entities_body_text' => array("not_entities_body_text_example"), - 'entities_body_type' => array("entities_body_type_example"), - 'not_entities_body_type' => array("not_entities_body_type_example"), - 'entities_body_links_dbpedia' => array("entities_body_links_dbpedia_example"), - 'not_entities_body_links_dbpedia' => array("not_entities_body_links_dbpedia_example"), - 'sentiment_title_polarity' => "sentiment_title_polarity_example", - 'not_sentiment_title_polarity' => "not_sentiment_title_polarity_example", - 'sentiment_body_polarity' => "sentiment_body_polarity_example", - 'not_sentiment_body_polarity' => "not_sentiment_body_polarity_example", - 'media_images_count_min' => 56, - 'media_images_count_max' => 56, - 'media_images_width_min' => 56, - 'media_images_width_max' => 56, - 'media_images_height_min' => 56, - 'media_images_height_max' => 56, - 'media_images_content_length_min' => 56, - 'media_images_content_length_max' => 56, - 'media_images_format' => array("media_images_format_example"), - 'not_media_images_format' => array("not_media_images_format_example"), - 'media_videos_count_min' => 56, - 'media_videos_count_max' => 56, - 'author_id' => array(56), - 'not_author_id' => array(56), - 'author_name' => "author_name_example", - 'not_author_name' => "not_author_name_example", - 'source_id' => array(56), - 'not_source_id' => array(56), - 'source_name' => array("source_name_example"), - 'not_source_name' => array("not_source_name_example"), - 'source_domain' => array("source_domain_example"), - 'not_source_domain' => array("not_source_domain_example"), - 'source_locations_country' => array("source_locations_country_example"), - 'not_source_locations_country' => array("not_source_locations_country_example"), - 'source_locations_state' => array("source_locations_state_example"), - 'not_source_locations_state' => array("not_source_locations_state_example"), - 'source_locations_city' => array("source_locations_city_example"), - 'not_source_locations_city' => array("not_source_locations_city_example"), - 'source_scopes_country' => array("source_scopes_country_example"), - 'not_source_scopes_country' => array("not_source_scopes_country_example"), - 'source_scopes_state' => array("source_scopes_state_example"), - 'not_source_scopes_state' => array("not_source_scopes_state_example"), - 'source_scopes_city' => array("source_scopes_city_example"), - 'not_source_scopes_city' => array("not_source_scopes_city_example"), - 'source_scopes_level' => array("source_scopes_level_example"), - 'not_source_scopes_level' => array("not_source_scopes_level_example"), - 'source_links_in_count_min' => 56, - 'source_links_in_count_max' => 56, - 'source_rankings_alexa_rank_min' => 56, - 'source_rankings_alexa_rank_max' => 56, - 'source_rankings_alexa_country' => array("source_rankings_alexa_country_example"), - 'social_shares_count_facebook_min' => 56, - 'social_shares_count_facebook_max' => 56, - 'social_shares_count_google_plus_min' => 56, - 'social_shares_count_google_plus_max' => 56, - 'social_shares_count_linkedin_min' => 56, - 'social_shares_count_linkedin_max' => 56, - 'social_shares_count_reddit_min' => 56, - 'social_shares_count_reddit_max' => 56, - 'cluster' => false, - 'cluster_algorithm' => "lingo", - 'return' => array("return_example"), - 'story_id' => 789, - 'story_url' => "story_url_example", - 'story_title' => "story_title_example", - 'story_body' => "story_body_example", - 'story_published_at' => new \DateTime(), - 'story_language' => "auto", - 'per_page' => 3 +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); + + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config ); +$associate_array['id'] = array(56); // int[] | This parameter is used for finding stories by story id. +$associate_array['notId'] = array(56); // int[] | This parameter is used for excluding stories by story id. +$associate_array['title'] = 'title_example'; // string | This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['body'] = 'body_example'; // string | This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['text'] = 'text_example'; // string | This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnTitle'] = 'translationsEnTitle_example'; // string | This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnBody'] = 'translationsEnBody_example'; // string | This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnText'] = 'translationsEnText_example'; // string | This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['language'] = array('language_example'); // string[] | This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['notLanguage'] = array('language_example'); // string[] | This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['publishedAtStart'] = 'publishedAtStart_example'; // string | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['publishedAtEnd'] = 'publishedAtEnd_example'; // string | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['categoriesTaxonomy'] = 'categoriesTaxonomy_example'; // string | This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesConfident'] = true; // bool | This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesLevel'] = array(56); // int[] | This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesLevel'] = array(56); // int[] | This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['entitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['sentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for finding stories whose title sentiment is the specified value. +$associate_array['notSentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for excluding stories whose title sentiment is the specified value. +$associate_array['sentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for finding stories whose body sentiment is the specified value. +$associate_array['notSentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for excluding stories whose body sentiment is the specified value. +$associate_array['mediaImagesCountMin'] = 56; // int | This parameter is used for finding stories whose number of images is greater than or equal to the specified value. +$associate_array['mediaImagesCountMax'] = 56; // int | This parameter is used for finding stories whose number of images is less than or equal to the specified value. +$associate_array['mediaImagesWidthMin'] = 56; // int | This parameter is used for finding stories whose width of images are greater than or equal to the specified value. +$associate_array['mediaImagesWidthMax'] = 56; // int | This parameter is used for finding stories whose width of images are less than or equal to the specified value. +$associate_array['mediaImagesHeightMin'] = 56; // int | This parameter is used for finding stories whose height of images are greater than or equal to the specified value. +$associate_array['mediaImagesHeightMax'] = 56; // int | This parameter is used for finding stories whose height of images are less than or equal to the specified value. +$associate_array['mediaImagesContentLengthMin'] = 56; // int | This parameter is used for finding stories whose images content length are greater than or equal to the specified value. +$associate_array['mediaImagesContentLengthMax'] = 56; // int | This parameter is used for finding stories whose images content length are less than or equal to the specified value. +$associate_array['mediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for finding stories whose images format are the specified value. +$associate_array['notMediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for excluding stories whose images format are the specified value. +$associate_array['mediaVideosCountMin'] = 56; // int | This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. +$associate_array['mediaVideosCountMax'] = 56; // int | This parameter is used for finding stories whose number of videos is less than or equal to the specified value. +$associate_array['authorId'] = array(56); // int[] | This parameter is used for finding stories whose author id is the specified value. +$associate_array['notAuthorId'] = array(56); // int[] | This parameter is used for excluding stories whose author id is the specified value. +$associate_array['authorName'] = 'authorName_example'; // string | This parameter is used for finding stories whose author full name contains the specified value. +$associate_array['notAuthorName'] = 'authorName_example'; // string | This parameter is used for excluding stories whose author full name contains the specified value. +$associate_array['sourceId'] = array(56); // int[] | This parameter is used for finding stories whose source id is the specified value. +$associate_array['notSourceId'] = array(56); // int[] | This parameter is used for excluding stories whose source id is the specified value. +$associate_array['sourceName'] = array('sourceName_example'); // string[] | This parameter is used for finding stories whose source name contains the specified value. +$associate_array['notSourceName'] = array('sourceName_example'); // string[] | This parameter is used for excluding stories whose source name contains the specified value. +$associate_array['sourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for finding stories whose source domain is the specified value. +$associate_array['notSourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for excluding stories whose source domain is the specified value. +$associate_array['sourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLinksInCountMin'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceLinksInCountMax'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceRankingsAlexaRankMin'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaRankMax'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaCountry'] = array('sourceRankingsAlexaCountry_example'); // string[] | This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['socialSharesCountFacebookMin'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountFacebookMax'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMin'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMax'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMin'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMax'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountRedditMin'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountRedditMax'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. +$associate_array['clusters'] = array('clusters_example'); // string[] | This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). +$associate_array['return'] = array('return_example'); // string[] | This parameter is used for specifying return fields. +$associate_array['storyId'] = 56; // int | A story id +$associate_array['storyUrl'] = 'storyUrl_example'; // string | An article or webpage +$associate_array['storyTitle'] = 'storyTitle_example'; // string | Title of the article +$associate_array['storyBody'] = 'storyBody_example'; // string | Body of the article +$associate_array['storyPublishedAt'] = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). +$associate_array['storyLanguage'] = 'auto'; // string | This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['perPage'] = 3; // int | This parameter is used for specifying number of items in each page. try { - $result = $api_instance->listCoverages($opts); + $result = $apiInstance->listCoverages($associate_array); print_r($result); } catch (Exception $e) { - print_r($e->getResponseObject()->getErrors()); echo 'Exception when calling DefaultApi->listCoverages: ', $e->getMessage(), PHP_EOL; } ?> @@ -201,98 +319,103 @@ try { ### Parameters +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int[]**| This parameter is used for finding stories by story id. | [optional] - **not_id** | **int[]**| This parameter is used for excluding stories by story id. | [optional] - **title** | **string**| This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **body** | **string**| This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **text** | **string**| This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **language** | **string[]**| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **not_language** | **string[]**| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **published_at_start** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **published_at_end** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **categories_taxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [enum: iab-qag, iptc-subjectcode] - **categories_confident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] - **categories_id** | **string[]**| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_id** | **string[]**| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **categories_level** | **int[]**| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_level** | **int[]**| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **entities_title_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **sentiment_title_polarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_title_polarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **sentiment_body_polarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_body_polarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **media_images_count_min** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] - **media_images_count_max** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] - **media_images_width_min** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] - **media_images_width_max** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] - **media_images_height_min** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] - **media_images_height_max** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] - **media_images_content_length_min** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] - **media_images_content_length_max** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] - **media_images_format** | **string[]**| This parameter is used for finding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **not_media_images_format** | **string[]**| This parameter is used for excluding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **media_videos_count_min** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] - **media_videos_count_max** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] - **author_id** | **int[]**| This parameter is used for finding stories whose author id is the specified value. | [optional] - **not_author_id** | **int[]**| This parameter is used for excluding stories whose author id is the specified value. | [optional] - **author_name** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] - **not_author_name** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] - **source_id** | **int[]**| This parameter is used for finding stories whose source id is the specified value. | [optional] - **not_source_id** | **int[]**| This parameter is used for excluding stories whose source id is the specified value. | [optional] - **source_name** | **string[]**| This parameter is used for finding stories whose source name contains the specified value. | [optional] - **not_source_name** | **string[]**| This parameter is used for excluding stories whose source name contains the specified value. | [optional] - **source_domain** | **string[]**| This parameter is used for finding stories whose source domain is the specified value. | [optional] - **not_source_domain** | **string[]**| This parameter is used for excluding stories whose source domain is the specified value. | [optional] - **source_locations_country** | **string[]**| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_country** | **string[]**| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_state** | **string[]**| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_state** | **string[]**| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_city** | **string[]**| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_city** | **string[]**| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_country** | **string[]**| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_country** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_state** | **string[]**| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_state** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_city** | **string[]**| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_city** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_level** | **string[]**| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **not_source_scopes_level** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **source_links_in_count_min** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_links_in_count_max** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_rankings_alexa_rank_min** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_rank_max** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_country** | **string[]**| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **social_shares_count_facebook_min** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_facebook_max** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_google_plus_min** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_google_plus_max** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_linkedin_min** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_linkedin_max** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_reddit_min** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_reddit_max** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] - **cluster** | **bool**| This parameter enables clustering for the returned stories. You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] [default to false] - **cluster_algorithm** | **string**| This parameter is used for specifying the clustering algorithm you wish to use. It supprts STC, Lingo and [k-means](https://en.wikipedia.org/wiki/K-means_clustering) algorithms. You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] [default to lingo] [enum: stc, lingo, kmeans] - **return** | **string[]**| This parameter is used for specifying return fields. | [optional] [enum: id, title, body, summary, source, author, entities, keywords, hashtags, characters_count, words_count, sentences_count, paragraphs_count, categories, social_shares_count, media, sentiment, language, published_at, links] - **story_id** | **int**| A story id | [optional] - **story_url** | **string**| An article or webpage | [optional] - **story_title** | **string**| Title of the article | [optional] - **story_body** | **string**| Body of the article | [optional] - **story_published_at** | **\DateTime**| Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). | [optional] - **story_language** | **string**| This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [default to auto] [enum: auto, en, de, fr, it, es, pt] - **per_page** | **int**| This parameter is used for specifying number of items in each page. | [optional] [default to 3] + **id** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by story id. | [optional] + **notId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by story id. | [optional] + **title** | **string**| This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **body** | **string**| This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **text** | **string**| This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnTitle** | **string**| This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnBody** | **string**| This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnText** | **string**| This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **language** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **notLanguage** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **publishedAtStart** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **publishedAtEnd** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **categoriesTaxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesConfident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] + **categoriesId** | [**string[]**](../Model/string.md)| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesId** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **entitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **sentimentTitlePolarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] + **notSentimentTitlePolarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] + **sentimentBodyPolarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] + **notSentimentBodyPolarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] + **mediaImagesCountMin** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] + **mediaImagesCountMax** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] + **mediaImagesWidthMin** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] + **mediaImagesWidthMax** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] + **mediaImagesHeightMin** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] + **mediaImagesHeightMax** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] + **mediaImagesContentLengthMin** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] + **mediaImagesContentLengthMax** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] + **mediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose images format are the specified value. | [optional] + **notMediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose images format are the specified value. | [optional] + **mediaVideosCountMin** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] + **mediaVideosCountMax** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] + **authorId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose author id is the specified value. | [optional] + **notAuthorId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose author id is the specified value. | [optional] + **authorName** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] + **notAuthorName** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] + **sourceId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose source id is the specified value. | [optional] + **notSourceId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose source id is the specified value. | [optional] + **sourceName** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source name contains the specified value. | [optional] + **notSourceName** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source name contains the specified value. | [optional] + **sourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source domain is the specified value. | [optional] + **notSourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source domain is the specified value. | [optional] + **sourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLinksInCountMin** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceLinksInCountMax** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceRankingsAlexaRankMin** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaRankMax** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **socialSharesCountFacebookMin** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountFacebookMax** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMin** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMax** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMin** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMax** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountRedditMin** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountRedditMax** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] + **clusters** | [**string[]**](../Model/string.md)| This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] + **return** | [**string[]**](../Model/string.md)| This parameter is used for specifying return fields. | [optional] + **storyId** | **int**| A story id | [optional] + **storyUrl** | **string**| An article or webpage | [optional] + **storyTitle** | **string**| Title of the article | [optional] + **storyBody** | **string**| Body of the article | [optional] + **storyPublishedAt** | **\DateTime**| Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). | [optional] + **storyLanguage** | **string**| This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [default to 'auto'] + **perPage** | **int**| This parameter is used for specifying number of items in each page. | [optional] [default to 3] ### Return type @@ -300,128 +423,142 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key), [app_id](../../README.md#app_id) +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, text/xml +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **listHistograms** -> \Aylien\NewsApi\Models\Histograms listHistograms($opts) +## listHistograms + +> \Aylien\NewsApi\Models\Histograms listHistograms($id, $notId, $title, $body, $text, $translationsEnTitle, $translationsEnBody, $translationsEnText, $language, $notLanguage, $publishedAtStart, $publishedAtEnd, $categoriesTaxonomy, $categoriesConfident, $categoriesId, $notCategoriesId, $categoriesLevel, $notCategoriesLevel, $entitiesTitleText, $notEntitiesTitleText, $entitiesTitleType, $notEntitiesTitleType, $entitiesTitleLinksDbpedia, $notEntitiesTitleLinksDbpedia, $entitiesBodyText, $notEntitiesBodyText, $entitiesBodyType, $notEntitiesBodyType, $entitiesBodyLinksDbpedia, $notEntitiesBodyLinksDbpedia, $sentimentTitlePolarity, $notSentimentTitlePolarity, $sentimentBodyPolarity, $notSentimentBodyPolarity, $mediaImagesCountMin, $mediaImagesCountMax, $mediaImagesWidthMin, $mediaImagesWidthMax, $mediaImagesHeightMin, $mediaImagesHeightMax, $mediaImagesContentLengthMin, $mediaImagesContentLengthMax, $mediaImagesFormat, $notMediaImagesFormat, $mediaVideosCountMin, $mediaVideosCountMax, $authorId, $notAuthorId, $authorName, $notAuthorName, $sourceId, $notSourceId, $sourceName, $notSourceName, $sourceDomain, $notSourceDomain, $sourceLocationsCountry, $notSourceLocationsCountry, $sourceLocationsState, $notSourceLocationsState, $sourceLocationsCity, $notSourceLocationsCity, $sourceScopesCountry, $notSourceScopesCountry, $sourceScopesState, $notSourceScopesState, $sourceScopesCity, $notSourceScopesCity, $sourceScopesLevel, $notSourceScopesLevel, $sourceLinksInCountMin, $sourceLinksInCountMax, $sourceRankingsAlexaRankMin, $sourceRankingsAlexaRankMax, $sourceRankingsAlexaCountry, $socialSharesCountFacebookMin, $socialSharesCountFacebookMax, $socialSharesCountGooglePlusMin, $socialSharesCountGooglePlusMax, $socialSharesCountLinkedinMin, $socialSharesCountLinkedinMax, $socialSharesCountRedditMin, $socialSharesCountRedditMax, $intervalStart, $intervalEnd, $intervalWidth, $field) List histograms -This endpoint is used for getting histograms based on the `field` parameter passed to the API. +For the numerical metadata that the News API gathers (such as word counts or social shares for example), you can use the histograms endpoint to access and display this information. As this endpoint does not return actual stories, the results you are given will not count towards your story allowance provided by your subscription, so you can effectively query this endpoint free of charge. ### Example + ```php setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); // Configure API key authorization: app_key -Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY'); - -$api_instance = new Aylien\NewsApi\Api\DefaultApi(); - - -$opts = array( - 'id' => array(56), - 'not_id' => array(56), - 'title' => "title_example", - 'body' => "body_example", - 'text' => "text_example", - 'language' => array("language_example"), - 'not_language' => array("not_language_example"), - 'published_at_start' => "published_at_start_example", - 'published_at_end' => "published_at_end_example", - 'categories_taxonomy' => "categories_taxonomy_example", - 'categories_confident' => true, - 'categories_id' => array("categories_id_example"), - 'not_categories_id' => array("not_categories_id_example"), - 'categories_level' => array(56), - 'not_categories_level' => array(56), - 'entities_title_text' => array("entities_title_text_example"), - 'not_entities_title_text' => array("not_entities_title_text_example"), - 'entities_title_type' => array("entities_title_type_example"), - 'not_entities_title_type' => array("not_entities_title_type_example"), - 'entities_title_links_dbpedia' => array("entities_title_links_dbpedia_example"), - 'not_entities_title_links_dbpedia' => array("not_entities_title_links_dbpedia_example"), - 'entities_body_text' => array("entities_body_text_example"), - 'not_entities_body_text' => array("not_entities_body_text_example"), - 'entities_body_type' => array("entities_body_type_example"), - 'not_entities_body_type' => array("not_entities_body_type_example"), - 'entities_body_links_dbpedia' => array("entities_body_links_dbpedia_example"), - 'not_entities_body_links_dbpedia' => array("not_entities_body_links_dbpedia_example"), - 'sentiment_title_polarity' => "sentiment_title_polarity_example", - 'not_sentiment_title_polarity' => "not_sentiment_title_polarity_example", - 'sentiment_body_polarity' => "sentiment_body_polarity_example", - 'not_sentiment_body_polarity' => "not_sentiment_body_polarity_example", - 'media_images_count_min' => 56, - 'media_images_count_max' => 56, - 'media_images_width_min' => 56, - 'media_images_width_max' => 56, - 'media_images_height_min' => 56, - 'media_images_height_max' => 56, - 'media_images_content_length_min' => 56, - 'media_images_content_length_max' => 56, - 'media_images_format' => array("media_images_format_example"), - 'not_media_images_format' => array("not_media_images_format_example"), - 'media_videos_count_min' => 56, - 'media_videos_count_max' => 56, - 'author_id' => array(56), - 'not_author_id' => array(56), - 'author_name' => "author_name_example", - 'not_author_name' => "not_author_name_example", - 'source_id' => array(56), - 'not_source_id' => array(56), - 'source_name' => array("source_name_example"), - 'not_source_name' => array("not_source_name_example"), - 'source_domain' => array("source_domain_example"), - 'not_source_domain' => array("not_source_domain_example"), - 'source_locations_country' => array("source_locations_country_example"), - 'not_source_locations_country' => array("not_source_locations_country_example"), - 'source_locations_state' => array("source_locations_state_example"), - 'not_source_locations_state' => array("not_source_locations_state_example"), - 'source_locations_city' => array("source_locations_city_example"), - 'not_source_locations_city' => array("not_source_locations_city_example"), - 'source_scopes_country' => array("source_scopes_country_example"), - 'not_source_scopes_country' => array("not_source_scopes_country_example"), - 'source_scopes_state' => array("source_scopes_state_example"), - 'not_source_scopes_state' => array("not_source_scopes_state_example"), - 'source_scopes_city' => array("source_scopes_city_example"), - 'not_source_scopes_city' => array("not_source_scopes_city_example"), - 'source_scopes_level' => array("source_scopes_level_example"), - 'not_source_scopes_level' => array("not_source_scopes_level_example"), - 'source_links_in_count_min' => 56, - 'source_links_in_count_max' => 56, - 'source_rankings_alexa_rank_min' => 56, - 'source_rankings_alexa_rank_max' => 56, - 'source_rankings_alexa_country' => array("source_rankings_alexa_country_example"), - 'social_shares_count_facebook_min' => 56, - 'social_shares_count_facebook_max' => 56, - 'social_shares_count_google_plus_min' => 56, - 'social_shares_count_google_plus_max' => 56, - 'social_shares_count_linkedin_min' => 56, - 'social_shares_count_linkedin_max' => 56, - 'social_shares_count_reddit_min' => 56, - 'social_shares_count_reddit_max' => 56, - 'interval_start' => 56, - 'interval_end' => 56, - 'interval_width' => 56, - 'field' => "social_shares_count" +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); + + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config ); +$associate_array['id'] = array(56); // int[] | This parameter is used for finding stories by story id. +$associate_array['notId'] = array(56); // int[] | This parameter is used for excluding stories by story id. +$associate_array['title'] = 'title_example'; // string | This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['body'] = 'body_example'; // string | This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['text'] = 'text_example'; // string | This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnTitle'] = 'translationsEnTitle_example'; // string | This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnBody'] = 'translationsEnBody_example'; // string | This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnText'] = 'translationsEnText_example'; // string | This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['language'] = array('language_example'); // string[] | This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['notLanguage'] = array('language_example'); // string[] | This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['publishedAtStart'] = 'publishedAtStart_example'; // string | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['publishedAtEnd'] = 'publishedAtEnd_example'; // string | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['categoriesTaxonomy'] = 'categoriesTaxonomy_example'; // string | This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesConfident'] = true; // bool | This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesLevel'] = array(56); // int[] | This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesLevel'] = array(56); // int[] | This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['entitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['sentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for finding stories whose title sentiment is the specified value. +$associate_array['notSentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for excluding stories whose title sentiment is the specified value. +$associate_array['sentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for finding stories whose body sentiment is the specified value. +$associate_array['notSentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for excluding stories whose body sentiment is the specified value. +$associate_array['mediaImagesCountMin'] = 56; // int | This parameter is used for finding stories whose number of images is greater than or equal to the specified value. +$associate_array['mediaImagesCountMax'] = 56; // int | This parameter is used for finding stories whose number of images is less than or equal to the specified value. +$associate_array['mediaImagesWidthMin'] = 56; // int | This parameter is used for finding stories whose width of images are greater than or equal to the specified value. +$associate_array['mediaImagesWidthMax'] = 56; // int | This parameter is used for finding stories whose width of images are less than or equal to the specified value. +$associate_array['mediaImagesHeightMin'] = 56; // int | This parameter is used for finding stories whose height of images are greater than or equal to the specified value. +$associate_array['mediaImagesHeightMax'] = 56; // int | This parameter is used for finding stories whose height of images are less than or equal to the specified value. +$associate_array['mediaImagesContentLengthMin'] = 56; // int | This parameter is used for finding stories whose images content length are greater than or equal to the specified value. +$associate_array['mediaImagesContentLengthMax'] = 56; // int | This parameter is used for finding stories whose images content length are less than or equal to the specified value. +$associate_array['mediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for finding stories whose images format are the specified value. +$associate_array['notMediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for excluding stories whose images format are the specified value. +$associate_array['mediaVideosCountMin'] = 56; // int | This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. +$associate_array['mediaVideosCountMax'] = 56; // int | This parameter is used for finding stories whose number of videos is less than or equal to the specified value. +$associate_array['authorId'] = array(56); // int[] | This parameter is used for finding stories whose author id is the specified value. +$associate_array['notAuthorId'] = array(56); // int[] | This parameter is used for excluding stories whose author id is the specified value. +$associate_array['authorName'] = 'authorName_example'; // string | This parameter is used for finding stories whose author full name contains the specified value. +$associate_array['notAuthorName'] = 'authorName_example'; // string | This parameter is used for excluding stories whose author full name contains the specified value. +$associate_array['sourceId'] = array(56); // int[] | This parameter is used for finding stories whose source id is the specified value. +$associate_array['notSourceId'] = array(56); // int[] | This parameter is used for excluding stories whose source id is the specified value. +$associate_array['sourceName'] = array('sourceName_example'); // string[] | This parameter is used for finding stories whose source name contains the specified value. +$associate_array['notSourceName'] = array('sourceName_example'); // string[] | This parameter is used for excluding stories whose source name contains the specified value. +$associate_array['sourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for finding stories whose source domain is the specified value. +$associate_array['notSourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for excluding stories whose source domain is the specified value. +$associate_array['sourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLinksInCountMin'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceLinksInCountMax'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceRankingsAlexaRankMin'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaRankMax'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaCountry'] = array('sourceRankingsAlexaCountry_example'); // string[] | This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['socialSharesCountFacebookMin'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountFacebookMax'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMin'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMax'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMin'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMax'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountRedditMin'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountRedditMax'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. +$associate_array['intervalStart'] = 56; // int | This parameter is used for setting the start data point of histogram intervals. +$associate_array['intervalEnd'] = 56; // int | This parameter is used for setting the end data point of histogram intervals. +$associate_array['intervalWidth'] = 56; // int | This parameter is used for setting the width of histogram intervals. +$associate_array['field'] = 'social_shares_count'; // string | This parameter is used for specifying the y-axis variable for the histogram. try { - $result = $api_instance->listHistograms($opts); + $result = $apiInstance->listHistograms($associate_array); print_r($result); } catch (Exception $e) { - print_r($e->getResponseObject()->getErrors()); echo 'Exception when calling DefaultApi->listHistograms: ', $e->getMessage(), PHP_EOL; } ?> @@ -429,92 +566,98 @@ try { ### Parameters +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int[]**| This parameter is used for finding stories by story id. | [optional] - **not_id** | **int[]**| This parameter is used for excluding stories by story id. | [optional] - **title** | **string**| This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **body** | **string**| This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **text** | **string**| This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **language** | **string[]**| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **not_language** | **string[]**| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **published_at_start** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **published_at_end** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **categories_taxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [enum: iab-qag, iptc-subjectcode] - **categories_confident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] - **categories_id** | **string[]**| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_id** | **string[]**| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **categories_level** | **int[]**| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_level** | **int[]**| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **entities_title_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **sentiment_title_polarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_title_polarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **sentiment_body_polarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_body_polarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **media_images_count_min** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] - **media_images_count_max** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] - **media_images_width_min** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] - **media_images_width_max** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] - **media_images_height_min** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] - **media_images_height_max** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] - **media_images_content_length_min** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] - **media_images_content_length_max** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] - **media_images_format** | **string[]**| This parameter is used for finding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **not_media_images_format** | **string[]**| This parameter is used for excluding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **media_videos_count_min** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] - **media_videos_count_max** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] - **author_id** | **int[]**| This parameter is used for finding stories whose author id is the specified value. | [optional] - **not_author_id** | **int[]**| This parameter is used for excluding stories whose author id is the specified value. | [optional] - **author_name** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] - **not_author_name** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] - **source_id** | **int[]**| This parameter is used for finding stories whose source id is the specified value. | [optional] - **not_source_id** | **int[]**| This parameter is used for excluding stories whose source id is the specified value. | [optional] - **source_name** | **string[]**| This parameter is used for finding stories whose source name contains the specified value. | [optional] - **not_source_name** | **string[]**| This parameter is used for excluding stories whose source name contains the specified value. | [optional] - **source_domain** | **string[]**| This parameter is used for finding stories whose source domain is the specified value. | [optional] - **not_source_domain** | **string[]**| This parameter is used for excluding stories whose source domain is the specified value. | [optional] - **source_locations_country** | **string[]**| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_country** | **string[]**| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_state** | **string[]**| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_state** | **string[]**| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_city** | **string[]**| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_city** | **string[]**| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_country** | **string[]**| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_country** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_state** | **string[]**| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_state** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_city** | **string[]**| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_city** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_level** | **string[]**| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **not_source_scopes_level** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **source_links_in_count_min** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_links_in_count_max** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_rankings_alexa_rank_min** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_rank_max** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_country** | **string[]**| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **social_shares_count_facebook_min** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_facebook_max** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_google_plus_min** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_google_plus_max** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_linkedin_min** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_linkedin_max** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_reddit_min** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_reddit_max** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] - **interval_start** | **int**| This parameter is used for setting the start data point of histogram intervals. | [optional] - **interval_end** | **int**| This parameter is used for setting the end data point of histogram intervals. | [optional] - **interval_width** | **int**| This parameter is used for setting the width of histogram intervals. | [optional] - **field** | **string**| This parameter is used for specifying the y-axis variable for the histogram. | [optional] [default to social_shares_count] [enum: social_shares_count, social_shares_count.facebook, social_shares_count.linkedin, social_shares_count.reddit, social_shares_count.google_plus, characters_count, words_count, sentences_count, paragraphs_count, media.images.count, media.videos.count, source.links_in_count, source.rankings.alexa.rank, source.rankings.alexa.rank.AF, source.rankings.alexa.rank.AX, source.rankings.alexa.rank.AL, source.rankings.alexa.rank.DZ, source.rankings.alexa.rank.AS, source.rankings.alexa.rank.AD, source.rankings.alexa.rank.AO, source.rankings.alexa.rank.AI, source.rankings.alexa.rank.AQ, source.rankings.alexa.rank.AG, source.rankings.alexa.rank.AR, source.rankings.alexa.rank.AM, source.rankings.alexa.rank.AW, source.rankings.alexa.rank.AU, source.rankings.alexa.rank.AT, source.rankings.alexa.rank.AZ, source.rankings.alexa.rank.BS, source.rankings.alexa.rank.BH, source.rankings.alexa.rank.BD, source.rankings.alexa.rank.BB, source.rankings.alexa.rank.BY, source.rankings.alexa.rank.BE, source.rankings.alexa.rank.BZ, source.rankings.alexa.rank.BJ, source.rankings.alexa.rank.BM, source.rankings.alexa.rank.BT, source.rankings.alexa.rank.BO, source.rankings.alexa.rank.BQ, source.rankings.alexa.rank.BA, source.rankings.alexa.rank.BW, source.rankings.alexa.rank.BV, source.rankings.alexa.rank.BR, source.rankings.alexa.rank.IO, source.rankings.alexa.rank.BN, source.rankings.alexa.rank.BG, source.rankings.alexa.rank.BF, source.rankings.alexa.rank.BI, source.rankings.alexa.rank.KH, source.rankings.alexa.rank.CM, source.rankings.alexa.rank.CA, source.rankings.alexa.rank.CV, source.rankings.alexa.rank.KY, source.rankings.alexa.rank.CF, source.rankings.alexa.rank.TD, source.rankings.alexa.rank.CL, source.rankings.alexa.rank.CN, source.rankings.alexa.rank.CX, source.rankings.alexa.rank.CC, source.rankings.alexa.rank.CO, source.rankings.alexa.rank.KM, source.rankings.alexa.rank.CG, source.rankings.alexa.rank.CD, source.rankings.alexa.rank.CK, source.rankings.alexa.rank.CR, source.rankings.alexa.rank.CI, source.rankings.alexa.rank.HR, source.rankings.alexa.rank.CU, source.rankings.alexa.rank.CW, source.rankings.alexa.rank.CY, source.rankings.alexa.rank.CZ, source.rankings.alexa.rank.DK, source.rankings.alexa.rank.DJ, source.rankings.alexa.rank.DM, source.rankings.alexa.rank.DO, source.rankings.alexa.rank.EC, source.rankings.alexa.rank.EG, source.rankings.alexa.rank.SV, source.rankings.alexa.rank.GQ, source.rankings.alexa.rank.ER, source.rankings.alexa.rank.EE, source.rankings.alexa.rank.ET, source.rankings.alexa.rank.FK, source.rankings.alexa.rank.FO, source.rankings.alexa.rank.FJ, source.rankings.alexa.rank.FI, source.rankings.alexa.rank.FR, source.rankings.alexa.rank.GF, source.rankings.alexa.rank.PF, source.rankings.alexa.rank.TF, source.rankings.alexa.rank.GA, source.rankings.alexa.rank.GM, source.rankings.alexa.rank.GE, source.rankings.alexa.rank.DE, source.rankings.alexa.rank.GH, source.rankings.alexa.rank.GI, source.rankings.alexa.rank.GR, source.rankings.alexa.rank.GL, source.rankings.alexa.rank.GD, source.rankings.alexa.rank.GP, source.rankings.alexa.rank.GU, source.rankings.alexa.rank.GT, source.rankings.alexa.rank.GG, source.rankings.alexa.rank.GN, source.rankings.alexa.rank.GW, source.rankings.alexa.rank.GY, source.rankings.alexa.rank.HT, source.rankings.alexa.rank.HM, source.rankings.alexa.rank.VA, source.rankings.alexa.rank.HN, source.rankings.alexa.rank.HK, source.rankings.alexa.rank.HU, source.rankings.alexa.rank.IS, source.rankings.alexa.rank.IN, source.rankings.alexa.rank.ID, source.rankings.alexa.rank.IR, source.rankings.alexa.rank.IQ, source.rankings.alexa.rank.IE, source.rankings.alexa.rank.IM, source.rankings.alexa.rank.IL, source.rankings.alexa.rank.IT, source.rankings.alexa.rank.JM, source.rankings.alexa.rank.JP, source.rankings.alexa.rank.JE, source.rankings.alexa.rank.JO, source.rankings.alexa.rank.KZ, source.rankings.alexa.rank.KE, source.rankings.alexa.rank.KI, source.rankings.alexa.rank.KP, source.rankings.alexa.rank.KR, source.rankings.alexa.rank.KW, source.rankings.alexa.rank.KG, source.rankings.alexa.rank.LA, source.rankings.alexa.rank.LV, source.rankings.alexa.rank.LB, source.rankings.alexa.rank.LS, source.rankings.alexa.rank.LR, source.rankings.alexa.rank.LY, source.rankings.alexa.rank.LI, source.rankings.alexa.rank.LT, source.rankings.alexa.rank.LU, source.rankings.alexa.rank.MO, source.rankings.alexa.rank.MK, source.rankings.alexa.rank.MG, source.rankings.alexa.rank.MW, source.rankings.alexa.rank.MY, source.rankings.alexa.rank.MV, source.rankings.alexa.rank.ML, source.rankings.alexa.rank.MT, source.rankings.alexa.rank.MH, source.rankings.alexa.rank.MQ, source.rankings.alexa.rank.MR, source.rankings.alexa.rank.MU, source.rankings.alexa.rank.YT, source.rankings.alexa.rank.MX, source.rankings.alexa.rank.FM, source.rankings.alexa.rank.MD, source.rankings.alexa.rank.MC, source.rankings.alexa.rank.MN, source.rankings.alexa.rank.ME, source.rankings.alexa.rank.MS, source.rankings.alexa.rank.MA, source.rankings.alexa.rank.MZ, source.rankings.alexa.rank.MM, source.rankings.alexa.rank.NA, source.rankings.alexa.rank.NR, source.rankings.alexa.rank.NP, source.rankings.alexa.rank.NL, source.rankings.alexa.rank.NC, source.rankings.alexa.rank.NZ, source.rankings.alexa.rank.NI, source.rankings.alexa.rank.NE, source.rankings.alexa.rank.NG, source.rankings.alexa.rank.NU, source.rankings.alexa.rank.NF, source.rankings.alexa.rank.MP, source.rankings.alexa.rank.NO, source.rankings.alexa.rank.OM, source.rankings.alexa.rank.PK, source.rankings.alexa.rank.PW, source.rankings.alexa.rank.PS, source.rankings.alexa.rank.PA, source.rankings.alexa.rank.PG, source.rankings.alexa.rank.PY, source.rankings.alexa.rank.PE, source.rankings.alexa.rank.PH, source.rankings.alexa.rank.PN, source.rankings.alexa.rank.PL, source.rankings.alexa.rank.PT, source.rankings.alexa.rank.PR, source.rankings.alexa.rank.QA, source.rankings.alexa.rank.RE, source.rankings.alexa.rank.RO, source.rankings.alexa.rank.RU, source.rankings.alexa.rank.RW, source.rankings.alexa.rank.BL, source.rankings.alexa.rank.SH, source.rankings.alexa.rank.KN, source.rankings.alexa.rank.LC, source.rankings.alexa.rank.MF, source.rankings.alexa.rank.PM, source.rankings.alexa.rank.VC, source.rankings.alexa.rank.WS, source.rankings.alexa.rank.SM, source.rankings.alexa.rank.ST, source.rankings.alexa.rank.SA, source.rankings.alexa.rank.SN, source.rankings.alexa.rank.RS, source.rankings.alexa.rank.SC, source.rankings.alexa.rank.SL, source.rankings.alexa.rank.SG, source.rankings.alexa.rank.SX, source.rankings.alexa.rank.SK, source.rankings.alexa.rank.SI, source.rankings.alexa.rank.SB, source.rankings.alexa.rank.SO, source.rankings.alexa.rank.ZA, source.rankings.alexa.rank.GS, source.rankings.alexa.rank.SS, source.rankings.alexa.rank.ES, source.rankings.alexa.rank.LK, source.rankings.alexa.rank.SD, source.rankings.alexa.rank.SR, source.rankings.alexa.rank.SJ, source.rankings.alexa.rank.SZ, source.rankings.alexa.rank.SE, source.rankings.alexa.rank.CH, source.rankings.alexa.rank.SY, source.rankings.alexa.rank.TW, source.rankings.alexa.rank.TJ, source.rankings.alexa.rank.TZ, source.rankings.alexa.rank.TH, source.rankings.alexa.rank.TL, source.rankings.alexa.rank.TG, source.rankings.alexa.rank.TK, source.rankings.alexa.rank.TO, source.rankings.alexa.rank.TT, source.rankings.alexa.rank.TN, source.rankings.alexa.rank.TR, source.rankings.alexa.rank.TM, source.rankings.alexa.rank.TC, source.rankings.alexa.rank.TV, source.rankings.alexa.rank.UG, source.rankings.alexa.rank.UA, source.rankings.alexa.rank.AE, source.rankings.alexa.rank.GB, source.rankings.alexa.rank.US, source.rankings.alexa.rank.UM, source.rankings.alexa.rank.UY, source.rankings.alexa.rank.UZ, source.rankings.alexa.rank.VU, source.rankings.alexa.rank.VE, source.rankings.alexa.rank.VN, source.rankings.alexa.rank.VG, source.rankings.alexa.rank.VI, source.rankings.alexa.rank.WF, source.rankings.alexa.rank.EH, source.rankings.alexa.rank.YE, source.rankings.alexa.rank.ZM, source.rankings.alexa.rank.ZW] + **id** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by story id. | [optional] + **notId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by story id. | [optional] + **title** | **string**| This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **body** | **string**| This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **text** | **string**| This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnTitle** | **string**| This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnBody** | **string**| This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnText** | **string**| This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **language** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **notLanguage** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **publishedAtStart** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **publishedAtEnd** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **categoriesTaxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesConfident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] + **categoriesId** | [**string[]**](../Model/string.md)| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesId** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **entitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **sentimentTitlePolarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] + **notSentimentTitlePolarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] + **sentimentBodyPolarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] + **notSentimentBodyPolarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] + **mediaImagesCountMin** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] + **mediaImagesCountMax** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] + **mediaImagesWidthMin** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] + **mediaImagesWidthMax** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] + **mediaImagesHeightMin** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] + **mediaImagesHeightMax** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] + **mediaImagesContentLengthMin** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] + **mediaImagesContentLengthMax** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] + **mediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose images format are the specified value. | [optional] + **notMediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose images format are the specified value. | [optional] + **mediaVideosCountMin** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] + **mediaVideosCountMax** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] + **authorId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose author id is the specified value. | [optional] + **notAuthorId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose author id is the specified value. | [optional] + **authorName** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] + **notAuthorName** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] + **sourceId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose source id is the specified value. | [optional] + **notSourceId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose source id is the specified value. | [optional] + **sourceName** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source name contains the specified value. | [optional] + **notSourceName** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source name contains the specified value. | [optional] + **sourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source domain is the specified value. | [optional] + **notSourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source domain is the specified value. | [optional] + **sourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLinksInCountMin** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceLinksInCountMax** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceRankingsAlexaRankMin** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaRankMax** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **socialSharesCountFacebookMin** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountFacebookMax** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMin** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMax** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMin** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMax** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountRedditMin** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountRedditMax** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] + **intervalStart** | **int**| This parameter is used for setting the start data point of histogram intervals. | [optional] + **intervalEnd** | **int**| This parameter is used for setting the end data point of histogram intervals. | [optional] + **intervalWidth** | **int**| This parameter is used for setting the width of histogram intervals. | [optional] + **field** | **string**| This parameter is used for specifying the y-axis variable for the histogram. | [optional] [default to 'social_shares_count'] ### Return type @@ -522,134 +665,147 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key), [app_id](../../README.md#app_id) +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, text/xml +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## listRelatedStories -# **listRelatedStories** -> \Aylien\NewsApi\Models\RelatedStories listRelatedStories($opts) +> \Aylien\NewsApi\Models\RelatedStories listRelatedStories($id, $notId, $title, $body, $text, $translationsEnTitle, $translationsEnBody, $translationsEnText, $language, $notLanguage, $publishedAtStart, $publishedAtEnd, $categoriesTaxonomy, $categoriesConfident, $categoriesId, $notCategoriesId, $categoriesLevel, $notCategoriesLevel, $entitiesTitleText, $notEntitiesTitleText, $entitiesTitleType, $notEntitiesTitleType, $entitiesTitleLinksDbpedia, $notEntitiesTitleLinksDbpedia, $entitiesBodyText, $notEntitiesBodyText, $entitiesBodyType, $notEntitiesBodyType, $entitiesBodyLinksDbpedia, $notEntitiesBodyLinksDbpedia, $sentimentTitlePolarity, $notSentimentTitlePolarity, $sentimentBodyPolarity, $notSentimentBodyPolarity, $mediaImagesCountMin, $mediaImagesCountMax, $mediaImagesWidthMin, $mediaImagesWidthMax, $mediaImagesHeightMin, $mediaImagesHeightMax, $mediaImagesContentLengthMin, $mediaImagesContentLengthMax, $mediaImagesFormat, $notMediaImagesFormat, $mediaVideosCountMin, $mediaVideosCountMax, $authorId, $notAuthorId, $authorName, $notAuthorName, $sourceId, $notSourceId, $sourceName, $notSourceName, $sourceDomain, $notSourceDomain, $sourceLocationsCountry, $notSourceLocationsCountry, $sourceLocationsState, $notSourceLocationsState, $sourceLocationsCity, $notSourceLocationsCity, $sourceScopesCountry, $notSourceScopesCountry, $sourceScopesState, $notSourceScopesState, $sourceScopesCity, $notSourceScopesCity, $sourceScopesLevel, $notSourceScopesLevel, $sourceLinksInCountMin, $sourceLinksInCountMax, $sourceRankingsAlexaRankMin, $sourceRankingsAlexaRankMax, $sourceRankingsAlexaCountry, $socialSharesCountFacebookMin, $socialSharesCountFacebookMax, $socialSharesCountGooglePlusMin, $socialSharesCountGooglePlusMax, $socialSharesCountLinkedinMin, $socialSharesCountLinkedinMax, $socialSharesCountRedditMin, $socialSharesCountRedditMax, $clusters, $return, $storyId, $storyUrl, $storyTitle, $storyBody, $boostBy, $storyLanguage, $perPage) List related stories -This endpoint is used for finding related stories based on the parameters provided. The maximum number of related stories returned is 100. +This endpoint is used for finding semantically similar stories based on the parameters you provide as inputs. For example, if you want to find stories similar to a Tweet or any text extract you input, the related stories endpoint will analyze the entities present and the meaning of the text, and find stories with a similar meaning. The maximum number of related stories returned is 100. ### Example + ```php setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); // Configure API key authorization: app_key -Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY'); - -$api_instance = new Aylien\NewsApi\Api\DefaultApi(); - - -$opts = array( - 'id' => array(56), - 'not_id' => array(56), - 'title' => "title_example", - 'body' => "body_example", - 'text' => "text_example", - 'language' => array("language_example"), - 'not_language' => array("not_language_example"), - 'published_at_start' => "published_at_start_example", - 'published_at_end' => "published_at_end_example", - 'categories_taxonomy' => "categories_taxonomy_example", - 'categories_confident' => true, - 'categories_id' => array("categories_id_example"), - 'not_categories_id' => array("not_categories_id_example"), - 'categories_level' => array(56), - 'not_categories_level' => array(56), - 'entities_title_text' => array("entities_title_text_example"), - 'not_entities_title_text' => array("not_entities_title_text_example"), - 'entities_title_type' => array("entities_title_type_example"), - 'not_entities_title_type' => array("not_entities_title_type_example"), - 'entities_title_links_dbpedia' => array("entities_title_links_dbpedia_example"), - 'not_entities_title_links_dbpedia' => array("not_entities_title_links_dbpedia_example"), - 'entities_body_text' => array("entities_body_text_example"), - 'not_entities_body_text' => array("not_entities_body_text_example"), - 'entities_body_type' => array("entities_body_type_example"), - 'not_entities_body_type' => array("not_entities_body_type_example"), - 'entities_body_links_dbpedia' => array("entities_body_links_dbpedia_example"), - 'not_entities_body_links_dbpedia' => array("not_entities_body_links_dbpedia_example"), - 'sentiment_title_polarity' => "sentiment_title_polarity_example", - 'not_sentiment_title_polarity' => "not_sentiment_title_polarity_example", - 'sentiment_body_polarity' => "sentiment_body_polarity_example", - 'not_sentiment_body_polarity' => "not_sentiment_body_polarity_example", - 'media_images_count_min' => 56, - 'media_images_count_max' => 56, - 'media_images_width_min' => 56, - 'media_images_width_max' => 56, - 'media_images_height_min' => 56, - 'media_images_height_max' => 56, - 'media_images_content_length_min' => 56, - 'media_images_content_length_max' => 56, - 'media_images_format' => array("media_images_format_example"), - 'not_media_images_format' => array("not_media_images_format_example"), - 'media_videos_count_min' => 56, - 'media_videos_count_max' => 56, - 'author_id' => array(56), - 'not_author_id' => array(56), - 'author_name' => "author_name_example", - 'not_author_name' => "not_author_name_example", - 'source_id' => array(56), - 'not_source_id' => array(56), - 'source_name' => array("source_name_example"), - 'not_source_name' => array("not_source_name_example"), - 'source_domain' => array("source_domain_example"), - 'not_source_domain' => array("not_source_domain_example"), - 'source_locations_country' => array("source_locations_country_example"), - 'not_source_locations_country' => array("not_source_locations_country_example"), - 'source_locations_state' => array("source_locations_state_example"), - 'not_source_locations_state' => array("not_source_locations_state_example"), - 'source_locations_city' => array("source_locations_city_example"), - 'not_source_locations_city' => array("not_source_locations_city_example"), - 'source_scopes_country' => array("source_scopes_country_example"), - 'not_source_scopes_country' => array("not_source_scopes_country_example"), - 'source_scopes_state' => array("source_scopes_state_example"), - 'not_source_scopes_state' => array("not_source_scopes_state_example"), - 'source_scopes_city' => array("source_scopes_city_example"), - 'not_source_scopes_city' => array("not_source_scopes_city_example"), - 'source_scopes_level' => array("source_scopes_level_example"), - 'not_source_scopes_level' => array("not_source_scopes_level_example"), - 'source_links_in_count_min' => 56, - 'source_links_in_count_max' => 56, - 'source_rankings_alexa_rank_min' => 56, - 'source_rankings_alexa_rank_max' => 56, - 'source_rankings_alexa_country' => array("source_rankings_alexa_country_example"), - 'social_shares_count_facebook_min' => 56, - 'social_shares_count_facebook_max' => 56, - 'social_shares_count_google_plus_min' => 56, - 'social_shares_count_google_plus_max' => 56, - 'social_shares_count_linkedin_min' => 56, - 'social_shares_count_linkedin_max' => 56, - 'social_shares_count_reddit_min' => 56, - 'social_shares_count_reddit_max' => 56, - 'cluster' => false, - 'cluster_algorithm' => "lingo", - 'return' => array("return_example"), - 'story_id' => 789, - 'story_url' => "story_url_example", - 'story_title' => "story_title_example", - 'story_body' => "story_body_example", - 'boost_by' => "boost_by_example", - 'story_language' => "auto", - 'per_page' => 3 +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); + + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config ); +$associate_array['id'] = array(56); // int[] | This parameter is used for finding stories by story id. +$associate_array['notId'] = array(56); // int[] | This parameter is used for excluding stories by story id. +$associate_array['title'] = 'title_example'; // string | This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['body'] = 'body_example'; // string | This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['text'] = 'text_example'; // string | This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnTitle'] = 'translationsEnTitle_example'; // string | This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnBody'] = 'translationsEnBody_example'; // string | This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnText'] = 'translationsEnText_example'; // string | This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['language'] = array('language_example'); // string[] | This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['notLanguage'] = array('language_example'); // string[] | This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['publishedAtStart'] = 'publishedAtStart_example'; // string | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['publishedAtEnd'] = 'publishedAtEnd_example'; // string | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['categoriesTaxonomy'] = 'categoriesTaxonomy_example'; // string | This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesConfident'] = true; // bool | This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesLevel'] = array(56); // int[] | This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesLevel'] = array(56); // int[] | This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['entitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['sentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for finding stories whose title sentiment is the specified value. +$associate_array['notSentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for excluding stories whose title sentiment is the specified value. +$associate_array['sentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for finding stories whose body sentiment is the specified value. +$associate_array['notSentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for excluding stories whose body sentiment is the specified value. +$associate_array['mediaImagesCountMin'] = 56; // int | This parameter is used for finding stories whose number of images is greater than or equal to the specified value. +$associate_array['mediaImagesCountMax'] = 56; // int | This parameter is used for finding stories whose number of images is less than or equal to the specified value. +$associate_array['mediaImagesWidthMin'] = 56; // int | This parameter is used for finding stories whose width of images are greater than or equal to the specified value. +$associate_array['mediaImagesWidthMax'] = 56; // int | This parameter is used for finding stories whose width of images are less than or equal to the specified value. +$associate_array['mediaImagesHeightMin'] = 56; // int | This parameter is used for finding stories whose height of images are greater than or equal to the specified value. +$associate_array['mediaImagesHeightMax'] = 56; // int | This parameter is used for finding stories whose height of images are less than or equal to the specified value. +$associate_array['mediaImagesContentLengthMin'] = 56; // int | This parameter is used for finding stories whose images content length are greater than or equal to the specified value. +$associate_array['mediaImagesContentLengthMax'] = 56; // int | This parameter is used for finding stories whose images content length are less than or equal to the specified value. +$associate_array['mediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for finding stories whose images format are the specified value. +$associate_array['notMediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for excluding stories whose images format are the specified value. +$associate_array['mediaVideosCountMin'] = 56; // int | This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. +$associate_array['mediaVideosCountMax'] = 56; // int | This parameter is used for finding stories whose number of videos is less than or equal to the specified value. +$associate_array['authorId'] = array(56); // int[] | This parameter is used for finding stories whose author id is the specified value. +$associate_array['notAuthorId'] = array(56); // int[] | This parameter is used for excluding stories whose author id is the specified value. +$associate_array['authorName'] = 'authorName_example'; // string | This parameter is used for finding stories whose author full name contains the specified value. +$associate_array['notAuthorName'] = 'authorName_example'; // string | This parameter is used for excluding stories whose author full name contains the specified value. +$associate_array['sourceId'] = array(56); // int[] | This parameter is used for finding stories whose source id is the specified value. +$associate_array['notSourceId'] = array(56); // int[] | This parameter is used for excluding stories whose source id is the specified value. +$associate_array['sourceName'] = array('sourceName_example'); // string[] | This parameter is used for finding stories whose source name contains the specified value. +$associate_array['notSourceName'] = array('sourceName_example'); // string[] | This parameter is used for excluding stories whose source name contains the specified value. +$associate_array['sourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for finding stories whose source domain is the specified value. +$associate_array['notSourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for excluding stories whose source domain is the specified value. +$associate_array['sourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLinksInCountMin'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceLinksInCountMax'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceRankingsAlexaRankMin'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaRankMax'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaCountry'] = array('sourceRankingsAlexaCountry_example'); // string[] | This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['socialSharesCountFacebookMin'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountFacebookMax'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMin'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMax'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMin'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMax'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountRedditMin'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountRedditMax'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. +$associate_array['clusters'] = array('clusters_example'); // string[] | This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). +$associate_array['return'] = array('return_example'); // string[] | This parameter is used for specifying return fields. +$associate_array['storyId'] = 56; // int | A story id +$associate_array['storyUrl'] = 'storyUrl_example'; // string | An article or webpage +$associate_array['storyTitle'] = 'storyTitle_example'; // string | Title of the article +$associate_array['storyBody'] = 'storyBody_example'; // string | Body of the article +$associate_array['boostBy'] = 'boostBy_example'; // string | This parameter is used for boosting the result by the specified value. +$associate_array['storyLanguage'] = 'auto'; // string | This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['perPage'] = 3; // int | This parameter is used for specifying number of items in each page. try { - $result = $api_instance->listRelatedStories($opts); + $result = $apiInstance->listRelatedStories($associate_array); print_r($result); } catch (Exception $e) { - print_r($e->getResponseObject()->getErrors()); echo 'Exception when calling DefaultApi->listRelatedStories: ', $e->getMessage(), PHP_EOL; } ?> @@ -657,98 +813,103 @@ try { ### Parameters +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int[]**| This parameter is used for finding stories by story id. | [optional] - **not_id** | **int[]**| This parameter is used for excluding stories by story id. | [optional] - **title** | **string**| This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **body** | **string**| This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **text** | **string**| This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **language** | **string[]**| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **not_language** | **string[]**| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **published_at_start** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **published_at_end** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **categories_taxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [enum: iab-qag, iptc-subjectcode] - **categories_confident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] - **categories_id** | **string[]**| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_id** | **string[]**| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **categories_level** | **int[]**| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_level** | **int[]**| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **entities_title_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **sentiment_title_polarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_title_polarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **sentiment_body_polarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_body_polarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **media_images_count_min** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] - **media_images_count_max** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] - **media_images_width_min** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] - **media_images_width_max** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] - **media_images_height_min** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] - **media_images_height_max** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] - **media_images_content_length_min** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] - **media_images_content_length_max** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] - **media_images_format** | **string[]**| This parameter is used for finding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **not_media_images_format** | **string[]**| This parameter is used for excluding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **media_videos_count_min** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] - **media_videos_count_max** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] - **author_id** | **int[]**| This parameter is used for finding stories whose author id is the specified value. | [optional] - **not_author_id** | **int[]**| This parameter is used for excluding stories whose author id is the specified value. | [optional] - **author_name** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] - **not_author_name** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] - **source_id** | **int[]**| This parameter is used for finding stories whose source id is the specified value. | [optional] - **not_source_id** | **int[]**| This parameter is used for excluding stories whose source id is the specified value. | [optional] - **source_name** | **string[]**| This parameter is used for finding stories whose source name contains the specified value. | [optional] - **not_source_name** | **string[]**| This parameter is used for excluding stories whose source name contains the specified value. | [optional] - **source_domain** | **string[]**| This parameter is used for finding stories whose source domain is the specified value. | [optional] - **not_source_domain** | **string[]**| This parameter is used for excluding stories whose source domain is the specified value. | [optional] - **source_locations_country** | **string[]**| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_country** | **string[]**| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_state** | **string[]**| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_state** | **string[]**| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_city** | **string[]**| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_city** | **string[]**| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_country** | **string[]**| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_country** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_state** | **string[]**| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_state** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_city** | **string[]**| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_city** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_level** | **string[]**| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **not_source_scopes_level** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **source_links_in_count_min** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_links_in_count_max** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_rankings_alexa_rank_min** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_rank_max** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_country** | **string[]**| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **social_shares_count_facebook_min** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_facebook_max** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_google_plus_min** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_google_plus_max** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_linkedin_min** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_linkedin_max** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_reddit_min** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_reddit_max** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] - **cluster** | **bool**| This parameter enables clustering for the returned stories. You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] [default to false] - **cluster_algorithm** | **string**| This parameter is used for specifying the clustering algorithm you wish to use. It supprts STC, Lingo and [k-means](https://en.wikipedia.org/wiki/K-means_clustering) algorithms. You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] [default to lingo] [enum: stc, lingo, kmeans] - **return** | **string[]**| This parameter is used for specifying return fields. | [optional] [enum: id, title, body, summary, source, author, entities, keywords, hashtags, characters_count, words_count, sentences_count, paragraphs_count, categories, social_shares_count, media, sentiment, language, published_at, links] - **story_id** | **int**| A story id | [optional] - **story_url** | **string**| An article or webpage | [optional] - **story_title** | **string**| Title of the article | [optional] - **story_body** | **string**| Body of the article | [optional] - **boost_by** | **string**| This parameter is used for boosting the result by the specified value. | [optional] [enum: recency, popularity] - **story_language** | **string**| This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [default to auto] [enum: auto, en, de, fr, it, es, pt] - **per_page** | **int**| This parameter is used for specifying number of items in each page. | [optional] [default to 3] + **id** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by story id. | [optional] + **notId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by story id. | [optional] + **title** | **string**| This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **body** | **string**| This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **text** | **string**| This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnTitle** | **string**| This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnBody** | **string**| This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnText** | **string**| This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **language** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **notLanguage** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **publishedAtStart** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **publishedAtEnd** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **categoriesTaxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesConfident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] + **categoriesId** | [**string[]**](../Model/string.md)| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesId** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **entitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **sentimentTitlePolarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] + **notSentimentTitlePolarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] + **sentimentBodyPolarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] + **notSentimentBodyPolarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] + **mediaImagesCountMin** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] + **mediaImagesCountMax** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] + **mediaImagesWidthMin** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] + **mediaImagesWidthMax** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] + **mediaImagesHeightMin** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] + **mediaImagesHeightMax** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] + **mediaImagesContentLengthMin** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] + **mediaImagesContentLengthMax** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] + **mediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose images format are the specified value. | [optional] + **notMediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose images format are the specified value. | [optional] + **mediaVideosCountMin** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] + **mediaVideosCountMax** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] + **authorId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose author id is the specified value. | [optional] + **notAuthorId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose author id is the specified value. | [optional] + **authorName** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] + **notAuthorName** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] + **sourceId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose source id is the specified value. | [optional] + **notSourceId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose source id is the specified value. | [optional] + **sourceName** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source name contains the specified value. | [optional] + **notSourceName** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source name contains the specified value. | [optional] + **sourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source domain is the specified value. | [optional] + **notSourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source domain is the specified value. | [optional] + **sourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLinksInCountMin** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceLinksInCountMax** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceRankingsAlexaRankMin** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaRankMax** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **socialSharesCountFacebookMin** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountFacebookMax** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMin** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMax** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMin** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMax** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountRedditMin** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountRedditMax** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] + **clusters** | [**string[]**](../Model/string.md)| This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] + **return** | [**string[]**](../Model/string.md)| This parameter is used for specifying return fields. | [optional] + **storyId** | **int**| A story id | [optional] + **storyUrl** | **string**| An article or webpage | [optional] + **storyTitle** | **string**| Title of the article | [optional] + **storyBody** | **string**| Body of the article | [optional] + **boostBy** | **string**| This parameter is used for boosting the result by the specified value. | [optional] + **storyLanguage** | **string**| This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [default to 'auto'] + **perPage** | **int**| This parameter is used for specifying number of items in each page. | [optional] [default to 3] ### Return type @@ -756,131 +917,144 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key), [app_id](../../README.md#app_id) +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, text/xml +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) -# **listStories** -> \Aylien\NewsApi\Models\Stories listStories($opts) + +## listStories + +> \Aylien\NewsApi\Models\Stories listStories($id, $notId, $title, $body, $text, $translationsEnTitle, $translationsEnBody, $translationsEnText, $language, $notLanguage, $publishedAtStart, $publishedAtEnd, $categoriesTaxonomy, $categoriesConfident, $categoriesId, $notCategoriesId, $categoriesLevel, $notCategoriesLevel, $entitiesTitleText, $notEntitiesTitleText, $entitiesTitleType, $notEntitiesTitleType, $entitiesTitleLinksDbpedia, $notEntitiesTitleLinksDbpedia, $entitiesBodyText, $notEntitiesBodyText, $entitiesBodyType, $notEntitiesBodyType, $entitiesBodyLinksDbpedia, $notEntitiesBodyLinksDbpedia, $sentimentTitlePolarity, $notSentimentTitlePolarity, $sentimentBodyPolarity, $notSentimentBodyPolarity, $mediaImagesCountMin, $mediaImagesCountMax, $mediaImagesWidthMin, $mediaImagesWidthMax, $mediaImagesHeightMin, $mediaImagesHeightMax, $mediaImagesContentLengthMin, $mediaImagesContentLengthMax, $mediaImagesFormat, $notMediaImagesFormat, $mediaVideosCountMin, $mediaVideosCountMax, $authorId, $notAuthorId, $authorName, $notAuthorName, $sourceId, $notSourceId, $sourceName, $notSourceName, $sourceDomain, $notSourceDomain, $sourceLocationsCountry, $notSourceLocationsCountry, $sourceLocationsState, $notSourceLocationsState, $sourceLocationsCity, $notSourceLocationsCity, $sourceScopesCountry, $notSourceScopesCountry, $sourceScopesState, $notSourceScopesState, $sourceScopesCity, $notSourceScopesCity, $sourceScopesLevel, $notSourceScopesLevel, $sourceLinksInCountMin, $sourceLinksInCountMax, $sourceRankingsAlexaRankMin, $sourceRankingsAlexaRankMax, $sourceRankingsAlexaCountry, $socialSharesCountFacebookMin, $socialSharesCountFacebookMax, $socialSharesCountGooglePlusMin, $socialSharesCountGooglePlusMax, $socialSharesCountLinkedinMin, $socialSharesCountLinkedinMax, $socialSharesCountRedditMin, $socialSharesCountRedditMax, $clusters, $return, $sortBy, $sortDirection, $cursor, $perPage) List Stories -This endpoint is used for getting a list of stories. +The stories endpoint is used to return stories based on parameters you set in your query. The News API crawler gathers articles in near real-time and stores information about them, or metadata. Below you can see all of the query parameters, which you can use to narrow down your query. ### Example + ```php setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); // Configure API key authorization: app_key -Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY'); - -$api_instance = new Aylien\NewsApi\Api\DefaultApi(); - - -$opts = array( - 'id' => array(56), - 'not_id' => array(56), - 'title' => "title_example", - 'body' => "body_example", - 'text' => "text_example", - 'language' => array("language_example"), - 'not_language' => array("not_language_example"), - 'published_at_start' => "published_at_start_example", - 'published_at_end' => "published_at_end_example", - 'categories_taxonomy' => "categories_taxonomy_example", - 'categories_confident' => true, - 'categories_id' => array("categories_id_example"), - 'not_categories_id' => array("not_categories_id_example"), - 'categories_level' => array(56), - 'not_categories_level' => array(56), - 'entities_title_text' => array("entities_title_text_example"), - 'not_entities_title_text' => array("not_entities_title_text_example"), - 'entities_title_type' => array("entities_title_type_example"), - 'not_entities_title_type' => array("not_entities_title_type_example"), - 'entities_title_links_dbpedia' => array("entities_title_links_dbpedia_example"), - 'not_entities_title_links_dbpedia' => array("not_entities_title_links_dbpedia_example"), - 'entities_body_text' => array("entities_body_text_example"), - 'not_entities_body_text' => array("not_entities_body_text_example"), - 'entities_body_type' => array("entities_body_type_example"), - 'not_entities_body_type' => array("not_entities_body_type_example"), - 'entities_body_links_dbpedia' => array("entities_body_links_dbpedia_example"), - 'not_entities_body_links_dbpedia' => array("not_entities_body_links_dbpedia_example"), - 'sentiment_title_polarity' => "sentiment_title_polarity_example", - 'not_sentiment_title_polarity' => "not_sentiment_title_polarity_example", - 'sentiment_body_polarity' => "sentiment_body_polarity_example", - 'not_sentiment_body_polarity' => "not_sentiment_body_polarity_example", - 'media_images_count_min' => 56, - 'media_images_count_max' => 56, - 'media_images_width_min' => 56, - 'media_images_width_max' => 56, - 'media_images_height_min' => 56, - 'media_images_height_max' => 56, - 'media_images_content_length_min' => 56, - 'media_images_content_length_max' => 56, - 'media_images_format' => array("media_images_format_example"), - 'not_media_images_format' => array("not_media_images_format_example"), - 'media_videos_count_min' => 56, - 'media_videos_count_max' => 56, - 'author_id' => array(56), - 'not_author_id' => array(56), - 'author_name' => "author_name_example", - 'not_author_name' => "not_author_name_example", - 'source_id' => array(56), - 'not_source_id' => array(56), - 'source_name' => array("source_name_example"), - 'not_source_name' => array("not_source_name_example"), - 'source_domain' => array("source_domain_example"), - 'not_source_domain' => array("not_source_domain_example"), - 'source_locations_country' => array("source_locations_country_example"), - 'not_source_locations_country' => array("not_source_locations_country_example"), - 'source_locations_state' => array("source_locations_state_example"), - 'not_source_locations_state' => array("not_source_locations_state_example"), - 'source_locations_city' => array("source_locations_city_example"), - 'not_source_locations_city' => array("not_source_locations_city_example"), - 'source_scopes_country' => array("source_scopes_country_example"), - 'not_source_scopes_country' => array("not_source_scopes_country_example"), - 'source_scopes_state' => array("source_scopes_state_example"), - 'not_source_scopes_state' => array("not_source_scopes_state_example"), - 'source_scopes_city' => array("source_scopes_city_example"), - 'not_source_scopes_city' => array("not_source_scopes_city_example"), - 'source_scopes_level' => array("source_scopes_level_example"), - 'not_source_scopes_level' => array("not_source_scopes_level_example"), - 'source_links_in_count_min' => 56, - 'source_links_in_count_max' => 56, - 'source_rankings_alexa_rank_min' => 56, - 'source_rankings_alexa_rank_max' => 56, - 'source_rankings_alexa_country' => array("source_rankings_alexa_country_example"), - 'social_shares_count_facebook_min' => 56, - 'social_shares_count_facebook_max' => 56, - 'social_shares_count_google_plus_min' => 56, - 'social_shares_count_google_plus_max' => 56, - 'social_shares_count_linkedin_min' => 56, - 'social_shares_count_linkedin_max' => 56, - 'social_shares_count_reddit_min' => 56, - 'social_shares_count_reddit_max' => 56, - 'cluster' => false, - 'cluster_algorithm' => "lingo", - 'return' => array("return_example"), - 'sort_by' => "published_at", - 'sort_direction' => "desc", - 'cursor' => "*", - 'per_page' => 10 +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); + + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config ); +$associate_array['id'] = array(56); // int[] | This parameter is used for finding stories by story id. +$associate_array['notId'] = array(56); // int[] | This parameter is used for excluding stories by story id. +$associate_array['title'] = 'title_example'; // string | This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['body'] = 'body_example'; // string | This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['text'] = 'text_example'; // string | This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnTitle'] = 'translationsEnTitle_example'; // string | This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnBody'] = 'translationsEnBody_example'; // string | This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnText'] = 'translationsEnText_example'; // string | This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['language'] = array('language_example'); // string[] | This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['notLanguage'] = array('language_example'); // string[] | This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['publishedAtStart'] = 'publishedAtStart_example'; // string | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['publishedAtEnd'] = 'publishedAtEnd_example'; // string | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['categoriesTaxonomy'] = 'categoriesTaxonomy_example'; // string | This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesConfident'] = true; // bool | This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesLevel'] = array(56); // int[] | This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesLevel'] = array(56); // int[] | This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['entitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['sentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for finding stories whose title sentiment is the specified value. +$associate_array['notSentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for excluding stories whose title sentiment is the specified value. +$associate_array['sentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for finding stories whose body sentiment is the specified value. +$associate_array['notSentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for excluding stories whose body sentiment is the specified value. +$associate_array['mediaImagesCountMin'] = 56; // int | This parameter is used for finding stories whose number of images is greater than or equal to the specified value. +$associate_array['mediaImagesCountMax'] = 56; // int | This parameter is used for finding stories whose number of images is less than or equal to the specified value. +$associate_array['mediaImagesWidthMin'] = 56; // int | This parameter is used for finding stories whose width of images are greater than or equal to the specified value. +$associate_array['mediaImagesWidthMax'] = 56; // int | This parameter is used for finding stories whose width of images are less than or equal to the specified value. +$associate_array['mediaImagesHeightMin'] = 56; // int | This parameter is used for finding stories whose height of images are greater than or equal to the specified value. +$associate_array['mediaImagesHeightMax'] = 56; // int | This parameter is used for finding stories whose height of images are less than or equal to the specified value. +$associate_array['mediaImagesContentLengthMin'] = 56; // int | This parameter is used for finding stories whose images content length are greater than or equal to the specified value. +$associate_array['mediaImagesContentLengthMax'] = 56; // int | This parameter is used for finding stories whose images content length are less than or equal to the specified value. +$associate_array['mediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for finding stories whose images format are the specified value. +$associate_array['notMediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for excluding stories whose images format are the specified value. +$associate_array['mediaVideosCountMin'] = 56; // int | This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. +$associate_array['mediaVideosCountMax'] = 56; // int | This parameter is used for finding stories whose number of videos is less than or equal to the specified value. +$associate_array['authorId'] = array(56); // int[] | This parameter is used for finding stories whose author id is the specified value. +$associate_array['notAuthorId'] = array(56); // int[] | This parameter is used for excluding stories whose author id is the specified value. +$associate_array['authorName'] = 'authorName_example'; // string | This parameter is used for finding stories whose author full name contains the specified value. +$associate_array['notAuthorName'] = 'authorName_example'; // string | This parameter is used for excluding stories whose author full name contains the specified value. +$associate_array['sourceId'] = array(56); // int[] | This parameter is used for finding stories whose source id is the specified value. +$associate_array['notSourceId'] = array(56); // int[] | This parameter is used for excluding stories whose source id is the specified value. +$associate_array['sourceName'] = array('sourceName_example'); // string[] | This parameter is used for finding stories whose source name contains the specified value. +$associate_array['notSourceName'] = array('sourceName_example'); // string[] | This parameter is used for excluding stories whose source name contains the specified value. +$associate_array['sourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for finding stories whose source domain is the specified value. +$associate_array['notSourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for excluding stories whose source domain is the specified value. +$associate_array['sourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLinksInCountMin'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceLinksInCountMax'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceRankingsAlexaRankMin'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaRankMax'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaCountry'] = array('sourceRankingsAlexaCountry_example'); // string[] | This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['socialSharesCountFacebookMin'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountFacebookMax'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMin'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMax'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMin'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMax'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountRedditMin'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountRedditMax'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. +$associate_array['clusters'] = array('clusters_example'); // string[] | This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). +$associate_array['return'] = array('return_example'); // string[] | This parameter is used for specifying return fields. +$associate_array['sortBy'] = 'published_at'; // string | This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). +$associate_array['sortDirection'] = 'desc'; // string | This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). +$associate_array['cursor'] = '*'; // string | This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). +$associate_array['perPage'] = 10; // int | This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) try { - $result = $api_instance->listStories($opts); + $result = $apiInstance->listStories($associate_array); print_r($result); } catch (Exception $e) { - print_r($e->getResponseObject()->getErrors()); echo 'Exception when calling DefaultApi->listStories: ', $e->getMessage(), PHP_EOL; } ?> @@ -888,95 +1062,100 @@ try { ### Parameters +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int[]**| This parameter is used for finding stories by story id. | [optional] - **not_id** | **int[]**| This parameter is used for excluding stories by story id. | [optional] - **title** | **string**| This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **body** | **string**| This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **text** | **string**| This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **language** | **string[]**| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **not_language** | **string[]**| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **published_at_start** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **published_at_end** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **categories_taxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [enum: iab-qag, iptc-subjectcode] - **categories_confident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] - **categories_id** | **string[]**| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_id** | **string[]**| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **categories_level** | **int[]**| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_level** | **int[]**| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **entities_title_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **sentiment_title_polarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_title_polarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **sentiment_body_polarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_body_polarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **media_images_count_min** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] - **media_images_count_max** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] - **media_images_width_min** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] - **media_images_width_max** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] - **media_images_height_min** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] - **media_images_height_max** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] - **media_images_content_length_min** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] - **media_images_content_length_max** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] - **media_images_format** | **string[]**| This parameter is used for finding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **not_media_images_format** | **string[]**| This parameter is used for excluding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **media_videos_count_min** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] - **media_videos_count_max** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] - **author_id** | **int[]**| This parameter is used for finding stories whose author id is the specified value. | [optional] - **not_author_id** | **int[]**| This parameter is used for excluding stories whose author id is the specified value. | [optional] - **author_name** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] - **not_author_name** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] - **source_id** | **int[]**| This parameter is used for finding stories whose source id is the specified value. | [optional] - **not_source_id** | **int[]**| This parameter is used for excluding stories whose source id is the specified value. | [optional] - **source_name** | **string[]**| This parameter is used for finding stories whose source name contains the specified value. | [optional] - **not_source_name** | **string[]**| This parameter is used for excluding stories whose source name contains the specified value. | [optional] - **source_domain** | **string[]**| This parameter is used for finding stories whose source domain is the specified value. | [optional] - **not_source_domain** | **string[]**| This parameter is used for excluding stories whose source domain is the specified value. | [optional] - **source_locations_country** | **string[]**| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_country** | **string[]**| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_state** | **string[]**| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_state** | **string[]**| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_city** | **string[]**| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_city** | **string[]**| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_country** | **string[]**| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_country** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_state** | **string[]**| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_state** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_city** | **string[]**| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_city** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_level** | **string[]**| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **not_source_scopes_level** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **source_links_in_count_min** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_links_in_count_max** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_rankings_alexa_rank_min** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_rank_max** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_country** | **string[]**| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **social_shares_count_facebook_min** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_facebook_max** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_google_plus_min** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_google_plus_max** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_linkedin_min** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_linkedin_max** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_reddit_min** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_reddit_max** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] - **cluster** | **bool**| This parameter enables clustering for the returned stories. You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] [default to false] - **cluster_algorithm** | **string**| This parameter is used for specifying the clustering algorithm you wish to use. It supprts STC, Lingo and [k-means](https://en.wikipedia.org/wiki/K-means_clustering) algorithms. You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] [default to lingo] [enum: stc, lingo, kmeans] - **return** | **string[]**| This parameter is used for specifying return fields. | [optional] [enum: id, title, body, summary, source, author, entities, keywords, hashtags, characters_count, words_count, sentences_count, paragraphs_count, categories, social_shares_count, media, sentiment, language, published_at, links] - **sort_by** | **string**| This parameter is used for changing the order column of the results. | [optional] [default to published_at] [enum: relevance, recency, hotness, published_at, social_shares_count, social_shares_count.facebook, social_shares_count.linkedin, social_shares_count.google_plus, social_shares_count.reddit, media.images.count, media.videos.count, source.links_in_count, source.rankings.alexa.rank, source.rankings.alexa.rank.AF, source.rankings.alexa.rank.AX, source.rankings.alexa.rank.AL, source.rankings.alexa.rank.DZ, source.rankings.alexa.rank.AS, source.rankings.alexa.rank.AD, source.rankings.alexa.rank.AO, source.rankings.alexa.rank.AI, source.rankings.alexa.rank.AQ, source.rankings.alexa.rank.AG, source.rankings.alexa.rank.AR, source.rankings.alexa.rank.AM, source.rankings.alexa.rank.AW, source.rankings.alexa.rank.AU, source.rankings.alexa.rank.AT, source.rankings.alexa.rank.AZ, source.rankings.alexa.rank.BS, source.rankings.alexa.rank.BH, source.rankings.alexa.rank.BD, source.rankings.alexa.rank.BB, source.rankings.alexa.rank.BY, source.rankings.alexa.rank.BE, source.rankings.alexa.rank.BZ, source.rankings.alexa.rank.BJ, source.rankings.alexa.rank.BM, source.rankings.alexa.rank.BT, source.rankings.alexa.rank.BO, source.rankings.alexa.rank.BQ, source.rankings.alexa.rank.BA, source.rankings.alexa.rank.BW, source.rankings.alexa.rank.BV, source.rankings.alexa.rank.BR, source.rankings.alexa.rank.IO, source.rankings.alexa.rank.BN, source.rankings.alexa.rank.BG, source.rankings.alexa.rank.BF, source.rankings.alexa.rank.BI, source.rankings.alexa.rank.KH, source.rankings.alexa.rank.CM, source.rankings.alexa.rank.CA, source.rankings.alexa.rank.CV, source.rankings.alexa.rank.KY, source.rankings.alexa.rank.CF, source.rankings.alexa.rank.TD, source.rankings.alexa.rank.CL, source.rankings.alexa.rank.CN, source.rankings.alexa.rank.CX, source.rankings.alexa.rank.CC, source.rankings.alexa.rank.CO, source.rankings.alexa.rank.KM, source.rankings.alexa.rank.CG, source.rankings.alexa.rank.CD, source.rankings.alexa.rank.CK, source.rankings.alexa.rank.CR, source.rankings.alexa.rank.CI, source.rankings.alexa.rank.HR, source.rankings.alexa.rank.CU, source.rankings.alexa.rank.CW, source.rankings.alexa.rank.CY, source.rankings.alexa.rank.CZ, source.rankings.alexa.rank.DK, source.rankings.alexa.rank.DJ, source.rankings.alexa.rank.DM, source.rankings.alexa.rank.DO, source.rankings.alexa.rank.EC, source.rankings.alexa.rank.EG, source.rankings.alexa.rank.SV, source.rankings.alexa.rank.GQ, source.rankings.alexa.rank.ER, source.rankings.alexa.rank.EE, source.rankings.alexa.rank.ET, source.rankings.alexa.rank.FK, source.rankings.alexa.rank.FO, source.rankings.alexa.rank.FJ, source.rankings.alexa.rank.FI, source.rankings.alexa.rank.FR, source.rankings.alexa.rank.GF, source.rankings.alexa.rank.PF, source.rankings.alexa.rank.TF, source.rankings.alexa.rank.GA, source.rankings.alexa.rank.GM, source.rankings.alexa.rank.GE, source.rankings.alexa.rank.DE, source.rankings.alexa.rank.GH, source.rankings.alexa.rank.GI, source.rankings.alexa.rank.GR, source.rankings.alexa.rank.GL, source.rankings.alexa.rank.GD, source.rankings.alexa.rank.GP, source.rankings.alexa.rank.GU, source.rankings.alexa.rank.GT, source.rankings.alexa.rank.GG, source.rankings.alexa.rank.GN, source.rankings.alexa.rank.GW, source.rankings.alexa.rank.GY, source.rankings.alexa.rank.HT, source.rankings.alexa.rank.HM, source.rankings.alexa.rank.VA, source.rankings.alexa.rank.HN, source.rankings.alexa.rank.HK, source.rankings.alexa.rank.HU, source.rankings.alexa.rank.IS, source.rankings.alexa.rank.IN, source.rankings.alexa.rank.ID, source.rankings.alexa.rank.IR, source.rankings.alexa.rank.IQ, source.rankings.alexa.rank.IE, source.rankings.alexa.rank.IM, source.rankings.alexa.rank.IL, source.rankings.alexa.rank.IT, source.rankings.alexa.rank.JM, source.rankings.alexa.rank.JP, source.rankings.alexa.rank.JE, source.rankings.alexa.rank.JO, source.rankings.alexa.rank.KZ, source.rankings.alexa.rank.KE, source.rankings.alexa.rank.KI, source.rankings.alexa.rank.KP, source.rankings.alexa.rank.KR, source.rankings.alexa.rank.KW, source.rankings.alexa.rank.KG, source.rankings.alexa.rank.LA, source.rankings.alexa.rank.LV, source.rankings.alexa.rank.LB, source.rankings.alexa.rank.LS, source.rankings.alexa.rank.LR, source.rankings.alexa.rank.LY, source.rankings.alexa.rank.LI, source.rankings.alexa.rank.LT, source.rankings.alexa.rank.LU, source.rankings.alexa.rank.MO, source.rankings.alexa.rank.MK, source.rankings.alexa.rank.MG, source.rankings.alexa.rank.MW, source.rankings.alexa.rank.MY, source.rankings.alexa.rank.MV, source.rankings.alexa.rank.ML, source.rankings.alexa.rank.MT, source.rankings.alexa.rank.MH, source.rankings.alexa.rank.MQ, source.rankings.alexa.rank.MR, source.rankings.alexa.rank.MU, source.rankings.alexa.rank.YT, source.rankings.alexa.rank.MX, source.rankings.alexa.rank.FM, source.rankings.alexa.rank.MD, source.rankings.alexa.rank.MC, source.rankings.alexa.rank.MN, source.rankings.alexa.rank.ME, source.rankings.alexa.rank.MS, source.rankings.alexa.rank.MA, source.rankings.alexa.rank.MZ, source.rankings.alexa.rank.MM, source.rankings.alexa.rank.NA, source.rankings.alexa.rank.NR, source.rankings.alexa.rank.NP, source.rankings.alexa.rank.NL, source.rankings.alexa.rank.NC, source.rankings.alexa.rank.NZ, source.rankings.alexa.rank.NI, source.rankings.alexa.rank.NE, source.rankings.alexa.rank.NG, source.rankings.alexa.rank.NU, source.rankings.alexa.rank.NF, source.rankings.alexa.rank.MP, source.rankings.alexa.rank.NO, source.rankings.alexa.rank.OM, source.rankings.alexa.rank.PK, source.rankings.alexa.rank.PW, source.rankings.alexa.rank.PS, source.rankings.alexa.rank.PA, source.rankings.alexa.rank.PG, source.rankings.alexa.rank.PY, source.rankings.alexa.rank.PE, source.rankings.alexa.rank.PH, source.rankings.alexa.rank.PN, source.rankings.alexa.rank.PL, source.rankings.alexa.rank.PT, source.rankings.alexa.rank.PR, source.rankings.alexa.rank.QA, source.rankings.alexa.rank.RE, source.rankings.alexa.rank.RO, source.rankings.alexa.rank.RU, source.rankings.alexa.rank.RW, source.rankings.alexa.rank.BL, source.rankings.alexa.rank.SH, source.rankings.alexa.rank.KN, source.rankings.alexa.rank.LC, source.rankings.alexa.rank.MF, source.rankings.alexa.rank.PM, source.rankings.alexa.rank.VC, source.rankings.alexa.rank.WS, source.rankings.alexa.rank.SM, source.rankings.alexa.rank.ST, source.rankings.alexa.rank.SA, source.rankings.alexa.rank.SN, source.rankings.alexa.rank.RS, source.rankings.alexa.rank.SC, source.rankings.alexa.rank.SL, source.rankings.alexa.rank.SG, source.rankings.alexa.rank.SX, source.rankings.alexa.rank.SK, source.rankings.alexa.rank.SI, source.rankings.alexa.rank.SB, source.rankings.alexa.rank.SO, source.rankings.alexa.rank.ZA, source.rankings.alexa.rank.GS, source.rankings.alexa.rank.SS, source.rankings.alexa.rank.ES, source.rankings.alexa.rank.LK, source.rankings.alexa.rank.SD, source.rankings.alexa.rank.SR, source.rankings.alexa.rank.SJ, source.rankings.alexa.rank.SZ, source.rankings.alexa.rank.SE, source.rankings.alexa.rank.CH, source.rankings.alexa.rank.SY, source.rankings.alexa.rank.TW, source.rankings.alexa.rank.TJ, source.rankings.alexa.rank.TZ, source.rankings.alexa.rank.TH, source.rankings.alexa.rank.TL, source.rankings.alexa.rank.TG, source.rankings.alexa.rank.TK, source.rankings.alexa.rank.TO, source.rankings.alexa.rank.TT, source.rankings.alexa.rank.TN, source.rankings.alexa.rank.TR, source.rankings.alexa.rank.TM, source.rankings.alexa.rank.TC, source.rankings.alexa.rank.TV, source.rankings.alexa.rank.UG, source.rankings.alexa.rank.UA, source.rankings.alexa.rank.AE, source.rankings.alexa.rank.GB, source.rankings.alexa.rank.US, source.rankings.alexa.rank.UM, source.rankings.alexa.rank.UY, source.rankings.alexa.rank.UZ, source.rankings.alexa.rank.VU, source.rankings.alexa.rank.VE, source.rankings.alexa.rank.VN, source.rankings.alexa.rank.VG, source.rankings.alexa.rank.VI, source.rankings.alexa.rank.WF, source.rankings.alexa.rank.EH, source.rankings.alexa.rank.YE, source.rankings.alexa.rank.ZM, source.rankings.alexa.rank.ZW] - **sort_direction** | **string**| This parameter is used for changing the order direction of the result. | [optional] [default to desc] [enum: asc, desc] - **cursor** | **string**| This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). | [optional] [default to *] - **per_page** | **int**| This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) | [optional] [default to 10] + **id** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by story id. | [optional] + **notId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by story id. | [optional] + **title** | **string**| This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **body** | **string**| This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **text** | **string**| This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnTitle** | **string**| This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnBody** | **string**| This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnText** | **string**| This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **language** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **notLanguage** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **publishedAtStart** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **publishedAtEnd** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **categoriesTaxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesConfident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] + **categoriesId** | [**string[]**](../Model/string.md)| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesId** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **entitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **sentimentTitlePolarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] + **notSentimentTitlePolarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] + **sentimentBodyPolarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] + **notSentimentBodyPolarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] + **mediaImagesCountMin** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] + **mediaImagesCountMax** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] + **mediaImagesWidthMin** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] + **mediaImagesWidthMax** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] + **mediaImagesHeightMin** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] + **mediaImagesHeightMax** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] + **mediaImagesContentLengthMin** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] + **mediaImagesContentLengthMax** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] + **mediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose images format are the specified value. | [optional] + **notMediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose images format are the specified value. | [optional] + **mediaVideosCountMin** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] + **mediaVideosCountMax** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] + **authorId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose author id is the specified value. | [optional] + **notAuthorId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose author id is the specified value. | [optional] + **authorName** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] + **notAuthorName** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] + **sourceId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose source id is the specified value. | [optional] + **notSourceId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose source id is the specified value. | [optional] + **sourceName** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source name contains the specified value. | [optional] + **notSourceName** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source name contains the specified value. | [optional] + **sourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source domain is the specified value. | [optional] + **notSourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source domain is the specified value. | [optional] + **sourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLinksInCountMin** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceLinksInCountMax** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceRankingsAlexaRankMin** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaRankMax** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **socialSharesCountFacebookMin** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountFacebookMax** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMin** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMax** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMin** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMax** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountRedditMin** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountRedditMax** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] + **clusters** | [**string[]**](../Model/string.md)| This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). | [optional] + **return** | [**string[]**](../Model/string.md)| This parameter is used for specifying return fields. | [optional] + **sortBy** | **string**| This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). | [optional] [default to 'published_at'] + **sortDirection** | **string**| This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). | [optional] [default to 'desc'] + **cursor** | **string**| This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). | [optional] [default to '*'] + **perPage** | **int**| This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) | [optional] [default to 10] ### Return type @@ -984,125 +1163,139 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key), [app_id](../../README.md#app_id) +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, text/xml +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **listTimeSeries** -> \Aylien\NewsApi\Models\TimeSeriesList listTimeSeries($opts) +## listTimeSeries + +> \Aylien\NewsApi\Models\TimeSeriesList listTimeSeries($id, $notId, $title, $body, $text, $translationsEnTitle, $translationsEnBody, $translationsEnText, $language, $notLanguage, $categoriesTaxonomy, $categoriesConfident, $categoriesId, $notCategoriesId, $categoriesLevel, $notCategoriesLevel, $entitiesTitleText, $notEntitiesTitleText, $entitiesTitleType, $notEntitiesTitleType, $entitiesTitleLinksDbpedia, $notEntitiesTitleLinksDbpedia, $entitiesBodyText, $notEntitiesBodyText, $entitiesBodyType, $notEntitiesBodyType, $entitiesBodyLinksDbpedia, $notEntitiesBodyLinksDbpedia, $sentimentTitlePolarity, $notSentimentTitlePolarity, $sentimentBodyPolarity, $notSentimentBodyPolarity, $mediaImagesCountMin, $mediaImagesCountMax, $mediaImagesWidthMin, $mediaImagesWidthMax, $mediaImagesHeightMin, $mediaImagesHeightMax, $mediaImagesContentLengthMin, $mediaImagesContentLengthMax, $mediaImagesFormat, $notMediaImagesFormat, $mediaVideosCountMin, $mediaVideosCountMax, $authorId, $notAuthorId, $authorName, $notAuthorName, $sourceId, $notSourceId, $sourceName, $notSourceName, $sourceDomain, $notSourceDomain, $sourceLocationsCountry, $notSourceLocationsCountry, $sourceLocationsState, $notSourceLocationsState, $sourceLocationsCity, $notSourceLocationsCity, $sourceScopesCountry, $notSourceScopesCountry, $sourceScopesState, $notSourceScopesState, $sourceScopesCity, $notSourceScopesCity, $sourceScopesLevel, $notSourceScopesLevel, $sourceLinksInCountMin, $sourceLinksInCountMax, $sourceRankingsAlexaRankMin, $sourceRankingsAlexaRankMax, $sourceRankingsAlexaCountry, $socialSharesCountFacebookMin, $socialSharesCountFacebookMax, $socialSharesCountGooglePlusMin, $socialSharesCountGooglePlusMax, $socialSharesCountLinkedinMin, $socialSharesCountLinkedinMax, $socialSharesCountRedditMin, $socialSharesCountRedditMax, $publishedAtStart, $publishedAtEnd, $period) List time series -This endpoint is used for getting time series by stories. +The time series endpoint allows you to track information contained in stories over time. This information can be anything from mentions of a topic or entities, sentiment about a topic, or the volume of stories published by a source, to name but a few. The full list of parameters is given below. Using the [Date Math Syntax](https://newsapi.aylien.com/docs/working-with-dates), you can easily set your query to return information from any time period, from the current point in time to when the News API started collecting stories. The returned information can be rounded to a time also specified by you, for example by setting the results into hourly, daily, or weekly data points. ### Example + ```php setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); // Configure API key authorization: app_key -Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY'); - -$api_instance = new Aylien\NewsApi\Api\DefaultApi(); - - -$opts = array( - 'id' => array(56), - 'not_id' => array(56), - 'title' => "title_example", - 'body' => "body_example", - 'text' => "text_example", - 'language' => array("language_example"), - 'not_language' => array("not_language_example"), - 'categories_taxonomy' => "categories_taxonomy_example", - 'categories_confident' => true, - 'categories_id' => array("categories_id_example"), - 'not_categories_id' => array("not_categories_id_example"), - 'categories_level' => array(56), - 'not_categories_level' => array(56), - 'entities_title_text' => array("entities_title_text_example"), - 'not_entities_title_text' => array("not_entities_title_text_example"), - 'entities_title_type' => array("entities_title_type_example"), - 'not_entities_title_type' => array("not_entities_title_type_example"), - 'entities_title_links_dbpedia' => array("entities_title_links_dbpedia_example"), - 'not_entities_title_links_dbpedia' => array("not_entities_title_links_dbpedia_example"), - 'entities_body_text' => array("entities_body_text_example"), - 'not_entities_body_text' => array("not_entities_body_text_example"), - 'entities_body_type' => array("entities_body_type_example"), - 'not_entities_body_type' => array("not_entities_body_type_example"), - 'entities_body_links_dbpedia' => array("entities_body_links_dbpedia_example"), - 'not_entities_body_links_dbpedia' => array("not_entities_body_links_dbpedia_example"), - 'sentiment_title_polarity' => "sentiment_title_polarity_example", - 'not_sentiment_title_polarity' => "not_sentiment_title_polarity_example", - 'sentiment_body_polarity' => "sentiment_body_polarity_example", - 'not_sentiment_body_polarity' => "not_sentiment_body_polarity_example", - 'media_images_count_min' => 56, - 'media_images_count_max' => 56, - 'media_images_width_min' => 56, - 'media_images_width_max' => 56, - 'media_images_height_min' => 56, - 'media_images_height_max' => 56, - 'media_images_content_length_min' => 56, - 'media_images_content_length_max' => 56, - 'media_images_format' => array("media_images_format_example"), - 'not_media_images_format' => array("not_media_images_format_example"), - 'media_videos_count_min' => 56, - 'media_videos_count_max' => 56, - 'author_id' => array(56), - 'not_author_id' => array(56), - 'author_name' => "author_name_example", - 'not_author_name' => "not_author_name_example", - 'source_id' => array(56), - 'not_source_id' => array(56), - 'source_name' => array("source_name_example"), - 'not_source_name' => array("not_source_name_example"), - 'source_domain' => array("source_domain_example"), - 'not_source_domain' => array("not_source_domain_example"), - 'source_locations_country' => array("source_locations_country_example"), - 'not_source_locations_country' => array("not_source_locations_country_example"), - 'source_locations_state' => array("source_locations_state_example"), - 'not_source_locations_state' => array("not_source_locations_state_example"), - 'source_locations_city' => array("source_locations_city_example"), - 'not_source_locations_city' => array("not_source_locations_city_example"), - 'source_scopes_country' => array("source_scopes_country_example"), - 'not_source_scopes_country' => array("not_source_scopes_country_example"), - 'source_scopes_state' => array("source_scopes_state_example"), - 'not_source_scopes_state' => array("not_source_scopes_state_example"), - 'source_scopes_city' => array("source_scopes_city_example"), - 'not_source_scopes_city' => array("not_source_scopes_city_example"), - 'source_scopes_level' => array("source_scopes_level_example"), - 'not_source_scopes_level' => array("not_source_scopes_level_example"), - 'source_links_in_count_min' => 56, - 'source_links_in_count_max' => 56, - 'source_rankings_alexa_rank_min' => 56, - 'source_rankings_alexa_rank_max' => 56, - 'source_rankings_alexa_country' => array("source_rankings_alexa_country_example"), - 'social_shares_count_facebook_min' => 56, - 'social_shares_count_facebook_max' => 56, - 'social_shares_count_google_plus_min' => 56, - 'social_shares_count_google_plus_max' => 56, - 'social_shares_count_linkedin_min' => 56, - 'social_shares_count_linkedin_max' => 56, - 'social_shares_count_reddit_min' => 56, - 'social_shares_count_reddit_max' => 56, - 'published_at_start' => "NOW-7DAYS/DAY", - 'published_at_end' => "NOW/DAY", - 'period' => "+1DAY" +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); + + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config ); +$associate_array['id'] = array(56); // int[] | This parameter is used for finding stories by story id. +$associate_array['notId'] = array(56); // int[] | This parameter is used for excluding stories by story id. +$associate_array['title'] = 'title_example'; // string | This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['body'] = 'body_example'; // string | This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['text'] = 'text_example'; // string | This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnTitle'] = 'translationsEnTitle_example'; // string | This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnBody'] = 'translationsEnBody_example'; // string | This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnText'] = 'translationsEnText_example'; // string | This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['language'] = array('language_example'); // string[] | This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['notLanguage'] = array('language_example'); // string[] | This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['categoriesTaxonomy'] = 'categoriesTaxonomy_example'; // string | This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesConfident'] = true; // bool | This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesLevel'] = array(56); // int[] | This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesLevel'] = array(56); // int[] | This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['entitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['sentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for finding stories whose title sentiment is the specified value. +$associate_array['notSentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for excluding stories whose title sentiment is the specified value. +$associate_array['sentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for finding stories whose body sentiment is the specified value. +$associate_array['notSentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for excluding stories whose body sentiment is the specified value. +$associate_array['mediaImagesCountMin'] = 56; // int | This parameter is used for finding stories whose number of images is greater than or equal to the specified value. +$associate_array['mediaImagesCountMax'] = 56; // int | This parameter is used for finding stories whose number of images is less than or equal to the specified value. +$associate_array['mediaImagesWidthMin'] = 56; // int | This parameter is used for finding stories whose width of images are greater than or equal to the specified value. +$associate_array['mediaImagesWidthMax'] = 56; // int | This parameter is used for finding stories whose width of images are less than or equal to the specified value. +$associate_array['mediaImagesHeightMin'] = 56; // int | This parameter is used for finding stories whose height of images are greater than or equal to the specified value. +$associate_array['mediaImagesHeightMax'] = 56; // int | This parameter is used for finding stories whose height of images are less than or equal to the specified value. +$associate_array['mediaImagesContentLengthMin'] = 56; // int | This parameter is used for finding stories whose images content length are greater than or equal to the specified value. +$associate_array['mediaImagesContentLengthMax'] = 56; // int | This parameter is used for finding stories whose images content length are less than or equal to the specified value. +$associate_array['mediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for finding stories whose images format are the specified value. +$associate_array['notMediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for excluding stories whose images format are the specified value. +$associate_array['mediaVideosCountMin'] = 56; // int | This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. +$associate_array['mediaVideosCountMax'] = 56; // int | This parameter is used for finding stories whose number of videos is less than or equal to the specified value. +$associate_array['authorId'] = array(56); // int[] | This parameter is used for finding stories whose author id is the specified value. +$associate_array['notAuthorId'] = array(56); // int[] | This parameter is used for excluding stories whose author id is the specified value. +$associate_array['authorName'] = 'authorName_example'; // string | This parameter is used for finding stories whose author full name contains the specified value. +$associate_array['notAuthorName'] = 'authorName_example'; // string | This parameter is used for excluding stories whose author full name contains the specified value. +$associate_array['sourceId'] = array(56); // int[] | This parameter is used for finding stories whose source id is the specified value. +$associate_array['notSourceId'] = array(56); // int[] | This parameter is used for excluding stories whose source id is the specified value. +$associate_array['sourceName'] = array('sourceName_example'); // string[] | This parameter is used for finding stories whose source name contains the specified value. +$associate_array['notSourceName'] = array('sourceName_example'); // string[] | This parameter is used for excluding stories whose source name contains the specified value. +$associate_array['sourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for finding stories whose source domain is the specified value. +$associate_array['notSourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for excluding stories whose source domain is the specified value. +$associate_array['sourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLinksInCountMin'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceLinksInCountMax'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceRankingsAlexaRankMin'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaRankMax'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaCountry'] = array('sourceRankingsAlexaCountry_example'); // string[] | This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['socialSharesCountFacebookMin'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountFacebookMax'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMin'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMax'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMin'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMax'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountRedditMin'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountRedditMax'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. +$associate_array['publishedAtStart'] = 'NOW-7DAYS/DAY'; // string | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['publishedAtEnd'] = 'NOW/DAY'; // string | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['period'] = '+1DAY'; // string | The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). try { - $result = $api_instance->listTimeSeries($opts); + $result = $apiInstance->listTimeSeries($associate_array); print_r($result); } catch (Exception $e) { - print_r($e->getResponseObject()->getErrors()); echo 'Exception when calling DefaultApi->listTimeSeries: ', $e->getMessage(), PHP_EOL; } ?> @@ -1110,89 +1303,95 @@ try { ### Parameters +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int[]**| This parameter is used for finding stories by story id. | [optional] - **not_id** | **int[]**| This parameter is used for excluding stories by story id. | [optional] - **title** | **string**| This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **body** | **string**| This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **text** | **string**| This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **language** | **string[]**| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **not_language** | **string[]**| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **categories_taxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [enum: iab-qag, iptc-subjectcode] - **categories_confident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] - **categories_id** | **string[]**| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_id** | **string[]**| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **categories_level** | **int[]**| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_level** | **int[]**| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **entities_title_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **sentiment_title_polarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_title_polarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **sentiment_body_polarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_body_polarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **media_images_count_min** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] - **media_images_count_max** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] - **media_images_width_min** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] - **media_images_width_max** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] - **media_images_height_min** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] - **media_images_height_max** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] - **media_images_content_length_min** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] - **media_images_content_length_max** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] - **media_images_format** | **string[]**| This parameter is used for finding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **not_media_images_format** | **string[]**| This parameter is used for excluding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **media_videos_count_min** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] - **media_videos_count_max** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] - **author_id** | **int[]**| This parameter is used for finding stories whose author id is the specified value. | [optional] - **not_author_id** | **int[]**| This parameter is used for excluding stories whose author id is the specified value. | [optional] - **author_name** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] - **not_author_name** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] - **source_id** | **int[]**| This parameter is used for finding stories whose source id is the specified value. | [optional] - **not_source_id** | **int[]**| This parameter is used for excluding stories whose source id is the specified value. | [optional] - **source_name** | **string[]**| This parameter is used for finding stories whose source name contains the specified value. | [optional] - **not_source_name** | **string[]**| This parameter is used for excluding stories whose source name contains the specified value. | [optional] - **source_domain** | **string[]**| This parameter is used for finding stories whose source domain is the specified value. | [optional] - **not_source_domain** | **string[]**| This parameter is used for excluding stories whose source domain is the specified value. | [optional] - **source_locations_country** | **string[]**| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_country** | **string[]**| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_state** | **string[]**| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_state** | **string[]**| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_city** | **string[]**| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_city** | **string[]**| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_country** | **string[]**| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_country** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_state** | **string[]**| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_state** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_city** | **string[]**| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_city** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_level** | **string[]**| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **not_source_scopes_level** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **source_links_in_count_min** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_links_in_count_max** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_rankings_alexa_rank_min** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_rank_max** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_country** | **string[]**| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **social_shares_count_facebook_min** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_facebook_max** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_google_plus_min** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_google_plus_max** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_linkedin_min** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_linkedin_max** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_reddit_min** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_reddit_max** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] - **published_at_start** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] [default to NOW-7DAYS/DAY] - **published_at_end** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] [default to NOW/DAY] - **period** | **string**| The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). | [optional] [default to +1DAY] + **id** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by story id. | [optional] + **notId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by story id. | [optional] + **title** | **string**| This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **body** | **string**| This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **text** | **string**| This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnTitle** | **string**| This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnBody** | **string**| This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnText** | **string**| This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **language** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **notLanguage** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **categoriesTaxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesConfident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] + **categoriesId** | [**string[]**](../Model/string.md)| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesId** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **entitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **sentimentTitlePolarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] + **notSentimentTitlePolarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] + **sentimentBodyPolarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] + **notSentimentBodyPolarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] + **mediaImagesCountMin** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] + **mediaImagesCountMax** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] + **mediaImagesWidthMin** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] + **mediaImagesWidthMax** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] + **mediaImagesHeightMin** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] + **mediaImagesHeightMax** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] + **mediaImagesContentLengthMin** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] + **mediaImagesContentLengthMax** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] + **mediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose images format are the specified value. | [optional] + **notMediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose images format are the specified value. | [optional] + **mediaVideosCountMin** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] + **mediaVideosCountMax** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] + **authorId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose author id is the specified value. | [optional] + **notAuthorId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose author id is the specified value. | [optional] + **authorName** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] + **notAuthorName** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] + **sourceId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose source id is the specified value. | [optional] + **notSourceId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose source id is the specified value. | [optional] + **sourceName** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source name contains the specified value. | [optional] + **notSourceName** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source name contains the specified value. | [optional] + **sourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source domain is the specified value. | [optional] + **notSourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source domain is the specified value. | [optional] + **sourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLinksInCountMin** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceLinksInCountMax** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceRankingsAlexaRankMin** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaRankMax** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **socialSharesCountFacebookMin** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountFacebookMax** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMin** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMax** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMin** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMax** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountRedditMin** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountRedditMax** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] + **publishedAtStart** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] [default to 'NOW-7DAYS/DAY'] + **publishedAtEnd** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] [default to 'NOW/DAY'] + **period** | **string**| The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). | [optional] [default to '+1DAY'] ### Return type @@ -1200,125 +1399,139 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key), [app_id](../../README.md#app_id) +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, text/xml +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## listTrends -# **listTrends** -> \Aylien\NewsApi\Models\Trends listTrends($field, $opts) +> \Aylien\NewsApi\Models\Trends listTrends($field, $id, $notId, $title, $body, $text, $translationsEnTitle, $translationsEnBody, $translationsEnText, $language, $notLanguage, $publishedAtStart, $publishedAtEnd, $categoriesTaxonomy, $categoriesConfident, $categoriesId, $notCategoriesId, $categoriesLevel, $notCategoriesLevel, $entitiesTitleText, $notEntitiesTitleText, $entitiesTitleType, $notEntitiesTitleType, $entitiesTitleLinksDbpedia, $notEntitiesTitleLinksDbpedia, $entitiesBodyText, $notEntitiesBodyText, $entitiesBodyType, $notEntitiesBodyType, $entitiesBodyLinksDbpedia, $notEntitiesBodyLinksDbpedia, $sentimentTitlePolarity, $notSentimentTitlePolarity, $sentimentBodyPolarity, $notSentimentBodyPolarity, $mediaImagesCountMin, $mediaImagesCountMax, $mediaImagesWidthMin, $mediaImagesWidthMax, $mediaImagesHeightMin, $mediaImagesHeightMax, $mediaImagesContentLengthMin, $mediaImagesContentLengthMax, $mediaImagesFormat, $notMediaImagesFormat, $mediaVideosCountMin, $mediaVideosCountMax, $authorId, $notAuthorId, $authorName, $notAuthorName, $sourceId, $notSourceId, $sourceName, $notSourceName, $sourceDomain, $notSourceDomain, $sourceLocationsCountry, $notSourceLocationsCountry, $sourceLocationsState, $notSourceLocationsState, $sourceLocationsCity, $notSourceLocationsCity, $sourceScopesCountry, $notSourceScopesCountry, $sourceScopesState, $notSourceScopesState, $sourceScopesCity, $notSourceScopesCity, $sourceScopesLevel, $notSourceScopesLevel, $sourceLinksInCountMin, $sourceLinksInCountMax, $sourceRankingsAlexaRankMin, $sourceRankingsAlexaRankMax, $sourceRankingsAlexaCountry, $socialSharesCountFacebookMin, $socialSharesCountFacebookMax, $socialSharesCountGooglePlusMin, $socialSharesCountGooglePlusMax, $socialSharesCountLinkedinMin, $socialSharesCountLinkedinMax, $socialSharesCountRedditMin, $socialSharesCountRedditMax) List trends -This endpoint is used for finding trends based on stories. +The trends endpoint allows you to identify the most-mentioned entities, concepts and keywords relevant to your query. For example, this endpoint allows you to set parameters like a time period, a subject category, or an entity, and your request will return the most mentioned entities or keywords that are mentioned in relation to your query. ### Example + ```php setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_APP_ID'); +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-ID', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-ID', 'Bearer'); // Configure API key authorization: app_key -Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_APP_KEY'); - -$api_instance = new Aylien\NewsApi\Api\DefaultApi(); - -$field = "field_example"; - -$opts = array( - 'id' => array(56), - 'not_id' => array(56), - 'title' => "title_example", - 'body' => "body_example", - 'text' => "text_example", - 'language' => array("language_example"), - 'not_language' => array("not_language_example"), - 'published_at_start' => "published_at_start_example", - 'published_at_end' => "published_at_end_example", - 'categories_taxonomy' => "categories_taxonomy_example", - 'categories_confident' => true, - 'categories_id' => array("categories_id_example"), - 'not_categories_id' => array("not_categories_id_example"), - 'categories_level' => array(56), - 'not_categories_level' => array(56), - 'entities_title_text' => array("entities_title_text_example"), - 'not_entities_title_text' => array("not_entities_title_text_example"), - 'entities_title_type' => array("entities_title_type_example"), - 'not_entities_title_type' => array("not_entities_title_type_example"), - 'entities_title_links_dbpedia' => array("entities_title_links_dbpedia_example"), - 'not_entities_title_links_dbpedia' => array("not_entities_title_links_dbpedia_example"), - 'entities_body_text' => array("entities_body_text_example"), - 'not_entities_body_text' => array("not_entities_body_text_example"), - 'entities_body_type' => array("entities_body_type_example"), - 'not_entities_body_type' => array("not_entities_body_type_example"), - 'entities_body_links_dbpedia' => array("entities_body_links_dbpedia_example"), - 'not_entities_body_links_dbpedia' => array("not_entities_body_links_dbpedia_example"), - 'sentiment_title_polarity' => "sentiment_title_polarity_example", - 'not_sentiment_title_polarity' => "not_sentiment_title_polarity_example", - 'sentiment_body_polarity' => "sentiment_body_polarity_example", - 'not_sentiment_body_polarity' => "not_sentiment_body_polarity_example", - 'media_images_count_min' => 56, - 'media_images_count_max' => 56, - 'media_images_width_min' => 56, - 'media_images_width_max' => 56, - 'media_images_height_min' => 56, - 'media_images_height_max' => 56, - 'media_images_content_length_min' => 56, - 'media_images_content_length_max' => 56, - 'media_images_format' => array("media_images_format_example"), - 'not_media_images_format' => array("not_media_images_format_example"), - 'media_videos_count_min' => 56, - 'media_videos_count_max' => 56, - 'author_id' => array(56), - 'not_author_id' => array(56), - 'author_name' => "author_name_example", - 'not_author_name' => "not_author_name_example", - 'source_id' => array(56), - 'not_source_id' => array(56), - 'source_name' => array("source_name_example"), - 'not_source_name' => array("not_source_name_example"), - 'source_domain' => array("source_domain_example"), - 'not_source_domain' => array("not_source_domain_example"), - 'source_locations_country' => array("source_locations_country_example"), - 'not_source_locations_country' => array("not_source_locations_country_example"), - 'source_locations_state' => array("source_locations_state_example"), - 'not_source_locations_state' => array("not_source_locations_state_example"), - 'source_locations_city' => array("source_locations_city_example"), - 'not_source_locations_city' => array("not_source_locations_city_example"), - 'source_scopes_country' => array("source_scopes_country_example"), - 'not_source_scopes_country' => array("not_source_scopes_country_example"), - 'source_scopes_state' => array("source_scopes_state_example"), - 'not_source_scopes_state' => array("not_source_scopes_state_example"), - 'source_scopes_city' => array("source_scopes_city_example"), - 'not_source_scopes_city' => array("not_source_scopes_city_example"), - 'source_scopes_level' => array("source_scopes_level_example"), - 'not_source_scopes_level' => array("not_source_scopes_level_example"), - 'source_links_in_count_min' => 56, - 'source_links_in_count_max' => 56, - 'source_rankings_alexa_rank_min' => 56, - 'source_rankings_alexa_rank_max' => 56, - 'source_rankings_alexa_country' => array("source_rankings_alexa_country_example"), - 'social_shares_count_facebook_min' => 56, - 'social_shares_count_facebook_max' => 56, - 'social_shares_count_google_plus_min' => 56, - 'social_shares_count_google_plus_max' => 56, - 'social_shares_count_linkedin_min' => 56, - 'social_shares_count_linkedin_max' => 56, - 'social_shares_count_reddit_min' => 56, - 'social_shares_count_reddit_max' => 56 +$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AYLIEN-NewsAPI-Application-Key', 'Bearer'); + + +$apiInstance = new Aylien\NewsApi\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config ); +$associate_array['field'] = keywords; // string | This parameter is used to specify the trend field. +$associate_array['id'] = array(56); // int[] | This parameter is used for finding stories by story id. +$associate_array['notId'] = array(56); // int[] | This parameter is used for excluding stories by story id. +$associate_array['title'] = 'title_example'; // string | This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['body'] = 'body_example'; // string | This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['text'] = 'text_example'; // string | This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnTitle'] = 'translationsEnTitle_example'; // string | This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnBody'] = 'translationsEnBody_example'; // string | This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['translationsEnText'] = 'translationsEnText_example'; // string | This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). +$associate_array['language'] = array('language_example'); // string[] | This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['notLanguage'] = array('language_example'); // string[] | This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. +$associate_array['publishedAtStart'] = 'publishedAtStart_example'; // string | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['publishedAtEnd'] = 'publishedAtEnd_example'; // string | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). +$associate_array['categoriesTaxonomy'] = 'categoriesTaxonomy_example'; // string | This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesConfident'] = true; // bool | This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesId'] = array('categoriesId_example'); // string[] | This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['categoriesLevel'] = array(56); // int[] | This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['notCategoriesLevel'] = array(56); // int[] | This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). +$associate_array['entitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleText'] = array('entitiesTitleText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleType'] = array('entitiesTitleType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesTitleLinksDbpedia'] = array('entitiesTitleLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyText'] = array('entitiesBodyText_example'); // string[] | This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyType'] = array('entitiesBodyType_example'); // string[] | This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['entitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['notEntitiesBodyLinksDbpedia'] = array('entitiesBodyLinksDbpedia_example'); // string[] | This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). +$associate_array['sentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for finding stories whose title sentiment is the specified value. +$associate_array['notSentimentTitlePolarity'] = 'sentimentTitlePolarity_example'; // string | This parameter is used for excluding stories whose title sentiment is the specified value. +$associate_array['sentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for finding stories whose body sentiment is the specified value. +$associate_array['notSentimentBodyPolarity'] = 'sentimentBodyPolarity_example'; // string | This parameter is used for excluding stories whose body sentiment is the specified value. +$associate_array['mediaImagesCountMin'] = 56; // int | This parameter is used for finding stories whose number of images is greater than or equal to the specified value. +$associate_array['mediaImagesCountMax'] = 56; // int | This parameter is used for finding stories whose number of images is less than or equal to the specified value. +$associate_array['mediaImagesWidthMin'] = 56; // int | This parameter is used for finding stories whose width of images are greater than or equal to the specified value. +$associate_array['mediaImagesWidthMax'] = 56; // int | This parameter is used for finding stories whose width of images are less than or equal to the specified value. +$associate_array['mediaImagesHeightMin'] = 56; // int | This parameter is used for finding stories whose height of images are greater than or equal to the specified value. +$associate_array['mediaImagesHeightMax'] = 56; // int | This parameter is used for finding stories whose height of images are less than or equal to the specified value. +$associate_array['mediaImagesContentLengthMin'] = 56; // int | This parameter is used for finding stories whose images content length are greater than or equal to the specified value. +$associate_array['mediaImagesContentLengthMax'] = 56; // int | This parameter is used for finding stories whose images content length are less than or equal to the specified value. +$associate_array['mediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for finding stories whose images format are the specified value. +$associate_array['notMediaImagesFormat'] = array('mediaImagesFormat_example'); // string[] | This parameter is used for excluding stories whose images format are the specified value. +$associate_array['mediaVideosCountMin'] = 56; // int | This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. +$associate_array['mediaVideosCountMax'] = 56; // int | This parameter is used for finding stories whose number of videos is less than or equal to the specified value. +$associate_array['authorId'] = array(56); // int[] | This parameter is used for finding stories whose author id is the specified value. +$associate_array['notAuthorId'] = array(56); // int[] | This parameter is used for excluding stories whose author id is the specified value. +$associate_array['authorName'] = 'authorName_example'; // string | This parameter is used for finding stories whose author full name contains the specified value. +$associate_array['notAuthorName'] = 'authorName_example'; // string | This parameter is used for excluding stories whose author full name contains the specified value. +$associate_array['sourceId'] = array(56); // int[] | This parameter is used for finding stories whose source id is the specified value. +$associate_array['notSourceId'] = array(56); // int[] | This parameter is used for excluding stories whose source id is the specified value. +$associate_array['sourceName'] = array('sourceName_example'); // string[] | This parameter is used for finding stories whose source name contains the specified value. +$associate_array['notSourceName'] = array('sourceName_example'); // string[] | This parameter is used for excluding stories whose source name contains the specified value. +$associate_array['sourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for finding stories whose source domain is the specified value. +$associate_array['notSourceDomain'] = array('sourceDomain_example'); // string[] | This parameter is used for excluding stories whose source domain is the specified value. +$associate_array['sourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCountry'] = array('sourceLocationsCountry_example'); // string[] | This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsState'] = array('sourceLocationsState_example'); // string[] | This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceLocationsCity'] = array('sourceLocationsCity_example'); // string[] | This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCountry'] = array('sourceScopesCountry_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesState'] = array('sourceScopesState_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesCity'] = array('sourceScopesCity_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['notSourceScopesLevel'] = array('sourceScopesLevel_example'); // string[] | This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). +$associate_array['sourceLinksInCountMin'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceLinksInCountMax'] = 56; // int | This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). +$associate_array['sourceRankingsAlexaRankMin'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaRankMax'] = 56; // int | This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['sourceRankingsAlexaCountry'] = array('sourceRankingsAlexaCountry_example'); // string[] | This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). +$associate_array['socialSharesCountFacebookMin'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountFacebookMax'] = 56; // int | This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMin'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountGooglePlusMax'] = 56; // int | This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMin'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountLinkedinMax'] = 56; // int | This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. +$associate_array['socialSharesCountRedditMin'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. +$associate_array['socialSharesCountRedditMax'] = 56; // int | This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. try { - $result = $api_instance->listTrends($field, $opts); + $result = $apiInstance->listTrends($associate_array); print_r($result); } catch (Exception $e) { - print_r($e->getResponseObject()->getErrors()); echo 'Exception when calling DefaultApi->listTrends: ', $e->getMessage(), PHP_EOL; } ?> @@ -1326,89 +1539,95 @@ try { ### Parameters +Note: the input parameter is an associative array with the keys listed as the parameter name below. + + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **field** | **string**| This parameter is used to specify the trend field. | [enum: author.name, source.name, source.domain, keywords, entities.title.text, entities.title.type, entities.title.links.dbpedia, entities.body.text, entities.body.type, entities.body.links.dbpedia, hashtags, categories.id, sentiment.title.polarity, sentiment.body.polarity] - **id** | **int[]**| This parameter is used for finding stories by story id. | [optional] - **not_id** | **int[]**| This parameter is used for excluding stories by story id. | [optional] - **title** | **string**| This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **body** | **string**| This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **text** | **string**| This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] - **language** | **string[]**| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **not_language** | **string[]**| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] [enum: en, de, fr, it, es, pt] - **published_at_start** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **published_at_end** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] - **categories_taxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [enum: iab-qag, iptc-subjectcode] - **categories_confident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] - **categories_id** | **string[]**| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_id** | **string[]**| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **categories_level** | **int[]**| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **not_categories_level** | **int[]**| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] - **entities_title_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_title_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_title_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_text** | **string[]**| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_text** | **string[]**| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_type** | **string[]**| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_type** | **string[]**| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **entities_body_links_dbpedia** | **string[]**| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **not_entities_body_links_dbpedia** | **string[]**| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] - **sentiment_title_polarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_title_polarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **sentiment_body_polarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **not_sentiment_body_polarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] [enum: positive, neutral, negative] - **media_images_count_min** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] - **media_images_count_max** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] - **media_images_width_min** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] - **media_images_width_max** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] - **media_images_height_min** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] - **media_images_height_max** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] - **media_images_content_length_min** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] - **media_images_content_length_max** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] - **media_images_format** | **string[]**| This parameter is used for finding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **not_media_images_format** | **string[]**| This parameter is used for excluding stories whose images format are the specified value. | [optional] [enum: BMP, GIF, JPEG, PNG, TIFF, PSD, ICO, CUR, WEBP, SVG] - **media_videos_count_min** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] - **media_videos_count_max** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] - **author_id** | **int[]**| This parameter is used for finding stories whose author id is the specified value. | [optional] - **not_author_id** | **int[]**| This parameter is used for excluding stories whose author id is the specified value. | [optional] - **author_name** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] - **not_author_name** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] - **source_id** | **int[]**| This parameter is used for finding stories whose source id is the specified value. | [optional] - **not_source_id** | **int[]**| This parameter is used for excluding stories whose source id is the specified value. | [optional] - **source_name** | **string[]**| This parameter is used for finding stories whose source name contains the specified value. | [optional] - **not_source_name** | **string[]**| This parameter is used for excluding stories whose source name contains the specified value. | [optional] - **source_domain** | **string[]**| This parameter is used for finding stories whose source domain is the specified value. | [optional] - **not_source_domain** | **string[]**| This parameter is used for excluding stories whose source domain is the specified value. | [optional] - **source_locations_country** | **string[]**| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_country** | **string[]**| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_state** | **string[]**| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_state** | **string[]**| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_locations_city** | **string[]**| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_locations_city** | **string[]**| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_country** | **string[]**| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_country** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_state** | **string[]**| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_state** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_city** | **string[]**| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **not_source_scopes_city** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] - **source_scopes_level** | **string[]**| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **not_source_scopes_level** | **string[]**| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] [enum: international, national, local] - **source_links_in_count_min** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_links_in_count_max** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] - **source_rankings_alexa_rank_min** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_rank_max** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **source_rankings_alexa_country** | **string[]**| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] - **social_shares_count_facebook_min** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_facebook_max** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_google_plus_min** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_google_plus_max** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_linkedin_min** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_linkedin_max** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] - **social_shares_count_reddit_min** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] - **social_shares_count_reddit_max** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] + **field** | **string**| This parameter is used to specify the trend field. | + **id** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by story id. | [optional] + **notId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by story id. | [optional] + **title** | **string**| This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **body** | **string**| This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **text** | **string**| This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnTitle** | **string**| This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnBody** | **string**| This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **translationsEnText** | **string**| This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). | [optional] + **language** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **notLanguage** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. | [optional] + **publishedAtStart** | **string**| This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **publishedAtEnd** | **string**| This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). | [optional] + **categoriesTaxonomy** | **string**| This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesConfident** | **bool**| This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] [default to true] + **categoriesId** | [**string[]**](../Model/string.md)| This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesId** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **categoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **notCategoriesLevel** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). | [optional] + **entitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesTitleLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyText** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyType** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **entitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **notEntitiesBodyLinksDbpedia** | [**string[]**](../Model/string.md)| This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). | [optional] + **sentimentTitlePolarity** | **string**| This parameter is used for finding stories whose title sentiment is the specified value. | [optional] + **notSentimentTitlePolarity** | **string**| This parameter is used for excluding stories whose title sentiment is the specified value. | [optional] + **sentimentBodyPolarity** | **string**| This parameter is used for finding stories whose body sentiment is the specified value. | [optional] + **notSentimentBodyPolarity** | **string**| This parameter is used for excluding stories whose body sentiment is the specified value. | [optional] + **mediaImagesCountMin** | **int**| This parameter is used for finding stories whose number of images is greater than or equal to the specified value. | [optional] + **mediaImagesCountMax** | **int**| This parameter is used for finding stories whose number of images is less than or equal to the specified value. | [optional] + **mediaImagesWidthMin** | **int**| This parameter is used for finding stories whose width of images are greater than or equal to the specified value. | [optional] + **mediaImagesWidthMax** | **int**| This parameter is used for finding stories whose width of images are less than or equal to the specified value. | [optional] + **mediaImagesHeightMin** | **int**| This parameter is used for finding stories whose height of images are greater than or equal to the specified value. | [optional] + **mediaImagesHeightMax** | **int**| This parameter is used for finding stories whose height of images are less than or equal to the specified value. | [optional] + **mediaImagesContentLengthMin** | **int**| This parameter is used for finding stories whose images content length are greater than or equal to the specified value. | [optional] + **mediaImagesContentLengthMax** | **int**| This parameter is used for finding stories whose images content length are less than or equal to the specified value. | [optional] + **mediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose images format are the specified value. | [optional] + **notMediaImagesFormat** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose images format are the specified value. | [optional] + **mediaVideosCountMin** | **int**| This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. | [optional] + **mediaVideosCountMax** | **int**| This parameter is used for finding stories whose number of videos is less than or equal to the specified value. | [optional] + **authorId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose author id is the specified value. | [optional] + **notAuthorId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose author id is the specified value. | [optional] + **authorName** | **string**| This parameter is used for finding stories whose author full name contains the specified value. | [optional] + **notAuthorName** | **string**| This parameter is used for excluding stories whose author full name contains the specified value. | [optional] + **sourceId** | [**int[]**](../Model/int.md)| This parameter is used for finding stories whose source id is the specified value. | [optional] + **notSourceId** | [**int[]**](../Model/int.md)| This parameter is used for excluding stories whose source id is the specified value. | [optional] + **sourceName** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source name contains the specified value. | [optional] + **notSourceName** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source name contains the specified value. | [optional] + **sourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source domain is the specified value. | [optional] + **notSourceDomain** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source domain is the specified value. | [optional] + **sourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceLocationsCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCountry** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesState** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesCity** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **notSourceScopesLevel** | [**string[]**](../Model/string.md)| This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). | [optional] + **sourceLinksInCountMin** | **int**| This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceLinksInCountMax** | **int**| This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). | [optional] + **sourceRankingsAlexaRankMin** | **int**| This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaRankMax** | **int**| This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **sourceRankingsAlexaCountry** | [**string[]**](../Model/string.md)| This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). | [optional] + **socialSharesCountFacebookMin** | **int**| This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountFacebookMax** | **int**| This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMin** | **int**| This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountGooglePlusMax** | **int**| This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMin** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountLinkedinMax** | **int**| This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. | [optional] + **socialSharesCountRedditMin** | **int**| This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. | [optional] + **socialSharesCountRedditMax** | **int**| This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. | [optional] ### Return type @@ -1416,12 +1635,14 @@ Name | Type | Description | Notes ### Authorization -[app_key](../../README.md#app_key), [app_id](../../README.md#app_id) +[app_id](../../README.md#app_id), [app_key](../../README.md#app_key) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, text/xml +- **Content-Type**: Not defined +- **Accept**: application/json, text/xml -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) diff --git a/docs/Model/Author.md b/docs/Model/Author.md index dd9eab1..66dc674 100644 --- a/docs/Model/Author.md +++ b/docs/Model/Author.md @@ -1,12 +1,13 @@ -# Author +# # Author ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**avatarUrl** | **string** | A URL which points to the author avatar | [optional] **id** | **int** | A unique identification for the author | [optional] **name** | **string** | The extracted author full name | [optional] -**avatar_url** | **string** | A URL which points to the author avatar | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Autocomplete.md b/docs/Model/Autocomplete.md index 0cb1e8d..65cfbf3 100644 --- a/docs/Model/Autocomplete.md +++ b/docs/Model/Autocomplete.md @@ -1,11 +1,12 @@ -# Autocomplete +# # Autocomplete ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | ID of the autocomplete | [optional] **text** | **string** | Text of the autocomplete | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Autocompletes.md b/docs/Model/Autocompletes.md index af8cd30..8e786d5 100644 --- a/docs/Model/Autocompletes.md +++ b/docs/Model/Autocompletes.md @@ -1,10 +1,11 @@ -# Autocompletes +# # Autocompletes ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **autocompletes** | [**\Aylien\NewsApi\Models\Autocomplete[]**](Autocomplete.md) | An array of autocompletes | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Category.md b/docs/Model/Category.md index 22f9a48..72d9e7a 100644 --- a/docs/Model/Category.md +++ b/docs/Model/Category.md @@ -1,15 +1,16 @@ -# Category +# # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**confident** | **bool** | It defines whether the extracted category is confident or not | [optional] **id** | **string** | The ID of the category | [optional] -**taxonomy** | **string** | The taxonomy of the category | [optional] **level** | **int** | The level of the category | [optional] +**links** | [**\Aylien\NewsApi\Models\CategoryLinks**](CategoryLinks.md) | | [optional] **score** | **double** | The score of the category | [optional] -**confident** | **bool** | It defines whether the extracted category is confident or not | [optional] -**links** | [**\Aylien\NewsApi\Models\CategoryLinks**](CategoryLinks.md) | Related links for the category | [optional] +**taxonomy** | **string** | The taxonomy of the category | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CategoryLinks.md b/docs/Model/CategoryLinks.md index a4beb66..3dac6f4 100644 --- a/docs/Model/CategoryLinks.md +++ b/docs/Model/CategoryLinks.md @@ -1,11 +1,12 @@ -# CategoryLinks +# # CategoryLinks ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**self** | **string** | A URL pointing to the category | [optional] **parent** | **string** | A URL pointing to the parent category | [optional] +**self** | **string** | A URL pointing to the category | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Cluster.md b/docs/Model/Cluster.md new file mode 100644 index 0000000..85f9d96 --- /dev/null +++ b/docs/Model/Cluster.md @@ -0,0 +1,17 @@ +# # Cluster + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**earliestStory** | [**\DateTime**](\DateTime.md) | Publication date of the earliest story in cluster | [optional] +**id** | **int** | ID of the cluster which is a unique identification | [optional] +**latestStory** | [**\DateTime**](\DateTime.md) | Publication date of the latest story in cluster | [optional] +**location** | [**\Aylien\NewsApi\Models\Location**](Location.md) | | [optional] +**representativeStory** | [**\Aylien\NewsApi\Models\RepresentativeStory**](RepresentativeStory.md) | | [optional] +**storyCount** | **int** | Number of stories associated with the cluster | [optional] +**time** | [**\DateTime**](\DateTime.md) | Time of the event | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Clusters.md b/docs/Model/Clusters.md new file mode 100644 index 0000000..77165b6 --- /dev/null +++ b/docs/Model/Clusters.md @@ -0,0 +1,13 @@ +# # Clusters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clusterCount** | **int** | The total number of clusters | [optional] +**clusters** | [**\Aylien\NewsApi\Models\Cluster[]**](Cluster.md) | An array of clusters | [optional] +**nextPageCursor** | **string** | The next page cursor | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Coverages.md b/docs/Model/Coverages.md index eb86db4..4ef3781 100644 --- a/docs/Model/Coverages.md +++ b/docs/Model/Coverages.md @@ -1,15 +1,15 @@ -# Coverages +# # Coverages ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**story_title** | **string** | The input story title | [optional] -**story_body** | **string** | The input story body | [optional] -**story_published_at** | [**\DateTime**](\DateTime.md) | The input story published date | [optional] -**story_language** | **string** | The input story language | [optional] **coverages** | [**\Aylien\NewsApi\Models\Story[]**](Story.md) | An array of coverages for the input story | [optional] -**clusters** | [**\Aylien\NewsApi\Models\StoryCluster[]**](StoryCluster.md) | An array of clusters | [optional] +**storyBody** | **string** | The input story body | [optional] +**storyLanguage** | **string** | The input story language | [optional] +**storyPublishedAt** | [**\DateTime**](\DateTime.md) | The input story published date | [optional] +**storyTitle** | **string** | The input story title | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Entities.md b/docs/Model/Entities.md index 3da263d..34ba3b0 100644 --- a/docs/Model/Entities.md +++ b/docs/Model/Entities.md @@ -1,11 +1,12 @@ -# Entities +# # Entities ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Aylien\NewsApi\Models\Entity[]**](Entity.md) | An array of extracted entities from the story title | [optional] **body** | [**\Aylien\NewsApi\Models\Entity[]**](Entity.md) | An array of extracted entities from the story body | [optional] +**title** | [**\Aylien\NewsApi\Models\Entity[]**](Entity.md) | An array of extracted entities from the story title | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Entity.md b/docs/Model/Entity.md index 4ba40ce..53bab22 100644 --- a/docs/Model/Entity.md +++ b/docs/Model/Entity.md @@ -1,14 +1,15 @@ -# Entity +# # Entity ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**text** | **string** | The entity text | [optional] +**indices** | [**int[][]**](array.md) | The indices of the entity text | [optional] +**links** | [**\Aylien\NewsApi\Models\EntityLinks**](EntityLinks.md) | | [optional] **score** | **double** | The entity score | [optional] +**text** | **string** | The entity text | [optional] **types** | **string[]** | An array of the dbpedia types | [optional] -**links** | [**\Aylien\NewsApi\Models\EntityLinks**](EntityLinks.md) | Related links to the entity | [optional] -**indices** | [**int[][]**](array.md) | The indices of the entity text | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EntityLinks.md b/docs/Model/EntityLinks.md index 92bf043..b31d548 100644 --- a/docs/Model/EntityLinks.md +++ b/docs/Model/EntityLinks.md @@ -1,10 +1,11 @@ -# EntityLinks +# # EntityLinks ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dbpedia** | **string** | A dbpedia resource URL | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Error.md b/docs/Model/Error.md index 8625d78..1bba253 100644 --- a/docs/Model/Error.md +++ b/docs/Model/Error.md @@ -1,15 +1,16 @@ -# Error +# # Error ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**code** | **string** | | [optional] +**detail** | **string** | | [optional] **id** | **string** | | [optional] **links** | [**\Aylien\NewsApi\Models\ErrorLinks**](ErrorLinks.md) | | [optional] **status** | **string** | | [optional] -**code** | **string** | | [optional] **title** | **string** | | [optional] -**detail** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorLinks.md b/docs/Model/ErrorLinks.md index 7b0fbf1..663cf8e 100644 --- a/docs/Model/ErrorLinks.md +++ b/docs/Model/ErrorLinks.md @@ -1,10 +1,11 @@ -# ErrorLinks +# # ErrorLinks ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **about** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Errors.md b/docs/Model/Errors.md index 31a9d35..3f5805f 100644 --- a/docs/Model/Errors.md +++ b/docs/Model/Errors.md @@ -1,10 +1,11 @@ -# Errors +# # Errors ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **errors** | [**\Aylien\NewsApi\Models\Error[]**](Error.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HistogramInterval.md b/docs/Model/HistogramInterval.md index 6254544..c6628a1 100644 --- a/docs/Model/HistogramInterval.md +++ b/docs/Model/HistogramInterval.md @@ -1,11 +1,12 @@ -# HistogramInterval +# # HistogramInterval ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bin** | **int** | Histogram bin | [optional] **count** | **int** | Histogram bin size | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Histograms.md b/docs/Model/Histograms.md index 075401e..80af936 100644 --- a/docs/Model/Histograms.md +++ b/docs/Model/Histograms.md @@ -1,14 +1,15 @@ -# Histograms +# # Histograms ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**intervals** | [**\Aylien\NewsApi\Models\HistogramInterval[]**](HistogramInterval.md) | The intervals of the histograms | [optional] -**interval_start** | **int** | The start interval of the histogram | [optional] -**interval_end** | **int** | The end interval of the histogram | [optional] -**interval_width** | **int** | The width of the histogram | [optional] **field** | **string** | | [optional] +**intervalEnd** | **int** | The end interval of the histogram | [optional] +**intervalStart** | **int** | The start interval of the histogram | [optional] +**intervalWidth** | **int** | The width of the histogram | [optional] +**intervals** | [**\Aylien\NewsApi\Models\HistogramInterval[]**](HistogramInterval.md) | The intervals of the histograms | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Location.md b/docs/Model/Location.md index 7fcd654..a7d59d7 100644 --- a/docs/Model/Location.md +++ b/docs/Model/Location.md @@ -1,12 +1,13 @@ -# Location +# # Location ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**city** | **string** | The city of the location | [optional] **country** | **string** | The country code of the location. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. | [optional] **state** | **string** | The state of the location | [optional] -**city** | **string** | The city of the location | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Media.md b/docs/Model/Media.md index f8942be..6434c8d 100644 --- a/docs/Model/Media.md +++ b/docs/Model/Media.md @@ -1,15 +1,16 @@ -# Media +# # Media ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**contentLength** | **int** | The content length of media | [optional] +**format** | **string** | The format of media | [optional] +**height** | **int** | The height of media | [optional] **type** | **string** | The type of media | [optional] **url** | **string** | A URL which points to the media file | [optional] -**format** | **string** | The format of media | [optional] -**content_length** | **int** | The content length of media | [optional] **width** | **int** | The width of media | [optional] -**height** | **int** | The height of media | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Rank.md b/docs/Model/Rank.md index 0fa972e..8b2ae2f 100644 --- a/docs/Model/Rank.md +++ b/docs/Model/Rank.md @@ -1,12 +1,13 @@ -# Rank +# # Rank ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**rank** | **int** | The rank | [optional] **country** | **string** | The country code which the rank is in it | [optional] -**fetched_at** | [**\DateTime**](\DateTime.md) | The fetched date of the rank | [optional] +**fetchedAt** | [**\DateTime**](\DateTime.md) | The fetched date of the rank | [optional] +**rank** | **int** | The rank | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Rankings.md b/docs/Model/Rankings.md index 8ba0fd2..b2c9059 100644 --- a/docs/Model/Rankings.md +++ b/docs/Model/Rankings.md @@ -1,10 +1,11 @@ -# Rankings +# # Rankings ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **alexa** | [**\Aylien\NewsApi\Models\Rank[]**](Rank.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelatedStories.md b/docs/Model/RelatedStories.md index 1409799..368fa2c 100644 --- a/docs/Model/RelatedStories.md +++ b/docs/Model/RelatedStories.md @@ -1,14 +1,14 @@ -# RelatedStories +# # RelatedStories ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**story_title** | **string** | The input story title | [optional] -**story_body** | **string** | The input story body | [optional] -**story_language** | **string** | The input story language | [optional] -**related_stories** | [**\Aylien\NewsApi\Models\Story[]**](Story.md) | An array of related stories for the input story | [optional] -**clusters** | [**\Aylien\NewsApi\Models\StoryCluster[]**](StoryCluster.md) | An array of clusters | [optional] +**relatedStories** | [**\Aylien\NewsApi\Models\Story[]**](Story.md) | An array of related stories for the input story | [optional] +**storyBody** | **string** | The input story body | [optional] +**storyLanguage** | **string** | The input story language | [optional] +**storyTitle** | **string** | The input story title | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RepresentativeStory.md b/docs/Model/RepresentativeStory.md new file mode 100644 index 0000000..c6db28a --- /dev/null +++ b/docs/Model/RepresentativeStory.md @@ -0,0 +1,14 @@ +# # RepresentativeStory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the story which is a unique identification | [optional] +**permalink** | **string** | The story permalink URL | [optional] +**publishedAt** | [**\DateTime**](\DateTime.md) | Published date of the story | [optional] +**title** | **string** | Title of the story | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Scope.md b/docs/Model/Scope.md index f22c6e1..55dce93 100644 --- a/docs/Model/Scope.md +++ b/docs/Model/Scope.md @@ -1,13 +1,14 @@ -# Scope +# # Scope ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country** | **string** | The source scope by country code. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. | [optional] -**state** | **string** | The scope by state | [optional] **city** | **string** | The scope by city | [optional] +**country** | **string** | The source scope by country code. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. | [optional] **level** | **string** | The scope by level | [optional] +**state** | **string** | The scope by state | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Sentiment.md b/docs/Model/Sentiment.md index 2a2a42a..e6e145b 100644 --- a/docs/Model/Sentiment.md +++ b/docs/Model/Sentiment.md @@ -1,11 +1,12 @@ -# Sentiment +# # Sentiment ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **polarity** | **string** | Polarity of the sentiment | [optional] **score** | **double** | Polarity score of the sentiment | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Sentiments.md b/docs/Model/Sentiments.md index ca0a1e7..f6f7a58 100644 --- a/docs/Model/Sentiments.md +++ b/docs/Model/Sentiments.md @@ -1,11 +1,12 @@ -# Sentiments +# # Sentiments ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | [**\Aylien\NewsApi\Models\Sentiment**](Sentiment.md) | The sentiment for the story title | [optional] -**body** | [**\Aylien\NewsApi\Models\Sentiment**](Sentiment.md) | The sentiment for the story body | [optional] +**body** | [**\Aylien\NewsApi\Models\Sentiment**](Sentiment.md) | | [optional] +**title** | [**\Aylien\NewsApi\Models\Sentiment**](Sentiment.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShareCount.md b/docs/Model/ShareCount.md index 34733d9..eabe802 100644 --- a/docs/Model/ShareCount.md +++ b/docs/Model/ShareCount.md @@ -1,11 +1,12 @@ -# ShareCount +# # ShareCount ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **count** | **int** | The number of shares | [optional] -**fetched_at** | [**\DateTime**](\DateTime.md) | The fetched date of the shares | [optional] +**fetchedAt** | [**\DateTime**](\DateTime.md) | The fetched date of the shares | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShareCounts.md b/docs/Model/ShareCounts.md index 1c6b965..6c6ab35 100644 --- a/docs/Model/ShareCounts.md +++ b/docs/Model/ShareCounts.md @@ -1,13 +1,14 @@ -# ShareCounts +# # ShareCounts ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **facebook** | [**\Aylien\NewsApi\Models\ShareCount[]**](ShareCount.md) | Facebook shares count | [optional] -**google_plus** | [**\Aylien\NewsApi\Models\ShareCount[]**](ShareCount.md) | Google Plus shares count | [optional] +**googlePlus** | [**\Aylien\NewsApi\Models\ShareCount[]**](ShareCount.md) | Google Plus shares count | [optional] **linkedin** | [**\Aylien\NewsApi\Models\ShareCount[]**](ShareCount.md) | LinkedIn shares count | [optional] **reddit** | [**\Aylien\NewsApi\Models\ShareCount[]**](ShareCount.md) | Reddit shares count | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Source.md b/docs/Model/Source.md index a7688b2..d899668 100644 --- a/docs/Model/Source.md +++ b/docs/Model/Source.md @@ -1,20 +1,21 @@ -# Source +# # Source ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | The source id which is a unique value | [optional] -**name** | **string** | The source name | [optional] -**title** | **string** | The title of the home page URL | [optional] **description** | **string** | A general explanation about the source | [optional] -**links_in_count** | **int** | The number of websites that link to the source | [optional] -**home_page_url** | **string** | The home page URL of the source | [optional] **domain** | **string** | The domain name of the source which is extracted from the source URL | [optional] -**logo_url** | **string** | A URL which points to the source logo | [optional] +**homePageUrl** | **string** | The home page URL of the source | [optional] +**id** | **int** | The source id which is a unique value | [optional] +**linksInCount** | **int** | The number of websites that link to the source | [optional] **locations** | [**\Aylien\NewsApi\Models\Location[]**](Location.md) | The source locations which are tend to be the physical locations of the source, e.g. BBC headquarter is located in London. | [optional] +**logoUrl** | **string** | A URL which points to the source logo | [optional] +**name** | **string** | The source name | [optional] +**rankings** | [**\Aylien\NewsApi\Models\Rankings**](Rankings.md) | | [optional] **scopes** | [**\Aylien\NewsApi\Models\Scope[]**](Scope.md) | The source scopes which is tend to be scope locations of the source, e.g. BBC scopes is international. | [optional] -**rankings** | [**\Aylien\NewsApi\Models\Rankings**](Rankings.md) | The web rankings of the source | [optional] +**title** | **string** | The title of the home page URL | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Stories.md b/docs/Model/Stories.md index 088ff6e..3b22a4a 100644 --- a/docs/Model/Stories.md +++ b/docs/Model/Stories.md @@ -1,12 +1,12 @@ -# Stories +# # Stories ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**nextPageCursor** | **string** | The next page cursor | [optional] **stories** | [**\Aylien\NewsApi\Models\Story[]**](Story.md) | An array of stories | [optional] -**clusters** | [**\Aylien\NewsApi\Models\StoryCluster[]**](StoryCluster.md) | An array of clusters | [optional] -**next_page_cursor** | **string** | The next page cursor | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Story.md b/docs/Model/Story.md index c629f67..f65c827 100644 --- a/docs/Model/Story.md +++ b/docs/Model/Story.md @@ -1,29 +1,32 @@ -# Story +# # Story ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | ID of the story which is a unique identification | [optional] -**title** | **string** | Title of the story | [optional] +**author** | [**\Aylien\NewsApi\Models\Author**](Author.md) | | [optional] **body** | **string** | Body of the story | [optional] -**summary** | [**\Aylien\NewsApi\Models\Summary**](Summary.md) | The suggested story summary | [optional] -**source** | [**\Aylien\NewsApi\Models\Source**](Source.md) | The story source | [optional] -**author** | [**\Aylien\NewsApi\Models\Author**](Author.md) | The story author | [optional] -**entities** | [**\Aylien\NewsApi\Models\Entities**](Entities.md) | Extracted entities from the story title or body | [optional] -**keywords** | **string[]** | Extracted keywords mentioned in the story title or body | [optional] -**hashtags** | **string[]** | An array of suggested Story hashtags | [optional] -**characters_count** | **int** | Character count of the story body | [optional] -**words_count** | **int** | Word count of the story body | [optional] -**sentences_count** | **int** | Sentence count of the story body | [optional] -**paragraphs_count** | **int** | Paragraph count of the story body | [optional] **categories** | [**\Aylien\NewsApi\Models\Category[]**](Category.md) | Suggested categories for the story | [optional] -**social_shares_count** | [**\Aylien\NewsApi\Models\ShareCounts**](ShareCounts.md) | Social shares count for the story | [optional] -**media** | [**\Aylien\NewsApi\Models\Media[]**](Media.md) | An array of extracted media such as images and videos | [optional] -**sentiment** | [**\Aylien\NewsApi\Models\Sentiments**](Sentiments.md) | Suggested sentiments for the story title or body | [optional] +**charactersCount** | **int** | Character count of the story body | [optional] +**clusters** | **int[]** | An array of clusters the story is associated with | [optional] +**entities** | [**\Aylien\NewsApi\Models\Entities**](Entities.md) | | [optional] +**hashtags** | **string[]** | An array of suggested Story hashtags | [optional] +**id** | **int** | ID of the story which is a unique identification | [optional] +**keywords** | **string[]** | Extracted keywords mentioned in the story title or body | [optional] **language** | **string** | Language of the story | [optional] -**published_at** | [**\DateTime**](\DateTime.md) | Published date of the story | [optional] -**links** | [**\Aylien\NewsApi\Models\StoryLinks**](StoryLinks.md) | Links which is related to the story | [optional] +**links** | [**\Aylien\NewsApi\Models\StoryLinks**](StoryLinks.md) | | [optional] +**media** | [**\Aylien\NewsApi\Models\Media[]**](Media.md) | An array of extracted media such as images and videos | [optional] +**paragraphsCount** | **int** | Paragraph count of the story body | [optional] +**publishedAt** | [**\DateTime**](\DateTime.md) | Published date of the story | [optional] +**sentencesCount** | **int** | Sentence count of the story body | [optional] +**sentiment** | [**\Aylien\NewsApi\Models\Sentiments**](Sentiments.md) | | [optional] +**socialSharesCount** | [**\Aylien\NewsApi\Models\ShareCounts**](ShareCounts.md) | | [optional] +**source** | [**\Aylien\NewsApi\Models\Source**](Source.md) | | [optional] +**summary** | [**\Aylien\NewsApi\Models\Summary**](Summary.md) | | [optional] +**title** | **string** | Title of the story | [optional] +**translations** | [**\Aylien\NewsApi\Models\StoryTranslations**](StoryTranslations.md) | | [optional] +**wordsCount** | **int** | Word count of the story body | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StoryCluster.md b/docs/Model/StoryCluster.md index 737423e..cc38d2e 100644 --- a/docs/Model/StoryCluster.md +++ b/docs/Model/StoryCluster.md @@ -1,14 +1,15 @@ -# StoryCluster +# # StoryCluster ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | A unique identification for the cluster | [optional] **phrases** | **string[]** | Suggested labels for the cluster | [optional] +**score** | **double** | The cluster score | [optional] **size** | **int** | Size of the cluster | [optional] **stories** | **int[]** | Story ids which are in the cluster | [optional] -**score** | **double** | The cluster score | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StoryLinks.md b/docs/Model/StoryLinks.md index 4fd9243..39afa2b 100644 --- a/docs/Model/StoryLinks.md +++ b/docs/Model/StoryLinks.md @@ -1,13 +1,14 @@ -# StoryLinks +# # StoryLinks ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**permalink** | **string** | The story permalink URL | [optional] -**related_stories** | **string** | The related stories URL | [optional] -**coverages** | **string** | The coverages URL | [optional] **canonical** | **string** | The story canonical URL | [optional] +**coverages** | **string** | The coverages URL | [optional] +**permalink** | **string** | The story permalink URL | [optional] +**relatedStories** | **string** | The related stories URL | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StoryTranslations.md b/docs/Model/StoryTranslations.md new file mode 100644 index 0000000..66c8856 --- /dev/null +++ b/docs/Model/StoryTranslations.md @@ -0,0 +1,11 @@ +# # StoryTranslations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**en** | [**\Aylien\NewsApi\Models\StoryTranslationsEn**](StoryTranslationsEn.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/StoryTranslationsEn.md b/docs/Model/StoryTranslationsEn.md new file mode 100644 index 0000000..c635289 --- /dev/null +++ b/docs/Model/StoryTranslationsEn.md @@ -0,0 +1,13 @@ +# # StoryTranslationsEn + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **string** | Translation of body | [optional] +**text** | **string** | Translation of a concatenation of title and body | [optional] +**title** | **string** | Translation of title | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Summary.md b/docs/Model/Summary.md index 641bb88..d21f814 100644 --- a/docs/Model/Summary.md +++ b/docs/Model/Summary.md @@ -1,10 +1,11 @@ -# Summary +# # Summary ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sentences** | **string[]** | An array of the suggested summary sentences | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TimeSeries.md b/docs/Model/TimeSeries.md index 1caf403..d4e7b2c 100644 --- a/docs/Model/TimeSeries.md +++ b/docs/Model/TimeSeries.md @@ -1,11 +1,12 @@ -# TimeSeries +# # TimeSeries ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**published_at** | [**\DateTime**](\DateTime.md) | The published date of the time series bin | [optional] **count** | **int** | The count of time series bin | [optional] +**publishedAt** | [**\DateTime**](\DateTime.md) | The published date of the time series bin | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TimeSeriesList.md b/docs/Model/TimeSeriesList.md index b4bbb8f..8dfecec 100644 --- a/docs/Model/TimeSeriesList.md +++ b/docs/Model/TimeSeriesList.md @@ -1,13 +1,14 @@ -# TimeSeriesList +# # TimeSeriesList ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**time_series** | [**\Aylien\NewsApi\Models\TimeSeries[]**](TimeSeries.md) | An array of time series | [optional] **period** | **string** | The size of each date range expressed as an interval to be added to the lower bound. | [optional] -**published_at_start** | [**\DateTime**](\DateTime.md) | The start published date of the time series | [optional] -**published_at_end** | [**\DateTime**](\DateTime.md) | The end published date of the time series | [optional] +**publishedAtEnd** | [**\DateTime**](\DateTime.md) | The end published date of the time series | [optional] +**publishedAtStart** | [**\DateTime**](\DateTime.md) | The start published date of the time series | [optional] +**timeSeries** | [**\Aylien\NewsApi\Models\TimeSeries[]**](TimeSeries.md) | An array of time series | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Trend.md b/docs/Model/Trend.md index 77135b6..1636bcc 100644 --- a/docs/Model/Trend.md +++ b/docs/Model/Trend.md @@ -1,11 +1,12 @@ -# Trend +# # Trend ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **string** | The value of the trend | [optional] **count** | **int** | The count of the trend | [optional] +**value** | **string** | The value of the trend | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Trends.md b/docs/Model/Trends.md index fa9940b..d0487dc 100644 --- a/docs/Model/Trends.md +++ b/docs/Model/Trends.md @@ -1,11 +1,12 @@ -# Trends +# # Trends ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**trends** | [**\Aylien\NewsApi\Models\Trend[]**](Trend.md) | An array of trends | [optional] **field** | **string** | The field of trends | [optional] +**trends** | [**\Aylien\NewsApi\Models\Trend[]**](Trend.md) | An array of trends | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..ced3be2 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/lib/Api/DefaultApi.php b/lib/Api/DefaultApi.php index 73baf9b..38498f4 100644 --- a/lib/Api/DefaultApi.php +++ b/lib/Api/DefaultApi.php @@ -5,92 +5,114 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Api; -use \Aylien\NewsApi\ApiClient; -use \Aylien\NewsApi\ApiException; -use \Aylien\NewsApi\Configuration; -use \Aylien\NewsApi\ObjectSerializer; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Aylien\NewsApi\ApiException; +use Aylien\NewsApi\Configuration; +use Aylien\NewsApi\HeaderSelector; +use Aylien\NewsApi\ObjectSerializer; /** * DefaultApi Class Doc Comment * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class DefaultApi { /** - * API Client - * - * @var \Aylien\NewsApi\ApiClient instance of the ApiClient + * @var ClientInterface */ - protected $apiClient; + protected $client; /** - * Constructor - * - * @param \Aylien\NewsApi\ApiClient|null $apiClient The api client to use + * @var Configuration */ - public function __construct(\Aylien\NewsApi\ApiClient $apiClient = null) - { - if ($apiClient === null) { - $apiClient = new ApiClient(); - } + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; - $this->apiClient = $apiClient; + /** + * @var int Host index + */ + protected $hostIndex; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $host_index (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $host_index = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; } /** - * Get API client + * Set the host index * - * @return \Aylien\NewsApi\ApiClient get the API client + * @param int Host index (required) */ - public function getApiClient() + public function setHostIndex($host_index) { - return $this->apiClient; + $this->hostIndex = $host_index; } /** - * Set the API client - * - * @param \Aylien\NewsApi\ApiClient $apiClient set the API client + * Get the host index * - * @return DefaultApi + * @return Host index */ - public function setApiClient(\Aylien\NewsApi\ApiClient $apiClient) + public function getHostIndex() { - $this->apiClient = $apiClient; - return $this; + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; } /** @@ -98,20 +120,20 @@ public function setApiClient(\Aylien\NewsApi\ApiClient $apiClient) * * List autocompletes * - * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $type This parameter is used for defining the type of autocompletes. (required) + * @param string $term This parameter is used for finding autocomplete objects that contain the specified value. (required) + * @param string $language This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'en') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) * - * @param string $type This parameter is used for defining the type of autocompletes. (required) - * @param string $term This parameter is used for finding autocomplete objects that contain the specified value. (required) - * @param array $opts (See above) * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return \Aylien\NewsApi\Models\Autocompletes + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\Autocompletes|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors */ - public function listAutocompletes($type, $term, $opts = array()) + public function listAutocompletes($associative_array) { - list($response) = $this->listAutocompletesWithHttpInfo($type, $term, $opts); + list($response) = $this->listAutocompletesWithHttpInfo($associative_array); return $response; } @@ -120,240 +142,1029 @@ public function listAutocompletes($type, $term, $opts = array()) * * List autocompletes * - - * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $type This parameter is used for defining the type of autocompletes. (required) + * @param string $term This parameter is used for finding autocomplete objects that contain the specified value. (required) + * @param string $language This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'en') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) * - * @param string $type This parameter is used for defining the type of autocompletes. (required) - * @param string $term This parameter is used for finding autocomplete objects that contain the specified value. (required) - * @param array $opts (See above) * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return array of \Aylien\NewsApi\Models\Autocompletes, HTTP status code, HTTP response headers (array of strings) + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\Autocompletes|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listAutocompletesWithHttpInfo($associative_array) + { + $request = $this->listAutocompletesRequest($associative_array); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\Autocompletes' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Autocompletes', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\Autocompletes'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Autocompletes', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listAutocompletesAsync + * + * List autocompletes + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $type This parameter is used for defining the type of autocompletes. (required) + * @param string $term This parameter is used for finding autocomplete objects that contain the specified value. (required) + * @param string $language This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'en') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listAutocompletesAsync($associative_array) + { + return $this->listAutocompletesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listAutocompletesAsyncWithHttpInfo + * + * List autocompletes + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $type This parameter is used for defining the type of autocompletes. (required) + * @param string $term This parameter is used for finding autocomplete objects that contain the specified value. (required) + * @param string $language This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'en') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAutocompletesWithHttpInfo($type, $term, $opts = array()) + public function listAutocompletesAsyncWithHttpInfo($associative_array) { - // define parameters - $language = (!empty($opts['language']) ? $opts['language'] : null); - $per_page = (!empty($opts['per_page']) ? $opts['per_page'] : null); + $returnType = '\Aylien\NewsApi\Models\Autocompletes'; + $request = $this->listAutocompletesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listAutocompletes' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $type This parameter is used for defining the type of autocompletes. (required) + * @param string $term This parameter is used for finding autocomplete objects that contain the specified value. (required) + * @param string $language This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'en') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listAutocompletesRequest($associative_array) + { + // unbox the parameters from the associative array + $type = array_key_exists('type', $associative_array) ? $associative_array['type'] : null; + $term = array_key_exists('term', $associative_array) ? $associative_array['term'] : null; + $language = array_key_exists('language', $associative_array) ? $associative_array['language'] : 'en'; + $perPage = array_key_exists('perPage', $associative_array) ? $associative_array['perPage'] : 3; + // verify the required parameter 'type' is set - if ($type === null) { - throw new \InvalidArgumentException('Missing the required parameter $type when calling listAutocompletes'); + if ($type === null || (is_array($type) && count($type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $type when calling listAutocompletes' + ); } // verify the required parameter 'term' is set - if ($term === null) { - throw new \InvalidArgumentException('Missing the required parameter $term when calling listAutocompletes'); + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling listAutocompletes' + ); } - if ((strlen($term) < 1)) { + if (strlen($term) < 1) { throw new \InvalidArgumentException('invalid length for "$term" when calling DefaultApi.listAutocompletes, must be bigger than or equal to 1.'); } - if (!is_null($per_page) && ($per_page > 100)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listAutocompletes, must be smaller than or equal to 100.'); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listAutocompletes, must be smaller than or equal to 100.'); } - if (!is_null($per_page) && ($per_page < 1)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listAutocompletes, must be bigger than or equal to 1.'); + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listAutocompletes, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/autocompletes"; - $httpBody = ''; + + $resourcePath = '/autocompletes'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/xml']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + $httpBody = ''; + $multipart = false; // query params if ($type !== null) { - $queryParams['type'] = $this->apiClient->getSerializer()->toQueryValue($type); + $queryParams['type'] = $type; } // query params if ($term !== null) { - $queryParams['term'] = $this->apiClient->getSerializer()->toQueryValue($term); + $queryParams['term'] = $term; } // query params if ($language !== null) { - $queryParams['language'] = $this->apiClient->getSerializer()->toQueryValue($language); + $queryParams['language'] = $language; } // query params - if ($per_page !== null) { - $queryParams['per_page'] = $this->apiClient->getSerializer()->toQueryValue($per_page); + if ($perPage !== null) { + $queryParams['per_page'] = $perPage; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } } + // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listClusters + * + * List Clusters + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding clusters by cluster id. (optional) + * @param int[] $notId This parameter is used for excluding clusters by cluster id. (optional) + * @param int $storyCountMin This parameter is used for finding clusters with more than or equal to a specific amount of stories associated with them. (optional) + * @param int $storyCountMax This parameter is used for finding clusters with less than or equal to a specific amount of stories associated with them. (optional) + * @param string $timeStart This parameter is used for finding clusters whose creation time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $timeEnd This parameter is used for finding clusters whose creation time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryStart This parameter is used for finding clusters whose publication date of its earliest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryEnd This parameter is used for finding clusters whose publication date of its earliest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryStart This parameter is used for finding clusters whose publication date of its latest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryEnd This parameter is used for finding clusters whose publication date of its latest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string[] $locationCountry This parameter is used for finding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notLocationCountry This parameter is used for excluding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\Clusters|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors + */ + public function listClusters($associative_array) + { + list($response) = $this->listClustersWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listClustersWithHttpInfo + * + * List Clusters + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding clusters by cluster id. (optional) + * @param int[] $notId This parameter is used for excluding clusters by cluster id. (optional) + * @param int $storyCountMin This parameter is used for finding clusters with more than or equal to a specific amount of stories associated with them. (optional) + * @param int $storyCountMax This parameter is used for finding clusters with less than or equal to a specific amount of stories associated with them. (optional) + * @param string $timeStart This parameter is used for finding clusters whose creation time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $timeEnd This parameter is used for finding clusters whose creation time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryStart This parameter is used for finding clusters whose publication date of its earliest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryEnd This parameter is used for finding clusters whose publication date of its earliest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryStart This parameter is used for finding clusters whose publication date of its latest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryEnd This parameter is used for finding clusters whose publication date of its latest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string[] $locationCountry This parameter is used for finding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notLocationCountry This parameter is used for excluding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\Clusters|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listClustersWithHttpInfo($associative_array) + { + $request = $this->listClustersRequest($associative_array); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Aylien\NewsApi\Models\Autocompletes', - '/autocompletes' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\Clusters' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Clusters', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\Clusters'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\Aylien\NewsApi\Models\Autocompletes', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Autocompletes', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Clusters', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } + /** + * Operation listClustersAsync + * + * List Clusters + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding clusters by cluster id. (optional) + * @param int[] $notId This parameter is used for excluding clusters by cluster id. (optional) + * @param int $storyCountMin This parameter is used for finding clusters with more than or equal to a specific amount of stories associated with them. (optional) + * @param int $storyCountMax This parameter is used for finding clusters with less than or equal to a specific amount of stories associated with them. (optional) + * @param string $timeStart This parameter is used for finding clusters whose creation time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $timeEnd This parameter is used for finding clusters whose creation time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryStart This parameter is used for finding clusters whose publication date of its earliest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryEnd This parameter is used for finding clusters whose publication date of its earliest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryStart This parameter is used for finding clusters whose publication date of its latest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryEnd This parameter is used for finding clusters whose publication date of its latest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string[] $locationCountry This parameter is used for finding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notLocationCountry This parameter is used for excluding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listClustersAsync($associative_array) + { + return $this->listClustersAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listClustersAsyncWithHttpInfo + * + * List Clusters + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding clusters by cluster id. (optional) + * @param int[] $notId This parameter is used for excluding clusters by cluster id. (optional) + * @param int $storyCountMin This parameter is used for finding clusters with more than or equal to a specific amount of stories associated with them. (optional) + * @param int $storyCountMax This parameter is used for finding clusters with less than or equal to a specific amount of stories associated with them. (optional) + * @param string $timeStart This parameter is used for finding clusters whose creation time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $timeEnd This parameter is used for finding clusters whose creation time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryStart This parameter is used for finding clusters whose publication date of its earliest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryEnd This parameter is used for finding clusters whose publication date of its earliest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryStart This parameter is used for finding clusters whose publication date of its latest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryEnd This parameter is used for finding clusters whose publication date of its latest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string[] $locationCountry This parameter is used for finding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notLocationCountry This parameter is used for excluding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listClustersAsyncWithHttpInfo($associative_array) + { + $returnType = '\Aylien\NewsApi\Models\Clusters'; + $request = $this->listClustersRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listClusters' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding clusters by cluster id. (optional) + * @param int[] $notId This parameter is used for excluding clusters by cluster id. (optional) + * @param int $storyCountMin This parameter is used for finding clusters with more than or equal to a specific amount of stories associated with them. (optional) + * @param int $storyCountMax This parameter is used for finding clusters with less than or equal to a specific amount of stories associated with them. (optional) + * @param string $timeStart This parameter is used for finding clusters whose creation time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $timeEnd This parameter is used for finding clusters whose creation time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryStart This parameter is used for finding clusters whose publication date of its earliest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $earliestStoryEnd This parameter is used for finding clusters whose publication date of its earliest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryStart This parameter is used for finding clusters whose publication date of its latest story is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $latestStoryEnd This parameter is used for finding clusters whose publication date of its latest story is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string[] $locationCountry This parameter is used for finding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notLocationCountry This parameter is used for excluding clusters belonging to a specific country. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listClustersRequest($associative_array) + { + // unbox the parameters from the associative array + $id = array_key_exists('id', $associative_array) ? $associative_array['id'] : null; + $notId = array_key_exists('notId', $associative_array) ? $associative_array['notId'] : null; + $storyCountMin = array_key_exists('storyCountMin', $associative_array) ? $associative_array['storyCountMin'] : null; + $storyCountMax = array_key_exists('storyCountMax', $associative_array) ? $associative_array['storyCountMax'] : null; + $timeStart = array_key_exists('timeStart', $associative_array) ? $associative_array['timeStart'] : null; + $timeEnd = array_key_exists('timeEnd', $associative_array) ? $associative_array['timeEnd'] : null; + $earliestStoryStart = array_key_exists('earliestStoryStart', $associative_array) ? $associative_array['earliestStoryStart'] : null; + $earliestStoryEnd = array_key_exists('earliestStoryEnd', $associative_array) ? $associative_array['earliestStoryEnd'] : null; + $latestStoryStart = array_key_exists('latestStoryStart', $associative_array) ? $associative_array['latestStoryStart'] : null; + $latestStoryEnd = array_key_exists('latestStoryEnd', $associative_array) ? $associative_array['latestStoryEnd'] : null; + $locationCountry = array_key_exists('locationCountry', $associative_array) ? $associative_array['locationCountry'] : null; + $notLocationCountry = array_key_exists('notLocationCountry', $associative_array) ? $associative_array['notLocationCountry'] : null; + + if ($storyCountMin !== null && $storyCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$storyCountMin" when calling DefaultApi.listClusters, must be bigger than 0.'); + } + + if ($storyCountMax !== null && $storyCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$storyCountMax" when calling DefaultApi.listClusters, must be bigger than 0.'); + } + + + $resourcePath = '/clusters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($id !== null) { + $queryParams['id[]'] = $id; + } + // query params + if ($notId !== null) { + $queryParams['!id[]'] = $notId; + } + // query params + if ($storyCountMin !== null) { + $queryParams['story_count.min'] = $storyCountMin; + } + // query params + if ($storyCountMax !== null) { + $queryParams['story_count.max'] = $storyCountMax; + } + // query params + if ($timeStart !== null) { + $queryParams['time.start'] = $timeStart; + } + // query params + if ($timeEnd !== null) { + $queryParams['time.end'] = $timeEnd; + } + // query params + if ($earliestStoryStart !== null) { + $queryParams['earliest_story.start'] = $earliestStoryStart; + } + // query params + if ($earliestStoryEnd !== null) { + $queryParams['earliest_story.end'] = $earliestStoryEnd; + } + // query params + if ($latestStoryStart !== null) { + $queryParams['latest_story.start'] = $latestStoryStart; + } + // query params + if ($latestStoryEnd !== null) { + $queryParams['latest_story.end'] = $latestStoryEnd; + } + // query params + if ($locationCountry !== null) { + $queryParams['location.country'] = $locationCountry; + } + // query params + if ($notLocationCountry !== null) { + $queryParams['!location.country'] = $notLocationCountry; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listCoverages * * List coverages * - * - * - * @param array $opts (See above) + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param \DateTime $storyPublishedAt Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return \Aylien\NewsApi\Models\Coverages + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\Coverages|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors */ - public function listCoverages($opts = array()) + public function listCoverages($associative_array) { - list($response) = $this->listCoveragesWithHttpInfo($opts); + list($response) = $this->listCoveragesWithHttpInfo($associative_array); return $response; } @@ -362,5242 +1173,7998 @@ public function listCoverages($opts = array()) * * List coverages * - - * - * - * @param array $opts (See above) + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param \DateTime $storyPublishedAt Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return array of \Aylien\NewsApi\Models\Coverages, HTTP status code, HTTP response headers (array of strings) + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\Coverages|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) */ - public function listCoveragesWithHttpInfo($opts = array()) + public function listCoveragesWithHttpInfo($associative_array) { - // define parameters - $id = (!empty($opts['id']) ? $opts['id'] : null); - $not_id = (!empty($opts['not_id']) ? $opts['not_id'] : null); - $title = (!empty($opts['title']) ? $opts['title'] : null); - $body = (!empty($opts['body']) ? $opts['body'] : null); - $text = (!empty($opts['text']) ? $opts['text'] : null); - $language = (!empty($opts['language']) ? $opts['language'] : null); - $not_language = (!empty($opts['not_language']) ? $opts['not_language'] : null); - $published_at_start = (!empty($opts['published_at_start']) ? $opts['published_at_start'] : null); - $published_at_end = (!empty($opts['published_at_end']) ? $opts['published_at_end'] : null); - $categories_taxonomy = (!empty($opts['categories_taxonomy']) ? $opts['categories_taxonomy'] : null); - $categories_confident = (!empty($opts['categories_confident']) ? $opts['categories_confident'] : null); - $categories_id = (!empty($opts['categories_id']) ? $opts['categories_id'] : null); - $not_categories_id = (!empty($opts['not_categories_id']) ? $opts['not_categories_id'] : null); - $categories_level = (!empty($opts['categories_level']) ? $opts['categories_level'] : null); - $not_categories_level = (!empty($opts['not_categories_level']) ? $opts['not_categories_level'] : null); - $entities_title_text = (!empty($opts['entities_title_text']) ? $opts['entities_title_text'] : null); - $not_entities_title_text = (!empty($opts['not_entities_title_text']) ? $opts['not_entities_title_text'] : null); - $entities_title_type = (!empty($opts['entities_title_type']) ? $opts['entities_title_type'] : null); - $not_entities_title_type = (!empty($opts['not_entities_title_type']) ? $opts['not_entities_title_type'] : null); - $entities_title_links_dbpedia = (!empty($opts['entities_title_links_dbpedia']) ? $opts['entities_title_links_dbpedia'] : null); - $not_entities_title_links_dbpedia = (!empty($opts['not_entities_title_links_dbpedia']) ? $opts['not_entities_title_links_dbpedia'] : null); - $entities_body_text = (!empty($opts['entities_body_text']) ? $opts['entities_body_text'] : null); - $not_entities_body_text = (!empty($opts['not_entities_body_text']) ? $opts['not_entities_body_text'] : null); - $entities_body_type = (!empty($opts['entities_body_type']) ? $opts['entities_body_type'] : null); - $not_entities_body_type = (!empty($opts['not_entities_body_type']) ? $opts['not_entities_body_type'] : null); - $entities_body_links_dbpedia = (!empty($opts['entities_body_links_dbpedia']) ? $opts['entities_body_links_dbpedia'] : null); - $not_entities_body_links_dbpedia = (!empty($opts['not_entities_body_links_dbpedia']) ? $opts['not_entities_body_links_dbpedia'] : null); - $sentiment_title_polarity = (!empty($opts['sentiment_title_polarity']) ? $opts['sentiment_title_polarity'] : null); - $not_sentiment_title_polarity = (!empty($opts['not_sentiment_title_polarity']) ? $opts['not_sentiment_title_polarity'] : null); - $sentiment_body_polarity = (!empty($opts['sentiment_body_polarity']) ? $opts['sentiment_body_polarity'] : null); - $not_sentiment_body_polarity = (!empty($opts['not_sentiment_body_polarity']) ? $opts['not_sentiment_body_polarity'] : null); - $media_images_count_min = (!empty($opts['media_images_count_min']) ? $opts['media_images_count_min'] : null); - $media_images_count_max = (!empty($opts['media_images_count_max']) ? $opts['media_images_count_max'] : null); - $media_images_width_min = (!empty($opts['media_images_width_min']) ? $opts['media_images_width_min'] : null); - $media_images_width_max = (!empty($opts['media_images_width_max']) ? $opts['media_images_width_max'] : null); - $media_images_height_min = (!empty($opts['media_images_height_min']) ? $opts['media_images_height_min'] : null); - $media_images_height_max = (!empty($opts['media_images_height_max']) ? $opts['media_images_height_max'] : null); - $media_images_content_length_min = (!empty($opts['media_images_content_length_min']) ? $opts['media_images_content_length_min'] : null); - $media_images_content_length_max = (!empty($opts['media_images_content_length_max']) ? $opts['media_images_content_length_max'] : null); - $media_images_format = (!empty($opts['media_images_format']) ? $opts['media_images_format'] : null); - $not_media_images_format = (!empty($opts['not_media_images_format']) ? $opts['not_media_images_format'] : null); - $media_videos_count_min = (!empty($opts['media_videos_count_min']) ? $opts['media_videos_count_min'] : null); - $media_videos_count_max = (!empty($opts['media_videos_count_max']) ? $opts['media_videos_count_max'] : null); - $author_id = (!empty($opts['author_id']) ? $opts['author_id'] : null); - $not_author_id = (!empty($opts['not_author_id']) ? $opts['not_author_id'] : null); - $author_name = (!empty($opts['author_name']) ? $opts['author_name'] : null); - $not_author_name = (!empty($opts['not_author_name']) ? $opts['not_author_name'] : null); - $source_id = (!empty($opts['source_id']) ? $opts['source_id'] : null); - $not_source_id = (!empty($opts['not_source_id']) ? $opts['not_source_id'] : null); - $source_name = (!empty($opts['source_name']) ? $opts['source_name'] : null); - $not_source_name = (!empty($opts['not_source_name']) ? $opts['not_source_name'] : null); - $source_domain = (!empty($opts['source_domain']) ? $opts['source_domain'] : null); - $not_source_domain = (!empty($opts['not_source_domain']) ? $opts['not_source_domain'] : null); - $source_locations_country = (!empty($opts['source_locations_country']) ? $opts['source_locations_country'] : null); - $not_source_locations_country = (!empty($opts['not_source_locations_country']) ? $opts['not_source_locations_country'] : null); - $source_locations_state = (!empty($opts['source_locations_state']) ? $opts['source_locations_state'] : null); - $not_source_locations_state = (!empty($opts['not_source_locations_state']) ? $opts['not_source_locations_state'] : null); - $source_locations_city = (!empty($opts['source_locations_city']) ? $opts['source_locations_city'] : null); - $not_source_locations_city = (!empty($opts['not_source_locations_city']) ? $opts['not_source_locations_city'] : null); - $source_scopes_country = (!empty($opts['source_scopes_country']) ? $opts['source_scopes_country'] : null); - $not_source_scopes_country = (!empty($opts['not_source_scopes_country']) ? $opts['not_source_scopes_country'] : null); - $source_scopes_state = (!empty($opts['source_scopes_state']) ? $opts['source_scopes_state'] : null); - $not_source_scopes_state = (!empty($opts['not_source_scopes_state']) ? $opts['not_source_scopes_state'] : null); - $source_scopes_city = (!empty($opts['source_scopes_city']) ? $opts['source_scopes_city'] : null); - $not_source_scopes_city = (!empty($opts['not_source_scopes_city']) ? $opts['not_source_scopes_city'] : null); - $source_scopes_level = (!empty($opts['source_scopes_level']) ? $opts['source_scopes_level'] : null); - $not_source_scopes_level = (!empty($opts['not_source_scopes_level']) ? $opts['not_source_scopes_level'] : null); - $source_links_in_count_min = (!empty($opts['source_links_in_count_min']) ? $opts['source_links_in_count_min'] : null); - $source_links_in_count_max = (!empty($opts['source_links_in_count_max']) ? $opts['source_links_in_count_max'] : null); - $source_rankings_alexa_rank_min = (!empty($opts['source_rankings_alexa_rank_min']) ? $opts['source_rankings_alexa_rank_min'] : null); - $source_rankings_alexa_rank_max = (!empty($opts['source_rankings_alexa_rank_max']) ? $opts['source_rankings_alexa_rank_max'] : null); - $source_rankings_alexa_country = (!empty($opts['source_rankings_alexa_country']) ? $opts['source_rankings_alexa_country'] : null); - $social_shares_count_facebook_min = (!empty($opts['social_shares_count_facebook_min']) ? $opts['social_shares_count_facebook_min'] : null); - $social_shares_count_facebook_max = (!empty($opts['social_shares_count_facebook_max']) ? $opts['social_shares_count_facebook_max'] : null); - $social_shares_count_google_plus_min = (!empty($opts['social_shares_count_google_plus_min']) ? $opts['social_shares_count_google_plus_min'] : null); - $social_shares_count_google_plus_max = (!empty($opts['social_shares_count_google_plus_max']) ? $opts['social_shares_count_google_plus_max'] : null); - $social_shares_count_linkedin_min = (!empty($opts['social_shares_count_linkedin_min']) ? $opts['social_shares_count_linkedin_min'] : null); - $social_shares_count_linkedin_max = (!empty($opts['social_shares_count_linkedin_max']) ? $opts['social_shares_count_linkedin_max'] : null); - $social_shares_count_reddit_min = (!empty($opts['social_shares_count_reddit_min']) ? $opts['social_shares_count_reddit_min'] : null); - $social_shares_count_reddit_max = (!empty($opts['social_shares_count_reddit_max']) ? $opts['social_shares_count_reddit_max'] : null); - $cluster = (!empty($opts['cluster']) ? $opts['cluster'] : null); - $cluster_algorithm = (!empty($opts['cluster_algorithm']) ? $opts['cluster_algorithm'] : null); - $return = (!empty($opts['return']) ? $opts['return'] : null); - $story_id = (!empty($opts['story_id']) ? $opts['story_id'] : null); - $story_url = (!empty($opts['story_url']) ? $opts['story_url'] : null); - $story_title = (!empty($opts['story_title']) ? $opts['story_title'] : null); - $story_body = (!empty($opts['story_body']) ? $opts['story_body'] : null); - $story_published_at = (!empty($opts['story_published_at']) ? $opts['story_published_at'] : null); - $story_language = (!empty($opts['story_language']) ? $opts['story_language'] : null); - $per_page = (!empty($opts['per_page']) ? $opts['per_page'] : null); - if (!is_null($media_images_count_min) && ($media_images_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + $request = $this->listCoveragesRequest($associative_array); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\Coverages' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Coverages', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\Coverages'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Coverages', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; } + } - if (!is_null($media_images_count_max) && ($media_images_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + /** + * Operation listCoveragesAsync + * + * List coverages + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param \DateTime $storyPublishedAt Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listCoveragesAsync($associative_array) + { + return $this->listCoveragesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listCoveragesAsyncWithHttpInfo + * + * List coverages + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param \DateTime $storyPublishedAt Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listCoveragesAsyncWithHttpInfo($associative_array) + { + $returnType = '\Aylien\NewsApi\Models\Coverages'; + $request = $this->listCoveragesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listCoverages' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param \DateTime $storyPublishedAt Publish date of the article. If you use a url or title and body of an article for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime). (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listCoveragesRequest($associative_array) + { + // unbox the parameters from the associative array + $id = array_key_exists('id', $associative_array) ? $associative_array['id'] : null; + $notId = array_key_exists('notId', $associative_array) ? $associative_array['notId'] : null; + $title = array_key_exists('title', $associative_array) ? $associative_array['title'] : null; + $body = array_key_exists('body', $associative_array) ? $associative_array['body'] : null; + $text = array_key_exists('text', $associative_array) ? $associative_array['text'] : null; + $translationsEnTitle = array_key_exists('translationsEnTitle', $associative_array) ? $associative_array['translationsEnTitle'] : null; + $translationsEnBody = array_key_exists('translationsEnBody', $associative_array) ? $associative_array['translationsEnBody'] : null; + $translationsEnText = array_key_exists('translationsEnText', $associative_array) ? $associative_array['translationsEnText'] : null; + $language = array_key_exists('language', $associative_array) ? $associative_array['language'] : null; + $notLanguage = array_key_exists('notLanguage', $associative_array) ? $associative_array['notLanguage'] : null; + $publishedAtStart = array_key_exists('publishedAtStart', $associative_array) ? $associative_array['publishedAtStart'] : null; + $publishedAtEnd = array_key_exists('publishedAtEnd', $associative_array) ? $associative_array['publishedAtEnd'] : null; + $categoriesTaxonomy = array_key_exists('categoriesTaxonomy', $associative_array) ? $associative_array['categoriesTaxonomy'] : null; + $categoriesConfident = array_key_exists('categoriesConfident', $associative_array) ? $associative_array['categoriesConfident'] : true; + $categoriesId = array_key_exists('categoriesId', $associative_array) ? $associative_array['categoriesId'] : null; + $notCategoriesId = array_key_exists('notCategoriesId', $associative_array) ? $associative_array['notCategoriesId'] : null; + $categoriesLevel = array_key_exists('categoriesLevel', $associative_array) ? $associative_array['categoriesLevel'] : null; + $notCategoriesLevel = array_key_exists('notCategoriesLevel', $associative_array) ? $associative_array['notCategoriesLevel'] : null; + $entitiesTitleText = array_key_exists('entitiesTitleText', $associative_array) ? $associative_array['entitiesTitleText'] : null; + $notEntitiesTitleText = array_key_exists('notEntitiesTitleText', $associative_array) ? $associative_array['notEntitiesTitleText'] : null; + $entitiesTitleType = array_key_exists('entitiesTitleType', $associative_array) ? $associative_array['entitiesTitleType'] : null; + $notEntitiesTitleType = array_key_exists('notEntitiesTitleType', $associative_array) ? $associative_array['notEntitiesTitleType'] : null; + $entitiesTitleLinksDbpedia = array_key_exists('entitiesTitleLinksDbpedia', $associative_array) ? $associative_array['entitiesTitleLinksDbpedia'] : null; + $notEntitiesTitleLinksDbpedia = array_key_exists('notEntitiesTitleLinksDbpedia', $associative_array) ? $associative_array['notEntitiesTitleLinksDbpedia'] : null; + $entitiesBodyText = array_key_exists('entitiesBodyText', $associative_array) ? $associative_array['entitiesBodyText'] : null; + $notEntitiesBodyText = array_key_exists('notEntitiesBodyText', $associative_array) ? $associative_array['notEntitiesBodyText'] : null; + $entitiesBodyType = array_key_exists('entitiesBodyType', $associative_array) ? $associative_array['entitiesBodyType'] : null; + $notEntitiesBodyType = array_key_exists('notEntitiesBodyType', $associative_array) ? $associative_array['notEntitiesBodyType'] : null; + $entitiesBodyLinksDbpedia = array_key_exists('entitiesBodyLinksDbpedia', $associative_array) ? $associative_array['entitiesBodyLinksDbpedia'] : null; + $notEntitiesBodyLinksDbpedia = array_key_exists('notEntitiesBodyLinksDbpedia', $associative_array) ? $associative_array['notEntitiesBodyLinksDbpedia'] : null; + $sentimentTitlePolarity = array_key_exists('sentimentTitlePolarity', $associative_array) ? $associative_array['sentimentTitlePolarity'] : null; + $notSentimentTitlePolarity = array_key_exists('notSentimentTitlePolarity', $associative_array) ? $associative_array['notSentimentTitlePolarity'] : null; + $sentimentBodyPolarity = array_key_exists('sentimentBodyPolarity', $associative_array) ? $associative_array['sentimentBodyPolarity'] : null; + $notSentimentBodyPolarity = array_key_exists('notSentimentBodyPolarity', $associative_array) ? $associative_array['notSentimentBodyPolarity'] : null; + $mediaImagesCountMin = array_key_exists('mediaImagesCountMin', $associative_array) ? $associative_array['mediaImagesCountMin'] : null; + $mediaImagesCountMax = array_key_exists('mediaImagesCountMax', $associative_array) ? $associative_array['mediaImagesCountMax'] : null; + $mediaImagesWidthMin = array_key_exists('mediaImagesWidthMin', $associative_array) ? $associative_array['mediaImagesWidthMin'] : null; + $mediaImagesWidthMax = array_key_exists('mediaImagesWidthMax', $associative_array) ? $associative_array['mediaImagesWidthMax'] : null; + $mediaImagesHeightMin = array_key_exists('mediaImagesHeightMin', $associative_array) ? $associative_array['mediaImagesHeightMin'] : null; + $mediaImagesHeightMax = array_key_exists('mediaImagesHeightMax', $associative_array) ? $associative_array['mediaImagesHeightMax'] : null; + $mediaImagesContentLengthMin = array_key_exists('mediaImagesContentLengthMin', $associative_array) ? $associative_array['mediaImagesContentLengthMin'] : null; + $mediaImagesContentLengthMax = array_key_exists('mediaImagesContentLengthMax', $associative_array) ? $associative_array['mediaImagesContentLengthMax'] : null; + $mediaImagesFormat = array_key_exists('mediaImagesFormat', $associative_array) ? $associative_array['mediaImagesFormat'] : null; + $notMediaImagesFormat = array_key_exists('notMediaImagesFormat', $associative_array) ? $associative_array['notMediaImagesFormat'] : null; + $mediaVideosCountMin = array_key_exists('mediaVideosCountMin', $associative_array) ? $associative_array['mediaVideosCountMin'] : null; + $mediaVideosCountMax = array_key_exists('mediaVideosCountMax', $associative_array) ? $associative_array['mediaVideosCountMax'] : null; + $authorId = array_key_exists('authorId', $associative_array) ? $associative_array['authorId'] : null; + $notAuthorId = array_key_exists('notAuthorId', $associative_array) ? $associative_array['notAuthorId'] : null; + $authorName = array_key_exists('authorName', $associative_array) ? $associative_array['authorName'] : null; + $notAuthorName = array_key_exists('notAuthorName', $associative_array) ? $associative_array['notAuthorName'] : null; + $sourceId = array_key_exists('sourceId', $associative_array) ? $associative_array['sourceId'] : null; + $notSourceId = array_key_exists('notSourceId', $associative_array) ? $associative_array['notSourceId'] : null; + $sourceName = array_key_exists('sourceName', $associative_array) ? $associative_array['sourceName'] : null; + $notSourceName = array_key_exists('notSourceName', $associative_array) ? $associative_array['notSourceName'] : null; + $sourceDomain = array_key_exists('sourceDomain', $associative_array) ? $associative_array['sourceDomain'] : null; + $notSourceDomain = array_key_exists('notSourceDomain', $associative_array) ? $associative_array['notSourceDomain'] : null; + $sourceLocationsCountry = array_key_exists('sourceLocationsCountry', $associative_array) ? $associative_array['sourceLocationsCountry'] : null; + $notSourceLocationsCountry = array_key_exists('notSourceLocationsCountry', $associative_array) ? $associative_array['notSourceLocationsCountry'] : null; + $sourceLocationsState = array_key_exists('sourceLocationsState', $associative_array) ? $associative_array['sourceLocationsState'] : null; + $notSourceLocationsState = array_key_exists('notSourceLocationsState', $associative_array) ? $associative_array['notSourceLocationsState'] : null; + $sourceLocationsCity = array_key_exists('sourceLocationsCity', $associative_array) ? $associative_array['sourceLocationsCity'] : null; + $notSourceLocationsCity = array_key_exists('notSourceLocationsCity', $associative_array) ? $associative_array['notSourceLocationsCity'] : null; + $sourceScopesCountry = array_key_exists('sourceScopesCountry', $associative_array) ? $associative_array['sourceScopesCountry'] : null; + $notSourceScopesCountry = array_key_exists('notSourceScopesCountry', $associative_array) ? $associative_array['notSourceScopesCountry'] : null; + $sourceScopesState = array_key_exists('sourceScopesState', $associative_array) ? $associative_array['sourceScopesState'] : null; + $notSourceScopesState = array_key_exists('notSourceScopesState', $associative_array) ? $associative_array['notSourceScopesState'] : null; + $sourceScopesCity = array_key_exists('sourceScopesCity', $associative_array) ? $associative_array['sourceScopesCity'] : null; + $notSourceScopesCity = array_key_exists('notSourceScopesCity', $associative_array) ? $associative_array['notSourceScopesCity'] : null; + $sourceScopesLevel = array_key_exists('sourceScopesLevel', $associative_array) ? $associative_array['sourceScopesLevel'] : null; + $notSourceScopesLevel = array_key_exists('notSourceScopesLevel', $associative_array) ? $associative_array['notSourceScopesLevel'] : null; + $sourceLinksInCountMin = array_key_exists('sourceLinksInCountMin', $associative_array) ? $associative_array['sourceLinksInCountMin'] : null; + $sourceLinksInCountMax = array_key_exists('sourceLinksInCountMax', $associative_array) ? $associative_array['sourceLinksInCountMax'] : null; + $sourceRankingsAlexaRankMin = array_key_exists('sourceRankingsAlexaRankMin', $associative_array) ? $associative_array['sourceRankingsAlexaRankMin'] : null; + $sourceRankingsAlexaRankMax = array_key_exists('sourceRankingsAlexaRankMax', $associative_array) ? $associative_array['sourceRankingsAlexaRankMax'] : null; + $sourceRankingsAlexaCountry = array_key_exists('sourceRankingsAlexaCountry', $associative_array) ? $associative_array['sourceRankingsAlexaCountry'] : null; + $socialSharesCountFacebookMin = array_key_exists('socialSharesCountFacebookMin', $associative_array) ? $associative_array['socialSharesCountFacebookMin'] : null; + $socialSharesCountFacebookMax = array_key_exists('socialSharesCountFacebookMax', $associative_array) ? $associative_array['socialSharesCountFacebookMax'] : null; + $socialSharesCountGooglePlusMin = array_key_exists('socialSharesCountGooglePlusMin', $associative_array) ? $associative_array['socialSharesCountGooglePlusMin'] : null; + $socialSharesCountGooglePlusMax = array_key_exists('socialSharesCountGooglePlusMax', $associative_array) ? $associative_array['socialSharesCountGooglePlusMax'] : null; + $socialSharesCountLinkedinMin = array_key_exists('socialSharesCountLinkedinMin', $associative_array) ? $associative_array['socialSharesCountLinkedinMin'] : null; + $socialSharesCountLinkedinMax = array_key_exists('socialSharesCountLinkedinMax', $associative_array) ? $associative_array['socialSharesCountLinkedinMax'] : null; + $socialSharesCountRedditMin = array_key_exists('socialSharesCountRedditMin', $associative_array) ? $associative_array['socialSharesCountRedditMin'] : null; + $socialSharesCountRedditMax = array_key_exists('socialSharesCountRedditMax', $associative_array) ? $associative_array['socialSharesCountRedditMax'] : null; + $clusters = array_key_exists('clusters', $associative_array) ? $associative_array['clusters'] : null; + $return = array_key_exists('return', $associative_array) ? $associative_array['return'] : null; + $storyId = array_key_exists('storyId', $associative_array) ? $associative_array['storyId'] : null; + $storyUrl = array_key_exists('storyUrl', $associative_array) ? $associative_array['storyUrl'] : null; + $storyTitle = array_key_exists('storyTitle', $associative_array) ? $associative_array['storyTitle'] : null; + $storyBody = array_key_exists('storyBody', $associative_array) ? $associative_array['storyBody'] : null; + $storyPublishedAt = array_key_exists('storyPublishedAt', $associative_array) ? $associative_array['storyPublishedAt'] : null; + $storyLanguage = array_key_exists('storyLanguage', $associative_array) ? $associative_array['storyLanguage'] : 'auto'; + $perPage = array_key_exists('perPage', $associative_array) ? $associative_array['perPage'] : 3; + + if ($mediaImagesCountMin !== null && $mediaImagesCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); + } + + if ($mediaImagesCountMax !== null && $mediaImagesCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_images_width_min) && ($media_images_width_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaImagesWidthMin !== null && $mediaImagesWidthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_images_width_max) && ($media_images_width_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaImagesWidthMax !== null && $mediaImagesWidthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_images_height_min) && ($media_images_height_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaImagesHeightMin !== null && $mediaImagesHeightMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_images_height_max) && ($media_images_height_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaImagesHeightMax !== null && $mediaImagesHeightMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_images_content_length_min) && ($media_images_content_length_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaImagesContentLengthMin !== null && $mediaImagesContentLengthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_images_content_length_max) && ($media_images_content_length_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaImagesContentLengthMax !== null && $mediaImagesContentLengthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_videos_count_min) && ($media_videos_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaVideosCountMin !== null && $mediaVideosCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($media_videos_count_max) && ($media_videos_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($mediaVideosCountMax !== null && $mediaVideosCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($source_links_in_count_min) && ($source_links_in_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($sourceLinksInCountMin !== null && $sourceLinksInCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($source_links_in_count_max) && ($source_links_in_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($sourceLinksInCountMax !== null && $sourceLinksInCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_min) && ($source_rankings_alexa_rank_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMin !== null && $sourceRankingsAlexaRankMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_max) && ($source_rankings_alexa_rank_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMax !== null && $sourceRankingsAlexaRankMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_min) && ($social_shares_count_facebook_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountFacebookMin !== null && $socialSharesCountFacebookMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_max) && ($social_shares_count_facebook_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountFacebookMax !== null && $socialSharesCountFacebookMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_min) && ($social_shares_count_google_plus_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMin !== null && $socialSharesCountGooglePlusMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_max) && ($social_shares_count_google_plus_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMax !== null && $socialSharesCountGooglePlusMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_min) && ($social_shares_count_linkedin_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountLinkedinMin !== null && $socialSharesCountLinkedinMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_max) && ($social_shares_count_linkedin_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountLinkedinMax !== null && $socialSharesCountLinkedinMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_min) && ($social_shares_count_reddit_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_min" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountRedditMin !== null && $socialSharesCountRedditMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMin" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_max) && ($social_shares_count_reddit_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_max" when calling DefaultApi.listCoverages, must be bigger than 0.'); + if ($socialSharesCountRedditMax !== null && $socialSharesCountRedditMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMax" when calling DefaultApi.listCoverages, must be bigger than 0.'); } - if (!is_null($per_page) && ($per_page > 100)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listCoverages, must be smaller than or equal to 100.'); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listCoverages, must be smaller than or equal to 100.'); } - if (!is_null($per_page) && ($per_page < 1)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listCoverages, must be bigger than or equal to 1.'); + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listCoverages, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/coverages"; - $httpBody = ''; + + $resourcePath = '/coverages'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/xml']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); - - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $httpBody = ''; + $multipart = false; - // form params + // query params if ($id !== null) { - $formParams['id[]'] = $this->apiClient->getSerializer()->toFormValue($id); + $queryParams['id[]'] = $id; } - // form params - if ($not_id !== null) { - $formParams['!id[]'] = $this->apiClient->getSerializer()->toFormValue($not_id); + // query params + if ($notId !== null) { + $queryParams['!id[]'] = $notId; } - // form params + // query params if ($title !== null) { - $formParams['title'] = $this->apiClient->getSerializer()->toFormValue($title); + $queryParams['title'] = $title; } - // form params + // query params if ($body !== null) { - $formParams['body'] = $this->apiClient->getSerializer()->toFormValue($body); + $queryParams['body'] = $body; } - // form params + // query params if ($text !== null) { - $formParams['text'] = $this->apiClient->getSerializer()->toFormValue($text); + $queryParams['text'] = $text; } - // form params - if ($language !== null) { - $formParams['language[]'] = $this->apiClient->getSerializer()->toFormValue($language); + // query params + if ($translationsEnTitle !== null) { + $queryParams['translations.en.title'] = $translationsEnTitle; } - // form params - if ($not_language !== null) { - $formParams['!language[]'] = $this->apiClient->getSerializer()->toFormValue($not_language); + // query params + if ($translationsEnBody !== null) { + $queryParams['translations.en.body'] = $translationsEnBody; } - // form params - if ($published_at_start !== null) { - $formParams['published_at.start'] = $this->apiClient->getSerializer()->toFormValue($published_at_start); + // query params + if ($translationsEnText !== null) { + $queryParams['translations.en.text'] = $translationsEnText; } - // form params - if ($published_at_end !== null) { - $formParams['published_at.end'] = $this->apiClient->getSerializer()->toFormValue($published_at_end); + // query params + if ($language !== null) { + $queryParams['language[]'] = $language; } - // form params - if ($categories_taxonomy !== null) { - $formParams['categories.taxonomy'] = $this->apiClient->getSerializer()->toFormValue($categories_taxonomy); + // query params + if ($notLanguage !== null) { + $queryParams['!language[]'] = $notLanguage; } - // form params - if ($categories_confident !== null) { - $formParams['categories.confident'] = $this->apiClient->getSerializer()->toFormValue($categories_confident); + // query params + if ($publishedAtStart !== null) { + $queryParams['published_at.start'] = $publishedAtStart; } - // form params - if ($categories_id !== null) { - $formParams['categories.id[]'] = $this->apiClient->getSerializer()->toFormValue($categories_id); + // query params + if ($publishedAtEnd !== null) { + $queryParams['published_at.end'] = $publishedAtEnd; } - // form params - if ($not_categories_id !== null) { - $formParams['!categories.id[]'] = $this->apiClient->getSerializer()->toFormValue($not_categories_id); + // query params + if ($categoriesTaxonomy !== null) { + $queryParams['categories.taxonomy'] = $categoriesTaxonomy; } - // form params - if ($categories_level !== null) { - $formParams['categories.level[]'] = $this->apiClient->getSerializer()->toFormValue($categories_level); + // query params + if ($categoriesConfident !== null) { + $queryParams['categories.confident'] = $categoriesConfident; } - // form params - if ($not_categories_level !== null) { - $formParams['!categories.level[]'] = $this->apiClient->getSerializer()->toFormValue($not_categories_level); + // query params + if ($categoriesId !== null) { + $queryParams['categories.id[]'] = $categoriesId; } - // form params - if ($entities_title_text !== null) { - $formParams['entities.title.text[]'] = $this->apiClient->getSerializer()->toFormValue($entities_title_text); + // query params + if ($notCategoriesId !== null) { + $queryParams['!categories.id[]'] = $notCategoriesId; } - // form params - if ($not_entities_title_text !== null) { - $formParams['!entities.title.text[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_title_text); + // query params + if ($categoriesLevel !== null) { + $queryParams['categories.level[]'] = $categoriesLevel; } - // form params - if ($entities_title_type !== null) { - $formParams['entities.title.type[]'] = $this->apiClient->getSerializer()->toFormValue($entities_title_type); + // query params + if ($notCategoriesLevel !== null) { + $queryParams['!categories.level[]'] = $notCategoriesLevel; } - // form params - if ($not_entities_title_type !== null) { - $formParams['!entities.title.type[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_title_type); + // query params + if ($entitiesTitleText !== null) { + $queryParams['entities.title.text[]'] = $entitiesTitleText; } - // form params - if ($entities_title_links_dbpedia !== null) { - $formParams['entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($entities_title_links_dbpedia); + // query params + if ($notEntitiesTitleText !== null) { + $queryParams['!entities.title.text[]'] = $notEntitiesTitleText; } - // form params - if ($not_entities_title_links_dbpedia !== null) { - $formParams['!entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_title_links_dbpedia); + // query params + if ($entitiesTitleType !== null) { + $queryParams['entities.title.type[]'] = $entitiesTitleType; } - // form params - if ($entities_body_text !== null) { - $formParams['entities.body.text[]'] = $this->apiClient->getSerializer()->toFormValue($entities_body_text); + // query params + if ($notEntitiesTitleType !== null) { + $queryParams['!entities.title.type[]'] = $notEntitiesTitleType; } - // form params - if ($not_entities_body_text !== null) { - $formParams['!entities.body.text[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_body_text); + // query params + if ($entitiesTitleLinksDbpedia !== null) { + $queryParams['entities.title.links.dbpedia[]'] = $entitiesTitleLinksDbpedia; } - // form params - if ($entities_body_type !== null) { - $formParams['entities.body.type[]'] = $this->apiClient->getSerializer()->toFormValue($entities_body_type); + // query params + if ($notEntitiesTitleLinksDbpedia !== null) { + $queryParams['!entities.title.links.dbpedia[]'] = $notEntitiesTitleLinksDbpedia; } - // form params - if ($not_entities_body_type !== null) { - $formParams['!entities.body.type[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_body_type); + // query params + if ($entitiesBodyText !== null) { + $queryParams['entities.body.text[]'] = $entitiesBodyText; } - // form params - if ($entities_body_links_dbpedia !== null) { - $formParams['entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($entities_body_links_dbpedia); + // query params + if ($notEntitiesBodyText !== null) { + $queryParams['!entities.body.text[]'] = $notEntitiesBodyText; } - // form params - if ($not_entities_body_links_dbpedia !== null) { - $formParams['!entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_body_links_dbpedia); + // query params + if ($entitiesBodyType !== null) { + $queryParams['entities.body.type[]'] = $entitiesBodyType; } - // form params - if ($sentiment_title_polarity !== null) { - $formParams['sentiment.title.polarity'] = $this->apiClient->getSerializer()->toFormValue($sentiment_title_polarity); + // query params + if ($notEntitiesBodyType !== null) { + $queryParams['!entities.body.type[]'] = $notEntitiesBodyType; } - // form params - if ($not_sentiment_title_polarity !== null) { - $formParams['!sentiment.title.polarity'] = $this->apiClient->getSerializer()->toFormValue($not_sentiment_title_polarity); + // query params + if ($entitiesBodyLinksDbpedia !== null) { + $queryParams['entities.body.links.dbpedia[]'] = $entitiesBodyLinksDbpedia; + } + // query params + if ($notEntitiesBodyLinksDbpedia !== null) { + $queryParams['!entities.body.links.dbpedia[]'] = $notEntitiesBodyLinksDbpedia; + } + // query params + if ($sentimentTitlePolarity !== null) { + $queryParams['sentiment.title.polarity'] = $sentimentTitlePolarity; } - // form params - if ($sentiment_body_polarity !== null) { - $formParams['sentiment.body.polarity'] = $this->apiClient->getSerializer()->toFormValue($sentiment_body_polarity); + // query params + if ($notSentimentTitlePolarity !== null) { + $queryParams['!sentiment.title.polarity'] = $notSentimentTitlePolarity; } - // form params - if ($not_sentiment_body_polarity !== null) { - $formParams['!sentiment.body.polarity'] = $this->apiClient->getSerializer()->toFormValue($not_sentiment_body_polarity); + // query params + if ($sentimentBodyPolarity !== null) { + $queryParams['sentiment.body.polarity'] = $sentimentBodyPolarity; } - // form params - if ($media_images_count_min !== null) { - $formParams['media.images.count.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_count_min); + // query params + if ($notSentimentBodyPolarity !== null) { + $queryParams['!sentiment.body.polarity'] = $notSentimentBodyPolarity; } - // form params - if ($media_images_count_max !== null) { - $formParams['media.images.count.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_count_max); + // query params + if ($mediaImagesCountMin !== null) { + $queryParams['media.images.count.min'] = $mediaImagesCountMin; } - // form params - if ($media_images_width_min !== null) { - $formParams['media.images.width.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_width_min); + // query params + if ($mediaImagesCountMax !== null) { + $queryParams['media.images.count.max'] = $mediaImagesCountMax; } - // form params - if ($media_images_width_max !== null) { - $formParams['media.images.width.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_width_max); + // query params + if ($mediaImagesWidthMin !== null) { + $queryParams['media.images.width.min'] = $mediaImagesWidthMin; } - // form params - if ($media_images_height_min !== null) { - $formParams['media.images.height.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_height_min); + // query params + if ($mediaImagesWidthMax !== null) { + $queryParams['media.images.width.max'] = $mediaImagesWidthMax; } - // form params - if ($media_images_height_max !== null) { - $formParams['media.images.height.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_height_max); + // query params + if ($mediaImagesHeightMin !== null) { + $queryParams['media.images.height.min'] = $mediaImagesHeightMin; } - // form params - if ($media_images_content_length_min !== null) { - $formParams['media.images.content_length.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_content_length_min); + // query params + if ($mediaImagesHeightMax !== null) { + $queryParams['media.images.height.max'] = $mediaImagesHeightMax; } - // form params - if ($media_images_content_length_max !== null) { - $formParams['media.images.content_length.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_content_length_max); + // query params + if ($mediaImagesContentLengthMin !== null) { + $queryParams['media.images.content_length.min'] = $mediaImagesContentLengthMin; } - // form params - if ($media_images_format !== null) { - $formParams['media.images.format[]'] = $this->apiClient->getSerializer()->toFormValue($media_images_format); + // query params + if ($mediaImagesContentLengthMax !== null) { + $queryParams['media.images.content_length.max'] = $mediaImagesContentLengthMax; } - // form params - if ($not_media_images_format !== null) { - $formParams['!media.images.format[]'] = $this->apiClient->getSerializer()->toFormValue($not_media_images_format); + // query params + if ($mediaImagesFormat !== null) { + $queryParams['media.images.format[]'] = $mediaImagesFormat; } - // form params - if ($media_videos_count_min !== null) { - $formParams['media.videos.count.min'] = $this->apiClient->getSerializer()->toFormValue($media_videos_count_min); + // query params + if ($notMediaImagesFormat !== null) { + $queryParams['!media.images.format[]'] = $notMediaImagesFormat; } - // form params - if ($media_videos_count_max !== null) { - $formParams['media.videos.count.max'] = $this->apiClient->getSerializer()->toFormValue($media_videos_count_max); + // query params + if ($mediaVideosCountMin !== null) { + $queryParams['media.videos.count.min'] = $mediaVideosCountMin; } - // form params - if ($author_id !== null) { - $formParams['author.id[]'] = $this->apiClient->getSerializer()->toFormValue($author_id); + // query params + if ($mediaVideosCountMax !== null) { + $queryParams['media.videos.count.max'] = $mediaVideosCountMax; } - // form params - if ($not_author_id !== null) { - $formParams['!author.id[]'] = $this->apiClient->getSerializer()->toFormValue($not_author_id); + // query params + if ($authorId !== null) { + $queryParams['author.id[]'] = $authorId; } - // form params - if ($author_name !== null) { - $formParams['author.name'] = $this->apiClient->getSerializer()->toFormValue($author_name); + // query params + if ($notAuthorId !== null) { + $queryParams['!author.id[]'] = $notAuthorId; } - // form params - if ($not_author_name !== null) { - $formParams['!author.name'] = $this->apiClient->getSerializer()->toFormValue($not_author_name); + // query params + if ($authorName !== null) { + $queryParams['author.name'] = $authorName; } - // form params - if ($source_id !== null) { - $formParams['source.id[]'] = $this->apiClient->getSerializer()->toFormValue($source_id); + // query params + if ($notAuthorName !== null) { + $queryParams['!author.name'] = $notAuthorName; } - // form params - if ($not_source_id !== null) { - $formParams['!source.id[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_id); + // query params + if ($sourceId !== null) { + $queryParams['source.id[]'] = $sourceId; } - // form params - if ($source_name !== null) { - $formParams['source.name[]'] = $this->apiClient->getSerializer()->toFormValue($source_name); + // query params + if ($notSourceId !== null) { + $queryParams['!source.id[]'] = $notSourceId; } - // form params - if ($not_source_name !== null) { - $formParams['!source.name[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_name); + // query params + if ($sourceName !== null) { + $queryParams['source.name[]'] = $sourceName; } - // form params - if ($source_domain !== null) { - $formParams['source.domain[]'] = $this->apiClient->getSerializer()->toFormValue($source_domain); + // query params + if ($notSourceName !== null) { + $queryParams['!source.name[]'] = $notSourceName; } - // form params - if ($not_source_domain !== null) { - $formParams['!source.domain[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_domain); + // query params + if ($sourceDomain !== null) { + $queryParams['source.domain[]'] = $sourceDomain; } - // form params - if ($source_locations_country !== null) { - $formParams['source.locations.country[]'] = $this->apiClient->getSerializer()->toFormValue($source_locations_country); + // query params + if ($notSourceDomain !== null) { + $queryParams['!source.domain[]'] = $notSourceDomain; } - // form params - if ($not_source_locations_country !== null) { - $formParams['!source.locations.country[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_locations_country); + // query params + if ($sourceLocationsCountry !== null) { + $queryParams['source.locations.country[]'] = $sourceLocationsCountry; } - // form params - if ($source_locations_state !== null) { - $formParams['source.locations.state[]'] = $this->apiClient->getSerializer()->toFormValue($source_locations_state); + // query params + if ($notSourceLocationsCountry !== null) { + $queryParams['!source.locations.country[]'] = $notSourceLocationsCountry; } - // form params - if ($not_source_locations_state !== null) { - $formParams['!source.locations.state[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_locations_state); + // query params + if ($sourceLocationsState !== null) { + $queryParams['source.locations.state[]'] = $sourceLocationsState; } - // form params - if ($source_locations_city !== null) { - $formParams['source.locations.city[]'] = $this->apiClient->getSerializer()->toFormValue($source_locations_city); + // query params + if ($notSourceLocationsState !== null) { + $queryParams['!source.locations.state[]'] = $notSourceLocationsState; } - // form params - if ($not_source_locations_city !== null) { - $formParams['!source.locations.city[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_locations_city); + // query params + if ($sourceLocationsCity !== null) { + $queryParams['source.locations.city[]'] = $sourceLocationsCity; } - // form params - if ($source_scopes_country !== null) { - $formParams['source.scopes.country[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_country); + // query params + if ($notSourceLocationsCity !== null) { + $queryParams['!source.locations.city[]'] = $notSourceLocationsCity; } - // form params - if ($not_source_scopes_country !== null) { - $formParams['!source.scopes.country[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_country); + // query params + if ($sourceScopesCountry !== null) { + $queryParams['source.scopes.country[]'] = $sourceScopesCountry; } - // form params - if ($source_scopes_state !== null) { - $formParams['source.scopes.state[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_state); + // query params + if ($notSourceScopesCountry !== null) { + $queryParams['!source.scopes.country[]'] = $notSourceScopesCountry; } - // form params - if ($not_source_scopes_state !== null) { - $formParams['!source.scopes.state[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_state); + // query params + if ($sourceScopesState !== null) { + $queryParams['source.scopes.state[]'] = $sourceScopesState; } - // form params - if ($source_scopes_city !== null) { - $formParams['source.scopes.city[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_city); + // query params + if ($notSourceScopesState !== null) { + $queryParams['!source.scopes.state[]'] = $notSourceScopesState; } - // form params - if ($not_source_scopes_city !== null) { - $formParams['!source.scopes.city[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_city); + // query params + if ($sourceScopesCity !== null) { + $queryParams['source.scopes.city[]'] = $sourceScopesCity; } - // form params - if ($source_scopes_level !== null) { - $formParams['source.scopes.level[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_level); + // query params + if ($notSourceScopesCity !== null) { + $queryParams['!source.scopes.city[]'] = $notSourceScopesCity; } - // form params - if ($not_source_scopes_level !== null) { - $formParams['!source.scopes.level[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_level); + // query params + if ($sourceScopesLevel !== null) { + $queryParams['source.scopes.level[]'] = $sourceScopesLevel; } - // form params - if ($source_links_in_count_min !== null) { - $formParams['source.links_in_count.min'] = $this->apiClient->getSerializer()->toFormValue($source_links_in_count_min); + // query params + if ($notSourceScopesLevel !== null) { + $queryParams['!source.scopes.level[]'] = $notSourceScopesLevel; } - // form params - if ($source_links_in_count_max !== null) { - $formParams['source.links_in_count.max'] = $this->apiClient->getSerializer()->toFormValue($source_links_in_count_max); + // query params + if ($sourceLinksInCountMin !== null) { + $queryParams['source.links_in_count.min'] = $sourceLinksInCountMin; } - // form params - if ($source_rankings_alexa_rank_min !== null) { - $formParams['source.rankings.alexa.rank.min'] = $this->apiClient->getSerializer()->toFormValue($source_rankings_alexa_rank_min); + // query params + if ($sourceLinksInCountMax !== null) { + $queryParams['source.links_in_count.max'] = $sourceLinksInCountMax; } - // form params - if ($source_rankings_alexa_rank_max !== null) { - $formParams['source.rankings.alexa.rank.max'] = $this->apiClient->getSerializer()->toFormValue($source_rankings_alexa_rank_max); + // query params + if ($sourceRankingsAlexaRankMin !== null) { + $queryParams['source.rankings.alexa.rank.min'] = $sourceRankingsAlexaRankMin; } - // form params - if ($source_rankings_alexa_country !== null) { - $formParams['source.rankings.alexa.country[]'] = $this->apiClient->getSerializer()->toFormValue($source_rankings_alexa_country); + // query params + if ($sourceRankingsAlexaRankMax !== null) { + $queryParams['source.rankings.alexa.rank.max'] = $sourceRankingsAlexaRankMax; } - // form params - if ($social_shares_count_facebook_min !== null) { - $formParams['social_shares_count.facebook.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_facebook_min); + // query params + if ($sourceRankingsAlexaCountry !== null) { + $queryParams['source.rankings.alexa.country[]'] = $sourceRankingsAlexaCountry; } - // form params - if ($social_shares_count_facebook_max !== null) { - $formParams['social_shares_count.facebook.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_facebook_max); + // query params + if ($socialSharesCountFacebookMin !== null) { + $queryParams['social_shares_count.facebook.min'] = $socialSharesCountFacebookMin; } - // form params - if ($social_shares_count_google_plus_min !== null) { - $formParams['social_shares_count.google_plus.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_google_plus_min); + // query params + if ($socialSharesCountFacebookMax !== null) { + $queryParams['social_shares_count.facebook.max'] = $socialSharesCountFacebookMax; } - // form params - if ($social_shares_count_google_plus_max !== null) { - $formParams['social_shares_count.google_plus.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_google_plus_max); + // query params + if ($socialSharesCountGooglePlusMin !== null) { + $queryParams['social_shares_count.google_plus.min'] = $socialSharesCountGooglePlusMin; } - // form params - if ($social_shares_count_linkedin_min !== null) { - $formParams['social_shares_count.linkedin.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_linkedin_min); + // query params + if ($socialSharesCountGooglePlusMax !== null) { + $queryParams['social_shares_count.google_plus.max'] = $socialSharesCountGooglePlusMax; } - // form params - if ($social_shares_count_linkedin_max !== null) { - $formParams['social_shares_count.linkedin.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_linkedin_max); + // query params + if ($socialSharesCountLinkedinMin !== null) { + $queryParams['social_shares_count.linkedin.min'] = $socialSharesCountLinkedinMin; } - // form params - if ($social_shares_count_reddit_min !== null) { - $formParams['social_shares_count.reddit.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_reddit_min); + // query params + if ($socialSharesCountLinkedinMax !== null) { + $queryParams['social_shares_count.linkedin.max'] = $socialSharesCountLinkedinMax; } - // form params - if ($social_shares_count_reddit_max !== null) { - $formParams['social_shares_count.reddit.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_reddit_max); + // query params + if ($socialSharesCountRedditMin !== null) { + $queryParams['social_shares_count.reddit.min'] = $socialSharesCountRedditMin; } - // form params - if ($cluster !== null) { - $formParams['cluster'] = $this->apiClient->getSerializer()->toFormValue($cluster); + // query params + if ($socialSharesCountRedditMax !== null) { + $queryParams['social_shares_count.reddit.max'] = $socialSharesCountRedditMax; } - // form params - if ($cluster_algorithm !== null) { - $formParams['cluster.algorithm'] = $this->apiClient->getSerializer()->toFormValue($cluster_algorithm); + // query params + if ($clusters !== null) { + $queryParams['clusters[]'] = $clusters; } - // form params + // query params if ($return !== null) { - $formParams['return[]'] = $this->apiClient->getSerializer()->toFormValue($return); + $queryParams['return[]'] = $return; + } + // query params + if ($storyId !== null) { + $queryParams['story_id'] = $storyId; } - // form params - if ($story_id !== null) { - $formParams['story_id'] = $this->apiClient->getSerializer()->toFormValue($story_id); + // query params + if ($storyUrl !== null) { + $queryParams['story_url'] = $storyUrl; } - // form params - if ($story_url !== null) { - $formParams['story_url'] = $this->apiClient->getSerializer()->toFormValue($story_url); + // query params + if ($storyTitle !== null) { + $queryParams['story_title'] = $storyTitle; } - // form params - if ($story_title !== null) { - $formParams['story_title'] = $this->apiClient->getSerializer()->toFormValue($story_title); + // query params + if ($storyBody !== null) { + $queryParams['story_body'] = $storyBody; } - // form params - if ($story_body !== null) { - $formParams['story_body'] = $this->apiClient->getSerializer()->toFormValue($story_body); + // query params + if ($storyPublishedAt !== null) { + $queryParams['story_published_at'] = $storyPublishedAt; } - // form params - if ($story_published_at !== null) { - $formParams['story_published_at'] = $this->apiClient->getSerializer()->toFormValue($story_published_at); + // query params + if ($storyLanguage !== null) { + $queryParams['story_language'] = $storyLanguage; } - // form params - if ($story_language !== null) { - $formParams['story_language'] = $this->apiClient->getSerializer()->toFormValue($story_language); + // query params + if ($perPage !== null) { + $queryParams['per_page'] = $perPage; } - // form params - if ($per_page !== null) { - $formParams['per_page'] = $this->apiClient->getSerializer()->toFormValue($per_page); + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); } - + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } } + // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listHistograms + * + * List histograms + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param int $intervalStart This parameter is used for setting the start data point of histogram intervals. (optional) + * @param int $intervalEnd This parameter is used for setting the end data point of histogram intervals. (optional) + * @param int $intervalWidth This parameter is used for setting the width of histogram intervals. (optional) + * @param string $field This parameter is used for specifying the y-axis variable for the histogram. (optional, default to 'social_shares_count') + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\Histograms|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors + */ + public function listHistograms($associative_array) + { + list($response) = $this->listHistogramsWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listHistogramsWithHttpInfo + * + * List histograms + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param int $intervalStart This parameter is used for setting the start data point of histogram intervals. (optional) + * @param int $intervalEnd This parameter is used for setting the end data point of histogram intervals. (optional) + * @param int $intervalWidth This parameter is used for setting the width of histogram intervals. (optional) + * @param string $field This parameter is used for specifying the y-axis variable for the histogram. (optional, default to 'social_shares_count') + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\Histograms|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listHistogramsWithHttpInfo($associative_array) + { + $request = $this->listHistogramsRequest($associative_array); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\Aylien\NewsApi\Models\Coverages', - '/coverages' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\Histograms' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Histograms', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\Histograms'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\Aylien\NewsApi\Models\Coverages', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Coverages', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Histograms', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listHistograms + * Operation listHistogramsAsync * * List histograms * - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return \Aylien\NewsApi\Models\Histograms + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param int $intervalStart This parameter is used for setting the start data point of histogram intervals. (optional) + * @param int $intervalEnd This parameter is used for setting the end data point of histogram intervals. (optional) + * @param int $intervalWidth This parameter is used for setting the width of histogram intervals. (optional) + * @param string $field This parameter is used for specifying the y-axis variable for the histogram. (optional, default to 'social_shares_count') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listHistograms($opts = array()) + public function listHistogramsAsync($associative_array) { - list($response) = $this->listHistogramsWithHttpInfo($opts); - return $response; + return $this->listHistogramsAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listHistogramsWithHttpInfo + * Operation listHistogramsAsyncWithHttpInfo * * List histograms * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param int $intervalStart This parameter is used for setting the start data point of histogram intervals. (optional) + * @param int $intervalEnd This parameter is used for setting the end data point of histogram intervals. (optional) + * @param int $intervalWidth This parameter is used for setting the width of histogram intervals. (optional) + * @param string $field This parameter is used for specifying the y-axis variable for the histogram. (optional, default to 'social_shares_count') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listHistogramsAsyncWithHttpInfo($associative_array) + { + $returnType = '\Aylien\NewsApi\Models\Histograms'; + $request = $this->listHistogramsRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return array of \Aylien\NewsApi\Models\Histograms, HTTP status code, HTTP response headers (array of strings) + /** + * Create request for operation 'listHistograms' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param int $intervalStart This parameter is used for setting the start data point of histogram intervals. (optional) + * @param int $intervalEnd This parameter is used for setting the end data point of histogram intervals. (optional) + * @param int $intervalWidth This parameter is used for setting the width of histogram intervals. (optional) + * @param string $field This parameter is used for specifying the y-axis variable for the histogram. (optional, default to 'social_shares_count') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function listHistogramsWithHttpInfo($opts = array()) + protected function listHistogramsRequest($associative_array) { - // define parameters - $id = (!empty($opts['id']) ? $opts['id'] : null); - $not_id = (!empty($opts['not_id']) ? $opts['not_id'] : null); - $title = (!empty($opts['title']) ? $opts['title'] : null); - $body = (!empty($opts['body']) ? $opts['body'] : null); - $text = (!empty($opts['text']) ? $opts['text'] : null); - $language = (!empty($opts['language']) ? $opts['language'] : null); - $not_language = (!empty($opts['not_language']) ? $opts['not_language'] : null); - $published_at_start = (!empty($opts['published_at_start']) ? $opts['published_at_start'] : null); - $published_at_end = (!empty($opts['published_at_end']) ? $opts['published_at_end'] : null); - $categories_taxonomy = (!empty($opts['categories_taxonomy']) ? $opts['categories_taxonomy'] : null); - $categories_confident = (!empty($opts['categories_confident']) ? $opts['categories_confident'] : null); - $categories_id = (!empty($opts['categories_id']) ? $opts['categories_id'] : null); - $not_categories_id = (!empty($opts['not_categories_id']) ? $opts['not_categories_id'] : null); - $categories_level = (!empty($opts['categories_level']) ? $opts['categories_level'] : null); - $not_categories_level = (!empty($opts['not_categories_level']) ? $opts['not_categories_level'] : null); - $entities_title_text = (!empty($opts['entities_title_text']) ? $opts['entities_title_text'] : null); - $not_entities_title_text = (!empty($opts['not_entities_title_text']) ? $opts['not_entities_title_text'] : null); - $entities_title_type = (!empty($opts['entities_title_type']) ? $opts['entities_title_type'] : null); - $not_entities_title_type = (!empty($opts['not_entities_title_type']) ? $opts['not_entities_title_type'] : null); - $entities_title_links_dbpedia = (!empty($opts['entities_title_links_dbpedia']) ? $opts['entities_title_links_dbpedia'] : null); - $not_entities_title_links_dbpedia = (!empty($opts['not_entities_title_links_dbpedia']) ? $opts['not_entities_title_links_dbpedia'] : null); - $entities_body_text = (!empty($opts['entities_body_text']) ? $opts['entities_body_text'] : null); - $not_entities_body_text = (!empty($opts['not_entities_body_text']) ? $opts['not_entities_body_text'] : null); - $entities_body_type = (!empty($opts['entities_body_type']) ? $opts['entities_body_type'] : null); - $not_entities_body_type = (!empty($opts['not_entities_body_type']) ? $opts['not_entities_body_type'] : null); - $entities_body_links_dbpedia = (!empty($opts['entities_body_links_dbpedia']) ? $opts['entities_body_links_dbpedia'] : null); - $not_entities_body_links_dbpedia = (!empty($opts['not_entities_body_links_dbpedia']) ? $opts['not_entities_body_links_dbpedia'] : null); - $sentiment_title_polarity = (!empty($opts['sentiment_title_polarity']) ? $opts['sentiment_title_polarity'] : null); - $not_sentiment_title_polarity = (!empty($opts['not_sentiment_title_polarity']) ? $opts['not_sentiment_title_polarity'] : null); - $sentiment_body_polarity = (!empty($opts['sentiment_body_polarity']) ? $opts['sentiment_body_polarity'] : null); - $not_sentiment_body_polarity = (!empty($opts['not_sentiment_body_polarity']) ? $opts['not_sentiment_body_polarity'] : null); - $media_images_count_min = (!empty($opts['media_images_count_min']) ? $opts['media_images_count_min'] : null); - $media_images_count_max = (!empty($opts['media_images_count_max']) ? $opts['media_images_count_max'] : null); - $media_images_width_min = (!empty($opts['media_images_width_min']) ? $opts['media_images_width_min'] : null); - $media_images_width_max = (!empty($opts['media_images_width_max']) ? $opts['media_images_width_max'] : null); - $media_images_height_min = (!empty($opts['media_images_height_min']) ? $opts['media_images_height_min'] : null); - $media_images_height_max = (!empty($opts['media_images_height_max']) ? $opts['media_images_height_max'] : null); - $media_images_content_length_min = (!empty($opts['media_images_content_length_min']) ? $opts['media_images_content_length_min'] : null); - $media_images_content_length_max = (!empty($opts['media_images_content_length_max']) ? $opts['media_images_content_length_max'] : null); - $media_images_format = (!empty($opts['media_images_format']) ? $opts['media_images_format'] : null); - $not_media_images_format = (!empty($opts['not_media_images_format']) ? $opts['not_media_images_format'] : null); - $media_videos_count_min = (!empty($opts['media_videos_count_min']) ? $opts['media_videos_count_min'] : null); - $media_videos_count_max = (!empty($opts['media_videos_count_max']) ? $opts['media_videos_count_max'] : null); - $author_id = (!empty($opts['author_id']) ? $opts['author_id'] : null); - $not_author_id = (!empty($opts['not_author_id']) ? $opts['not_author_id'] : null); - $author_name = (!empty($opts['author_name']) ? $opts['author_name'] : null); - $not_author_name = (!empty($opts['not_author_name']) ? $opts['not_author_name'] : null); - $source_id = (!empty($opts['source_id']) ? $opts['source_id'] : null); - $not_source_id = (!empty($opts['not_source_id']) ? $opts['not_source_id'] : null); - $source_name = (!empty($opts['source_name']) ? $opts['source_name'] : null); - $not_source_name = (!empty($opts['not_source_name']) ? $opts['not_source_name'] : null); - $source_domain = (!empty($opts['source_domain']) ? $opts['source_domain'] : null); - $not_source_domain = (!empty($opts['not_source_domain']) ? $opts['not_source_domain'] : null); - $source_locations_country = (!empty($opts['source_locations_country']) ? $opts['source_locations_country'] : null); - $not_source_locations_country = (!empty($opts['not_source_locations_country']) ? $opts['not_source_locations_country'] : null); - $source_locations_state = (!empty($opts['source_locations_state']) ? $opts['source_locations_state'] : null); - $not_source_locations_state = (!empty($opts['not_source_locations_state']) ? $opts['not_source_locations_state'] : null); - $source_locations_city = (!empty($opts['source_locations_city']) ? $opts['source_locations_city'] : null); - $not_source_locations_city = (!empty($opts['not_source_locations_city']) ? $opts['not_source_locations_city'] : null); - $source_scopes_country = (!empty($opts['source_scopes_country']) ? $opts['source_scopes_country'] : null); - $not_source_scopes_country = (!empty($opts['not_source_scopes_country']) ? $opts['not_source_scopes_country'] : null); - $source_scopes_state = (!empty($opts['source_scopes_state']) ? $opts['source_scopes_state'] : null); - $not_source_scopes_state = (!empty($opts['not_source_scopes_state']) ? $opts['not_source_scopes_state'] : null); - $source_scopes_city = (!empty($opts['source_scopes_city']) ? $opts['source_scopes_city'] : null); - $not_source_scopes_city = (!empty($opts['not_source_scopes_city']) ? $opts['not_source_scopes_city'] : null); - $source_scopes_level = (!empty($opts['source_scopes_level']) ? $opts['source_scopes_level'] : null); - $not_source_scopes_level = (!empty($opts['not_source_scopes_level']) ? $opts['not_source_scopes_level'] : null); - $source_links_in_count_min = (!empty($opts['source_links_in_count_min']) ? $opts['source_links_in_count_min'] : null); - $source_links_in_count_max = (!empty($opts['source_links_in_count_max']) ? $opts['source_links_in_count_max'] : null); - $source_rankings_alexa_rank_min = (!empty($opts['source_rankings_alexa_rank_min']) ? $opts['source_rankings_alexa_rank_min'] : null); - $source_rankings_alexa_rank_max = (!empty($opts['source_rankings_alexa_rank_max']) ? $opts['source_rankings_alexa_rank_max'] : null); - $source_rankings_alexa_country = (!empty($opts['source_rankings_alexa_country']) ? $opts['source_rankings_alexa_country'] : null); - $social_shares_count_facebook_min = (!empty($opts['social_shares_count_facebook_min']) ? $opts['social_shares_count_facebook_min'] : null); - $social_shares_count_facebook_max = (!empty($opts['social_shares_count_facebook_max']) ? $opts['social_shares_count_facebook_max'] : null); - $social_shares_count_google_plus_min = (!empty($opts['social_shares_count_google_plus_min']) ? $opts['social_shares_count_google_plus_min'] : null); - $social_shares_count_google_plus_max = (!empty($opts['social_shares_count_google_plus_max']) ? $opts['social_shares_count_google_plus_max'] : null); - $social_shares_count_linkedin_min = (!empty($opts['social_shares_count_linkedin_min']) ? $opts['social_shares_count_linkedin_min'] : null); - $social_shares_count_linkedin_max = (!empty($opts['social_shares_count_linkedin_max']) ? $opts['social_shares_count_linkedin_max'] : null); - $social_shares_count_reddit_min = (!empty($opts['social_shares_count_reddit_min']) ? $opts['social_shares_count_reddit_min'] : null); - $social_shares_count_reddit_max = (!empty($opts['social_shares_count_reddit_max']) ? $opts['social_shares_count_reddit_max'] : null); - $interval_start = (!empty($opts['interval_start']) ? $opts['interval_start'] : null); - $interval_end = (!empty($opts['interval_end']) ? $opts['interval_end'] : null); - $interval_width = (!empty($opts['interval_width']) ? $opts['interval_width'] : null); - $field = (!empty($opts['field']) ? $opts['field'] : null); - if (!is_null($media_images_count_min) && ($media_images_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + // unbox the parameters from the associative array + $id = array_key_exists('id', $associative_array) ? $associative_array['id'] : null; + $notId = array_key_exists('notId', $associative_array) ? $associative_array['notId'] : null; + $title = array_key_exists('title', $associative_array) ? $associative_array['title'] : null; + $body = array_key_exists('body', $associative_array) ? $associative_array['body'] : null; + $text = array_key_exists('text', $associative_array) ? $associative_array['text'] : null; + $translationsEnTitle = array_key_exists('translationsEnTitle', $associative_array) ? $associative_array['translationsEnTitle'] : null; + $translationsEnBody = array_key_exists('translationsEnBody', $associative_array) ? $associative_array['translationsEnBody'] : null; + $translationsEnText = array_key_exists('translationsEnText', $associative_array) ? $associative_array['translationsEnText'] : null; + $language = array_key_exists('language', $associative_array) ? $associative_array['language'] : null; + $notLanguage = array_key_exists('notLanguage', $associative_array) ? $associative_array['notLanguage'] : null; + $publishedAtStart = array_key_exists('publishedAtStart', $associative_array) ? $associative_array['publishedAtStart'] : null; + $publishedAtEnd = array_key_exists('publishedAtEnd', $associative_array) ? $associative_array['publishedAtEnd'] : null; + $categoriesTaxonomy = array_key_exists('categoriesTaxonomy', $associative_array) ? $associative_array['categoriesTaxonomy'] : null; + $categoriesConfident = array_key_exists('categoriesConfident', $associative_array) ? $associative_array['categoriesConfident'] : true; + $categoriesId = array_key_exists('categoriesId', $associative_array) ? $associative_array['categoriesId'] : null; + $notCategoriesId = array_key_exists('notCategoriesId', $associative_array) ? $associative_array['notCategoriesId'] : null; + $categoriesLevel = array_key_exists('categoriesLevel', $associative_array) ? $associative_array['categoriesLevel'] : null; + $notCategoriesLevel = array_key_exists('notCategoriesLevel', $associative_array) ? $associative_array['notCategoriesLevel'] : null; + $entitiesTitleText = array_key_exists('entitiesTitleText', $associative_array) ? $associative_array['entitiesTitleText'] : null; + $notEntitiesTitleText = array_key_exists('notEntitiesTitleText', $associative_array) ? $associative_array['notEntitiesTitleText'] : null; + $entitiesTitleType = array_key_exists('entitiesTitleType', $associative_array) ? $associative_array['entitiesTitleType'] : null; + $notEntitiesTitleType = array_key_exists('notEntitiesTitleType', $associative_array) ? $associative_array['notEntitiesTitleType'] : null; + $entitiesTitleLinksDbpedia = array_key_exists('entitiesTitleLinksDbpedia', $associative_array) ? $associative_array['entitiesTitleLinksDbpedia'] : null; + $notEntitiesTitleLinksDbpedia = array_key_exists('notEntitiesTitleLinksDbpedia', $associative_array) ? $associative_array['notEntitiesTitleLinksDbpedia'] : null; + $entitiesBodyText = array_key_exists('entitiesBodyText', $associative_array) ? $associative_array['entitiesBodyText'] : null; + $notEntitiesBodyText = array_key_exists('notEntitiesBodyText', $associative_array) ? $associative_array['notEntitiesBodyText'] : null; + $entitiesBodyType = array_key_exists('entitiesBodyType', $associative_array) ? $associative_array['entitiesBodyType'] : null; + $notEntitiesBodyType = array_key_exists('notEntitiesBodyType', $associative_array) ? $associative_array['notEntitiesBodyType'] : null; + $entitiesBodyLinksDbpedia = array_key_exists('entitiesBodyLinksDbpedia', $associative_array) ? $associative_array['entitiesBodyLinksDbpedia'] : null; + $notEntitiesBodyLinksDbpedia = array_key_exists('notEntitiesBodyLinksDbpedia', $associative_array) ? $associative_array['notEntitiesBodyLinksDbpedia'] : null; + $sentimentTitlePolarity = array_key_exists('sentimentTitlePolarity', $associative_array) ? $associative_array['sentimentTitlePolarity'] : null; + $notSentimentTitlePolarity = array_key_exists('notSentimentTitlePolarity', $associative_array) ? $associative_array['notSentimentTitlePolarity'] : null; + $sentimentBodyPolarity = array_key_exists('sentimentBodyPolarity', $associative_array) ? $associative_array['sentimentBodyPolarity'] : null; + $notSentimentBodyPolarity = array_key_exists('notSentimentBodyPolarity', $associative_array) ? $associative_array['notSentimentBodyPolarity'] : null; + $mediaImagesCountMin = array_key_exists('mediaImagesCountMin', $associative_array) ? $associative_array['mediaImagesCountMin'] : null; + $mediaImagesCountMax = array_key_exists('mediaImagesCountMax', $associative_array) ? $associative_array['mediaImagesCountMax'] : null; + $mediaImagesWidthMin = array_key_exists('mediaImagesWidthMin', $associative_array) ? $associative_array['mediaImagesWidthMin'] : null; + $mediaImagesWidthMax = array_key_exists('mediaImagesWidthMax', $associative_array) ? $associative_array['mediaImagesWidthMax'] : null; + $mediaImagesHeightMin = array_key_exists('mediaImagesHeightMin', $associative_array) ? $associative_array['mediaImagesHeightMin'] : null; + $mediaImagesHeightMax = array_key_exists('mediaImagesHeightMax', $associative_array) ? $associative_array['mediaImagesHeightMax'] : null; + $mediaImagesContentLengthMin = array_key_exists('mediaImagesContentLengthMin', $associative_array) ? $associative_array['mediaImagesContentLengthMin'] : null; + $mediaImagesContentLengthMax = array_key_exists('mediaImagesContentLengthMax', $associative_array) ? $associative_array['mediaImagesContentLengthMax'] : null; + $mediaImagesFormat = array_key_exists('mediaImagesFormat', $associative_array) ? $associative_array['mediaImagesFormat'] : null; + $notMediaImagesFormat = array_key_exists('notMediaImagesFormat', $associative_array) ? $associative_array['notMediaImagesFormat'] : null; + $mediaVideosCountMin = array_key_exists('mediaVideosCountMin', $associative_array) ? $associative_array['mediaVideosCountMin'] : null; + $mediaVideosCountMax = array_key_exists('mediaVideosCountMax', $associative_array) ? $associative_array['mediaVideosCountMax'] : null; + $authorId = array_key_exists('authorId', $associative_array) ? $associative_array['authorId'] : null; + $notAuthorId = array_key_exists('notAuthorId', $associative_array) ? $associative_array['notAuthorId'] : null; + $authorName = array_key_exists('authorName', $associative_array) ? $associative_array['authorName'] : null; + $notAuthorName = array_key_exists('notAuthorName', $associative_array) ? $associative_array['notAuthorName'] : null; + $sourceId = array_key_exists('sourceId', $associative_array) ? $associative_array['sourceId'] : null; + $notSourceId = array_key_exists('notSourceId', $associative_array) ? $associative_array['notSourceId'] : null; + $sourceName = array_key_exists('sourceName', $associative_array) ? $associative_array['sourceName'] : null; + $notSourceName = array_key_exists('notSourceName', $associative_array) ? $associative_array['notSourceName'] : null; + $sourceDomain = array_key_exists('sourceDomain', $associative_array) ? $associative_array['sourceDomain'] : null; + $notSourceDomain = array_key_exists('notSourceDomain', $associative_array) ? $associative_array['notSourceDomain'] : null; + $sourceLocationsCountry = array_key_exists('sourceLocationsCountry', $associative_array) ? $associative_array['sourceLocationsCountry'] : null; + $notSourceLocationsCountry = array_key_exists('notSourceLocationsCountry', $associative_array) ? $associative_array['notSourceLocationsCountry'] : null; + $sourceLocationsState = array_key_exists('sourceLocationsState', $associative_array) ? $associative_array['sourceLocationsState'] : null; + $notSourceLocationsState = array_key_exists('notSourceLocationsState', $associative_array) ? $associative_array['notSourceLocationsState'] : null; + $sourceLocationsCity = array_key_exists('sourceLocationsCity', $associative_array) ? $associative_array['sourceLocationsCity'] : null; + $notSourceLocationsCity = array_key_exists('notSourceLocationsCity', $associative_array) ? $associative_array['notSourceLocationsCity'] : null; + $sourceScopesCountry = array_key_exists('sourceScopesCountry', $associative_array) ? $associative_array['sourceScopesCountry'] : null; + $notSourceScopesCountry = array_key_exists('notSourceScopesCountry', $associative_array) ? $associative_array['notSourceScopesCountry'] : null; + $sourceScopesState = array_key_exists('sourceScopesState', $associative_array) ? $associative_array['sourceScopesState'] : null; + $notSourceScopesState = array_key_exists('notSourceScopesState', $associative_array) ? $associative_array['notSourceScopesState'] : null; + $sourceScopesCity = array_key_exists('sourceScopesCity', $associative_array) ? $associative_array['sourceScopesCity'] : null; + $notSourceScopesCity = array_key_exists('notSourceScopesCity', $associative_array) ? $associative_array['notSourceScopesCity'] : null; + $sourceScopesLevel = array_key_exists('sourceScopesLevel', $associative_array) ? $associative_array['sourceScopesLevel'] : null; + $notSourceScopesLevel = array_key_exists('notSourceScopesLevel', $associative_array) ? $associative_array['notSourceScopesLevel'] : null; + $sourceLinksInCountMin = array_key_exists('sourceLinksInCountMin', $associative_array) ? $associative_array['sourceLinksInCountMin'] : null; + $sourceLinksInCountMax = array_key_exists('sourceLinksInCountMax', $associative_array) ? $associative_array['sourceLinksInCountMax'] : null; + $sourceRankingsAlexaRankMin = array_key_exists('sourceRankingsAlexaRankMin', $associative_array) ? $associative_array['sourceRankingsAlexaRankMin'] : null; + $sourceRankingsAlexaRankMax = array_key_exists('sourceRankingsAlexaRankMax', $associative_array) ? $associative_array['sourceRankingsAlexaRankMax'] : null; + $sourceRankingsAlexaCountry = array_key_exists('sourceRankingsAlexaCountry', $associative_array) ? $associative_array['sourceRankingsAlexaCountry'] : null; + $socialSharesCountFacebookMin = array_key_exists('socialSharesCountFacebookMin', $associative_array) ? $associative_array['socialSharesCountFacebookMin'] : null; + $socialSharesCountFacebookMax = array_key_exists('socialSharesCountFacebookMax', $associative_array) ? $associative_array['socialSharesCountFacebookMax'] : null; + $socialSharesCountGooglePlusMin = array_key_exists('socialSharesCountGooglePlusMin', $associative_array) ? $associative_array['socialSharesCountGooglePlusMin'] : null; + $socialSharesCountGooglePlusMax = array_key_exists('socialSharesCountGooglePlusMax', $associative_array) ? $associative_array['socialSharesCountGooglePlusMax'] : null; + $socialSharesCountLinkedinMin = array_key_exists('socialSharesCountLinkedinMin', $associative_array) ? $associative_array['socialSharesCountLinkedinMin'] : null; + $socialSharesCountLinkedinMax = array_key_exists('socialSharesCountLinkedinMax', $associative_array) ? $associative_array['socialSharesCountLinkedinMax'] : null; + $socialSharesCountRedditMin = array_key_exists('socialSharesCountRedditMin', $associative_array) ? $associative_array['socialSharesCountRedditMin'] : null; + $socialSharesCountRedditMax = array_key_exists('socialSharesCountRedditMax', $associative_array) ? $associative_array['socialSharesCountRedditMax'] : null; + $intervalStart = array_key_exists('intervalStart', $associative_array) ? $associative_array['intervalStart'] : null; + $intervalEnd = array_key_exists('intervalEnd', $associative_array) ? $associative_array['intervalEnd'] : null; + $intervalWidth = array_key_exists('intervalWidth', $associative_array) ? $associative_array['intervalWidth'] : null; + $field = array_key_exists('field', $associative_array) ? $associative_array['field'] : 'social_shares_count'; + + if ($mediaImagesCountMin !== null && $mediaImagesCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_images_count_max) && ($media_images_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaImagesCountMax !== null && $mediaImagesCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_images_width_min) && ($media_images_width_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaImagesWidthMin !== null && $mediaImagesWidthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_images_width_max) && ($media_images_width_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaImagesWidthMax !== null && $mediaImagesWidthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_images_height_min) && ($media_images_height_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaImagesHeightMin !== null && $mediaImagesHeightMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_images_height_max) && ($media_images_height_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaImagesHeightMax !== null && $mediaImagesHeightMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_images_content_length_min) && ($media_images_content_length_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaImagesContentLengthMin !== null && $mediaImagesContentLengthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_images_content_length_max) && ($media_images_content_length_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaImagesContentLengthMax !== null && $mediaImagesContentLengthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_videos_count_min) && ($media_videos_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaVideosCountMin !== null && $mediaVideosCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($media_videos_count_max) && ($media_videos_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($mediaVideosCountMax !== null && $mediaVideosCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($source_links_in_count_min) && ($source_links_in_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($sourceLinksInCountMin !== null && $sourceLinksInCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($source_links_in_count_max) && ($source_links_in_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($sourceLinksInCountMax !== null && $sourceLinksInCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_min) && ($source_rankings_alexa_rank_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMin !== null && $sourceRankingsAlexaRankMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_max) && ($source_rankings_alexa_rank_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMax !== null && $sourceRankingsAlexaRankMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_min) && ($social_shares_count_facebook_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountFacebookMin !== null && $socialSharesCountFacebookMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_max) && ($social_shares_count_facebook_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountFacebookMax !== null && $socialSharesCountFacebookMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_min) && ($social_shares_count_google_plus_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMin !== null && $socialSharesCountGooglePlusMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_max) && ($social_shares_count_google_plus_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMax !== null && $socialSharesCountGooglePlusMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_min) && ($social_shares_count_linkedin_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountLinkedinMin !== null && $socialSharesCountLinkedinMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_max) && ($social_shares_count_linkedin_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountLinkedinMax !== null && $socialSharesCountLinkedinMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_min) && ($social_shares_count_reddit_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_min" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountRedditMin !== null && $socialSharesCountRedditMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMin" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_max) && ($social_shares_count_reddit_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_max" when calling DefaultApi.listHistograms, must be bigger than 0.'); + if ($socialSharesCountRedditMax !== null && $socialSharesCountRedditMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMax" when calling DefaultApi.listHistograms, must be bigger than 0.'); } - // parse inputs - $resourcePath = "/histograms"; - $httpBody = ''; + + $resourcePath = '/histograms'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/xml']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + $httpBody = ''; + $multipart = false; // query params - if (is_array($id)) { - $id = $this->apiClient->getSerializer()->serializeCollection($id, 'multi', true); - } if ($id !== null) { - $queryParams['id[]'] = $this->apiClient->getSerializer()->toQueryValue($id); + $queryParams['id[]'] = $id; } // query params - if (is_array($not_id)) { - $not_id = $this->apiClient->getSerializer()->serializeCollection($not_id, 'multi', true); - } - if ($not_id !== null) { - $queryParams['!id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_id); + if ($notId !== null) { + $queryParams['!id[]'] = $notId; } // query params if ($title !== null) { - $queryParams['title'] = $this->apiClient->getSerializer()->toQueryValue($title); + $queryParams['title'] = $title; } // query params if ($body !== null) { - $queryParams['body'] = $this->apiClient->getSerializer()->toQueryValue($body); + $queryParams['body'] = $body; } // query params if ($text !== null) { - $queryParams['text'] = $this->apiClient->getSerializer()->toQueryValue($text); + $queryParams['text'] = $text; } // query params - if (is_array($language)) { - $language = $this->apiClient->getSerializer()->serializeCollection($language, 'multi', true); - } - if ($language !== null) { - $queryParams['language[]'] = $this->apiClient->getSerializer()->toQueryValue($language); + if ($translationsEnTitle !== null) { + $queryParams['translations.en.title'] = $translationsEnTitle; } // query params - if (is_array($not_language)) { - $not_language = $this->apiClient->getSerializer()->serializeCollection($not_language, 'multi', true); - } - if ($not_language !== null) { - $queryParams['!language[]'] = $this->apiClient->getSerializer()->toQueryValue($not_language); + if ($translationsEnBody !== null) { + $queryParams['translations.en.body'] = $translationsEnBody; } // query params - if ($published_at_start !== null) { - $queryParams['published_at.start'] = $this->apiClient->getSerializer()->toQueryValue($published_at_start); + if ($translationsEnText !== null) { + $queryParams['translations.en.text'] = $translationsEnText; } // query params - if ($published_at_end !== null) { - $queryParams['published_at.end'] = $this->apiClient->getSerializer()->toQueryValue($published_at_end); + if ($language !== null) { + $queryParams['language[]'] = $language; } // query params - if ($categories_taxonomy !== null) { - $queryParams['categories.taxonomy'] = $this->apiClient->getSerializer()->toQueryValue($categories_taxonomy); + if ($notLanguage !== null) { + $queryParams['!language[]'] = $notLanguage; } // query params - if ($categories_confident !== null) { - $queryParams['categories.confident'] = $this->apiClient->getSerializer()->toQueryValue($categories_confident); + if ($publishedAtStart !== null) { + $queryParams['published_at.start'] = $publishedAtStart; } // query params - if (is_array($categories_id)) { - $categories_id = $this->apiClient->getSerializer()->serializeCollection($categories_id, 'multi', true); - } - if ($categories_id !== null) { - $queryParams['categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_id); + if ($publishedAtEnd !== null) { + $queryParams['published_at.end'] = $publishedAtEnd; } // query params - if (is_array($not_categories_id)) { - $not_categories_id = $this->apiClient->getSerializer()->serializeCollection($not_categories_id, 'multi', true); - } - if ($not_categories_id !== null) { - $queryParams['!categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_id); + if ($categoriesTaxonomy !== null) { + $queryParams['categories.taxonomy'] = $categoriesTaxonomy; } // query params - if (is_array($categories_level)) { - $categories_level = $this->apiClient->getSerializer()->serializeCollection($categories_level, 'multi', true); - } - if ($categories_level !== null) { - $queryParams['categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_level); + if ($categoriesConfident !== null) { + $queryParams['categories.confident'] = $categoriesConfident; } // query params - if (is_array($not_categories_level)) { - $not_categories_level = $this->apiClient->getSerializer()->serializeCollection($not_categories_level, 'multi', true); - } - if ($not_categories_level !== null) { - $queryParams['!categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_level); + if ($categoriesId !== null) { + $queryParams['categories.id[]'] = $categoriesId; } // query params - if (is_array($entities_title_text)) { - $entities_title_text = $this->apiClient->getSerializer()->serializeCollection($entities_title_text, 'multi', true); - } - if ($entities_title_text !== null) { - $queryParams['entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_text); + if ($notCategoriesId !== null) { + $queryParams['!categories.id[]'] = $notCategoriesId; } // query params - if (is_array($not_entities_title_text)) { - $not_entities_title_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_text, 'multi', true); - } - if ($not_entities_title_text !== null) { - $queryParams['!entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_text); + if ($categoriesLevel !== null) { + $queryParams['categories.level[]'] = $categoriesLevel; } // query params - if (is_array($entities_title_type)) { - $entities_title_type = $this->apiClient->getSerializer()->serializeCollection($entities_title_type, 'multi', true); - } - if ($entities_title_type !== null) { - $queryParams['entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_type); + if ($notCategoriesLevel !== null) { + $queryParams['!categories.level[]'] = $notCategoriesLevel; } // query params - if (is_array($not_entities_title_type)) { - $not_entities_title_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_type, 'multi', true); - } - if ($not_entities_title_type !== null) { - $queryParams['!entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_type); + if ($entitiesTitleText !== null) { + $queryParams['entities.title.text[]'] = $entitiesTitleText; } // query params - if (is_array($entities_title_links_dbpedia)) { - $entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_title_links_dbpedia, 'multi', true); - } - if ($entities_title_links_dbpedia !== null) { - $queryParams['entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_links_dbpedia); + if ($notEntitiesTitleText !== null) { + $queryParams['!entities.title.text[]'] = $notEntitiesTitleText; } // query params - if (is_array($not_entities_title_links_dbpedia)) { - $not_entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_links_dbpedia, 'multi', true); - } - if ($not_entities_title_links_dbpedia !== null) { - $queryParams['!entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_links_dbpedia); + if ($entitiesTitleType !== null) { + $queryParams['entities.title.type[]'] = $entitiesTitleType; } // query params - if (is_array($entities_body_text)) { - $entities_body_text = $this->apiClient->getSerializer()->serializeCollection($entities_body_text, 'multi', true); - } - if ($entities_body_text !== null) { - $queryParams['entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_text); + if ($notEntitiesTitleType !== null) { + $queryParams['!entities.title.type[]'] = $notEntitiesTitleType; } // query params - if (is_array($not_entities_body_text)) { - $not_entities_body_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_text, 'multi', true); - } - if ($not_entities_body_text !== null) { - $queryParams['!entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_text); + if ($entitiesTitleLinksDbpedia !== null) { + $queryParams['entities.title.links.dbpedia[]'] = $entitiesTitleLinksDbpedia; } // query params - if (is_array($entities_body_type)) { - $entities_body_type = $this->apiClient->getSerializer()->serializeCollection($entities_body_type, 'multi', true); - } - if ($entities_body_type !== null) { - $queryParams['entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_type); + if ($notEntitiesTitleLinksDbpedia !== null) { + $queryParams['!entities.title.links.dbpedia[]'] = $notEntitiesTitleLinksDbpedia; } // query params - if (is_array($not_entities_body_type)) { - $not_entities_body_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_type, 'multi', true); - } - if ($not_entities_body_type !== null) { - $queryParams['!entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_type); + if ($entitiesBodyText !== null) { + $queryParams['entities.body.text[]'] = $entitiesBodyText; } // query params - if (is_array($entities_body_links_dbpedia)) { - $entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_body_links_dbpedia, 'multi', true); - } - if ($entities_body_links_dbpedia !== null) { - $queryParams['entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_links_dbpedia); + if ($notEntitiesBodyText !== null) { + $queryParams['!entities.body.text[]'] = $notEntitiesBodyText; } // query params - if (is_array($not_entities_body_links_dbpedia)) { - $not_entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_links_dbpedia, 'multi', true); - } - if ($not_entities_body_links_dbpedia !== null) { - $queryParams['!entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_links_dbpedia); + if ($entitiesBodyType !== null) { + $queryParams['entities.body.type[]'] = $entitiesBodyType; } // query params - if ($sentiment_title_polarity !== null) { - $queryParams['sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_title_polarity); + if ($notEntitiesBodyType !== null) { + $queryParams['!entities.body.type[]'] = $notEntitiesBodyType; } // query params - if ($not_sentiment_title_polarity !== null) { - $queryParams['!sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_title_polarity); + if ($entitiesBodyLinksDbpedia !== null) { + $queryParams['entities.body.links.dbpedia[]'] = $entitiesBodyLinksDbpedia; } // query params - if ($sentiment_body_polarity !== null) { - $queryParams['sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_body_polarity); + if ($notEntitiesBodyLinksDbpedia !== null) { + $queryParams['!entities.body.links.dbpedia[]'] = $notEntitiesBodyLinksDbpedia; } // query params - if ($not_sentiment_body_polarity !== null) { - $queryParams['!sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_body_polarity); + if ($sentimentTitlePolarity !== null) { + $queryParams['sentiment.title.polarity'] = $sentimentTitlePolarity; } // query params - if ($media_images_count_min !== null) { - $queryParams['media.images.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_min); + if ($notSentimentTitlePolarity !== null) { + $queryParams['!sentiment.title.polarity'] = $notSentimentTitlePolarity; } // query params - if ($media_images_count_max !== null) { - $queryParams['media.images.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_max); + if ($sentimentBodyPolarity !== null) { + $queryParams['sentiment.body.polarity'] = $sentimentBodyPolarity; } // query params - if ($media_images_width_min !== null) { - $queryParams['media.images.width.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_min); + if ($notSentimentBodyPolarity !== null) { + $queryParams['!sentiment.body.polarity'] = $notSentimentBodyPolarity; } // query params - if ($media_images_width_max !== null) { - $queryParams['media.images.width.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_max); + if ($mediaImagesCountMin !== null) { + $queryParams['media.images.count.min'] = $mediaImagesCountMin; } // query params - if ($media_images_height_min !== null) { - $queryParams['media.images.height.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_min); + if ($mediaImagesCountMax !== null) { + $queryParams['media.images.count.max'] = $mediaImagesCountMax; } // query params - if ($media_images_height_max !== null) { - $queryParams['media.images.height.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_max); + if ($mediaImagesWidthMin !== null) { + $queryParams['media.images.width.min'] = $mediaImagesWidthMin; } // query params - if ($media_images_content_length_min !== null) { - $queryParams['media.images.content_length.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_min); + if ($mediaImagesWidthMax !== null) { + $queryParams['media.images.width.max'] = $mediaImagesWidthMax; } // query params - if ($media_images_content_length_max !== null) { - $queryParams['media.images.content_length.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_max); + if ($mediaImagesHeightMin !== null) { + $queryParams['media.images.height.min'] = $mediaImagesHeightMin; } // query params - if (is_array($media_images_format)) { - $media_images_format = $this->apiClient->getSerializer()->serializeCollection($media_images_format, 'multi', true); - } - if ($media_images_format !== null) { - $queryParams['media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($media_images_format); + if ($mediaImagesHeightMax !== null) { + $queryParams['media.images.height.max'] = $mediaImagesHeightMax; } // query params - if (is_array($not_media_images_format)) { - $not_media_images_format = $this->apiClient->getSerializer()->serializeCollection($not_media_images_format, 'multi', true); - } - if ($not_media_images_format !== null) { - $queryParams['!media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($not_media_images_format); + if ($mediaImagesContentLengthMin !== null) { + $queryParams['media.images.content_length.min'] = $mediaImagesContentLengthMin; } // query params - if ($media_videos_count_min !== null) { - $queryParams['media.videos.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_min); + if ($mediaImagesContentLengthMax !== null) { + $queryParams['media.images.content_length.max'] = $mediaImagesContentLengthMax; } // query params - if ($media_videos_count_max !== null) { - $queryParams['media.videos.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_max); + if ($mediaImagesFormat !== null) { + $queryParams['media.images.format[]'] = $mediaImagesFormat; } // query params - if (is_array($author_id)) { - $author_id = $this->apiClient->getSerializer()->serializeCollection($author_id, 'multi', true); - } - if ($author_id !== null) { - $queryParams['author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($author_id); + if ($notMediaImagesFormat !== null) { + $queryParams['!media.images.format[]'] = $notMediaImagesFormat; } // query params - if (is_array($not_author_id)) { - $not_author_id = $this->apiClient->getSerializer()->serializeCollection($not_author_id, 'multi', true); - } - if ($not_author_id !== null) { - $queryParams['!author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_author_id); + if ($mediaVideosCountMin !== null) { + $queryParams['media.videos.count.min'] = $mediaVideosCountMin; } // query params - if ($author_name !== null) { - $queryParams['author.name'] = $this->apiClient->getSerializer()->toQueryValue($author_name); + if ($mediaVideosCountMax !== null) { + $queryParams['media.videos.count.max'] = $mediaVideosCountMax; } // query params - if ($not_author_name !== null) { - $queryParams['!author.name'] = $this->apiClient->getSerializer()->toQueryValue($not_author_name); + if ($authorId !== null) { + $queryParams['author.id[]'] = $authorId; } // query params - if (is_array($source_id)) { - $source_id = $this->apiClient->getSerializer()->serializeCollection($source_id, 'multi', true); - } - if ($source_id !== null) { - $queryParams['source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($source_id); + if ($notAuthorId !== null) { + $queryParams['!author.id[]'] = $notAuthorId; } // query params - if (is_array($not_source_id)) { - $not_source_id = $this->apiClient->getSerializer()->serializeCollection($not_source_id, 'multi', true); - } - if ($not_source_id !== null) { - $queryParams['!source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_id); + if ($authorName !== null) { + $queryParams['author.name'] = $authorName; } // query params - if (is_array($source_name)) { - $source_name = $this->apiClient->getSerializer()->serializeCollection($source_name, 'multi', true); - } - if ($source_name !== null) { - $queryParams['source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($source_name); + if ($notAuthorName !== null) { + $queryParams['!author.name'] = $notAuthorName; } // query params - if (is_array($not_source_name)) { - $not_source_name = $this->apiClient->getSerializer()->serializeCollection($not_source_name, 'multi', true); - } - if ($not_source_name !== null) { - $queryParams['!source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_name); + if ($sourceId !== null) { + $queryParams['source.id[]'] = $sourceId; } // query params - if (is_array($source_domain)) { - $source_domain = $this->apiClient->getSerializer()->serializeCollection($source_domain, 'multi', true); - } - if ($source_domain !== null) { - $queryParams['source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($source_domain); + if ($notSourceId !== null) { + $queryParams['!source.id[]'] = $notSourceId; } // query params - if (is_array($not_source_domain)) { - $not_source_domain = $this->apiClient->getSerializer()->serializeCollection($not_source_domain, 'multi', true); - } - if ($not_source_domain !== null) { - $queryParams['!source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_domain); + if ($sourceName !== null) { + $queryParams['source.name[]'] = $sourceName; } // query params - if (is_array($source_locations_country)) { - $source_locations_country = $this->apiClient->getSerializer()->serializeCollection($source_locations_country, 'multi', true); - } - if ($source_locations_country !== null) { - $queryParams['source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_country); + if ($notSourceName !== null) { + $queryParams['!source.name[]'] = $notSourceName; } // query params - if (is_array($not_source_locations_country)) { - $not_source_locations_country = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_country, 'multi', true); - } - if ($not_source_locations_country !== null) { - $queryParams['!source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_country); + if ($sourceDomain !== null) { + $queryParams['source.domain[]'] = $sourceDomain; } // query params - if (is_array($source_locations_state)) { - $source_locations_state = $this->apiClient->getSerializer()->serializeCollection($source_locations_state, 'multi', true); - } - if ($source_locations_state !== null) { - $queryParams['source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_state); + if ($notSourceDomain !== null) { + $queryParams['!source.domain[]'] = $notSourceDomain; } // query params - if (is_array($not_source_locations_state)) { - $not_source_locations_state = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_state, 'multi', true); - } - if ($not_source_locations_state !== null) { - $queryParams['!source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_state); + if ($sourceLocationsCountry !== null) { + $queryParams['source.locations.country[]'] = $sourceLocationsCountry; } // query params - if (is_array($source_locations_city)) { - $source_locations_city = $this->apiClient->getSerializer()->serializeCollection($source_locations_city, 'multi', true); - } - if ($source_locations_city !== null) { - $queryParams['source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_city); + if ($notSourceLocationsCountry !== null) { + $queryParams['!source.locations.country[]'] = $notSourceLocationsCountry; } // query params - if (is_array($not_source_locations_city)) { - $not_source_locations_city = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_city, 'multi', true); - } - if ($not_source_locations_city !== null) { - $queryParams['!source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_city); + if ($sourceLocationsState !== null) { + $queryParams['source.locations.state[]'] = $sourceLocationsState; } // query params - if (is_array($source_scopes_country)) { - $source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($source_scopes_country, 'multi', true); - } - if ($source_scopes_country !== null) { - $queryParams['source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_country); + if ($notSourceLocationsState !== null) { + $queryParams['!source.locations.state[]'] = $notSourceLocationsState; } // query params - if (is_array($not_source_scopes_country)) { - $not_source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_country, 'multi', true); - } - if ($not_source_scopes_country !== null) { - $queryParams['!source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_country); + if ($sourceLocationsCity !== null) { + $queryParams['source.locations.city[]'] = $sourceLocationsCity; } // query params - if (is_array($source_scopes_state)) { - $source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($source_scopes_state, 'multi', true); - } - if ($source_scopes_state !== null) { - $queryParams['source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_state); + if ($notSourceLocationsCity !== null) { + $queryParams['!source.locations.city[]'] = $notSourceLocationsCity; } // query params - if (is_array($not_source_scopes_state)) { - $not_source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_state, 'multi', true); - } - if ($not_source_scopes_state !== null) { - $queryParams['!source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_state); + if ($sourceScopesCountry !== null) { + $queryParams['source.scopes.country[]'] = $sourceScopesCountry; } // query params - if (is_array($source_scopes_city)) { - $source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($source_scopes_city, 'multi', true); - } - if ($source_scopes_city !== null) { - $queryParams['source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_city); + if ($notSourceScopesCountry !== null) { + $queryParams['!source.scopes.country[]'] = $notSourceScopesCountry; } // query params - if (is_array($not_source_scopes_city)) { - $not_source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_city, 'multi', true); - } - if ($not_source_scopes_city !== null) { - $queryParams['!source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_city); + if ($sourceScopesState !== null) { + $queryParams['source.scopes.state[]'] = $sourceScopesState; } // query params - if (is_array($source_scopes_level)) { - $source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($source_scopes_level, 'multi', true); + if ($notSourceScopesState !== null) { + $queryParams['!source.scopes.state[]'] = $notSourceScopesState; } - if ($source_scopes_level !== null) { - $queryParams['source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_level); + // query params + if ($sourceScopesCity !== null) { + $queryParams['source.scopes.city[]'] = $sourceScopesCity; } // query params - if (is_array($not_source_scopes_level)) { - $not_source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_level, 'multi', true); + if ($notSourceScopesCity !== null) { + $queryParams['!source.scopes.city[]'] = $notSourceScopesCity; } - if ($not_source_scopes_level !== null) { - $queryParams['!source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_level); + // query params + if ($sourceScopesLevel !== null) { + $queryParams['source.scopes.level[]'] = $sourceScopesLevel; } // query params - if ($source_links_in_count_min !== null) { - $queryParams['source.links_in_count.min'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_min); + if ($notSourceScopesLevel !== null) { + $queryParams['!source.scopes.level[]'] = $notSourceScopesLevel; } // query params - if ($source_links_in_count_max !== null) { - $queryParams['source.links_in_count.max'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_max); + if ($sourceLinksInCountMin !== null) { + $queryParams['source.links_in_count.min'] = $sourceLinksInCountMin; } // query params - if ($source_rankings_alexa_rank_min !== null) { - $queryParams['source.rankings.alexa.rank.min'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_min); + if ($sourceLinksInCountMax !== null) { + $queryParams['source.links_in_count.max'] = $sourceLinksInCountMax; } // query params - if ($source_rankings_alexa_rank_max !== null) { - $queryParams['source.rankings.alexa.rank.max'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_max); + if ($sourceRankingsAlexaRankMin !== null) { + $queryParams['source.rankings.alexa.rank.min'] = $sourceRankingsAlexaRankMin; } // query params - if (is_array($source_rankings_alexa_country)) { - $source_rankings_alexa_country = $this->apiClient->getSerializer()->serializeCollection($source_rankings_alexa_country, 'multi', true); + if ($sourceRankingsAlexaRankMax !== null) { + $queryParams['source.rankings.alexa.rank.max'] = $sourceRankingsAlexaRankMax; } - if ($source_rankings_alexa_country !== null) { - $queryParams['source.rankings.alexa.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_country); + // query params + if ($sourceRankingsAlexaCountry !== null) { + $queryParams['source.rankings.alexa.country[]'] = $sourceRankingsAlexaCountry; } // query params - if ($social_shares_count_facebook_min !== null) { - $queryParams['social_shares_count.facebook.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_min); + if ($socialSharesCountFacebookMin !== null) { + $queryParams['social_shares_count.facebook.min'] = $socialSharesCountFacebookMin; } // query params - if ($social_shares_count_facebook_max !== null) { - $queryParams['social_shares_count.facebook.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_max); + if ($socialSharesCountFacebookMax !== null) { + $queryParams['social_shares_count.facebook.max'] = $socialSharesCountFacebookMax; } // query params - if ($social_shares_count_google_plus_min !== null) { - $queryParams['social_shares_count.google_plus.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_min); + if ($socialSharesCountGooglePlusMin !== null) { + $queryParams['social_shares_count.google_plus.min'] = $socialSharesCountGooglePlusMin; } // query params - if ($social_shares_count_google_plus_max !== null) { - $queryParams['social_shares_count.google_plus.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_max); + if ($socialSharesCountGooglePlusMax !== null) { + $queryParams['social_shares_count.google_plus.max'] = $socialSharesCountGooglePlusMax; } // query params - if ($social_shares_count_linkedin_min !== null) { - $queryParams['social_shares_count.linkedin.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_min); + if ($socialSharesCountLinkedinMin !== null) { + $queryParams['social_shares_count.linkedin.min'] = $socialSharesCountLinkedinMin; } // query params - if ($social_shares_count_linkedin_max !== null) { - $queryParams['social_shares_count.linkedin.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_max); + if ($socialSharesCountLinkedinMax !== null) { + $queryParams['social_shares_count.linkedin.max'] = $socialSharesCountLinkedinMax; } // query params - if ($social_shares_count_reddit_min !== null) { - $queryParams['social_shares_count.reddit.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_min); + if ($socialSharesCountRedditMin !== null) { + $queryParams['social_shares_count.reddit.min'] = $socialSharesCountRedditMin; } // query params - if ($social_shares_count_reddit_max !== null) { - $queryParams['social_shares_count.reddit.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_max); + if ($socialSharesCountRedditMax !== null) { + $queryParams['social_shares_count.reddit.max'] = $socialSharesCountRedditMax; } // query params - if ($interval_start !== null) { - $queryParams['interval.start'] = $this->apiClient->getSerializer()->toQueryValue($interval_start); + if ($intervalStart !== null) { + $queryParams['interval.start'] = $intervalStart; } // query params - if ($interval_end !== null) { - $queryParams['interval.end'] = $this->apiClient->getSerializer()->toQueryValue($interval_end); + if ($intervalEnd !== null) { + $queryParams['interval.end'] = $intervalEnd; } // query params - if ($interval_width !== null) { - $queryParams['interval.width'] = $this->apiClient->getSerializer()->toQueryValue($interval_width); + if ($intervalWidth !== null) { + $queryParams['interval.width'] = $intervalWidth; } // query params if ($field !== null) { - $queryParams['field'] = $this->apiClient->getSerializer()->toQueryValue($field); + $queryParams['field'] = $field; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } } + // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listRelatedStories + * + * List related stories + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param string $boostBy This parameter is used for boosting the result by the specified value. (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\RelatedStories|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors + */ + public function listRelatedStories($associative_array) + { + list($response) = $this->listRelatedStoriesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listRelatedStoriesWithHttpInfo + * + * List related stories + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param string $boostBy This parameter is used for boosting the result by the specified value. (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\RelatedStories|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listRelatedStoriesWithHttpInfo($associative_array) + { + $request = $this->listRelatedStoriesRequest($associative_array); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Aylien\NewsApi\Models\Histograms', - '/histograms' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\RelatedStories' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\RelatedStories', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\RelatedStories'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\Aylien\NewsApi\Models\Histograms', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Histograms', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\RelatedStories', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listRelatedStories + * Operation listRelatedStoriesAsync * * List related stories * - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return \Aylien\NewsApi\Models\RelatedStories + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param string $boostBy This parameter is used for boosting the result by the specified value. (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listRelatedStories($opts = array()) + public function listRelatedStoriesAsync($associative_array) { - list($response) = $this->listRelatedStoriesWithHttpInfo($opts); - return $response; + return $this->listRelatedStoriesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listRelatedStoriesWithHttpInfo + * Operation listRelatedStoriesAsyncWithHttpInfo * * List related stories * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param string $boostBy This parameter is used for boosting the result by the specified value. (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listRelatedStoriesAsyncWithHttpInfo($associative_array) + { + $returnType = '\Aylien\NewsApi\Models\RelatedStories'; + $request = $this->listRelatedStoriesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return array of \Aylien\NewsApi\Models\RelatedStories, HTTP status code, HTTP response headers (array of strings) + /** + * Create request for operation 'listRelatedStories' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param int $storyId A story id (optional) + * @param string $storyUrl An article or webpage (optional) + * @param string $storyTitle Title of the article (optional) + * @param string $storyBody Body of the article (optional) + * @param string $boostBy This parameter is used for boosting the result by the specified value. (optional) + * @param string $storyLanguage This parameter is used for setting the language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional, default to 'auto') + * @param int $perPage This parameter is used for specifying number of items in each page. (optional, default to 3) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function listRelatedStoriesWithHttpInfo($opts = array()) + protected function listRelatedStoriesRequest($associative_array) { - // define parameters - $id = (!empty($opts['id']) ? $opts['id'] : null); - $not_id = (!empty($opts['not_id']) ? $opts['not_id'] : null); - $title = (!empty($opts['title']) ? $opts['title'] : null); - $body = (!empty($opts['body']) ? $opts['body'] : null); - $text = (!empty($opts['text']) ? $opts['text'] : null); - $language = (!empty($opts['language']) ? $opts['language'] : null); - $not_language = (!empty($opts['not_language']) ? $opts['not_language'] : null); - $published_at_start = (!empty($opts['published_at_start']) ? $opts['published_at_start'] : null); - $published_at_end = (!empty($opts['published_at_end']) ? $opts['published_at_end'] : null); - $categories_taxonomy = (!empty($opts['categories_taxonomy']) ? $opts['categories_taxonomy'] : null); - $categories_confident = (!empty($opts['categories_confident']) ? $opts['categories_confident'] : null); - $categories_id = (!empty($opts['categories_id']) ? $opts['categories_id'] : null); - $not_categories_id = (!empty($opts['not_categories_id']) ? $opts['not_categories_id'] : null); - $categories_level = (!empty($opts['categories_level']) ? $opts['categories_level'] : null); - $not_categories_level = (!empty($opts['not_categories_level']) ? $opts['not_categories_level'] : null); - $entities_title_text = (!empty($opts['entities_title_text']) ? $opts['entities_title_text'] : null); - $not_entities_title_text = (!empty($opts['not_entities_title_text']) ? $opts['not_entities_title_text'] : null); - $entities_title_type = (!empty($opts['entities_title_type']) ? $opts['entities_title_type'] : null); - $not_entities_title_type = (!empty($opts['not_entities_title_type']) ? $opts['not_entities_title_type'] : null); - $entities_title_links_dbpedia = (!empty($opts['entities_title_links_dbpedia']) ? $opts['entities_title_links_dbpedia'] : null); - $not_entities_title_links_dbpedia = (!empty($opts['not_entities_title_links_dbpedia']) ? $opts['not_entities_title_links_dbpedia'] : null); - $entities_body_text = (!empty($opts['entities_body_text']) ? $opts['entities_body_text'] : null); - $not_entities_body_text = (!empty($opts['not_entities_body_text']) ? $opts['not_entities_body_text'] : null); - $entities_body_type = (!empty($opts['entities_body_type']) ? $opts['entities_body_type'] : null); - $not_entities_body_type = (!empty($opts['not_entities_body_type']) ? $opts['not_entities_body_type'] : null); - $entities_body_links_dbpedia = (!empty($opts['entities_body_links_dbpedia']) ? $opts['entities_body_links_dbpedia'] : null); - $not_entities_body_links_dbpedia = (!empty($opts['not_entities_body_links_dbpedia']) ? $opts['not_entities_body_links_dbpedia'] : null); - $sentiment_title_polarity = (!empty($opts['sentiment_title_polarity']) ? $opts['sentiment_title_polarity'] : null); - $not_sentiment_title_polarity = (!empty($opts['not_sentiment_title_polarity']) ? $opts['not_sentiment_title_polarity'] : null); - $sentiment_body_polarity = (!empty($opts['sentiment_body_polarity']) ? $opts['sentiment_body_polarity'] : null); - $not_sentiment_body_polarity = (!empty($opts['not_sentiment_body_polarity']) ? $opts['not_sentiment_body_polarity'] : null); - $media_images_count_min = (!empty($opts['media_images_count_min']) ? $opts['media_images_count_min'] : null); - $media_images_count_max = (!empty($opts['media_images_count_max']) ? $opts['media_images_count_max'] : null); - $media_images_width_min = (!empty($opts['media_images_width_min']) ? $opts['media_images_width_min'] : null); - $media_images_width_max = (!empty($opts['media_images_width_max']) ? $opts['media_images_width_max'] : null); - $media_images_height_min = (!empty($opts['media_images_height_min']) ? $opts['media_images_height_min'] : null); - $media_images_height_max = (!empty($opts['media_images_height_max']) ? $opts['media_images_height_max'] : null); - $media_images_content_length_min = (!empty($opts['media_images_content_length_min']) ? $opts['media_images_content_length_min'] : null); - $media_images_content_length_max = (!empty($opts['media_images_content_length_max']) ? $opts['media_images_content_length_max'] : null); - $media_images_format = (!empty($opts['media_images_format']) ? $opts['media_images_format'] : null); - $not_media_images_format = (!empty($opts['not_media_images_format']) ? $opts['not_media_images_format'] : null); - $media_videos_count_min = (!empty($opts['media_videos_count_min']) ? $opts['media_videos_count_min'] : null); - $media_videos_count_max = (!empty($opts['media_videos_count_max']) ? $opts['media_videos_count_max'] : null); - $author_id = (!empty($opts['author_id']) ? $opts['author_id'] : null); - $not_author_id = (!empty($opts['not_author_id']) ? $opts['not_author_id'] : null); - $author_name = (!empty($opts['author_name']) ? $opts['author_name'] : null); - $not_author_name = (!empty($opts['not_author_name']) ? $opts['not_author_name'] : null); - $source_id = (!empty($opts['source_id']) ? $opts['source_id'] : null); - $not_source_id = (!empty($opts['not_source_id']) ? $opts['not_source_id'] : null); - $source_name = (!empty($opts['source_name']) ? $opts['source_name'] : null); - $not_source_name = (!empty($opts['not_source_name']) ? $opts['not_source_name'] : null); - $source_domain = (!empty($opts['source_domain']) ? $opts['source_domain'] : null); - $not_source_domain = (!empty($opts['not_source_domain']) ? $opts['not_source_domain'] : null); - $source_locations_country = (!empty($opts['source_locations_country']) ? $opts['source_locations_country'] : null); - $not_source_locations_country = (!empty($opts['not_source_locations_country']) ? $opts['not_source_locations_country'] : null); - $source_locations_state = (!empty($opts['source_locations_state']) ? $opts['source_locations_state'] : null); - $not_source_locations_state = (!empty($opts['not_source_locations_state']) ? $opts['not_source_locations_state'] : null); - $source_locations_city = (!empty($opts['source_locations_city']) ? $opts['source_locations_city'] : null); - $not_source_locations_city = (!empty($opts['not_source_locations_city']) ? $opts['not_source_locations_city'] : null); - $source_scopes_country = (!empty($opts['source_scopes_country']) ? $opts['source_scopes_country'] : null); - $not_source_scopes_country = (!empty($opts['not_source_scopes_country']) ? $opts['not_source_scopes_country'] : null); - $source_scopes_state = (!empty($opts['source_scopes_state']) ? $opts['source_scopes_state'] : null); - $not_source_scopes_state = (!empty($opts['not_source_scopes_state']) ? $opts['not_source_scopes_state'] : null); - $source_scopes_city = (!empty($opts['source_scopes_city']) ? $opts['source_scopes_city'] : null); - $not_source_scopes_city = (!empty($opts['not_source_scopes_city']) ? $opts['not_source_scopes_city'] : null); - $source_scopes_level = (!empty($opts['source_scopes_level']) ? $opts['source_scopes_level'] : null); - $not_source_scopes_level = (!empty($opts['not_source_scopes_level']) ? $opts['not_source_scopes_level'] : null); - $source_links_in_count_min = (!empty($opts['source_links_in_count_min']) ? $opts['source_links_in_count_min'] : null); - $source_links_in_count_max = (!empty($opts['source_links_in_count_max']) ? $opts['source_links_in_count_max'] : null); - $source_rankings_alexa_rank_min = (!empty($opts['source_rankings_alexa_rank_min']) ? $opts['source_rankings_alexa_rank_min'] : null); - $source_rankings_alexa_rank_max = (!empty($opts['source_rankings_alexa_rank_max']) ? $opts['source_rankings_alexa_rank_max'] : null); - $source_rankings_alexa_country = (!empty($opts['source_rankings_alexa_country']) ? $opts['source_rankings_alexa_country'] : null); - $social_shares_count_facebook_min = (!empty($opts['social_shares_count_facebook_min']) ? $opts['social_shares_count_facebook_min'] : null); - $social_shares_count_facebook_max = (!empty($opts['social_shares_count_facebook_max']) ? $opts['social_shares_count_facebook_max'] : null); - $social_shares_count_google_plus_min = (!empty($opts['social_shares_count_google_plus_min']) ? $opts['social_shares_count_google_plus_min'] : null); - $social_shares_count_google_plus_max = (!empty($opts['social_shares_count_google_plus_max']) ? $opts['social_shares_count_google_plus_max'] : null); - $social_shares_count_linkedin_min = (!empty($opts['social_shares_count_linkedin_min']) ? $opts['social_shares_count_linkedin_min'] : null); - $social_shares_count_linkedin_max = (!empty($opts['social_shares_count_linkedin_max']) ? $opts['social_shares_count_linkedin_max'] : null); - $social_shares_count_reddit_min = (!empty($opts['social_shares_count_reddit_min']) ? $opts['social_shares_count_reddit_min'] : null); - $social_shares_count_reddit_max = (!empty($opts['social_shares_count_reddit_max']) ? $opts['social_shares_count_reddit_max'] : null); - $cluster = (!empty($opts['cluster']) ? $opts['cluster'] : null); - $cluster_algorithm = (!empty($opts['cluster_algorithm']) ? $opts['cluster_algorithm'] : null); - $return = (!empty($opts['return']) ? $opts['return'] : null); - $story_id = (!empty($opts['story_id']) ? $opts['story_id'] : null); - $story_url = (!empty($opts['story_url']) ? $opts['story_url'] : null); - $story_title = (!empty($opts['story_title']) ? $opts['story_title'] : null); - $story_body = (!empty($opts['story_body']) ? $opts['story_body'] : null); - $boost_by = (!empty($opts['boost_by']) ? $opts['boost_by'] : null); - $story_language = (!empty($opts['story_language']) ? $opts['story_language'] : null); - $per_page = (!empty($opts['per_page']) ? $opts['per_page'] : null); - if (!is_null($media_images_count_min) && ($media_images_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + // unbox the parameters from the associative array + $id = array_key_exists('id', $associative_array) ? $associative_array['id'] : null; + $notId = array_key_exists('notId', $associative_array) ? $associative_array['notId'] : null; + $title = array_key_exists('title', $associative_array) ? $associative_array['title'] : null; + $body = array_key_exists('body', $associative_array) ? $associative_array['body'] : null; + $text = array_key_exists('text', $associative_array) ? $associative_array['text'] : null; + $translationsEnTitle = array_key_exists('translationsEnTitle', $associative_array) ? $associative_array['translationsEnTitle'] : null; + $translationsEnBody = array_key_exists('translationsEnBody', $associative_array) ? $associative_array['translationsEnBody'] : null; + $translationsEnText = array_key_exists('translationsEnText', $associative_array) ? $associative_array['translationsEnText'] : null; + $language = array_key_exists('language', $associative_array) ? $associative_array['language'] : null; + $notLanguage = array_key_exists('notLanguage', $associative_array) ? $associative_array['notLanguage'] : null; + $publishedAtStart = array_key_exists('publishedAtStart', $associative_array) ? $associative_array['publishedAtStart'] : null; + $publishedAtEnd = array_key_exists('publishedAtEnd', $associative_array) ? $associative_array['publishedAtEnd'] : null; + $categoriesTaxonomy = array_key_exists('categoriesTaxonomy', $associative_array) ? $associative_array['categoriesTaxonomy'] : null; + $categoriesConfident = array_key_exists('categoriesConfident', $associative_array) ? $associative_array['categoriesConfident'] : true; + $categoriesId = array_key_exists('categoriesId', $associative_array) ? $associative_array['categoriesId'] : null; + $notCategoriesId = array_key_exists('notCategoriesId', $associative_array) ? $associative_array['notCategoriesId'] : null; + $categoriesLevel = array_key_exists('categoriesLevel', $associative_array) ? $associative_array['categoriesLevel'] : null; + $notCategoriesLevel = array_key_exists('notCategoriesLevel', $associative_array) ? $associative_array['notCategoriesLevel'] : null; + $entitiesTitleText = array_key_exists('entitiesTitleText', $associative_array) ? $associative_array['entitiesTitleText'] : null; + $notEntitiesTitleText = array_key_exists('notEntitiesTitleText', $associative_array) ? $associative_array['notEntitiesTitleText'] : null; + $entitiesTitleType = array_key_exists('entitiesTitleType', $associative_array) ? $associative_array['entitiesTitleType'] : null; + $notEntitiesTitleType = array_key_exists('notEntitiesTitleType', $associative_array) ? $associative_array['notEntitiesTitleType'] : null; + $entitiesTitleLinksDbpedia = array_key_exists('entitiesTitleLinksDbpedia', $associative_array) ? $associative_array['entitiesTitleLinksDbpedia'] : null; + $notEntitiesTitleLinksDbpedia = array_key_exists('notEntitiesTitleLinksDbpedia', $associative_array) ? $associative_array['notEntitiesTitleLinksDbpedia'] : null; + $entitiesBodyText = array_key_exists('entitiesBodyText', $associative_array) ? $associative_array['entitiesBodyText'] : null; + $notEntitiesBodyText = array_key_exists('notEntitiesBodyText', $associative_array) ? $associative_array['notEntitiesBodyText'] : null; + $entitiesBodyType = array_key_exists('entitiesBodyType', $associative_array) ? $associative_array['entitiesBodyType'] : null; + $notEntitiesBodyType = array_key_exists('notEntitiesBodyType', $associative_array) ? $associative_array['notEntitiesBodyType'] : null; + $entitiesBodyLinksDbpedia = array_key_exists('entitiesBodyLinksDbpedia', $associative_array) ? $associative_array['entitiesBodyLinksDbpedia'] : null; + $notEntitiesBodyLinksDbpedia = array_key_exists('notEntitiesBodyLinksDbpedia', $associative_array) ? $associative_array['notEntitiesBodyLinksDbpedia'] : null; + $sentimentTitlePolarity = array_key_exists('sentimentTitlePolarity', $associative_array) ? $associative_array['sentimentTitlePolarity'] : null; + $notSentimentTitlePolarity = array_key_exists('notSentimentTitlePolarity', $associative_array) ? $associative_array['notSentimentTitlePolarity'] : null; + $sentimentBodyPolarity = array_key_exists('sentimentBodyPolarity', $associative_array) ? $associative_array['sentimentBodyPolarity'] : null; + $notSentimentBodyPolarity = array_key_exists('notSentimentBodyPolarity', $associative_array) ? $associative_array['notSentimentBodyPolarity'] : null; + $mediaImagesCountMin = array_key_exists('mediaImagesCountMin', $associative_array) ? $associative_array['mediaImagesCountMin'] : null; + $mediaImagesCountMax = array_key_exists('mediaImagesCountMax', $associative_array) ? $associative_array['mediaImagesCountMax'] : null; + $mediaImagesWidthMin = array_key_exists('mediaImagesWidthMin', $associative_array) ? $associative_array['mediaImagesWidthMin'] : null; + $mediaImagesWidthMax = array_key_exists('mediaImagesWidthMax', $associative_array) ? $associative_array['mediaImagesWidthMax'] : null; + $mediaImagesHeightMin = array_key_exists('mediaImagesHeightMin', $associative_array) ? $associative_array['mediaImagesHeightMin'] : null; + $mediaImagesHeightMax = array_key_exists('mediaImagesHeightMax', $associative_array) ? $associative_array['mediaImagesHeightMax'] : null; + $mediaImagesContentLengthMin = array_key_exists('mediaImagesContentLengthMin', $associative_array) ? $associative_array['mediaImagesContentLengthMin'] : null; + $mediaImagesContentLengthMax = array_key_exists('mediaImagesContentLengthMax', $associative_array) ? $associative_array['mediaImagesContentLengthMax'] : null; + $mediaImagesFormat = array_key_exists('mediaImagesFormat', $associative_array) ? $associative_array['mediaImagesFormat'] : null; + $notMediaImagesFormat = array_key_exists('notMediaImagesFormat', $associative_array) ? $associative_array['notMediaImagesFormat'] : null; + $mediaVideosCountMin = array_key_exists('mediaVideosCountMin', $associative_array) ? $associative_array['mediaVideosCountMin'] : null; + $mediaVideosCountMax = array_key_exists('mediaVideosCountMax', $associative_array) ? $associative_array['mediaVideosCountMax'] : null; + $authorId = array_key_exists('authorId', $associative_array) ? $associative_array['authorId'] : null; + $notAuthorId = array_key_exists('notAuthorId', $associative_array) ? $associative_array['notAuthorId'] : null; + $authorName = array_key_exists('authorName', $associative_array) ? $associative_array['authorName'] : null; + $notAuthorName = array_key_exists('notAuthorName', $associative_array) ? $associative_array['notAuthorName'] : null; + $sourceId = array_key_exists('sourceId', $associative_array) ? $associative_array['sourceId'] : null; + $notSourceId = array_key_exists('notSourceId', $associative_array) ? $associative_array['notSourceId'] : null; + $sourceName = array_key_exists('sourceName', $associative_array) ? $associative_array['sourceName'] : null; + $notSourceName = array_key_exists('notSourceName', $associative_array) ? $associative_array['notSourceName'] : null; + $sourceDomain = array_key_exists('sourceDomain', $associative_array) ? $associative_array['sourceDomain'] : null; + $notSourceDomain = array_key_exists('notSourceDomain', $associative_array) ? $associative_array['notSourceDomain'] : null; + $sourceLocationsCountry = array_key_exists('sourceLocationsCountry', $associative_array) ? $associative_array['sourceLocationsCountry'] : null; + $notSourceLocationsCountry = array_key_exists('notSourceLocationsCountry', $associative_array) ? $associative_array['notSourceLocationsCountry'] : null; + $sourceLocationsState = array_key_exists('sourceLocationsState', $associative_array) ? $associative_array['sourceLocationsState'] : null; + $notSourceLocationsState = array_key_exists('notSourceLocationsState', $associative_array) ? $associative_array['notSourceLocationsState'] : null; + $sourceLocationsCity = array_key_exists('sourceLocationsCity', $associative_array) ? $associative_array['sourceLocationsCity'] : null; + $notSourceLocationsCity = array_key_exists('notSourceLocationsCity', $associative_array) ? $associative_array['notSourceLocationsCity'] : null; + $sourceScopesCountry = array_key_exists('sourceScopesCountry', $associative_array) ? $associative_array['sourceScopesCountry'] : null; + $notSourceScopesCountry = array_key_exists('notSourceScopesCountry', $associative_array) ? $associative_array['notSourceScopesCountry'] : null; + $sourceScopesState = array_key_exists('sourceScopesState', $associative_array) ? $associative_array['sourceScopesState'] : null; + $notSourceScopesState = array_key_exists('notSourceScopesState', $associative_array) ? $associative_array['notSourceScopesState'] : null; + $sourceScopesCity = array_key_exists('sourceScopesCity', $associative_array) ? $associative_array['sourceScopesCity'] : null; + $notSourceScopesCity = array_key_exists('notSourceScopesCity', $associative_array) ? $associative_array['notSourceScopesCity'] : null; + $sourceScopesLevel = array_key_exists('sourceScopesLevel', $associative_array) ? $associative_array['sourceScopesLevel'] : null; + $notSourceScopesLevel = array_key_exists('notSourceScopesLevel', $associative_array) ? $associative_array['notSourceScopesLevel'] : null; + $sourceLinksInCountMin = array_key_exists('sourceLinksInCountMin', $associative_array) ? $associative_array['sourceLinksInCountMin'] : null; + $sourceLinksInCountMax = array_key_exists('sourceLinksInCountMax', $associative_array) ? $associative_array['sourceLinksInCountMax'] : null; + $sourceRankingsAlexaRankMin = array_key_exists('sourceRankingsAlexaRankMin', $associative_array) ? $associative_array['sourceRankingsAlexaRankMin'] : null; + $sourceRankingsAlexaRankMax = array_key_exists('sourceRankingsAlexaRankMax', $associative_array) ? $associative_array['sourceRankingsAlexaRankMax'] : null; + $sourceRankingsAlexaCountry = array_key_exists('sourceRankingsAlexaCountry', $associative_array) ? $associative_array['sourceRankingsAlexaCountry'] : null; + $socialSharesCountFacebookMin = array_key_exists('socialSharesCountFacebookMin', $associative_array) ? $associative_array['socialSharesCountFacebookMin'] : null; + $socialSharesCountFacebookMax = array_key_exists('socialSharesCountFacebookMax', $associative_array) ? $associative_array['socialSharesCountFacebookMax'] : null; + $socialSharesCountGooglePlusMin = array_key_exists('socialSharesCountGooglePlusMin', $associative_array) ? $associative_array['socialSharesCountGooglePlusMin'] : null; + $socialSharesCountGooglePlusMax = array_key_exists('socialSharesCountGooglePlusMax', $associative_array) ? $associative_array['socialSharesCountGooglePlusMax'] : null; + $socialSharesCountLinkedinMin = array_key_exists('socialSharesCountLinkedinMin', $associative_array) ? $associative_array['socialSharesCountLinkedinMin'] : null; + $socialSharesCountLinkedinMax = array_key_exists('socialSharesCountLinkedinMax', $associative_array) ? $associative_array['socialSharesCountLinkedinMax'] : null; + $socialSharesCountRedditMin = array_key_exists('socialSharesCountRedditMin', $associative_array) ? $associative_array['socialSharesCountRedditMin'] : null; + $socialSharesCountRedditMax = array_key_exists('socialSharesCountRedditMax', $associative_array) ? $associative_array['socialSharesCountRedditMax'] : null; + $clusters = array_key_exists('clusters', $associative_array) ? $associative_array['clusters'] : null; + $return = array_key_exists('return', $associative_array) ? $associative_array['return'] : null; + $storyId = array_key_exists('storyId', $associative_array) ? $associative_array['storyId'] : null; + $storyUrl = array_key_exists('storyUrl', $associative_array) ? $associative_array['storyUrl'] : null; + $storyTitle = array_key_exists('storyTitle', $associative_array) ? $associative_array['storyTitle'] : null; + $storyBody = array_key_exists('storyBody', $associative_array) ? $associative_array['storyBody'] : null; + $boostBy = array_key_exists('boostBy', $associative_array) ? $associative_array['boostBy'] : null; + $storyLanguage = array_key_exists('storyLanguage', $associative_array) ? $associative_array['storyLanguage'] : 'auto'; + $perPage = array_key_exists('perPage', $associative_array) ? $associative_array['perPage'] : 3; + + if ($mediaImagesCountMin !== null && $mediaImagesCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_images_count_max) && ($media_images_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaImagesCountMax !== null && $mediaImagesCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_images_width_min) && ($media_images_width_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaImagesWidthMin !== null && $mediaImagesWidthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_images_width_max) && ($media_images_width_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaImagesWidthMax !== null && $mediaImagesWidthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_images_height_min) && ($media_images_height_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaImagesHeightMin !== null && $mediaImagesHeightMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_images_height_max) && ($media_images_height_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaImagesHeightMax !== null && $mediaImagesHeightMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_images_content_length_min) && ($media_images_content_length_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaImagesContentLengthMin !== null && $mediaImagesContentLengthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_images_content_length_max) && ($media_images_content_length_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaImagesContentLengthMax !== null && $mediaImagesContentLengthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_videos_count_min) && ($media_videos_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaVideosCountMin !== null && $mediaVideosCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($media_videos_count_max) && ($media_videos_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($mediaVideosCountMax !== null && $mediaVideosCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($source_links_in_count_min) && ($source_links_in_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($sourceLinksInCountMin !== null && $sourceLinksInCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($source_links_in_count_max) && ($source_links_in_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($sourceLinksInCountMax !== null && $sourceLinksInCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_min) && ($source_rankings_alexa_rank_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMin !== null && $sourceRankingsAlexaRankMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_max) && ($source_rankings_alexa_rank_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMax !== null && $sourceRankingsAlexaRankMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_min) && ($social_shares_count_facebook_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountFacebookMin !== null && $socialSharesCountFacebookMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_max) && ($social_shares_count_facebook_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountFacebookMax !== null && $socialSharesCountFacebookMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_min) && ($social_shares_count_google_plus_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMin !== null && $socialSharesCountGooglePlusMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_max) && ($social_shares_count_google_plus_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMax !== null && $socialSharesCountGooglePlusMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_min) && ($social_shares_count_linkedin_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountLinkedinMin !== null && $socialSharesCountLinkedinMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_max) && ($social_shares_count_linkedin_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountLinkedinMax !== null && $socialSharesCountLinkedinMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_min) && ($social_shares_count_reddit_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_min" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountRedditMin !== null && $socialSharesCountRedditMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMin" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_max) && ($social_shares_count_reddit_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_max" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); + if ($socialSharesCountRedditMax !== null && $socialSharesCountRedditMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMax" when calling DefaultApi.listRelatedStories, must be bigger than 0.'); } - if (!is_null($per_page) && ($per_page > 100)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listRelatedStories, must be smaller than or equal to 100.'); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listRelatedStories, must be smaller than or equal to 100.'); } - if (!is_null($per_page) && ($per_page < 1)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listRelatedStories, must be bigger than or equal to 1.'); + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listRelatedStories, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/related_stories"; - $httpBody = ''; + + $resourcePath = '/related_stories'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/xml']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); - - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $httpBody = ''; + $multipart = false; - // form params + // query params if ($id !== null) { - $formParams['id[]'] = $this->apiClient->getSerializer()->toFormValue($id); + $queryParams['id[]'] = $id; } - // form params - if ($not_id !== null) { - $formParams['!id[]'] = $this->apiClient->getSerializer()->toFormValue($not_id); + // query params + if ($notId !== null) { + $queryParams['!id[]'] = $notId; } - // form params + // query params if ($title !== null) { - $formParams['title'] = $this->apiClient->getSerializer()->toFormValue($title); + $queryParams['title'] = $title; + } + // query params + if ($body !== null) { + $queryParams['body'] = $body; + } + // query params + if ($text !== null) { + $queryParams['text'] = $text; + } + // query params + if ($translationsEnTitle !== null) { + $queryParams['translations.en.title'] = $translationsEnTitle; } - // form params - if ($body !== null) { - $formParams['body'] = $this->apiClient->getSerializer()->toFormValue($body); + // query params + if ($translationsEnBody !== null) { + $queryParams['translations.en.body'] = $translationsEnBody; } - // form params - if ($text !== null) { - $formParams['text'] = $this->apiClient->getSerializer()->toFormValue($text); + // query params + if ($translationsEnText !== null) { + $queryParams['translations.en.text'] = $translationsEnText; } - // form params + // query params if ($language !== null) { - $formParams['language[]'] = $this->apiClient->getSerializer()->toFormValue($language); - } - // form params - if ($not_language !== null) { - $formParams['!language[]'] = $this->apiClient->getSerializer()->toFormValue($not_language); + $queryParams['language[]'] = $language; } - // form params - if ($published_at_start !== null) { - $formParams['published_at.start'] = $this->apiClient->getSerializer()->toFormValue($published_at_start); + // query params + if ($notLanguage !== null) { + $queryParams['!language[]'] = $notLanguage; } - // form params - if ($published_at_end !== null) { - $formParams['published_at.end'] = $this->apiClient->getSerializer()->toFormValue($published_at_end); + // query params + if ($publishedAtStart !== null) { + $queryParams['published_at.start'] = $publishedAtStart; } - // form params - if ($categories_taxonomy !== null) { - $formParams['categories.taxonomy'] = $this->apiClient->getSerializer()->toFormValue($categories_taxonomy); + // query params + if ($publishedAtEnd !== null) { + $queryParams['published_at.end'] = $publishedAtEnd; } - // form params - if ($categories_confident !== null) { - $formParams['categories.confident'] = $this->apiClient->getSerializer()->toFormValue($categories_confident); + // query params + if ($categoriesTaxonomy !== null) { + $queryParams['categories.taxonomy'] = $categoriesTaxonomy; } - // form params - if ($categories_id !== null) { - $formParams['categories.id[]'] = $this->apiClient->getSerializer()->toFormValue($categories_id); + // query params + if ($categoriesConfident !== null) { + $queryParams['categories.confident'] = $categoriesConfident; } - // form params - if ($not_categories_id !== null) { - $formParams['!categories.id[]'] = $this->apiClient->getSerializer()->toFormValue($not_categories_id); + // query params + if ($categoriesId !== null) { + $queryParams['categories.id[]'] = $categoriesId; } - // form params - if ($categories_level !== null) { - $formParams['categories.level[]'] = $this->apiClient->getSerializer()->toFormValue($categories_level); + // query params + if ($notCategoriesId !== null) { + $queryParams['!categories.id[]'] = $notCategoriesId; } - // form params - if ($not_categories_level !== null) { - $formParams['!categories.level[]'] = $this->apiClient->getSerializer()->toFormValue($not_categories_level); + // query params + if ($categoriesLevel !== null) { + $queryParams['categories.level[]'] = $categoriesLevel; } - // form params - if ($entities_title_text !== null) { - $formParams['entities.title.text[]'] = $this->apiClient->getSerializer()->toFormValue($entities_title_text); + // query params + if ($notCategoriesLevel !== null) { + $queryParams['!categories.level[]'] = $notCategoriesLevel; } - // form params - if ($not_entities_title_text !== null) { - $formParams['!entities.title.text[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_title_text); + // query params + if ($entitiesTitleText !== null) { + $queryParams['entities.title.text[]'] = $entitiesTitleText; } - // form params - if ($entities_title_type !== null) { - $formParams['entities.title.type[]'] = $this->apiClient->getSerializer()->toFormValue($entities_title_type); + // query params + if ($notEntitiesTitleText !== null) { + $queryParams['!entities.title.text[]'] = $notEntitiesTitleText; } - // form params - if ($not_entities_title_type !== null) { - $formParams['!entities.title.type[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_title_type); + // query params + if ($entitiesTitleType !== null) { + $queryParams['entities.title.type[]'] = $entitiesTitleType; } - // form params - if ($entities_title_links_dbpedia !== null) { - $formParams['entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($entities_title_links_dbpedia); + // query params + if ($notEntitiesTitleType !== null) { + $queryParams['!entities.title.type[]'] = $notEntitiesTitleType; } - // form params - if ($not_entities_title_links_dbpedia !== null) { - $formParams['!entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_title_links_dbpedia); + // query params + if ($entitiesTitleLinksDbpedia !== null) { + $queryParams['entities.title.links.dbpedia[]'] = $entitiesTitleLinksDbpedia; } - // form params - if ($entities_body_text !== null) { - $formParams['entities.body.text[]'] = $this->apiClient->getSerializer()->toFormValue($entities_body_text); + // query params + if ($notEntitiesTitleLinksDbpedia !== null) { + $queryParams['!entities.title.links.dbpedia[]'] = $notEntitiesTitleLinksDbpedia; } - // form params - if ($not_entities_body_text !== null) { - $formParams['!entities.body.text[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_body_text); + // query params + if ($entitiesBodyText !== null) { + $queryParams['entities.body.text[]'] = $entitiesBodyText; } - // form params - if ($entities_body_type !== null) { - $formParams['entities.body.type[]'] = $this->apiClient->getSerializer()->toFormValue($entities_body_type); + // query params + if ($notEntitiesBodyText !== null) { + $queryParams['!entities.body.text[]'] = $notEntitiesBodyText; } - // form params - if ($not_entities_body_type !== null) { - $formParams['!entities.body.type[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_body_type); + // query params + if ($entitiesBodyType !== null) { + $queryParams['entities.body.type[]'] = $entitiesBodyType; } - // form params - if ($entities_body_links_dbpedia !== null) { - $formParams['entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($entities_body_links_dbpedia); + // query params + if ($notEntitiesBodyType !== null) { + $queryParams['!entities.body.type[]'] = $notEntitiesBodyType; } - // form params - if ($not_entities_body_links_dbpedia !== null) { - $formParams['!entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toFormValue($not_entities_body_links_dbpedia); + // query params + if ($entitiesBodyLinksDbpedia !== null) { + $queryParams['entities.body.links.dbpedia[]'] = $entitiesBodyLinksDbpedia; } - // form params - if ($sentiment_title_polarity !== null) { - $formParams['sentiment.title.polarity'] = $this->apiClient->getSerializer()->toFormValue($sentiment_title_polarity); + // query params + if ($notEntitiesBodyLinksDbpedia !== null) { + $queryParams['!entities.body.links.dbpedia[]'] = $notEntitiesBodyLinksDbpedia; } - // form params - if ($not_sentiment_title_polarity !== null) { - $formParams['!sentiment.title.polarity'] = $this->apiClient->getSerializer()->toFormValue($not_sentiment_title_polarity); + // query params + if ($sentimentTitlePolarity !== null) { + $queryParams['sentiment.title.polarity'] = $sentimentTitlePolarity; } - // form params - if ($sentiment_body_polarity !== null) { - $formParams['sentiment.body.polarity'] = $this->apiClient->getSerializer()->toFormValue($sentiment_body_polarity); + // query params + if ($notSentimentTitlePolarity !== null) { + $queryParams['!sentiment.title.polarity'] = $notSentimentTitlePolarity; } - // form params - if ($not_sentiment_body_polarity !== null) { - $formParams['!sentiment.body.polarity'] = $this->apiClient->getSerializer()->toFormValue($not_sentiment_body_polarity); + // query params + if ($sentimentBodyPolarity !== null) { + $queryParams['sentiment.body.polarity'] = $sentimentBodyPolarity; } - // form params - if ($media_images_count_min !== null) { - $formParams['media.images.count.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_count_min); + // query params + if ($notSentimentBodyPolarity !== null) { + $queryParams['!sentiment.body.polarity'] = $notSentimentBodyPolarity; } - // form params - if ($media_images_count_max !== null) { - $formParams['media.images.count.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_count_max); + // query params + if ($mediaImagesCountMin !== null) { + $queryParams['media.images.count.min'] = $mediaImagesCountMin; } - // form params - if ($media_images_width_min !== null) { - $formParams['media.images.width.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_width_min); + // query params + if ($mediaImagesCountMax !== null) { + $queryParams['media.images.count.max'] = $mediaImagesCountMax; } - // form params - if ($media_images_width_max !== null) { - $formParams['media.images.width.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_width_max); + // query params + if ($mediaImagesWidthMin !== null) { + $queryParams['media.images.width.min'] = $mediaImagesWidthMin; } - // form params - if ($media_images_height_min !== null) { - $formParams['media.images.height.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_height_min); + // query params + if ($mediaImagesWidthMax !== null) { + $queryParams['media.images.width.max'] = $mediaImagesWidthMax; } - // form params - if ($media_images_height_max !== null) { - $formParams['media.images.height.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_height_max); + // query params + if ($mediaImagesHeightMin !== null) { + $queryParams['media.images.height.min'] = $mediaImagesHeightMin; } - // form params - if ($media_images_content_length_min !== null) { - $formParams['media.images.content_length.min'] = $this->apiClient->getSerializer()->toFormValue($media_images_content_length_min); + // query params + if ($mediaImagesHeightMax !== null) { + $queryParams['media.images.height.max'] = $mediaImagesHeightMax; } - // form params - if ($media_images_content_length_max !== null) { - $formParams['media.images.content_length.max'] = $this->apiClient->getSerializer()->toFormValue($media_images_content_length_max); + // query params + if ($mediaImagesContentLengthMin !== null) { + $queryParams['media.images.content_length.min'] = $mediaImagesContentLengthMin; } - // form params - if ($media_images_format !== null) { - $formParams['media.images.format[]'] = $this->apiClient->getSerializer()->toFormValue($media_images_format); + // query params + if ($mediaImagesContentLengthMax !== null) { + $queryParams['media.images.content_length.max'] = $mediaImagesContentLengthMax; } - // form params - if ($not_media_images_format !== null) { - $formParams['!media.images.format[]'] = $this->apiClient->getSerializer()->toFormValue($not_media_images_format); + // query params + if ($mediaImagesFormat !== null) { + $queryParams['media.images.format[]'] = $mediaImagesFormat; } - // form params - if ($media_videos_count_min !== null) { - $formParams['media.videos.count.min'] = $this->apiClient->getSerializer()->toFormValue($media_videos_count_min); + // query params + if ($notMediaImagesFormat !== null) { + $queryParams['!media.images.format[]'] = $notMediaImagesFormat; } - // form params - if ($media_videos_count_max !== null) { - $formParams['media.videos.count.max'] = $this->apiClient->getSerializer()->toFormValue($media_videos_count_max); + // query params + if ($mediaVideosCountMin !== null) { + $queryParams['media.videos.count.min'] = $mediaVideosCountMin; } - // form params - if ($author_id !== null) { - $formParams['author.id[]'] = $this->apiClient->getSerializer()->toFormValue($author_id); + // query params + if ($mediaVideosCountMax !== null) { + $queryParams['media.videos.count.max'] = $mediaVideosCountMax; } - // form params - if ($not_author_id !== null) { - $formParams['!author.id[]'] = $this->apiClient->getSerializer()->toFormValue($not_author_id); + // query params + if ($authorId !== null) { + $queryParams['author.id[]'] = $authorId; } - // form params - if ($author_name !== null) { - $formParams['author.name'] = $this->apiClient->getSerializer()->toFormValue($author_name); + // query params + if ($notAuthorId !== null) { + $queryParams['!author.id[]'] = $notAuthorId; } - // form params - if ($not_author_name !== null) { - $formParams['!author.name'] = $this->apiClient->getSerializer()->toFormValue($not_author_name); + // query params + if ($authorName !== null) { + $queryParams['author.name'] = $authorName; } - // form params - if ($source_id !== null) { - $formParams['source.id[]'] = $this->apiClient->getSerializer()->toFormValue($source_id); + // query params + if ($notAuthorName !== null) { + $queryParams['!author.name'] = $notAuthorName; } - // form params - if ($not_source_id !== null) { - $formParams['!source.id[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_id); + // query params + if ($sourceId !== null) { + $queryParams['source.id[]'] = $sourceId; } - // form params - if ($source_name !== null) { - $formParams['source.name[]'] = $this->apiClient->getSerializer()->toFormValue($source_name); + // query params + if ($notSourceId !== null) { + $queryParams['!source.id[]'] = $notSourceId; } - // form params - if ($not_source_name !== null) { - $formParams['!source.name[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_name); + // query params + if ($sourceName !== null) { + $queryParams['source.name[]'] = $sourceName; } - // form params - if ($source_domain !== null) { - $formParams['source.domain[]'] = $this->apiClient->getSerializer()->toFormValue($source_domain); + // query params + if ($notSourceName !== null) { + $queryParams['!source.name[]'] = $notSourceName; } - // form params - if ($not_source_domain !== null) { - $formParams['!source.domain[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_domain); + // query params + if ($sourceDomain !== null) { + $queryParams['source.domain[]'] = $sourceDomain; } - // form params - if ($source_locations_country !== null) { - $formParams['source.locations.country[]'] = $this->apiClient->getSerializer()->toFormValue($source_locations_country); + // query params + if ($notSourceDomain !== null) { + $queryParams['!source.domain[]'] = $notSourceDomain; } - // form params - if ($not_source_locations_country !== null) { - $formParams['!source.locations.country[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_locations_country); + // query params + if ($sourceLocationsCountry !== null) { + $queryParams['source.locations.country[]'] = $sourceLocationsCountry; } - // form params - if ($source_locations_state !== null) { - $formParams['source.locations.state[]'] = $this->apiClient->getSerializer()->toFormValue($source_locations_state); + // query params + if ($notSourceLocationsCountry !== null) { + $queryParams['!source.locations.country[]'] = $notSourceLocationsCountry; } - // form params - if ($not_source_locations_state !== null) { - $formParams['!source.locations.state[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_locations_state); + // query params + if ($sourceLocationsState !== null) { + $queryParams['source.locations.state[]'] = $sourceLocationsState; } - // form params - if ($source_locations_city !== null) { - $formParams['source.locations.city[]'] = $this->apiClient->getSerializer()->toFormValue($source_locations_city); + // query params + if ($notSourceLocationsState !== null) { + $queryParams['!source.locations.state[]'] = $notSourceLocationsState; } - // form params - if ($not_source_locations_city !== null) { - $formParams['!source.locations.city[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_locations_city); + // query params + if ($sourceLocationsCity !== null) { + $queryParams['source.locations.city[]'] = $sourceLocationsCity; } - // form params - if ($source_scopes_country !== null) { - $formParams['source.scopes.country[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_country); + // query params + if ($notSourceLocationsCity !== null) { + $queryParams['!source.locations.city[]'] = $notSourceLocationsCity; } - // form params - if ($not_source_scopes_country !== null) { - $formParams['!source.scopes.country[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_country); + // query params + if ($sourceScopesCountry !== null) { + $queryParams['source.scopes.country[]'] = $sourceScopesCountry; } - // form params - if ($source_scopes_state !== null) { - $formParams['source.scopes.state[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_state); + // query params + if ($notSourceScopesCountry !== null) { + $queryParams['!source.scopes.country[]'] = $notSourceScopesCountry; } - // form params - if ($not_source_scopes_state !== null) { - $formParams['!source.scopes.state[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_state); + // query params + if ($sourceScopesState !== null) { + $queryParams['source.scopes.state[]'] = $sourceScopesState; } - // form params - if ($source_scopes_city !== null) { - $formParams['source.scopes.city[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_city); + // query params + if ($notSourceScopesState !== null) { + $queryParams['!source.scopes.state[]'] = $notSourceScopesState; } - // form params - if ($not_source_scopes_city !== null) { - $formParams['!source.scopes.city[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_city); + // query params + if ($sourceScopesCity !== null) { + $queryParams['source.scopes.city[]'] = $sourceScopesCity; } - // form params - if ($source_scopes_level !== null) { - $formParams['source.scopes.level[]'] = $this->apiClient->getSerializer()->toFormValue($source_scopes_level); + // query params + if ($notSourceScopesCity !== null) { + $queryParams['!source.scopes.city[]'] = $notSourceScopesCity; } - // form params - if ($not_source_scopes_level !== null) { - $formParams['!source.scopes.level[]'] = $this->apiClient->getSerializer()->toFormValue($not_source_scopes_level); + // query params + if ($sourceScopesLevel !== null) { + $queryParams['source.scopes.level[]'] = $sourceScopesLevel; } - // form params - if ($source_links_in_count_min !== null) { - $formParams['source.links_in_count.min'] = $this->apiClient->getSerializer()->toFormValue($source_links_in_count_min); + // query params + if ($notSourceScopesLevel !== null) { + $queryParams['!source.scopes.level[]'] = $notSourceScopesLevel; } - // form params - if ($source_links_in_count_max !== null) { - $formParams['source.links_in_count.max'] = $this->apiClient->getSerializer()->toFormValue($source_links_in_count_max); + // query params + if ($sourceLinksInCountMin !== null) { + $queryParams['source.links_in_count.min'] = $sourceLinksInCountMin; } - // form params - if ($source_rankings_alexa_rank_min !== null) { - $formParams['source.rankings.alexa.rank.min'] = $this->apiClient->getSerializer()->toFormValue($source_rankings_alexa_rank_min); + // query params + if ($sourceLinksInCountMax !== null) { + $queryParams['source.links_in_count.max'] = $sourceLinksInCountMax; } - // form params - if ($source_rankings_alexa_rank_max !== null) { - $formParams['source.rankings.alexa.rank.max'] = $this->apiClient->getSerializer()->toFormValue($source_rankings_alexa_rank_max); + // query params + if ($sourceRankingsAlexaRankMin !== null) { + $queryParams['source.rankings.alexa.rank.min'] = $sourceRankingsAlexaRankMin; } - // form params - if ($source_rankings_alexa_country !== null) { - $formParams['source.rankings.alexa.country[]'] = $this->apiClient->getSerializer()->toFormValue($source_rankings_alexa_country); + // query params + if ($sourceRankingsAlexaRankMax !== null) { + $queryParams['source.rankings.alexa.rank.max'] = $sourceRankingsAlexaRankMax; } - // form params - if ($social_shares_count_facebook_min !== null) { - $formParams['social_shares_count.facebook.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_facebook_min); + // query params + if ($sourceRankingsAlexaCountry !== null) { + $queryParams['source.rankings.alexa.country[]'] = $sourceRankingsAlexaCountry; } - // form params - if ($social_shares_count_facebook_max !== null) { - $formParams['social_shares_count.facebook.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_facebook_max); + // query params + if ($socialSharesCountFacebookMin !== null) { + $queryParams['social_shares_count.facebook.min'] = $socialSharesCountFacebookMin; } - // form params - if ($social_shares_count_google_plus_min !== null) { - $formParams['social_shares_count.google_plus.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_google_plus_min); + // query params + if ($socialSharesCountFacebookMax !== null) { + $queryParams['social_shares_count.facebook.max'] = $socialSharesCountFacebookMax; } - // form params - if ($social_shares_count_google_plus_max !== null) { - $formParams['social_shares_count.google_plus.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_google_plus_max); + // query params + if ($socialSharesCountGooglePlusMin !== null) { + $queryParams['social_shares_count.google_plus.min'] = $socialSharesCountGooglePlusMin; } - // form params - if ($social_shares_count_linkedin_min !== null) { - $formParams['social_shares_count.linkedin.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_linkedin_min); + // query params + if ($socialSharesCountGooglePlusMax !== null) { + $queryParams['social_shares_count.google_plus.max'] = $socialSharesCountGooglePlusMax; } - // form params - if ($social_shares_count_linkedin_max !== null) { - $formParams['social_shares_count.linkedin.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_linkedin_max); + // query params + if ($socialSharesCountLinkedinMin !== null) { + $queryParams['social_shares_count.linkedin.min'] = $socialSharesCountLinkedinMin; } - // form params - if ($social_shares_count_reddit_min !== null) { - $formParams['social_shares_count.reddit.min'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_reddit_min); + // query params + if ($socialSharesCountLinkedinMax !== null) { + $queryParams['social_shares_count.linkedin.max'] = $socialSharesCountLinkedinMax; } - // form params - if ($social_shares_count_reddit_max !== null) { - $formParams['social_shares_count.reddit.max'] = $this->apiClient->getSerializer()->toFormValue($social_shares_count_reddit_max); + // query params + if ($socialSharesCountRedditMin !== null) { + $queryParams['social_shares_count.reddit.min'] = $socialSharesCountRedditMin; } - // form params - if ($cluster !== null) { - $formParams['cluster'] = $this->apiClient->getSerializer()->toFormValue($cluster); + // query params + if ($socialSharesCountRedditMax !== null) { + $queryParams['social_shares_count.reddit.max'] = $socialSharesCountRedditMax; } - // form params - if ($cluster_algorithm !== null) { - $formParams['cluster.algorithm'] = $this->apiClient->getSerializer()->toFormValue($cluster_algorithm); + // query params + if ($clusters !== null) { + $queryParams['clusters[]'] = $clusters; } - // form params + // query params if ($return !== null) { - $formParams['return[]'] = $this->apiClient->getSerializer()->toFormValue($return); + $queryParams['return[]'] = $return; + } + // query params + if ($storyId !== null) { + $queryParams['story_id'] = $storyId; } - // form params - if ($story_id !== null) { - $formParams['story_id'] = $this->apiClient->getSerializer()->toFormValue($story_id); + // query params + if ($storyUrl !== null) { + $queryParams['story_url'] = $storyUrl; } - // form params - if ($story_url !== null) { - $formParams['story_url'] = $this->apiClient->getSerializer()->toFormValue($story_url); + // query params + if ($storyTitle !== null) { + $queryParams['story_title'] = $storyTitle; } - // form params - if ($story_title !== null) { - $formParams['story_title'] = $this->apiClient->getSerializer()->toFormValue($story_title); + // query params + if ($storyBody !== null) { + $queryParams['story_body'] = $storyBody; } - // form params - if ($story_body !== null) { - $formParams['story_body'] = $this->apiClient->getSerializer()->toFormValue($story_body); + // query params + if ($boostBy !== null) { + $queryParams['boost_by'] = $boostBy; } - // form params - if ($boost_by !== null) { - $formParams['boost_by'] = $this->apiClient->getSerializer()->toFormValue($boost_by); + // query params + if ($storyLanguage !== null) { + $queryParams['story_language'] = $storyLanguage; } - // form params - if ($story_language !== null) { - $formParams['story_language'] = $this->apiClient->getSerializer()->toFormValue($story_language); + // query params + if ($perPage !== null) { + $queryParams['per_page'] = $perPage; } - // form params - if ($per_page !== null) { - $formParams['per_page'] = $this->apiClient->getSerializer()->toFormValue($per_page); + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); } - + // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } } + // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; } - // make the API Call + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listStories + * + * List Stories + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param string $sortBy This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'published_at') + * @param string $sortDirection This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'desc') + * @param string $cursor This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). (optional, default to '*') + * @param int $perPage This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) (optional, default to 10) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\Stories|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors + */ + public function listStories($associative_array) + { + list($response) = $this->listStoriesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listStoriesWithHttpInfo + * + * List Stories + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param string $sortBy This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'published_at') + * @param string $sortDirection This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'desc') + * @param string $cursor This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). (optional, default to '*') + * @param int $perPage This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) (optional, default to 10) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\Stories|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listStoriesWithHttpInfo($associative_array) + { + $request = $this->listStoriesRequest($associative_array); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'POST', - $queryParams, - $httpBody, - $headerParams, - '\Aylien\NewsApi\Models\RelatedStories', - '/related_stories' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\Stories' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Stories', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\Stories'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\Aylien\NewsApi\Models\RelatedStories', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\RelatedStories', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Stories', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listStories + * Operation listStoriesAsync * * List Stories * - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return \Aylien\NewsApi\Models\Stories + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param string $sortBy This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'published_at') + * @param string $sortDirection This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'desc') + * @param string $cursor This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). (optional, default to '*') + * @param int $perPage This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) (optional, default to 10) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listStories($opts = array()) + public function listStoriesAsync($associative_array) { - list($response) = $this->listStoriesWithHttpInfo($opts); - return $response; + return $this->listStoriesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listStoriesWithHttpInfo + * Operation listStoriesAsyncWithHttpInfo * * List Stories * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param string $sortBy This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'published_at') + * @param string $sortDirection This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'desc') + * @param string $cursor This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). (optional, default to '*') + * @param int $perPage This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) (optional, default to 10) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listStoriesAsyncWithHttpInfo($associative_array) + { + $returnType = '\Aylien\NewsApi\Models\Stories'; + $request = $this->listStoriesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return array of \Aylien\NewsApi\Models\Stories, HTTP status code, HTTP response headers (array of strings) + /** + * Create request for operation 'listStories' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string[] $clusters This parameter is used for finding stories with belonging to one of clusters in a specific set of clusters You can read more about working with clustering [here](https://newsapi.aylien.com/docs/working-with-clustering). (optional) + * @param string[] $return This parameter is used for specifying return fields. (optional) + * @param string $sortBy This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'published_at') + * @param string $sortDirection This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results). (optional, default to 'desc') + * @param string $cursor This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results). (optional, default to '*') + * @param int $perPage This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results) (optional, default to 10) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function listStoriesWithHttpInfo($opts = array()) + protected function listStoriesRequest($associative_array) { - // define parameters - $id = (!empty($opts['id']) ? $opts['id'] : null); - $not_id = (!empty($opts['not_id']) ? $opts['not_id'] : null); - $title = (!empty($opts['title']) ? $opts['title'] : null); - $body = (!empty($opts['body']) ? $opts['body'] : null); - $text = (!empty($opts['text']) ? $opts['text'] : null); - $language = (!empty($opts['language']) ? $opts['language'] : null); - $not_language = (!empty($opts['not_language']) ? $opts['not_language'] : null); - $published_at_start = (!empty($opts['published_at_start']) ? $opts['published_at_start'] : null); - $published_at_end = (!empty($opts['published_at_end']) ? $opts['published_at_end'] : null); - $categories_taxonomy = (!empty($opts['categories_taxonomy']) ? $opts['categories_taxonomy'] : null); - $categories_confident = (!empty($opts['categories_confident']) ? $opts['categories_confident'] : null); - $categories_id = (!empty($opts['categories_id']) ? $opts['categories_id'] : null); - $not_categories_id = (!empty($opts['not_categories_id']) ? $opts['not_categories_id'] : null); - $categories_level = (!empty($opts['categories_level']) ? $opts['categories_level'] : null); - $not_categories_level = (!empty($opts['not_categories_level']) ? $opts['not_categories_level'] : null); - $entities_title_text = (!empty($opts['entities_title_text']) ? $opts['entities_title_text'] : null); - $not_entities_title_text = (!empty($opts['not_entities_title_text']) ? $opts['not_entities_title_text'] : null); - $entities_title_type = (!empty($opts['entities_title_type']) ? $opts['entities_title_type'] : null); - $not_entities_title_type = (!empty($opts['not_entities_title_type']) ? $opts['not_entities_title_type'] : null); - $entities_title_links_dbpedia = (!empty($opts['entities_title_links_dbpedia']) ? $opts['entities_title_links_dbpedia'] : null); - $not_entities_title_links_dbpedia = (!empty($opts['not_entities_title_links_dbpedia']) ? $opts['not_entities_title_links_dbpedia'] : null); - $entities_body_text = (!empty($opts['entities_body_text']) ? $opts['entities_body_text'] : null); - $not_entities_body_text = (!empty($opts['not_entities_body_text']) ? $opts['not_entities_body_text'] : null); - $entities_body_type = (!empty($opts['entities_body_type']) ? $opts['entities_body_type'] : null); - $not_entities_body_type = (!empty($opts['not_entities_body_type']) ? $opts['not_entities_body_type'] : null); - $entities_body_links_dbpedia = (!empty($opts['entities_body_links_dbpedia']) ? $opts['entities_body_links_dbpedia'] : null); - $not_entities_body_links_dbpedia = (!empty($opts['not_entities_body_links_dbpedia']) ? $opts['not_entities_body_links_dbpedia'] : null); - $sentiment_title_polarity = (!empty($opts['sentiment_title_polarity']) ? $opts['sentiment_title_polarity'] : null); - $not_sentiment_title_polarity = (!empty($opts['not_sentiment_title_polarity']) ? $opts['not_sentiment_title_polarity'] : null); - $sentiment_body_polarity = (!empty($opts['sentiment_body_polarity']) ? $opts['sentiment_body_polarity'] : null); - $not_sentiment_body_polarity = (!empty($opts['not_sentiment_body_polarity']) ? $opts['not_sentiment_body_polarity'] : null); - $media_images_count_min = (!empty($opts['media_images_count_min']) ? $opts['media_images_count_min'] : null); - $media_images_count_max = (!empty($opts['media_images_count_max']) ? $opts['media_images_count_max'] : null); - $media_images_width_min = (!empty($opts['media_images_width_min']) ? $opts['media_images_width_min'] : null); - $media_images_width_max = (!empty($opts['media_images_width_max']) ? $opts['media_images_width_max'] : null); - $media_images_height_min = (!empty($opts['media_images_height_min']) ? $opts['media_images_height_min'] : null); - $media_images_height_max = (!empty($opts['media_images_height_max']) ? $opts['media_images_height_max'] : null); - $media_images_content_length_min = (!empty($opts['media_images_content_length_min']) ? $opts['media_images_content_length_min'] : null); - $media_images_content_length_max = (!empty($opts['media_images_content_length_max']) ? $opts['media_images_content_length_max'] : null); - $media_images_format = (!empty($opts['media_images_format']) ? $opts['media_images_format'] : null); - $not_media_images_format = (!empty($opts['not_media_images_format']) ? $opts['not_media_images_format'] : null); - $media_videos_count_min = (!empty($opts['media_videos_count_min']) ? $opts['media_videos_count_min'] : null); - $media_videos_count_max = (!empty($opts['media_videos_count_max']) ? $opts['media_videos_count_max'] : null); - $author_id = (!empty($opts['author_id']) ? $opts['author_id'] : null); - $not_author_id = (!empty($opts['not_author_id']) ? $opts['not_author_id'] : null); - $author_name = (!empty($opts['author_name']) ? $opts['author_name'] : null); - $not_author_name = (!empty($opts['not_author_name']) ? $opts['not_author_name'] : null); - $source_id = (!empty($opts['source_id']) ? $opts['source_id'] : null); - $not_source_id = (!empty($opts['not_source_id']) ? $opts['not_source_id'] : null); - $source_name = (!empty($opts['source_name']) ? $opts['source_name'] : null); - $not_source_name = (!empty($opts['not_source_name']) ? $opts['not_source_name'] : null); - $source_domain = (!empty($opts['source_domain']) ? $opts['source_domain'] : null); - $not_source_domain = (!empty($opts['not_source_domain']) ? $opts['not_source_domain'] : null); - $source_locations_country = (!empty($opts['source_locations_country']) ? $opts['source_locations_country'] : null); - $not_source_locations_country = (!empty($opts['not_source_locations_country']) ? $opts['not_source_locations_country'] : null); - $source_locations_state = (!empty($opts['source_locations_state']) ? $opts['source_locations_state'] : null); - $not_source_locations_state = (!empty($opts['not_source_locations_state']) ? $opts['not_source_locations_state'] : null); - $source_locations_city = (!empty($opts['source_locations_city']) ? $opts['source_locations_city'] : null); - $not_source_locations_city = (!empty($opts['not_source_locations_city']) ? $opts['not_source_locations_city'] : null); - $source_scopes_country = (!empty($opts['source_scopes_country']) ? $opts['source_scopes_country'] : null); - $not_source_scopes_country = (!empty($opts['not_source_scopes_country']) ? $opts['not_source_scopes_country'] : null); - $source_scopes_state = (!empty($opts['source_scopes_state']) ? $opts['source_scopes_state'] : null); - $not_source_scopes_state = (!empty($opts['not_source_scopes_state']) ? $opts['not_source_scopes_state'] : null); - $source_scopes_city = (!empty($opts['source_scopes_city']) ? $opts['source_scopes_city'] : null); - $not_source_scopes_city = (!empty($opts['not_source_scopes_city']) ? $opts['not_source_scopes_city'] : null); - $source_scopes_level = (!empty($opts['source_scopes_level']) ? $opts['source_scopes_level'] : null); - $not_source_scopes_level = (!empty($opts['not_source_scopes_level']) ? $opts['not_source_scopes_level'] : null); - $source_links_in_count_min = (!empty($opts['source_links_in_count_min']) ? $opts['source_links_in_count_min'] : null); - $source_links_in_count_max = (!empty($opts['source_links_in_count_max']) ? $opts['source_links_in_count_max'] : null); - $source_rankings_alexa_rank_min = (!empty($opts['source_rankings_alexa_rank_min']) ? $opts['source_rankings_alexa_rank_min'] : null); - $source_rankings_alexa_rank_max = (!empty($opts['source_rankings_alexa_rank_max']) ? $opts['source_rankings_alexa_rank_max'] : null); - $source_rankings_alexa_country = (!empty($opts['source_rankings_alexa_country']) ? $opts['source_rankings_alexa_country'] : null); - $social_shares_count_facebook_min = (!empty($opts['social_shares_count_facebook_min']) ? $opts['social_shares_count_facebook_min'] : null); - $social_shares_count_facebook_max = (!empty($opts['social_shares_count_facebook_max']) ? $opts['social_shares_count_facebook_max'] : null); - $social_shares_count_google_plus_min = (!empty($opts['social_shares_count_google_plus_min']) ? $opts['social_shares_count_google_plus_min'] : null); - $social_shares_count_google_plus_max = (!empty($opts['social_shares_count_google_plus_max']) ? $opts['social_shares_count_google_plus_max'] : null); - $social_shares_count_linkedin_min = (!empty($opts['social_shares_count_linkedin_min']) ? $opts['social_shares_count_linkedin_min'] : null); - $social_shares_count_linkedin_max = (!empty($opts['social_shares_count_linkedin_max']) ? $opts['social_shares_count_linkedin_max'] : null); - $social_shares_count_reddit_min = (!empty($opts['social_shares_count_reddit_min']) ? $opts['social_shares_count_reddit_min'] : null); - $social_shares_count_reddit_max = (!empty($opts['social_shares_count_reddit_max']) ? $opts['social_shares_count_reddit_max'] : null); - $cluster = (!empty($opts['cluster']) ? $opts['cluster'] : null); - $cluster_algorithm = (!empty($opts['cluster_algorithm']) ? $opts['cluster_algorithm'] : null); - $return = (!empty($opts['return']) ? $opts['return'] : null); - $sort_by = (!empty($opts['sort_by']) ? $opts['sort_by'] : null); - $sort_direction = (!empty($opts['sort_direction']) ? $opts['sort_direction'] : null); - $cursor = (!empty($opts['cursor']) ? $opts['cursor'] : null); - $per_page = (!empty($opts['per_page']) ? $opts['per_page'] : null); - if (!is_null($media_images_count_min) && ($media_images_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_min" when calling DefaultApi.listStories, must be bigger than 0.'); + // unbox the parameters from the associative array + $id = array_key_exists('id', $associative_array) ? $associative_array['id'] : null; + $notId = array_key_exists('notId', $associative_array) ? $associative_array['notId'] : null; + $title = array_key_exists('title', $associative_array) ? $associative_array['title'] : null; + $body = array_key_exists('body', $associative_array) ? $associative_array['body'] : null; + $text = array_key_exists('text', $associative_array) ? $associative_array['text'] : null; + $translationsEnTitle = array_key_exists('translationsEnTitle', $associative_array) ? $associative_array['translationsEnTitle'] : null; + $translationsEnBody = array_key_exists('translationsEnBody', $associative_array) ? $associative_array['translationsEnBody'] : null; + $translationsEnText = array_key_exists('translationsEnText', $associative_array) ? $associative_array['translationsEnText'] : null; + $language = array_key_exists('language', $associative_array) ? $associative_array['language'] : null; + $notLanguage = array_key_exists('notLanguage', $associative_array) ? $associative_array['notLanguage'] : null; + $publishedAtStart = array_key_exists('publishedAtStart', $associative_array) ? $associative_array['publishedAtStart'] : null; + $publishedAtEnd = array_key_exists('publishedAtEnd', $associative_array) ? $associative_array['publishedAtEnd'] : null; + $categoriesTaxonomy = array_key_exists('categoriesTaxonomy', $associative_array) ? $associative_array['categoriesTaxonomy'] : null; + $categoriesConfident = array_key_exists('categoriesConfident', $associative_array) ? $associative_array['categoriesConfident'] : true; + $categoriesId = array_key_exists('categoriesId', $associative_array) ? $associative_array['categoriesId'] : null; + $notCategoriesId = array_key_exists('notCategoriesId', $associative_array) ? $associative_array['notCategoriesId'] : null; + $categoriesLevel = array_key_exists('categoriesLevel', $associative_array) ? $associative_array['categoriesLevel'] : null; + $notCategoriesLevel = array_key_exists('notCategoriesLevel', $associative_array) ? $associative_array['notCategoriesLevel'] : null; + $entitiesTitleText = array_key_exists('entitiesTitleText', $associative_array) ? $associative_array['entitiesTitleText'] : null; + $notEntitiesTitleText = array_key_exists('notEntitiesTitleText', $associative_array) ? $associative_array['notEntitiesTitleText'] : null; + $entitiesTitleType = array_key_exists('entitiesTitleType', $associative_array) ? $associative_array['entitiesTitleType'] : null; + $notEntitiesTitleType = array_key_exists('notEntitiesTitleType', $associative_array) ? $associative_array['notEntitiesTitleType'] : null; + $entitiesTitleLinksDbpedia = array_key_exists('entitiesTitleLinksDbpedia', $associative_array) ? $associative_array['entitiesTitleLinksDbpedia'] : null; + $notEntitiesTitleLinksDbpedia = array_key_exists('notEntitiesTitleLinksDbpedia', $associative_array) ? $associative_array['notEntitiesTitleLinksDbpedia'] : null; + $entitiesBodyText = array_key_exists('entitiesBodyText', $associative_array) ? $associative_array['entitiesBodyText'] : null; + $notEntitiesBodyText = array_key_exists('notEntitiesBodyText', $associative_array) ? $associative_array['notEntitiesBodyText'] : null; + $entitiesBodyType = array_key_exists('entitiesBodyType', $associative_array) ? $associative_array['entitiesBodyType'] : null; + $notEntitiesBodyType = array_key_exists('notEntitiesBodyType', $associative_array) ? $associative_array['notEntitiesBodyType'] : null; + $entitiesBodyLinksDbpedia = array_key_exists('entitiesBodyLinksDbpedia', $associative_array) ? $associative_array['entitiesBodyLinksDbpedia'] : null; + $notEntitiesBodyLinksDbpedia = array_key_exists('notEntitiesBodyLinksDbpedia', $associative_array) ? $associative_array['notEntitiesBodyLinksDbpedia'] : null; + $sentimentTitlePolarity = array_key_exists('sentimentTitlePolarity', $associative_array) ? $associative_array['sentimentTitlePolarity'] : null; + $notSentimentTitlePolarity = array_key_exists('notSentimentTitlePolarity', $associative_array) ? $associative_array['notSentimentTitlePolarity'] : null; + $sentimentBodyPolarity = array_key_exists('sentimentBodyPolarity', $associative_array) ? $associative_array['sentimentBodyPolarity'] : null; + $notSentimentBodyPolarity = array_key_exists('notSentimentBodyPolarity', $associative_array) ? $associative_array['notSentimentBodyPolarity'] : null; + $mediaImagesCountMin = array_key_exists('mediaImagesCountMin', $associative_array) ? $associative_array['mediaImagesCountMin'] : null; + $mediaImagesCountMax = array_key_exists('mediaImagesCountMax', $associative_array) ? $associative_array['mediaImagesCountMax'] : null; + $mediaImagesWidthMin = array_key_exists('mediaImagesWidthMin', $associative_array) ? $associative_array['mediaImagesWidthMin'] : null; + $mediaImagesWidthMax = array_key_exists('mediaImagesWidthMax', $associative_array) ? $associative_array['mediaImagesWidthMax'] : null; + $mediaImagesHeightMin = array_key_exists('mediaImagesHeightMin', $associative_array) ? $associative_array['mediaImagesHeightMin'] : null; + $mediaImagesHeightMax = array_key_exists('mediaImagesHeightMax', $associative_array) ? $associative_array['mediaImagesHeightMax'] : null; + $mediaImagesContentLengthMin = array_key_exists('mediaImagesContentLengthMin', $associative_array) ? $associative_array['mediaImagesContentLengthMin'] : null; + $mediaImagesContentLengthMax = array_key_exists('mediaImagesContentLengthMax', $associative_array) ? $associative_array['mediaImagesContentLengthMax'] : null; + $mediaImagesFormat = array_key_exists('mediaImagesFormat', $associative_array) ? $associative_array['mediaImagesFormat'] : null; + $notMediaImagesFormat = array_key_exists('notMediaImagesFormat', $associative_array) ? $associative_array['notMediaImagesFormat'] : null; + $mediaVideosCountMin = array_key_exists('mediaVideosCountMin', $associative_array) ? $associative_array['mediaVideosCountMin'] : null; + $mediaVideosCountMax = array_key_exists('mediaVideosCountMax', $associative_array) ? $associative_array['mediaVideosCountMax'] : null; + $authorId = array_key_exists('authorId', $associative_array) ? $associative_array['authorId'] : null; + $notAuthorId = array_key_exists('notAuthorId', $associative_array) ? $associative_array['notAuthorId'] : null; + $authorName = array_key_exists('authorName', $associative_array) ? $associative_array['authorName'] : null; + $notAuthorName = array_key_exists('notAuthorName', $associative_array) ? $associative_array['notAuthorName'] : null; + $sourceId = array_key_exists('sourceId', $associative_array) ? $associative_array['sourceId'] : null; + $notSourceId = array_key_exists('notSourceId', $associative_array) ? $associative_array['notSourceId'] : null; + $sourceName = array_key_exists('sourceName', $associative_array) ? $associative_array['sourceName'] : null; + $notSourceName = array_key_exists('notSourceName', $associative_array) ? $associative_array['notSourceName'] : null; + $sourceDomain = array_key_exists('sourceDomain', $associative_array) ? $associative_array['sourceDomain'] : null; + $notSourceDomain = array_key_exists('notSourceDomain', $associative_array) ? $associative_array['notSourceDomain'] : null; + $sourceLocationsCountry = array_key_exists('sourceLocationsCountry', $associative_array) ? $associative_array['sourceLocationsCountry'] : null; + $notSourceLocationsCountry = array_key_exists('notSourceLocationsCountry', $associative_array) ? $associative_array['notSourceLocationsCountry'] : null; + $sourceLocationsState = array_key_exists('sourceLocationsState', $associative_array) ? $associative_array['sourceLocationsState'] : null; + $notSourceLocationsState = array_key_exists('notSourceLocationsState', $associative_array) ? $associative_array['notSourceLocationsState'] : null; + $sourceLocationsCity = array_key_exists('sourceLocationsCity', $associative_array) ? $associative_array['sourceLocationsCity'] : null; + $notSourceLocationsCity = array_key_exists('notSourceLocationsCity', $associative_array) ? $associative_array['notSourceLocationsCity'] : null; + $sourceScopesCountry = array_key_exists('sourceScopesCountry', $associative_array) ? $associative_array['sourceScopesCountry'] : null; + $notSourceScopesCountry = array_key_exists('notSourceScopesCountry', $associative_array) ? $associative_array['notSourceScopesCountry'] : null; + $sourceScopesState = array_key_exists('sourceScopesState', $associative_array) ? $associative_array['sourceScopesState'] : null; + $notSourceScopesState = array_key_exists('notSourceScopesState', $associative_array) ? $associative_array['notSourceScopesState'] : null; + $sourceScopesCity = array_key_exists('sourceScopesCity', $associative_array) ? $associative_array['sourceScopesCity'] : null; + $notSourceScopesCity = array_key_exists('notSourceScopesCity', $associative_array) ? $associative_array['notSourceScopesCity'] : null; + $sourceScopesLevel = array_key_exists('sourceScopesLevel', $associative_array) ? $associative_array['sourceScopesLevel'] : null; + $notSourceScopesLevel = array_key_exists('notSourceScopesLevel', $associative_array) ? $associative_array['notSourceScopesLevel'] : null; + $sourceLinksInCountMin = array_key_exists('sourceLinksInCountMin', $associative_array) ? $associative_array['sourceLinksInCountMin'] : null; + $sourceLinksInCountMax = array_key_exists('sourceLinksInCountMax', $associative_array) ? $associative_array['sourceLinksInCountMax'] : null; + $sourceRankingsAlexaRankMin = array_key_exists('sourceRankingsAlexaRankMin', $associative_array) ? $associative_array['sourceRankingsAlexaRankMin'] : null; + $sourceRankingsAlexaRankMax = array_key_exists('sourceRankingsAlexaRankMax', $associative_array) ? $associative_array['sourceRankingsAlexaRankMax'] : null; + $sourceRankingsAlexaCountry = array_key_exists('sourceRankingsAlexaCountry', $associative_array) ? $associative_array['sourceRankingsAlexaCountry'] : null; + $socialSharesCountFacebookMin = array_key_exists('socialSharesCountFacebookMin', $associative_array) ? $associative_array['socialSharesCountFacebookMin'] : null; + $socialSharesCountFacebookMax = array_key_exists('socialSharesCountFacebookMax', $associative_array) ? $associative_array['socialSharesCountFacebookMax'] : null; + $socialSharesCountGooglePlusMin = array_key_exists('socialSharesCountGooglePlusMin', $associative_array) ? $associative_array['socialSharesCountGooglePlusMin'] : null; + $socialSharesCountGooglePlusMax = array_key_exists('socialSharesCountGooglePlusMax', $associative_array) ? $associative_array['socialSharesCountGooglePlusMax'] : null; + $socialSharesCountLinkedinMin = array_key_exists('socialSharesCountLinkedinMin', $associative_array) ? $associative_array['socialSharesCountLinkedinMin'] : null; + $socialSharesCountLinkedinMax = array_key_exists('socialSharesCountLinkedinMax', $associative_array) ? $associative_array['socialSharesCountLinkedinMax'] : null; + $socialSharesCountRedditMin = array_key_exists('socialSharesCountRedditMin', $associative_array) ? $associative_array['socialSharesCountRedditMin'] : null; + $socialSharesCountRedditMax = array_key_exists('socialSharesCountRedditMax', $associative_array) ? $associative_array['socialSharesCountRedditMax'] : null; + $clusters = array_key_exists('clusters', $associative_array) ? $associative_array['clusters'] : null; + $return = array_key_exists('return', $associative_array) ? $associative_array['return'] : null; + $sortBy = array_key_exists('sortBy', $associative_array) ? $associative_array['sortBy'] : 'published_at'; + $sortDirection = array_key_exists('sortDirection', $associative_array) ? $associative_array['sortDirection'] : 'desc'; + $cursor = array_key_exists('cursor', $associative_array) ? $associative_array['cursor'] : '*'; + $perPage = array_key_exists('perPage', $associative_array) ? $associative_array['perPage'] : 10; + + if ($mediaImagesCountMin !== null && $mediaImagesCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_images_count_max) && ($media_images_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaImagesCountMax !== null && $mediaImagesCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_images_width_min) && ($media_images_width_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaImagesWidthMin !== null && $mediaImagesWidthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_images_width_max) && ($media_images_width_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaImagesWidthMax !== null && $mediaImagesWidthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_images_height_min) && ($media_images_height_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaImagesHeightMin !== null && $mediaImagesHeightMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_images_height_max) && ($media_images_height_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaImagesHeightMax !== null && $mediaImagesHeightMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_images_content_length_min) && ($media_images_content_length_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaImagesContentLengthMin !== null && $mediaImagesContentLengthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_images_content_length_max) && ($media_images_content_length_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaImagesContentLengthMax !== null && $mediaImagesContentLengthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_videos_count_min) && ($media_videos_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaVideosCountMin !== null && $mediaVideosCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($media_videos_count_max) && ($media_videos_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($mediaVideosCountMax !== null && $mediaVideosCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($source_links_in_count_min) && ($source_links_in_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($sourceLinksInCountMin !== null && $sourceLinksInCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($source_links_in_count_max) && ($source_links_in_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($sourceLinksInCountMax !== null && $sourceLinksInCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_min) && ($source_rankings_alexa_rank_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMin !== null && $sourceRankingsAlexaRankMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_max) && ($source_rankings_alexa_rank_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMax !== null && $sourceRankingsAlexaRankMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_min) && ($social_shares_count_facebook_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountFacebookMin !== null && $socialSharesCountFacebookMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_max) && ($social_shares_count_facebook_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountFacebookMax !== null && $socialSharesCountFacebookMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_min) && ($social_shares_count_google_plus_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMin !== null && $socialSharesCountGooglePlusMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_max) && ($social_shares_count_google_plus_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMax !== null && $socialSharesCountGooglePlusMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_min) && ($social_shares_count_linkedin_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountLinkedinMin !== null && $socialSharesCountLinkedinMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_max) && ($social_shares_count_linkedin_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountLinkedinMax !== null && $socialSharesCountLinkedinMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_min) && ($social_shares_count_reddit_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_min" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountRedditMin !== null && $socialSharesCountRedditMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMin" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_max) && ($social_shares_count_reddit_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_max" when calling DefaultApi.listStories, must be bigger than 0.'); + if ($socialSharesCountRedditMax !== null && $socialSharesCountRedditMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMax" when calling DefaultApi.listStories, must be bigger than 0.'); } - if (!is_null($per_page) && ($per_page > 100)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listStories, must be smaller than or equal to 100.'); + if ($perPage !== null && $perPage > 100) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listStories, must be smaller than or equal to 100.'); } - if (!is_null($per_page) && ($per_page < 1)) { - throw new \InvalidArgumentException('invalid value for "$per_page" when calling DefaultApi.listStories, must be bigger than or equal to 1.'); + if ($perPage !== null && $perPage < 1) { + throw new \InvalidArgumentException('invalid value for "$perPage" when calling DefaultApi.listStories, must be bigger than or equal to 1.'); } - // parse inputs - $resourcePath = "/stories"; - $httpBody = ''; + + $resourcePath = '/stories'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/xml']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + $httpBody = ''; + $multipart = false; // query params - if (is_array($id)) { - $id = $this->apiClient->getSerializer()->serializeCollection($id, 'multi', true); - } if ($id !== null) { - $queryParams['id[]'] = $this->apiClient->getSerializer()->toQueryValue($id); + $queryParams['id[]'] = $id; } // query params - if (is_array($not_id)) { - $not_id = $this->apiClient->getSerializer()->serializeCollection($not_id, 'multi', true); - } - if ($not_id !== null) { - $queryParams['!id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_id); + if ($notId !== null) { + $queryParams['!id[]'] = $notId; } // query params if ($title !== null) { - $queryParams['title'] = $this->apiClient->getSerializer()->toQueryValue($title); + $queryParams['title'] = $title; } // query params if ($body !== null) { - $queryParams['body'] = $this->apiClient->getSerializer()->toQueryValue($body); + $queryParams['body'] = $body; } // query params if ($text !== null) { - $queryParams['text'] = $this->apiClient->getSerializer()->toQueryValue($text); + $queryParams['text'] = $text; } // query params - if (is_array($language)) { - $language = $this->apiClient->getSerializer()->serializeCollection($language, 'multi', true); - } - if ($language !== null) { - $queryParams['language[]'] = $this->apiClient->getSerializer()->toQueryValue($language); + if ($translationsEnTitle !== null) { + $queryParams['translations.en.title'] = $translationsEnTitle; } // query params - if (is_array($not_language)) { - $not_language = $this->apiClient->getSerializer()->serializeCollection($not_language, 'multi', true); - } - if ($not_language !== null) { - $queryParams['!language[]'] = $this->apiClient->getSerializer()->toQueryValue($not_language); + if ($translationsEnBody !== null) { + $queryParams['translations.en.body'] = $translationsEnBody; } // query params - if ($published_at_start !== null) { - $queryParams['published_at.start'] = $this->apiClient->getSerializer()->toQueryValue($published_at_start); + if ($translationsEnText !== null) { + $queryParams['translations.en.text'] = $translationsEnText; } // query params - if ($published_at_end !== null) { - $queryParams['published_at.end'] = $this->apiClient->getSerializer()->toQueryValue($published_at_end); + if ($language !== null) { + $queryParams['language[]'] = $language; } // query params - if ($categories_taxonomy !== null) { - $queryParams['categories.taxonomy'] = $this->apiClient->getSerializer()->toQueryValue($categories_taxonomy); + if ($notLanguage !== null) { + $queryParams['!language[]'] = $notLanguage; } // query params - if ($categories_confident !== null) { - $queryParams['categories.confident'] = $this->apiClient->getSerializer()->toQueryValue($categories_confident); + if ($publishedAtStart !== null) { + $queryParams['published_at.start'] = $publishedAtStart; } // query params - if (is_array($categories_id)) { - $categories_id = $this->apiClient->getSerializer()->serializeCollection($categories_id, 'multi', true); - } - if ($categories_id !== null) { - $queryParams['categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_id); + if ($publishedAtEnd !== null) { + $queryParams['published_at.end'] = $publishedAtEnd; } // query params - if (is_array($not_categories_id)) { - $not_categories_id = $this->apiClient->getSerializer()->serializeCollection($not_categories_id, 'multi', true); - } - if ($not_categories_id !== null) { - $queryParams['!categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_id); + if ($categoriesTaxonomy !== null) { + $queryParams['categories.taxonomy'] = $categoriesTaxonomy; } // query params - if (is_array($categories_level)) { - $categories_level = $this->apiClient->getSerializer()->serializeCollection($categories_level, 'multi', true); - } - if ($categories_level !== null) { - $queryParams['categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_level); + if ($categoriesConfident !== null) { + $queryParams['categories.confident'] = $categoriesConfident; } // query params - if (is_array($not_categories_level)) { - $not_categories_level = $this->apiClient->getSerializer()->serializeCollection($not_categories_level, 'multi', true); - } - if ($not_categories_level !== null) { - $queryParams['!categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_level); + if ($categoriesId !== null) { + $queryParams['categories.id[]'] = $categoriesId; } // query params - if (is_array($entities_title_text)) { - $entities_title_text = $this->apiClient->getSerializer()->serializeCollection($entities_title_text, 'multi', true); - } - if ($entities_title_text !== null) { - $queryParams['entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_text); + if ($notCategoriesId !== null) { + $queryParams['!categories.id[]'] = $notCategoriesId; } // query params - if (is_array($not_entities_title_text)) { - $not_entities_title_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_text, 'multi', true); - } - if ($not_entities_title_text !== null) { - $queryParams['!entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_text); + if ($categoriesLevel !== null) { + $queryParams['categories.level[]'] = $categoriesLevel; } // query params - if (is_array($entities_title_type)) { - $entities_title_type = $this->apiClient->getSerializer()->serializeCollection($entities_title_type, 'multi', true); - } - if ($entities_title_type !== null) { - $queryParams['entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_type); + if ($notCategoriesLevel !== null) { + $queryParams['!categories.level[]'] = $notCategoriesLevel; } // query params - if (is_array($not_entities_title_type)) { - $not_entities_title_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_type, 'multi', true); - } - if ($not_entities_title_type !== null) { - $queryParams['!entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_type); + if ($entitiesTitleText !== null) { + $queryParams['entities.title.text[]'] = $entitiesTitleText; } // query params - if (is_array($entities_title_links_dbpedia)) { - $entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_title_links_dbpedia, 'multi', true); - } - if ($entities_title_links_dbpedia !== null) { - $queryParams['entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_links_dbpedia); + if ($notEntitiesTitleText !== null) { + $queryParams['!entities.title.text[]'] = $notEntitiesTitleText; } // query params - if (is_array($not_entities_title_links_dbpedia)) { - $not_entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_links_dbpedia, 'multi', true); - } - if ($not_entities_title_links_dbpedia !== null) { - $queryParams['!entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_links_dbpedia); + if ($entitiesTitleType !== null) { + $queryParams['entities.title.type[]'] = $entitiesTitleType; } // query params - if (is_array($entities_body_text)) { - $entities_body_text = $this->apiClient->getSerializer()->serializeCollection($entities_body_text, 'multi', true); - } - if ($entities_body_text !== null) { - $queryParams['entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_text); + if ($notEntitiesTitleType !== null) { + $queryParams['!entities.title.type[]'] = $notEntitiesTitleType; } // query params - if (is_array($not_entities_body_text)) { - $not_entities_body_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_text, 'multi', true); - } - if ($not_entities_body_text !== null) { - $queryParams['!entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_text); + if ($entitiesTitleLinksDbpedia !== null) { + $queryParams['entities.title.links.dbpedia[]'] = $entitiesTitleLinksDbpedia; } // query params - if (is_array($entities_body_type)) { - $entities_body_type = $this->apiClient->getSerializer()->serializeCollection($entities_body_type, 'multi', true); - } - if ($entities_body_type !== null) { - $queryParams['entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_type); + if ($notEntitiesTitleLinksDbpedia !== null) { + $queryParams['!entities.title.links.dbpedia[]'] = $notEntitiesTitleLinksDbpedia; } // query params - if (is_array($not_entities_body_type)) { - $not_entities_body_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_type, 'multi', true); - } - if ($not_entities_body_type !== null) { - $queryParams['!entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_type); + if ($entitiesBodyText !== null) { + $queryParams['entities.body.text[]'] = $entitiesBodyText; } // query params - if (is_array($entities_body_links_dbpedia)) { - $entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_body_links_dbpedia, 'multi', true); - } - if ($entities_body_links_dbpedia !== null) { - $queryParams['entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_links_dbpedia); + if ($notEntitiesBodyText !== null) { + $queryParams['!entities.body.text[]'] = $notEntitiesBodyText; } // query params - if (is_array($not_entities_body_links_dbpedia)) { - $not_entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_links_dbpedia, 'multi', true); - } - if ($not_entities_body_links_dbpedia !== null) { - $queryParams['!entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_links_dbpedia); + if ($entitiesBodyType !== null) { + $queryParams['entities.body.type[]'] = $entitiesBodyType; } // query params - if ($sentiment_title_polarity !== null) { - $queryParams['sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_title_polarity); + if ($notEntitiesBodyType !== null) { + $queryParams['!entities.body.type[]'] = $notEntitiesBodyType; } // query params - if ($not_sentiment_title_polarity !== null) { - $queryParams['!sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_title_polarity); + if ($entitiesBodyLinksDbpedia !== null) { + $queryParams['entities.body.links.dbpedia[]'] = $entitiesBodyLinksDbpedia; } // query params - if ($sentiment_body_polarity !== null) { - $queryParams['sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_body_polarity); + if ($notEntitiesBodyLinksDbpedia !== null) { + $queryParams['!entities.body.links.dbpedia[]'] = $notEntitiesBodyLinksDbpedia; } // query params - if ($not_sentiment_body_polarity !== null) { - $queryParams['!sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_body_polarity); + if ($sentimentTitlePolarity !== null) { + $queryParams['sentiment.title.polarity'] = $sentimentTitlePolarity; } // query params - if ($media_images_count_min !== null) { - $queryParams['media.images.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_min); + if ($notSentimentTitlePolarity !== null) { + $queryParams['!sentiment.title.polarity'] = $notSentimentTitlePolarity; } // query params - if ($media_images_count_max !== null) { - $queryParams['media.images.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_max); + if ($sentimentBodyPolarity !== null) { + $queryParams['sentiment.body.polarity'] = $sentimentBodyPolarity; } // query params - if ($media_images_width_min !== null) { - $queryParams['media.images.width.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_min); + if ($notSentimentBodyPolarity !== null) { + $queryParams['!sentiment.body.polarity'] = $notSentimentBodyPolarity; } // query params - if ($media_images_width_max !== null) { - $queryParams['media.images.width.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_max); + if ($mediaImagesCountMin !== null) { + $queryParams['media.images.count.min'] = $mediaImagesCountMin; } // query params - if ($media_images_height_min !== null) { - $queryParams['media.images.height.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_min); + if ($mediaImagesCountMax !== null) { + $queryParams['media.images.count.max'] = $mediaImagesCountMax; } // query params - if ($media_images_height_max !== null) { - $queryParams['media.images.height.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_max); + if ($mediaImagesWidthMin !== null) { + $queryParams['media.images.width.min'] = $mediaImagesWidthMin; } // query params - if ($media_images_content_length_min !== null) { - $queryParams['media.images.content_length.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_min); + if ($mediaImagesWidthMax !== null) { + $queryParams['media.images.width.max'] = $mediaImagesWidthMax; } // query params - if ($media_images_content_length_max !== null) { - $queryParams['media.images.content_length.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_max); + if ($mediaImagesHeightMin !== null) { + $queryParams['media.images.height.min'] = $mediaImagesHeightMin; } // query params - if (is_array($media_images_format)) { - $media_images_format = $this->apiClient->getSerializer()->serializeCollection($media_images_format, 'multi', true); - } - if ($media_images_format !== null) { - $queryParams['media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($media_images_format); + if ($mediaImagesHeightMax !== null) { + $queryParams['media.images.height.max'] = $mediaImagesHeightMax; } // query params - if (is_array($not_media_images_format)) { - $not_media_images_format = $this->apiClient->getSerializer()->serializeCollection($not_media_images_format, 'multi', true); - } - if ($not_media_images_format !== null) { - $queryParams['!media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($not_media_images_format); + if ($mediaImagesContentLengthMin !== null) { + $queryParams['media.images.content_length.min'] = $mediaImagesContentLengthMin; } // query params - if ($media_videos_count_min !== null) { - $queryParams['media.videos.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_min); + if ($mediaImagesContentLengthMax !== null) { + $queryParams['media.images.content_length.max'] = $mediaImagesContentLengthMax; } // query params - if ($media_videos_count_max !== null) { - $queryParams['media.videos.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_max); + if ($mediaImagesFormat !== null) { + $queryParams['media.images.format[]'] = $mediaImagesFormat; } // query params - if (is_array($author_id)) { - $author_id = $this->apiClient->getSerializer()->serializeCollection($author_id, 'multi', true); - } - if ($author_id !== null) { - $queryParams['author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($author_id); + if ($notMediaImagesFormat !== null) { + $queryParams['!media.images.format[]'] = $notMediaImagesFormat; } // query params - if (is_array($not_author_id)) { - $not_author_id = $this->apiClient->getSerializer()->serializeCollection($not_author_id, 'multi', true); - } - if ($not_author_id !== null) { - $queryParams['!author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_author_id); + if ($mediaVideosCountMin !== null) { + $queryParams['media.videos.count.min'] = $mediaVideosCountMin; } // query params - if ($author_name !== null) { - $queryParams['author.name'] = $this->apiClient->getSerializer()->toQueryValue($author_name); + if ($mediaVideosCountMax !== null) { + $queryParams['media.videos.count.max'] = $mediaVideosCountMax; } // query params - if ($not_author_name !== null) { - $queryParams['!author.name'] = $this->apiClient->getSerializer()->toQueryValue($not_author_name); + if ($authorId !== null) { + $queryParams['author.id[]'] = $authorId; } // query params - if (is_array($source_id)) { - $source_id = $this->apiClient->getSerializer()->serializeCollection($source_id, 'multi', true); - } - if ($source_id !== null) { - $queryParams['source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($source_id); + if ($notAuthorId !== null) { + $queryParams['!author.id[]'] = $notAuthorId; } // query params - if (is_array($not_source_id)) { - $not_source_id = $this->apiClient->getSerializer()->serializeCollection($not_source_id, 'multi', true); - } - if ($not_source_id !== null) { - $queryParams['!source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_id); + if ($authorName !== null) { + $queryParams['author.name'] = $authorName; } // query params - if (is_array($source_name)) { - $source_name = $this->apiClient->getSerializer()->serializeCollection($source_name, 'multi', true); - } - if ($source_name !== null) { - $queryParams['source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($source_name); + if ($notAuthorName !== null) { + $queryParams['!author.name'] = $notAuthorName; } // query params - if (is_array($not_source_name)) { - $not_source_name = $this->apiClient->getSerializer()->serializeCollection($not_source_name, 'multi', true); - } - if ($not_source_name !== null) { - $queryParams['!source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_name); + if ($sourceId !== null) { + $queryParams['source.id[]'] = $sourceId; } // query params - if (is_array($source_domain)) { - $source_domain = $this->apiClient->getSerializer()->serializeCollection($source_domain, 'multi', true); - } - if ($source_domain !== null) { - $queryParams['source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($source_domain); + if ($notSourceId !== null) { + $queryParams['!source.id[]'] = $notSourceId; } // query params - if (is_array($not_source_domain)) { - $not_source_domain = $this->apiClient->getSerializer()->serializeCollection($not_source_domain, 'multi', true); - } - if ($not_source_domain !== null) { - $queryParams['!source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_domain); + if ($sourceName !== null) { + $queryParams['source.name[]'] = $sourceName; } // query params - if (is_array($source_locations_country)) { - $source_locations_country = $this->apiClient->getSerializer()->serializeCollection($source_locations_country, 'multi', true); - } - if ($source_locations_country !== null) { - $queryParams['source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_country); + if ($notSourceName !== null) { + $queryParams['!source.name[]'] = $notSourceName; } // query params - if (is_array($not_source_locations_country)) { - $not_source_locations_country = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_country, 'multi', true); - } - if ($not_source_locations_country !== null) { - $queryParams['!source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_country); + if ($sourceDomain !== null) { + $queryParams['source.domain[]'] = $sourceDomain; } // query params - if (is_array($source_locations_state)) { - $source_locations_state = $this->apiClient->getSerializer()->serializeCollection($source_locations_state, 'multi', true); - } - if ($source_locations_state !== null) { - $queryParams['source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_state); + if ($notSourceDomain !== null) { + $queryParams['!source.domain[]'] = $notSourceDomain; } // query params - if (is_array($not_source_locations_state)) { - $not_source_locations_state = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_state, 'multi', true); - } - if ($not_source_locations_state !== null) { - $queryParams['!source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_state); + if ($sourceLocationsCountry !== null) { + $queryParams['source.locations.country[]'] = $sourceLocationsCountry; } // query params - if (is_array($source_locations_city)) { - $source_locations_city = $this->apiClient->getSerializer()->serializeCollection($source_locations_city, 'multi', true); - } - if ($source_locations_city !== null) { - $queryParams['source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_city); + if ($notSourceLocationsCountry !== null) { + $queryParams['!source.locations.country[]'] = $notSourceLocationsCountry; } // query params - if (is_array($not_source_locations_city)) { - $not_source_locations_city = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_city, 'multi', true); - } - if ($not_source_locations_city !== null) { - $queryParams['!source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_city); + if ($sourceLocationsState !== null) { + $queryParams['source.locations.state[]'] = $sourceLocationsState; } // query params - if (is_array($source_scopes_country)) { - $source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($source_scopes_country, 'multi', true); - } - if ($source_scopes_country !== null) { - $queryParams['source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_country); + if ($notSourceLocationsState !== null) { + $queryParams['!source.locations.state[]'] = $notSourceLocationsState; } // query params - if (is_array($not_source_scopes_country)) { - $not_source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_country, 'multi', true); - } - if ($not_source_scopes_country !== null) { - $queryParams['!source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_country); + if ($sourceLocationsCity !== null) { + $queryParams['source.locations.city[]'] = $sourceLocationsCity; } // query params - if (is_array($source_scopes_state)) { - $source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($source_scopes_state, 'multi', true); - } - if ($source_scopes_state !== null) { - $queryParams['source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_state); + if ($notSourceLocationsCity !== null) { + $queryParams['!source.locations.city[]'] = $notSourceLocationsCity; } // query params - if (is_array($not_source_scopes_state)) { - $not_source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_state, 'multi', true); - } - if ($not_source_scopes_state !== null) { - $queryParams['!source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_state); + if ($sourceScopesCountry !== null) { + $queryParams['source.scopes.country[]'] = $sourceScopesCountry; } // query params - if (is_array($source_scopes_city)) { - $source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($source_scopes_city, 'multi', true); - } - if ($source_scopes_city !== null) { - $queryParams['source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_city); + if ($notSourceScopesCountry !== null) { + $queryParams['!source.scopes.country[]'] = $notSourceScopesCountry; } // query params - if (is_array($not_source_scopes_city)) { - $not_source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_city, 'multi', true); - } - if ($not_source_scopes_city !== null) { - $queryParams['!source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_city); + if ($sourceScopesState !== null) { + $queryParams['source.scopes.state[]'] = $sourceScopesState; } // query params - if (is_array($source_scopes_level)) { - $source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($source_scopes_level, 'multi', true); - } - if ($source_scopes_level !== null) { - $queryParams['source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_level); + if ($notSourceScopesState !== null) { + $queryParams['!source.scopes.state[]'] = $notSourceScopesState; } // query params - if (is_array($not_source_scopes_level)) { - $not_source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_level, 'multi', true); - } - if ($not_source_scopes_level !== null) { - $queryParams['!source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_level); + if ($sourceScopesCity !== null) { + $queryParams['source.scopes.city[]'] = $sourceScopesCity; } // query params - if ($source_links_in_count_min !== null) { - $queryParams['source.links_in_count.min'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_min); + if ($notSourceScopesCity !== null) { + $queryParams['!source.scopes.city[]'] = $notSourceScopesCity; } // query params - if ($source_links_in_count_max !== null) { - $queryParams['source.links_in_count.max'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_max); + if ($sourceScopesLevel !== null) { + $queryParams['source.scopes.level[]'] = $sourceScopesLevel; } // query params - if ($source_rankings_alexa_rank_min !== null) { - $queryParams['source.rankings.alexa.rank.min'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_min); + if ($notSourceScopesLevel !== null) { + $queryParams['!source.scopes.level[]'] = $notSourceScopesLevel; } // query params - if ($source_rankings_alexa_rank_max !== null) { - $queryParams['source.rankings.alexa.rank.max'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_max); + if ($sourceLinksInCountMin !== null) { + $queryParams['source.links_in_count.min'] = $sourceLinksInCountMin; } // query params - if (is_array($source_rankings_alexa_country)) { - $source_rankings_alexa_country = $this->apiClient->getSerializer()->serializeCollection($source_rankings_alexa_country, 'multi', true); + if ($sourceLinksInCountMax !== null) { + $queryParams['source.links_in_count.max'] = $sourceLinksInCountMax; } - if ($source_rankings_alexa_country !== null) { - $queryParams['source.rankings.alexa.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_country); + // query params + if ($sourceRankingsAlexaRankMin !== null) { + $queryParams['source.rankings.alexa.rank.min'] = $sourceRankingsAlexaRankMin; } // query params - if ($social_shares_count_facebook_min !== null) { - $queryParams['social_shares_count.facebook.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_min); + if ($sourceRankingsAlexaRankMax !== null) { + $queryParams['source.rankings.alexa.rank.max'] = $sourceRankingsAlexaRankMax; } // query params - if ($social_shares_count_facebook_max !== null) { - $queryParams['social_shares_count.facebook.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_max); + if ($sourceRankingsAlexaCountry !== null) { + $queryParams['source.rankings.alexa.country[]'] = $sourceRankingsAlexaCountry; } // query params - if ($social_shares_count_google_plus_min !== null) { - $queryParams['social_shares_count.google_plus.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_min); + if ($socialSharesCountFacebookMin !== null) { + $queryParams['social_shares_count.facebook.min'] = $socialSharesCountFacebookMin; } // query params - if ($social_shares_count_google_plus_max !== null) { - $queryParams['social_shares_count.google_plus.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_max); + if ($socialSharesCountFacebookMax !== null) { + $queryParams['social_shares_count.facebook.max'] = $socialSharesCountFacebookMax; } // query params - if ($social_shares_count_linkedin_min !== null) { - $queryParams['social_shares_count.linkedin.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_min); + if ($socialSharesCountGooglePlusMin !== null) { + $queryParams['social_shares_count.google_plus.min'] = $socialSharesCountGooglePlusMin; } // query params - if ($social_shares_count_linkedin_max !== null) { - $queryParams['social_shares_count.linkedin.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_max); + if ($socialSharesCountGooglePlusMax !== null) { + $queryParams['social_shares_count.google_plus.max'] = $socialSharesCountGooglePlusMax; } // query params - if ($social_shares_count_reddit_min !== null) { - $queryParams['social_shares_count.reddit.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_min); + if ($socialSharesCountLinkedinMin !== null) { + $queryParams['social_shares_count.linkedin.min'] = $socialSharesCountLinkedinMin; } // query params - if ($social_shares_count_reddit_max !== null) { - $queryParams['social_shares_count.reddit.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_max); + if ($socialSharesCountLinkedinMax !== null) { + $queryParams['social_shares_count.linkedin.max'] = $socialSharesCountLinkedinMax; } // query params - if ($cluster !== null) { - $queryParams['cluster'] = $this->apiClient->getSerializer()->toQueryValue($cluster); + if ($socialSharesCountRedditMin !== null) { + $queryParams['social_shares_count.reddit.min'] = $socialSharesCountRedditMin; } // query params - if ($cluster_algorithm !== null) { - $queryParams['cluster.algorithm'] = $this->apiClient->getSerializer()->toQueryValue($cluster_algorithm); + if ($socialSharesCountRedditMax !== null) { + $queryParams['social_shares_count.reddit.max'] = $socialSharesCountRedditMax; } // query params - if (is_array($return)) { - $return = $this->apiClient->getSerializer()->serializeCollection($return, 'multi', true); + if ($clusters !== null) { + $queryParams['clusters[]'] = $clusters; } + // query params if ($return !== null) { - $queryParams['return[]'] = $this->apiClient->getSerializer()->toQueryValue($return); + $queryParams['return[]'] = $return; } // query params - if ($sort_by !== null) { - $queryParams['sort_by'] = $this->apiClient->getSerializer()->toQueryValue($sort_by); + if ($sortBy !== null) { + $queryParams['sort_by'] = $sortBy; } // query params - if ($sort_direction !== null) { - $queryParams['sort_direction'] = $this->apiClient->getSerializer()->toQueryValue($sort_direction); + if ($sortDirection !== null) { + $queryParams['sort_direction'] = $sortDirection; } // query params if ($cursor !== null) { - $queryParams['cursor'] = $this->apiClient->getSerializer()->toQueryValue($cursor); + $queryParams['cursor'] = $cursor; } // query params - if ($per_page !== null) { - $queryParams['per_page'] = $this->apiClient->getSerializer()->toQueryValue($per_page); + if ($perPage !== null) { + $queryParams['per_page'] = $perPage; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } } + // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listTimeSeries + * + * List time series + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW-7DAYS/DAY') + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW/DAY') + * @param string $period The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). (optional, default to '+1DAY') + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\TimeSeriesList|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors + */ + public function listTimeSeries($associative_array) + { + list($response) = $this->listTimeSeriesWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listTimeSeriesWithHttpInfo + * + * List time series + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW-7DAYS/DAY') + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW/DAY') + * @param string $period The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). (optional, default to '+1DAY') + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\TimeSeriesList|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listTimeSeriesWithHttpInfo($associative_array) + { + $request = $this->listTimeSeriesRequest($associative_array); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Aylien\NewsApi\Models\Stories', - '/stories' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\TimeSeriesList' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\TimeSeriesList', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\TimeSeriesList'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\Aylien\NewsApi\Models\Stories', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Stories', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\TimeSeriesList', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listTimeSeries + * Operation listTimeSeriesAsync * * List time series * - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return \Aylien\NewsApi\Models\TimeSeriesList + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW-7DAYS/DAY') + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW/DAY') + * @param string $period The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). (optional, default to '+1DAY') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTimeSeries($opts = array()) + public function listTimeSeriesAsync($associative_array) { - list($response) = $this->listTimeSeriesWithHttpInfo($opts); - return $response; + return $this->listTimeSeriesAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listTimeSeriesWithHttpInfo + * Operation listTimeSeriesAsyncWithHttpInfo * * List time series * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW-7DAYS/DAY') + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW/DAY') + * @param string $period The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). (optional, default to '+1DAY') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTimeSeriesAsyncWithHttpInfo($associative_array) + { + $returnType = '\Aylien\NewsApi\Models\TimeSeriesList'; + $request = $this->listTimeSeriesRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } - * - * - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return array of \Aylien\NewsApi\Models\TimeSeriesList, HTTP status code, HTTP response headers (array of strings) + /** + * Create request for operation 'listTimeSeries' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW-7DAYS/DAY') + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional, default to 'NOW/DAY') + * @param string $period The size of each date range is expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math). (optional, default to '+1DAY') + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function listTimeSeriesWithHttpInfo($opts = array()) + protected function listTimeSeriesRequest($associative_array) { - // define parameters - $id = (!empty($opts['id']) ? $opts['id'] : null); - $not_id = (!empty($opts['not_id']) ? $opts['not_id'] : null); - $title = (!empty($opts['title']) ? $opts['title'] : null); - $body = (!empty($opts['body']) ? $opts['body'] : null); - $text = (!empty($opts['text']) ? $opts['text'] : null); - $language = (!empty($opts['language']) ? $opts['language'] : null); - $not_language = (!empty($opts['not_language']) ? $opts['not_language'] : null); - $categories_taxonomy = (!empty($opts['categories_taxonomy']) ? $opts['categories_taxonomy'] : null); - $categories_confident = (!empty($opts['categories_confident']) ? $opts['categories_confident'] : null); - $categories_id = (!empty($opts['categories_id']) ? $opts['categories_id'] : null); - $not_categories_id = (!empty($opts['not_categories_id']) ? $opts['not_categories_id'] : null); - $categories_level = (!empty($opts['categories_level']) ? $opts['categories_level'] : null); - $not_categories_level = (!empty($opts['not_categories_level']) ? $opts['not_categories_level'] : null); - $entities_title_text = (!empty($opts['entities_title_text']) ? $opts['entities_title_text'] : null); - $not_entities_title_text = (!empty($opts['not_entities_title_text']) ? $opts['not_entities_title_text'] : null); - $entities_title_type = (!empty($opts['entities_title_type']) ? $opts['entities_title_type'] : null); - $not_entities_title_type = (!empty($opts['not_entities_title_type']) ? $opts['not_entities_title_type'] : null); - $entities_title_links_dbpedia = (!empty($opts['entities_title_links_dbpedia']) ? $opts['entities_title_links_dbpedia'] : null); - $not_entities_title_links_dbpedia = (!empty($opts['not_entities_title_links_dbpedia']) ? $opts['not_entities_title_links_dbpedia'] : null); - $entities_body_text = (!empty($opts['entities_body_text']) ? $opts['entities_body_text'] : null); - $not_entities_body_text = (!empty($opts['not_entities_body_text']) ? $opts['not_entities_body_text'] : null); - $entities_body_type = (!empty($opts['entities_body_type']) ? $opts['entities_body_type'] : null); - $not_entities_body_type = (!empty($opts['not_entities_body_type']) ? $opts['not_entities_body_type'] : null); - $entities_body_links_dbpedia = (!empty($opts['entities_body_links_dbpedia']) ? $opts['entities_body_links_dbpedia'] : null); - $not_entities_body_links_dbpedia = (!empty($opts['not_entities_body_links_dbpedia']) ? $opts['not_entities_body_links_dbpedia'] : null); - $sentiment_title_polarity = (!empty($opts['sentiment_title_polarity']) ? $opts['sentiment_title_polarity'] : null); - $not_sentiment_title_polarity = (!empty($opts['not_sentiment_title_polarity']) ? $opts['not_sentiment_title_polarity'] : null); - $sentiment_body_polarity = (!empty($opts['sentiment_body_polarity']) ? $opts['sentiment_body_polarity'] : null); - $not_sentiment_body_polarity = (!empty($opts['not_sentiment_body_polarity']) ? $opts['not_sentiment_body_polarity'] : null); - $media_images_count_min = (!empty($opts['media_images_count_min']) ? $opts['media_images_count_min'] : null); - $media_images_count_max = (!empty($opts['media_images_count_max']) ? $opts['media_images_count_max'] : null); - $media_images_width_min = (!empty($opts['media_images_width_min']) ? $opts['media_images_width_min'] : null); - $media_images_width_max = (!empty($opts['media_images_width_max']) ? $opts['media_images_width_max'] : null); - $media_images_height_min = (!empty($opts['media_images_height_min']) ? $opts['media_images_height_min'] : null); - $media_images_height_max = (!empty($opts['media_images_height_max']) ? $opts['media_images_height_max'] : null); - $media_images_content_length_min = (!empty($opts['media_images_content_length_min']) ? $opts['media_images_content_length_min'] : null); - $media_images_content_length_max = (!empty($opts['media_images_content_length_max']) ? $opts['media_images_content_length_max'] : null); - $media_images_format = (!empty($opts['media_images_format']) ? $opts['media_images_format'] : null); - $not_media_images_format = (!empty($opts['not_media_images_format']) ? $opts['not_media_images_format'] : null); - $media_videos_count_min = (!empty($opts['media_videos_count_min']) ? $opts['media_videos_count_min'] : null); - $media_videos_count_max = (!empty($opts['media_videos_count_max']) ? $opts['media_videos_count_max'] : null); - $author_id = (!empty($opts['author_id']) ? $opts['author_id'] : null); - $not_author_id = (!empty($opts['not_author_id']) ? $opts['not_author_id'] : null); - $author_name = (!empty($opts['author_name']) ? $opts['author_name'] : null); - $not_author_name = (!empty($opts['not_author_name']) ? $opts['not_author_name'] : null); - $source_id = (!empty($opts['source_id']) ? $opts['source_id'] : null); - $not_source_id = (!empty($opts['not_source_id']) ? $opts['not_source_id'] : null); - $source_name = (!empty($opts['source_name']) ? $opts['source_name'] : null); - $not_source_name = (!empty($opts['not_source_name']) ? $opts['not_source_name'] : null); - $source_domain = (!empty($opts['source_domain']) ? $opts['source_domain'] : null); - $not_source_domain = (!empty($opts['not_source_domain']) ? $opts['not_source_domain'] : null); - $source_locations_country = (!empty($opts['source_locations_country']) ? $opts['source_locations_country'] : null); - $not_source_locations_country = (!empty($opts['not_source_locations_country']) ? $opts['not_source_locations_country'] : null); - $source_locations_state = (!empty($opts['source_locations_state']) ? $opts['source_locations_state'] : null); - $not_source_locations_state = (!empty($opts['not_source_locations_state']) ? $opts['not_source_locations_state'] : null); - $source_locations_city = (!empty($opts['source_locations_city']) ? $opts['source_locations_city'] : null); - $not_source_locations_city = (!empty($opts['not_source_locations_city']) ? $opts['not_source_locations_city'] : null); - $source_scopes_country = (!empty($opts['source_scopes_country']) ? $opts['source_scopes_country'] : null); - $not_source_scopes_country = (!empty($opts['not_source_scopes_country']) ? $opts['not_source_scopes_country'] : null); - $source_scopes_state = (!empty($opts['source_scopes_state']) ? $opts['source_scopes_state'] : null); - $not_source_scopes_state = (!empty($opts['not_source_scopes_state']) ? $opts['not_source_scopes_state'] : null); - $source_scopes_city = (!empty($opts['source_scopes_city']) ? $opts['source_scopes_city'] : null); - $not_source_scopes_city = (!empty($opts['not_source_scopes_city']) ? $opts['not_source_scopes_city'] : null); - $source_scopes_level = (!empty($opts['source_scopes_level']) ? $opts['source_scopes_level'] : null); - $not_source_scopes_level = (!empty($opts['not_source_scopes_level']) ? $opts['not_source_scopes_level'] : null); - $source_links_in_count_min = (!empty($opts['source_links_in_count_min']) ? $opts['source_links_in_count_min'] : null); - $source_links_in_count_max = (!empty($opts['source_links_in_count_max']) ? $opts['source_links_in_count_max'] : null); - $source_rankings_alexa_rank_min = (!empty($opts['source_rankings_alexa_rank_min']) ? $opts['source_rankings_alexa_rank_min'] : null); - $source_rankings_alexa_rank_max = (!empty($opts['source_rankings_alexa_rank_max']) ? $opts['source_rankings_alexa_rank_max'] : null); - $source_rankings_alexa_country = (!empty($opts['source_rankings_alexa_country']) ? $opts['source_rankings_alexa_country'] : null); - $social_shares_count_facebook_min = (!empty($opts['social_shares_count_facebook_min']) ? $opts['social_shares_count_facebook_min'] : null); - $social_shares_count_facebook_max = (!empty($opts['social_shares_count_facebook_max']) ? $opts['social_shares_count_facebook_max'] : null); - $social_shares_count_google_plus_min = (!empty($opts['social_shares_count_google_plus_min']) ? $opts['social_shares_count_google_plus_min'] : null); - $social_shares_count_google_plus_max = (!empty($opts['social_shares_count_google_plus_max']) ? $opts['social_shares_count_google_plus_max'] : null); - $social_shares_count_linkedin_min = (!empty($opts['social_shares_count_linkedin_min']) ? $opts['social_shares_count_linkedin_min'] : null); - $social_shares_count_linkedin_max = (!empty($opts['social_shares_count_linkedin_max']) ? $opts['social_shares_count_linkedin_max'] : null); - $social_shares_count_reddit_min = (!empty($opts['social_shares_count_reddit_min']) ? $opts['social_shares_count_reddit_min'] : null); - $social_shares_count_reddit_max = (!empty($opts['social_shares_count_reddit_max']) ? $opts['social_shares_count_reddit_max'] : null); - $published_at_start = (!empty($opts['published_at_start']) ? $opts['published_at_start'] : null); - $published_at_end = (!empty($opts['published_at_end']) ? $opts['published_at_end'] : null); - $period = (!empty($opts['period']) ? $opts['period'] : null); - if (!is_null($media_images_count_min) && ($media_images_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + // unbox the parameters from the associative array + $id = array_key_exists('id', $associative_array) ? $associative_array['id'] : null; + $notId = array_key_exists('notId', $associative_array) ? $associative_array['notId'] : null; + $title = array_key_exists('title', $associative_array) ? $associative_array['title'] : null; + $body = array_key_exists('body', $associative_array) ? $associative_array['body'] : null; + $text = array_key_exists('text', $associative_array) ? $associative_array['text'] : null; + $translationsEnTitle = array_key_exists('translationsEnTitle', $associative_array) ? $associative_array['translationsEnTitle'] : null; + $translationsEnBody = array_key_exists('translationsEnBody', $associative_array) ? $associative_array['translationsEnBody'] : null; + $translationsEnText = array_key_exists('translationsEnText', $associative_array) ? $associative_array['translationsEnText'] : null; + $language = array_key_exists('language', $associative_array) ? $associative_array['language'] : null; + $notLanguage = array_key_exists('notLanguage', $associative_array) ? $associative_array['notLanguage'] : null; + $categoriesTaxonomy = array_key_exists('categoriesTaxonomy', $associative_array) ? $associative_array['categoriesTaxonomy'] : null; + $categoriesConfident = array_key_exists('categoriesConfident', $associative_array) ? $associative_array['categoriesConfident'] : true; + $categoriesId = array_key_exists('categoriesId', $associative_array) ? $associative_array['categoriesId'] : null; + $notCategoriesId = array_key_exists('notCategoriesId', $associative_array) ? $associative_array['notCategoriesId'] : null; + $categoriesLevel = array_key_exists('categoriesLevel', $associative_array) ? $associative_array['categoriesLevel'] : null; + $notCategoriesLevel = array_key_exists('notCategoriesLevel', $associative_array) ? $associative_array['notCategoriesLevel'] : null; + $entitiesTitleText = array_key_exists('entitiesTitleText', $associative_array) ? $associative_array['entitiesTitleText'] : null; + $notEntitiesTitleText = array_key_exists('notEntitiesTitleText', $associative_array) ? $associative_array['notEntitiesTitleText'] : null; + $entitiesTitleType = array_key_exists('entitiesTitleType', $associative_array) ? $associative_array['entitiesTitleType'] : null; + $notEntitiesTitleType = array_key_exists('notEntitiesTitleType', $associative_array) ? $associative_array['notEntitiesTitleType'] : null; + $entitiesTitleLinksDbpedia = array_key_exists('entitiesTitleLinksDbpedia', $associative_array) ? $associative_array['entitiesTitleLinksDbpedia'] : null; + $notEntitiesTitleLinksDbpedia = array_key_exists('notEntitiesTitleLinksDbpedia', $associative_array) ? $associative_array['notEntitiesTitleLinksDbpedia'] : null; + $entitiesBodyText = array_key_exists('entitiesBodyText', $associative_array) ? $associative_array['entitiesBodyText'] : null; + $notEntitiesBodyText = array_key_exists('notEntitiesBodyText', $associative_array) ? $associative_array['notEntitiesBodyText'] : null; + $entitiesBodyType = array_key_exists('entitiesBodyType', $associative_array) ? $associative_array['entitiesBodyType'] : null; + $notEntitiesBodyType = array_key_exists('notEntitiesBodyType', $associative_array) ? $associative_array['notEntitiesBodyType'] : null; + $entitiesBodyLinksDbpedia = array_key_exists('entitiesBodyLinksDbpedia', $associative_array) ? $associative_array['entitiesBodyLinksDbpedia'] : null; + $notEntitiesBodyLinksDbpedia = array_key_exists('notEntitiesBodyLinksDbpedia', $associative_array) ? $associative_array['notEntitiesBodyLinksDbpedia'] : null; + $sentimentTitlePolarity = array_key_exists('sentimentTitlePolarity', $associative_array) ? $associative_array['sentimentTitlePolarity'] : null; + $notSentimentTitlePolarity = array_key_exists('notSentimentTitlePolarity', $associative_array) ? $associative_array['notSentimentTitlePolarity'] : null; + $sentimentBodyPolarity = array_key_exists('sentimentBodyPolarity', $associative_array) ? $associative_array['sentimentBodyPolarity'] : null; + $notSentimentBodyPolarity = array_key_exists('notSentimentBodyPolarity', $associative_array) ? $associative_array['notSentimentBodyPolarity'] : null; + $mediaImagesCountMin = array_key_exists('mediaImagesCountMin', $associative_array) ? $associative_array['mediaImagesCountMin'] : null; + $mediaImagesCountMax = array_key_exists('mediaImagesCountMax', $associative_array) ? $associative_array['mediaImagesCountMax'] : null; + $mediaImagesWidthMin = array_key_exists('mediaImagesWidthMin', $associative_array) ? $associative_array['mediaImagesWidthMin'] : null; + $mediaImagesWidthMax = array_key_exists('mediaImagesWidthMax', $associative_array) ? $associative_array['mediaImagesWidthMax'] : null; + $mediaImagesHeightMin = array_key_exists('mediaImagesHeightMin', $associative_array) ? $associative_array['mediaImagesHeightMin'] : null; + $mediaImagesHeightMax = array_key_exists('mediaImagesHeightMax', $associative_array) ? $associative_array['mediaImagesHeightMax'] : null; + $mediaImagesContentLengthMin = array_key_exists('mediaImagesContentLengthMin', $associative_array) ? $associative_array['mediaImagesContentLengthMin'] : null; + $mediaImagesContentLengthMax = array_key_exists('mediaImagesContentLengthMax', $associative_array) ? $associative_array['mediaImagesContentLengthMax'] : null; + $mediaImagesFormat = array_key_exists('mediaImagesFormat', $associative_array) ? $associative_array['mediaImagesFormat'] : null; + $notMediaImagesFormat = array_key_exists('notMediaImagesFormat', $associative_array) ? $associative_array['notMediaImagesFormat'] : null; + $mediaVideosCountMin = array_key_exists('mediaVideosCountMin', $associative_array) ? $associative_array['mediaVideosCountMin'] : null; + $mediaVideosCountMax = array_key_exists('mediaVideosCountMax', $associative_array) ? $associative_array['mediaVideosCountMax'] : null; + $authorId = array_key_exists('authorId', $associative_array) ? $associative_array['authorId'] : null; + $notAuthorId = array_key_exists('notAuthorId', $associative_array) ? $associative_array['notAuthorId'] : null; + $authorName = array_key_exists('authorName', $associative_array) ? $associative_array['authorName'] : null; + $notAuthorName = array_key_exists('notAuthorName', $associative_array) ? $associative_array['notAuthorName'] : null; + $sourceId = array_key_exists('sourceId', $associative_array) ? $associative_array['sourceId'] : null; + $notSourceId = array_key_exists('notSourceId', $associative_array) ? $associative_array['notSourceId'] : null; + $sourceName = array_key_exists('sourceName', $associative_array) ? $associative_array['sourceName'] : null; + $notSourceName = array_key_exists('notSourceName', $associative_array) ? $associative_array['notSourceName'] : null; + $sourceDomain = array_key_exists('sourceDomain', $associative_array) ? $associative_array['sourceDomain'] : null; + $notSourceDomain = array_key_exists('notSourceDomain', $associative_array) ? $associative_array['notSourceDomain'] : null; + $sourceLocationsCountry = array_key_exists('sourceLocationsCountry', $associative_array) ? $associative_array['sourceLocationsCountry'] : null; + $notSourceLocationsCountry = array_key_exists('notSourceLocationsCountry', $associative_array) ? $associative_array['notSourceLocationsCountry'] : null; + $sourceLocationsState = array_key_exists('sourceLocationsState', $associative_array) ? $associative_array['sourceLocationsState'] : null; + $notSourceLocationsState = array_key_exists('notSourceLocationsState', $associative_array) ? $associative_array['notSourceLocationsState'] : null; + $sourceLocationsCity = array_key_exists('sourceLocationsCity', $associative_array) ? $associative_array['sourceLocationsCity'] : null; + $notSourceLocationsCity = array_key_exists('notSourceLocationsCity', $associative_array) ? $associative_array['notSourceLocationsCity'] : null; + $sourceScopesCountry = array_key_exists('sourceScopesCountry', $associative_array) ? $associative_array['sourceScopesCountry'] : null; + $notSourceScopesCountry = array_key_exists('notSourceScopesCountry', $associative_array) ? $associative_array['notSourceScopesCountry'] : null; + $sourceScopesState = array_key_exists('sourceScopesState', $associative_array) ? $associative_array['sourceScopesState'] : null; + $notSourceScopesState = array_key_exists('notSourceScopesState', $associative_array) ? $associative_array['notSourceScopesState'] : null; + $sourceScopesCity = array_key_exists('sourceScopesCity', $associative_array) ? $associative_array['sourceScopesCity'] : null; + $notSourceScopesCity = array_key_exists('notSourceScopesCity', $associative_array) ? $associative_array['notSourceScopesCity'] : null; + $sourceScopesLevel = array_key_exists('sourceScopesLevel', $associative_array) ? $associative_array['sourceScopesLevel'] : null; + $notSourceScopesLevel = array_key_exists('notSourceScopesLevel', $associative_array) ? $associative_array['notSourceScopesLevel'] : null; + $sourceLinksInCountMin = array_key_exists('sourceLinksInCountMin', $associative_array) ? $associative_array['sourceLinksInCountMin'] : null; + $sourceLinksInCountMax = array_key_exists('sourceLinksInCountMax', $associative_array) ? $associative_array['sourceLinksInCountMax'] : null; + $sourceRankingsAlexaRankMin = array_key_exists('sourceRankingsAlexaRankMin', $associative_array) ? $associative_array['sourceRankingsAlexaRankMin'] : null; + $sourceRankingsAlexaRankMax = array_key_exists('sourceRankingsAlexaRankMax', $associative_array) ? $associative_array['sourceRankingsAlexaRankMax'] : null; + $sourceRankingsAlexaCountry = array_key_exists('sourceRankingsAlexaCountry', $associative_array) ? $associative_array['sourceRankingsAlexaCountry'] : null; + $socialSharesCountFacebookMin = array_key_exists('socialSharesCountFacebookMin', $associative_array) ? $associative_array['socialSharesCountFacebookMin'] : null; + $socialSharesCountFacebookMax = array_key_exists('socialSharesCountFacebookMax', $associative_array) ? $associative_array['socialSharesCountFacebookMax'] : null; + $socialSharesCountGooglePlusMin = array_key_exists('socialSharesCountGooglePlusMin', $associative_array) ? $associative_array['socialSharesCountGooglePlusMin'] : null; + $socialSharesCountGooglePlusMax = array_key_exists('socialSharesCountGooglePlusMax', $associative_array) ? $associative_array['socialSharesCountGooglePlusMax'] : null; + $socialSharesCountLinkedinMin = array_key_exists('socialSharesCountLinkedinMin', $associative_array) ? $associative_array['socialSharesCountLinkedinMin'] : null; + $socialSharesCountLinkedinMax = array_key_exists('socialSharesCountLinkedinMax', $associative_array) ? $associative_array['socialSharesCountLinkedinMax'] : null; + $socialSharesCountRedditMin = array_key_exists('socialSharesCountRedditMin', $associative_array) ? $associative_array['socialSharesCountRedditMin'] : null; + $socialSharesCountRedditMax = array_key_exists('socialSharesCountRedditMax', $associative_array) ? $associative_array['socialSharesCountRedditMax'] : null; + $publishedAtStart = array_key_exists('publishedAtStart', $associative_array) ? $associative_array['publishedAtStart'] : 'NOW-7DAYS/DAY'; + $publishedAtEnd = array_key_exists('publishedAtEnd', $associative_array) ? $associative_array['publishedAtEnd'] : 'NOW/DAY'; + $period = array_key_exists('period', $associative_array) ? $associative_array['period'] : '+1DAY'; + + if ($mediaImagesCountMin !== null && $mediaImagesCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_images_count_max) && ($media_images_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaImagesCountMax !== null && $mediaImagesCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_images_width_min) && ($media_images_width_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaImagesWidthMin !== null && $mediaImagesWidthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_images_width_max) && ($media_images_width_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaImagesWidthMax !== null && $mediaImagesWidthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_images_height_min) && ($media_images_height_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaImagesHeightMin !== null && $mediaImagesHeightMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_images_height_max) && ($media_images_height_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaImagesHeightMax !== null && $mediaImagesHeightMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_images_content_length_min) && ($media_images_content_length_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaImagesContentLengthMin !== null && $mediaImagesContentLengthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_images_content_length_max) && ($media_images_content_length_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaImagesContentLengthMax !== null && $mediaImagesContentLengthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_videos_count_min) && ($media_videos_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaVideosCountMin !== null && $mediaVideosCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($media_videos_count_max) && ($media_videos_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($mediaVideosCountMax !== null && $mediaVideosCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($source_links_in_count_min) && ($source_links_in_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($sourceLinksInCountMin !== null && $sourceLinksInCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($source_links_in_count_max) && ($source_links_in_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($sourceLinksInCountMax !== null && $sourceLinksInCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_min) && ($source_rankings_alexa_rank_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMin !== null && $sourceRankingsAlexaRankMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_max) && ($source_rankings_alexa_rank_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMax !== null && $sourceRankingsAlexaRankMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_min) && ($social_shares_count_facebook_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountFacebookMin !== null && $socialSharesCountFacebookMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_max) && ($social_shares_count_facebook_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountFacebookMax !== null && $socialSharesCountFacebookMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_min) && ($social_shares_count_google_plus_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMin !== null && $socialSharesCountGooglePlusMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_max) && ($social_shares_count_google_plus_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMax !== null && $socialSharesCountGooglePlusMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_min) && ($social_shares_count_linkedin_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountLinkedinMin !== null && $socialSharesCountLinkedinMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_max) && ($social_shares_count_linkedin_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountLinkedinMax !== null && $socialSharesCountLinkedinMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_min) && ($social_shares_count_reddit_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_min" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountRedditMin !== null && $socialSharesCountRedditMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMin" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_max) && ($social_shares_count_reddit_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_max" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); + if ($socialSharesCountRedditMax !== null && $socialSharesCountRedditMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMax" when calling DefaultApi.listTimeSeries, must be bigger than 0.'); } - // parse inputs - $resourcePath = "/time_series"; - $httpBody = ''; + + $resourcePath = '/time_series'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/xml']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + $httpBody = ''; + $multipart = false; // query params - if (is_array($id)) { - $id = $this->apiClient->getSerializer()->serializeCollection($id, 'multi', true); - } if ($id !== null) { - $queryParams['id[]'] = $this->apiClient->getSerializer()->toQueryValue($id); + $queryParams['id[]'] = $id; } // query params - if (is_array($not_id)) { - $not_id = $this->apiClient->getSerializer()->serializeCollection($not_id, 'multi', true); - } - if ($not_id !== null) { - $queryParams['!id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_id); + if ($notId !== null) { + $queryParams['!id[]'] = $notId; } // query params if ($title !== null) { - $queryParams['title'] = $this->apiClient->getSerializer()->toQueryValue($title); + $queryParams['title'] = $title; } // query params if ($body !== null) { - $queryParams['body'] = $this->apiClient->getSerializer()->toQueryValue($body); + $queryParams['body'] = $body; } // query params if ($text !== null) { - $queryParams['text'] = $this->apiClient->getSerializer()->toQueryValue($text); + $queryParams['text'] = $text; } // query params - if (is_array($language)) { - $language = $this->apiClient->getSerializer()->serializeCollection($language, 'multi', true); - } - if ($language !== null) { - $queryParams['language[]'] = $this->apiClient->getSerializer()->toQueryValue($language); + if ($translationsEnTitle !== null) { + $queryParams['translations.en.title'] = $translationsEnTitle; } // query params - if (is_array($not_language)) { - $not_language = $this->apiClient->getSerializer()->serializeCollection($not_language, 'multi', true); - } - if ($not_language !== null) { - $queryParams['!language[]'] = $this->apiClient->getSerializer()->toQueryValue($not_language); + if ($translationsEnBody !== null) { + $queryParams['translations.en.body'] = $translationsEnBody; } // query params - if ($categories_taxonomy !== null) { - $queryParams['categories.taxonomy'] = $this->apiClient->getSerializer()->toQueryValue($categories_taxonomy); + if ($translationsEnText !== null) { + $queryParams['translations.en.text'] = $translationsEnText; } // query params - if ($categories_confident !== null) { - $queryParams['categories.confident'] = $this->apiClient->getSerializer()->toQueryValue($categories_confident); + if ($language !== null) { + $queryParams['language[]'] = $language; } // query params - if (is_array($categories_id)) { - $categories_id = $this->apiClient->getSerializer()->serializeCollection($categories_id, 'multi', true); - } - if ($categories_id !== null) { - $queryParams['categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_id); + if ($notLanguage !== null) { + $queryParams['!language[]'] = $notLanguage; } // query params - if (is_array($not_categories_id)) { - $not_categories_id = $this->apiClient->getSerializer()->serializeCollection($not_categories_id, 'multi', true); - } - if ($not_categories_id !== null) { - $queryParams['!categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_id); + if ($categoriesTaxonomy !== null) { + $queryParams['categories.taxonomy'] = $categoriesTaxonomy; } // query params - if (is_array($categories_level)) { - $categories_level = $this->apiClient->getSerializer()->serializeCollection($categories_level, 'multi', true); - } - if ($categories_level !== null) { - $queryParams['categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_level); + if ($categoriesConfident !== null) { + $queryParams['categories.confident'] = $categoriesConfident; } // query params - if (is_array($not_categories_level)) { - $not_categories_level = $this->apiClient->getSerializer()->serializeCollection($not_categories_level, 'multi', true); - } - if ($not_categories_level !== null) { - $queryParams['!categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_level); + if ($categoriesId !== null) { + $queryParams['categories.id[]'] = $categoriesId; } // query params - if (is_array($entities_title_text)) { - $entities_title_text = $this->apiClient->getSerializer()->serializeCollection($entities_title_text, 'multi', true); - } - if ($entities_title_text !== null) { - $queryParams['entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_text); + if ($notCategoriesId !== null) { + $queryParams['!categories.id[]'] = $notCategoriesId; } // query params - if (is_array($not_entities_title_text)) { - $not_entities_title_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_text, 'multi', true); - } - if ($not_entities_title_text !== null) { - $queryParams['!entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_text); + if ($categoriesLevel !== null) { + $queryParams['categories.level[]'] = $categoriesLevel; } // query params - if (is_array($entities_title_type)) { - $entities_title_type = $this->apiClient->getSerializer()->serializeCollection($entities_title_type, 'multi', true); - } - if ($entities_title_type !== null) { - $queryParams['entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_type); + if ($notCategoriesLevel !== null) { + $queryParams['!categories.level[]'] = $notCategoriesLevel; } // query params - if (is_array($not_entities_title_type)) { - $not_entities_title_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_type, 'multi', true); - } - if ($not_entities_title_type !== null) { - $queryParams['!entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_type); + if ($entitiesTitleText !== null) { + $queryParams['entities.title.text[]'] = $entitiesTitleText; } // query params - if (is_array($entities_title_links_dbpedia)) { - $entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_title_links_dbpedia, 'multi', true); - } - if ($entities_title_links_dbpedia !== null) { - $queryParams['entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_links_dbpedia); + if ($notEntitiesTitleText !== null) { + $queryParams['!entities.title.text[]'] = $notEntitiesTitleText; } // query params - if (is_array($not_entities_title_links_dbpedia)) { - $not_entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_links_dbpedia, 'multi', true); - } - if ($not_entities_title_links_dbpedia !== null) { - $queryParams['!entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_links_dbpedia); + if ($entitiesTitleType !== null) { + $queryParams['entities.title.type[]'] = $entitiesTitleType; } // query params - if (is_array($entities_body_text)) { - $entities_body_text = $this->apiClient->getSerializer()->serializeCollection($entities_body_text, 'multi', true); - } - if ($entities_body_text !== null) { - $queryParams['entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_text); + if ($notEntitiesTitleType !== null) { + $queryParams['!entities.title.type[]'] = $notEntitiesTitleType; } // query params - if (is_array($not_entities_body_text)) { - $not_entities_body_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_text, 'multi', true); - } - if ($not_entities_body_text !== null) { - $queryParams['!entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_text); + if ($entitiesTitleLinksDbpedia !== null) { + $queryParams['entities.title.links.dbpedia[]'] = $entitiesTitleLinksDbpedia; } // query params - if (is_array($entities_body_type)) { - $entities_body_type = $this->apiClient->getSerializer()->serializeCollection($entities_body_type, 'multi', true); - } - if ($entities_body_type !== null) { - $queryParams['entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_type); + if ($notEntitiesTitleLinksDbpedia !== null) { + $queryParams['!entities.title.links.dbpedia[]'] = $notEntitiesTitleLinksDbpedia; } // query params - if (is_array($not_entities_body_type)) { - $not_entities_body_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_type, 'multi', true); - } - if ($not_entities_body_type !== null) { - $queryParams['!entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_type); + if ($entitiesBodyText !== null) { + $queryParams['entities.body.text[]'] = $entitiesBodyText; } // query params - if (is_array($entities_body_links_dbpedia)) { - $entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_body_links_dbpedia, 'multi', true); - } - if ($entities_body_links_dbpedia !== null) { - $queryParams['entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_links_dbpedia); + if ($notEntitiesBodyText !== null) { + $queryParams['!entities.body.text[]'] = $notEntitiesBodyText; } // query params - if (is_array($not_entities_body_links_dbpedia)) { - $not_entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_links_dbpedia, 'multi', true); - } - if ($not_entities_body_links_dbpedia !== null) { - $queryParams['!entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_links_dbpedia); + if ($entitiesBodyType !== null) { + $queryParams['entities.body.type[]'] = $entitiesBodyType; } // query params - if ($sentiment_title_polarity !== null) { - $queryParams['sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_title_polarity); + if ($notEntitiesBodyType !== null) { + $queryParams['!entities.body.type[]'] = $notEntitiesBodyType; } // query params - if ($not_sentiment_title_polarity !== null) { - $queryParams['!sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_title_polarity); + if ($entitiesBodyLinksDbpedia !== null) { + $queryParams['entities.body.links.dbpedia[]'] = $entitiesBodyLinksDbpedia; } // query params - if ($sentiment_body_polarity !== null) { - $queryParams['sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_body_polarity); + if ($notEntitiesBodyLinksDbpedia !== null) { + $queryParams['!entities.body.links.dbpedia[]'] = $notEntitiesBodyLinksDbpedia; } // query params - if ($not_sentiment_body_polarity !== null) { - $queryParams['!sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_body_polarity); + if ($sentimentTitlePolarity !== null) { + $queryParams['sentiment.title.polarity'] = $sentimentTitlePolarity; } // query params - if ($media_images_count_min !== null) { - $queryParams['media.images.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_min); + if ($notSentimentTitlePolarity !== null) { + $queryParams['!sentiment.title.polarity'] = $notSentimentTitlePolarity; } // query params - if ($media_images_count_max !== null) { - $queryParams['media.images.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_max); + if ($sentimentBodyPolarity !== null) { + $queryParams['sentiment.body.polarity'] = $sentimentBodyPolarity; } // query params - if ($media_images_width_min !== null) { - $queryParams['media.images.width.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_min); + if ($notSentimentBodyPolarity !== null) { + $queryParams['!sentiment.body.polarity'] = $notSentimentBodyPolarity; } // query params - if ($media_images_width_max !== null) { - $queryParams['media.images.width.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_max); + if ($mediaImagesCountMin !== null) { + $queryParams['media.images.count.min'] = $mediaImagesCountMin; } // query params - if ($media_images_height_min !== null) { - $queryParams['media.images.height.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_min); + if ($mediaImagesCountMax !== null) { + $queryParams['media.images.count.max'] = $mediaImagesCountMax; } // query params - if ($media_images_height_max !== null) { - $queryParams['media.images.height.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_max); + if ($mediaImagesWidthMin !== null) { + $queryParams['media.images.width.min'] = $mediaImagesWidthMin; } // query params - if ($media_images_content_length_min !== null) { - $queryParams['media.images.content_length.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_min); + if ($mediaImagesWidthMax !== null) { + $queryParams['media.images.width.max'] = $mediaImagesWidthMax; } // query params - if ($media_images_content_length_max !== null) { - $queryParams['media.images.content_length.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_max); + if ($mediaImagesHeightMin !== null) { + $queryParams['media.images.height.min'] = $mediaImagesHeightMin; } // query params - if (is_array($media_images_format)) { - $media_images_format = $this->apiClient->getSerializer()->serializeCollection($media_images_format, 'multi', true); - } - if ($media_images_format !== null) { - $queryParams['media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($media_images_format); + if ($mediaImagesHeightMax !== null) { + $queryParams['media.images.height.max'] = $mediaImagesHeightMax; } // query params - if (is_array($not_media_images_format)) { - $not_media_images_format = $this->apiClient->getSerializer()->serializeCollection($not_media_images_format, 'multi', true); - } - if ($not_media_images_format !== null) { - $queryParams['!media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($not_media_images_format); + if ($mediaImagesContentLengthMin !== null) { + $queryParams['media.images.content_length.min'] = $mediaImagesContentLengthMin; } // query params - if ($media_videos_count_min !== null) { - $queryParams['media.videos.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_min); + if ($mediaImagesContentLengthMax !== null) { + $queryParams['media.images.content_length.max'] = $mediaImagesContentLengthMax; } // query params - if ($media_videos_count_max !== null) { - $queryParams['media.videos.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_max); + if ($mediaImagesFormat !== null) { + $queryParams['media.images.format[]'] = $mediaImagesFormat; } // query params - if (is_array($author_id)) { - $author_id = $this->apiClient->getSerializer()->serializeCollection($author_id, 'multi', true); - } - if ($author_id !== null) { - $queryParams['author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($author_id); + if ($notMediaImagesFormat !== null) { + $queryParams['!media.images.format[]'] = $notMediaImagesFormat; } // query params - if (is_array($not_author_id)) { - $not_author_id = $this->apiClient->getSerializer()->serializeCollection($not_author_id, 'multi', true); - } - if ($not_author_id !== null) { - $queryParams['!author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_author_id); + if ($mediaVideosCountMin !== null) { + $queryParams['media.videos.count.min'] = $mediaVideosCountMin; } // query params - if ($author_name !== null) { - $queryParams['author.name'] = $this->apiClient->getSerializer()->toQueryValue($author_name); + if ($mediaVideosCountMax !== null) { + $queryParams['media.videos.count.max'] = $mediaVideosCountMax; } // query params - if ($not_author_name !== null) { - $queryParams['!author.name'] = $this->apiClient->getSerializer()->toQueryValue($not_author_name); + if ($authorId !== null) { + $queryParams['author.id[]'] = $authorId; } // query params - if (is_array($source_id)) { - $source_id = $this->apiClient->getSerializer()->serializeCollection($source_id, 'multi', true); - } - if ($source_id !== null) { - $queryParams['source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($source_id); + if ($notAuthorId !== null) { + $queryParams['!author.id[]'] = $notAuthorId; } // query params - if (is_array($not_source_id)) { - $not_source_id = $this->apiClient->getSerializer()->serializeCollection($not_source_id, 'multi', true); - } - if ($not_source_id !== null) { - $queryParams['!source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_id); + if ($authorName !== null) { + $queryParams['author.name'] = $authorName; } // query params - if (is_array($source_name)) { - $source_name = $this->apiClient->getSerializer()->serializeCollection($source_name, 'multi', true); - } - if ($source_name !== null) { - $queryParams['source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($source_name); + if ($notAuthorName !== null) { + $queryParams['!author.name'] = $notAuthorName; } // query params - if (is_array($not_source_name)) { - $not_source_name = $this->apiClient->getSerializer()->serializeCollection($not_source_name, 'multi', true); - } - if ($not_source_name !== null) { - $queryParams['!source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_name); + if ($sourceId !== null) { + $queryParams['source.id[]'] = $sourceId; } // query params - if (is_array($source_domain)) { - $source_domain = $this->apiClient->getSerializer()->serializeCollection($source_domain, 'multi', true); - } - if ($source_domain !== null) { - $queryParams['source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($source_domain); + if ($notSourceId !== null) { + $queryParams['!source.id[]'] = $notSourceId; } // query params - if (is_array($not_source_domain)) { - $not_source_domain = $this->apiClient->getSerializer()->serializeCollection($not_source_domain, 'multi', true); - } - if ($not_source_domain !== null) { - $queryParams['!source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_domain); + if ($sourceName !== null) { + $queryParams['source.name[]'] = $sourceName; } // query params - if (is_array($source_locations_country)) { - $source_locations_country = $this->apiClient->getSerializer()->serializeCollection($source_locations_country, 'multi', true); - } - if ($source_locations_country !== null) { - $queryParams['source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_country); + if ($notSourceName !== null) { + $queryParams['!source.name[]'] = $notSourceName; } // query params - if (is_array($not_source_locations_country)) { - $not_source_locations_country = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_country, 'multi', true); - } - if ($not_source_locations_country !== null) { - $queryParams['!source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_country); + if ($sourceDomain !== null) { + $queryParams['source.domain[]'] = $sourceDomain; } // query params - if (is_array($source_locations_state)) { - $source_locations_state = $this->apiClient->getSerializer()->serializeCollection($source_locations_state, 'multi', true); - } - if ($source_locations_state !== null) { - $queryParams['source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_state); + if ($notSourceDomain !== null) { + $queryParams['!source.domain[]'] = $notSourceDomain; } // query params - if (is_array($not_source_locations_state)) { - $not_source_locations_state = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_state, 'multi', true); - } - if ($not_source_locations_state !== null) { - $queryParams['!source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_state); + if ($sourceLocationsCountry !== null) { + $queryParams['source.locations.country[]'] = $sourceLocationsCountry; } // query params - if (is_array($source_locations_city)) { - $source_locations_city = $this->apiClient->getSerializer()->serializeCollection($source_locations_city, 'multi', true); - } - if ($source_locations_city !== null) { - $queryParams['source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_city); + if ($notSourceLocationsCountry !== null) { + $queryParams['!source.locations.country[]'] = $notSourceLocationsCountry; } // query params - if (is_array($not_source_locations_city)) { - $not_source_locations_city = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_city, 'multi', true); - } - if ($not_source_locations_city !== null) { - $queryParams['!source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_city); + if ($sourceLocationsState !== null) { + $queryParams['source.locations.state[]'] = $sourceLocationsState; } // query params - if (is_array($source_scopes_country)) { - $source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($source_scopes_country, 'multi', true); - } - if ($source_scopes_country !== null) { - $queryParams['source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_country); + if ($notSourceLocationsState !== null) { + $queryParams['!source.locations.state[]'] = $notSourceLocationsState; } // query params - if (is_array($not_source_scopes_country)) { - $not_source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_country, 'multi', true); - } - if ($not_source_scopes_country !== null) { - $queryParams['!source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_country); + if ($sourceLocationsCity !== null) { + $queryParams['source.locations.city[]'] = $sourceLocationsCity; } // query params - if (is_array($source_scopes_state)) { - $source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($source_scopes_state, 'multi', true); - } - if ($source_scopes_state !== null) { - $queryParams['source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_state); + if ($notSourceLocationsCity !== null) { + $queryParams['!source.locations.city[]'] = $notSourceLocationsCity; } // query params - if (is_array($not_source_scopes_state)) { - $not_source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_state, 'multi', true); - } - if ($not_source_scopes_state !== null) { - $queryParams['!source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_state); + if ($sourceScopesCountry !== null) { + $queryParams['source.scopes.country[]'] = $sourceScopesCountry; } // query params - if (is_array($source_scopes_city)) { - $source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($source_scopes_city, 'multi', true); - } - if ($source_scopes_city !== null) { - $queryParams['source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_city); + if ($notSourceScopesCountry !== null) { + $queryParams['!source.scopes.country[]'] = $notSourceScopesCountry; } // query params - if (is_array($not_source_scopes_city)) { - $not_source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_city, 'multi', true); - } - if ($not_source_scopes_city !== null) { - $queryParams['!source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_city); + if ($sourceScopesState !== null) { + $queryParams['source.scopes.state[]'] = $sourceScopesState; } // query params - if (is_array($source_scopes_level)) { - $source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($source_scopes_level, 'multi', true); + if ($notSourceScopesState !== null) { + $queryParams['!source.scopes.state[]'] = $notSourceScopesState; } - if ($source_scopes_level !== null) { - $queryParams['source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_level); + // query params + if ($sourceScopesCity !== null) { + $queryParams['source.scopes.city[]'] = $sourceScopesCity; } // query params - if (is_array($not_source_scopes_level)) { - $not_source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_level, 'multi', true); + if ($notSourceScopesCity !== null) { + $queryParams['!source.scopes.city[]'] = $notSourceScopesCity; } - if ($not_source_scopes_level !== null) { - $queryParams['!source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_level); + // query params + if ($sourceScopesLevel !== null) { + $queryParams['source.scopes.level[]'] = $sourceScopesLevel; } // query params - if ($source_links_in_count_min !== null) { - $queryParams['source.links_in_count.min'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_min); + if ($notSourceScopesLevel !== null) { + $queryParams['!source.scopes.level[]'] = $notSourceScopesLevel; } // query params - if ($source_links_in_count_max !== null) { - $queryParams['source.links_in_count.max'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_max); + if ($sourceLinksInCountMin !== null) { + $queryParams['source.links_in_count.min'] = $sourceLinksInCountMin; } // query params - if ($source_rankings_alexa_rank_min !== null) { - $queryParams['source.rankings.alexa.rank.min'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_min); + if ($sourceLinksInCountMax !== null) { + $queryParams['source.links_in_count.max'] = $sourceLinksInCountMax; } // query params - if ($source_rankings_alexa_rank_max !== null) { - $queryParams['source.rankings.alexa.rank.max'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_max); + if ($sourceRankingsAlexaRankMin !== null) { + $queryParams['source.rankings.alexa.rank.min'] = $sourceRankingsAlexaRankMin; } // query params - if (is_array($source_rankings_alexa_country)) { - $source_rankings_alexa_country = $this->apiClient->getSerializer()->serializeCollection($source_rankings_alexa_country, 'multi', true); + if ($sourceRankingsAlexaRankMax !== null) { + $queryParams['source.rankings.alexa.rank.max'] = $sourceRankingsAlexaRankMax; } - if ($source_rankings_alexa_country !== null) { - $queryParams['source.rankings.alexa.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_country); + // query params + if ($sourceRankingsAlexaCountry !== null) { + $queryParams['source.rankings.alexa.country[]'] = $sourceRankingsAlexaCountry; } // query params - if ($social_shares_count_facebook_min !== null) { - $queryParams['social_shares_count.facebook.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_min); + if ($socialSharesCountFacebookMin !== null) { + $queryParams['social_shares_count.facebook.min'] = $socialSharesCountFacebookMin; } // query params - if ($social_shares_count_facebook_max !== null) { - $queryParams['social_shares_count.facebook.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_max); + if ($socialSharesCountFacebookMax !== null) { + $queryParams['social_shares_count.facebook.max'] = $socialSharesCountFacebookMax; } // query params - if ($social_shares_count_google_plus_min !== null) { - $queryParams['social_shares_count.google_plus.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_min); + if ($socialSharesCountGooglePlusMin !== null) { + $queryParams['social_shares_count.google_plus.min'] = $socialSharesCountGooglePlusMin; } // query params - if ($social_shares_count_google_plus_max !== null) { - $queryParams['social_shares_count.google_plus.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_max); + if ($socialSharesCountGooglePlusMax !== null) { + $queryParams['social_shares_count.google_plus.max'] = $socialSharesCountGooglePlusMax; } // query params - if ($social_shares_count_linkedin_min !== null) { - $queryParams['social_shares_count.linkedin.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_min); + if ($socialSharesCountLinkedinMin !== null) { + $queryParams['social_shares_count.linkedin.min'] = $socialSharesCountLinkedinMin; } // query params - if ($social_shares_count_linkedin_max !== null) { - $queryParams['social_shares_count.linkedin.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_max); + if ($socialSharesCountLinkedinMax !== null) { + $queryParams['social_shares_count.linkedin.max'] = $socialSharesCountLinkedinMax; } // query params - if ($social_shares_count_reddit_min !== null) { - $queryParams['social_shares_count.reddit.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_min); + if ($socialSharesCountRedditMin !== null) { + $queryParams['social_shares_count.reddit.min'] = $socialSharesCountRedditMin; } // query params - if ($social_shares_count_reddit_max !== null) { - $queryParams['social_shares_count.reddit.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_max); + if ($socialSharesCountRedditMax !== null) { + $queryParams['social_shares_count.reddit.max'] = $socialSharesCountRedditMax; } // query params - if ($published_at_start !== null) { - $queryParams['published_at.start'] = $this->apiClient->getSerializer()->toQueryValue($published_at_start); + if ($publishedAtStart !== null) { + $queryParams['published_at.start'] = $publishedAtStart; } // query params - if ($published_at_end !== null) { - $queryParams['published_at.end'] = $this->apiClient->getSerializer()->toQueryValue($published_at_end); + if ($publishedAtEnd !== null) { + $queryParams['published_at.end'] = $publishedAtEnd; } // query params if ($period !== null) { - $queryParams['period'] = $this->apiClient->getSerializer()->toQueryValue($period); + $queryParams['period'] = $period; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } } + // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - // make the API Call + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listTrends + * + * List trends + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $field This parameter is used to specify the trend field. (required) + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Aylien\NewsApi\Models\Trends|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors + */ + public function listTrends($associative_array) + { + list($response) = $this->listTrendsWithHttpInfo($associative_array); + return $response; + } + + /** + * Operation listTrendsWithHttpInfo + * + * List trends + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $field This parameter is used to specify the trend field. (required) + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * + * @throws \Aylien\NewsApi\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Aylien\NewsApi\Models\Trends|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors|\Aylien\NewsApi\Models\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listTrendsWithHttpInfo($associative_array) + { + $request = $this->listTrendsRequest($associative_array); + try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Aylien\NewsApi\Models\TimeSeriesList', - '/time_series' - ); + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Aylien\NewsApi\Models\Trends' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Trends', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not42: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case not49: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Aylien\NewsApi\Models\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, '\Aylien\NewsApi\Models\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Aylien\NewsApi\Models\Trends'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; - return [$this->apiClient->getSerializer()->deserialize($response, '\Aylien\NewsApi\Models\TimeSeriesList', $httpHeader), $statusCode, $httpHeader]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\TimeSeriesList', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Trends', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not42: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + case not49: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aylien\NewsApi\Models\Errors', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } - throw $e; } } /** - * Operation listTrends + * Operation listTrendsAsync * * List trends * - * - * - * @param string $field This parameter is used to specify the trend field. (required) - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return \Aylien\NewsApi\Models\Trends + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $field This parameter is used to specify the trend field. (required) + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTrends($field, $opts = array()) + public function listTrendsAsync($associative_array) { - list($response) = $this->listTrendsWithHttpInfo($field, $opts); - return $response; + return $this->listTrendsAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); } /** - * Operation listTrendsWithHttpInfo + * Operation listTrendsAsyncWithHttpInfo * * List trends * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $field This parameter is used to specify the trend field. (required) + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listTrendsAsyncWithHttpInfo($associative_array) + { + $returnType = '\Aylien\NewsApi\Models\Trends'; + $request = $this->listTrendsRequest($associative_array); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } - * - * - * @param string $field This parameter is used to specify the trend field. (required) - * @param array $opts (See above) - * @throws \Aylien\NewsApi\ApiException on non-2xx response - * @return array of \Aylien\NewsApi\Models\Trends, HTTP status code, HTTP response headers (array of strings) + /** + * Create request for operation 'listTrends' + * + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * + * @param string $field This parameter is used to specify the trend field. (required) + * @param int[] $id This parameter is used for finding stories by story id. (optional) + * @param int[] $notId This parameter is used for excluding stories by story id. (optional) + * @param string $title This parameter is used for finding stories whose title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $body This parameter is used for finding stories whose body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $text This parameter is used for finding stories whose title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnTitle This parameter is used for finding stories whose translation title contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnBody This parameter is used for finding stories whose translation body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string $translationsEnText This parameter is used for finding stories whose translation title or body contains a specific keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators). (optional) + * @param string[] $language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string[] $notLanguage This parameter is used for excluding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes. (optional) + * @param string $publishedAtStart This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $publishedAtEnd This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates). (optional) + * @param string $categoriesTaxonomy This parameter is used for defining the type of the taxonomy for the rest of the categories queries. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param bool $categoriesConfident This parameter is used for finding stories whose categories are confident. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional, default to true) + * @param string[] $categoriesId This parameter is used for finding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $notCategoriesId This parameter is used for excluding stories by categories id. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $categoriesLevel This parameter is used for finding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param int[] $notCategoriesLevel This parameter is used for excluding stories by categories level. You can read more about working with categories [here](https://newsapi.aylien.com/docs/working-with-categories). (optional) + * @param string[] $entitiesTitleText This parameter is used to find stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleText This parameter is used to exclude stories based on the specified entities `text` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleType This parameter is used to find stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleType This parameter is used to exclude stories based on the specified entities `type` in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesTitleLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesTitleLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in story titles. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyText This parameter is used to find stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyText This parameter is used to exclude stories based on the specified entities `text` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyType This parameter is used to find stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyType This parameter is used to exclude stories based on the specified entities `type` in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $entitiesBodyLinksDbpedia This parameter is used to find stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string[] $notEntitiesBodyLinksDbpedia This parameter is used to exclude stories based on the specified entities dbpedia URL in the body of stories. You can read more about working with entities [here](https://newsapi.aylien.com/docs/working-with-entities). (optional) + * @param string $sentimentTitlePolarity This parameter is used for finding stories whose title sentiment is the specified value. (optional) + * @param string $notSentimentTitlePolarity This parameter is used for excluding stories whose title sentiment is the specified value. (optional) + * @param string $sentimentBodyPolarity This parameter is used for finding stories whose body sentiment is the specified value. (optional) + * @param string $notSentimentBodyPolarity This parameter is used for excluding stories whose body sentiment is the specified value. (optional) + * @param int $mediaImagesCountMin This parameter is used for finding stories whose number of images is greater than or equal to the specified value. (optional) + * @param int $mediaImagesCountMax This parameter is used for finding stories whose number of images is less than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMin This parameter is used for finding stories whose width of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesWidthMax This parameter is used for finding stories whose width of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMin This parameter is used for finding stories whose height of images are greater than or equal to the specified value. (optional) + * @param int $mediaImagesHeightMax This parameter is used for finding stories whose height of images are less than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMin This parameter is used for finding stories whose images content length are greater than or equal to the specified value. (optional) + * @param int $mediaImagesContentLengthMax This parameter is used for finding stories whose images content length are less than or equal to the specified value. (optional) + * @param string[] $mediaImagesFormat This parameter is used for finding stories whose images format are the specified value. (optional) + * @param string[] $notMediaImagesFormat This parameter is used for excluding stories whose images format are the specified value. (optional) + * @param int $mediaVideosCountMin This parameter is used for finding stories whose number of videos is greater than or equal to the specified value. (optional) + * @param int $mediaVideosCountMax This parameter is used for finding stories whose number of videos is less than or equal to the specified value. (optional) + * @param int[] $authorId This parameter is used for finding stories whose author id is the specified value. (optional) + * @param int[] $notAuthorId This parameter is used for excluding stories whose author id is the specified value. (optional) + * @param string $authorName This parameter is used for finding stories whose author full name contains the specified value. (optional) + * @param string $notAuthorName This parameter is used for excluding stories whose author full name contains the specified value. (optional) + * @param int[] $sourceId This parameter is used for finding stories whose source id is the specified value. (optional) + * @param int[] $notSourceId This parameter is used for excluding stories whose source id is the specified value. (optional) + * @param string[] $sourceName This parameter is used for finding stories whose source name contains the specified value. (optional) + * @param string[] $notSourceName This parameter is used for excluding stories whose source name contains the specified value. (optional) + * @param string[] $sourceDomain This parameter is used for finding stories whose source domain is the specified value. (optional) + * @param string[] $notSourceDomain This parameter is used for excluding stories whose source domain is the specified value. (optional) + * @param string[] $sourceLocationsCountry This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCountry This parameter is used for excluding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsState This parameter is used for finding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsState This parameter is used for excluding stories whose source state/province is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceLocationsCity This parameter is used for finding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceLocationsCity This parameter is used for excluding stories whose source city is the specified value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCountry This parameter is used for finding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCountry This parameter is used for excluding stories whose source scopes is the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesState This parameter is used for finding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesState This parameter is used for excluding stories whose source scopes is the specified state/province value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesCity This parameter is used for finding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesCity This parameter is used for excluding stories whose source scopes is the specified city value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $sourceScopesLevel This parameter is used for finding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param string[] $notSourceScopesLevel This parameter is used for excluding stories whose source scopes is the specified level value. [Here](https://newsapi.aylien.com/docs/working-with-locations) you can find more information about how [to work with locations](https://newsapi.aylien.com/docs/working-with-locations). (optional) + * @param int $sourceLinksInCountMin This parameter is used for finding stories from sources whose Links in count is greater than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceLinksInCountMax This parameter is used for finding stories from sources whose Links in count is less than or equal to the specified value. You can read more about working with Links in count [here](https://newsapi.aylien.com/docs/working-with-links-in-count). (optional) + * @param int $sourceRankingsAlexaRankMin This parameter is used for finding stories from sources whose Alexa rank is greater than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $sourceRankingsAlexaRankMax This parameter is used for finding stories from sources whose Alexa rank is less than or equal to the specified value. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param string[] $sourceRankingsAlexaCountry This parameter is used for finding stories from sources whose Alexa rank is in the specified country value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. You can read more about working with Alexa ranks [here](https://newsapi.aylien.com/docs/working-with-alexa-ranks). (optional) + * @param int $socialSharesCountFacebookMin This parameter is used for finding stories whose Facebook social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountFacebookMax This parameter is used for finding stories whose Facebook social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMin This parameter is used for finding stories whose Google+ social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountGooglePlusMax This parameter is used for finding stories whose Google+ social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMin This parameter is used for finding stories whose LinkedIn social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountLinkedinMax This parameter is used for finding stories whose LinkedIn social shares count is less than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMin This parameter is used for finding stories whose Reddit social shares count is greater than or equal to the specified value. (optional) + * @param int $socialSharesCountRedditMax This parameter is used for finding stories whose Reddit social shares count is less than or equal to the specified value. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function listTrendsWithHttpInfo($field, $opts = array()) + protected function listTrendsRequest($associative_array) { - // define parameters - $id = (!empty($opts['id']) ? $opts['id'] : null); - $not_id = (!empty($opts['not_id']) ? $opts['not_id'] : null); - $title = (!empty($opts['title']) ? $opts['title'] : null); - $body = (!empty($opts['body']) ? $opts['body'] : null); - $text = (!empty($opts['text']) ? $opts['text'] : null); - $language = (!empty($opts['language']) ? $opts['language'] : null); - $not_language = (!empty($opts['not_language']) ? $opts['not_language'] : null); - $published_at_start = (!empty($opts['published_at_start']) ? $opts['published_at_start'] : null); - $published_at_end = (!empty($opts['published_at_end']) ? $opts['published_at_end'] : null); - $categories_taxonomy = (!empty($opts['categories_taxonomy']) ? $opts['categories_taxonomy'] : null); - $categories_confident = (!empty($opts['categories_confident']) ? $opts['categories_confident'] : null); - $categories_id = (!empty($opts['categories_id']) ? $opts['categories_id'] : null); - $not_categories_id = (!empty($opts['not_categories_id']) ? $opts['not_categories_id'] : null); - $categories_level = (!empty($opts['categories_level']) ? $opts['categories_level'] : null); - $not_categories_level = (!empty($opts['not_categories_level']) ? $opts['not_categories_level'] : null); - $entities_title_text = (!empty($opts['entities_title_text']) ? $opts['entities_title_text'] : null); - $not_entities_title_text = (!empty($opts['not_entities_title_text']) ? $opts['not_entities_title_text'] : null); - $entities_title_type = (!empty($opts['entities_title_type']) ? $opts['entities_title_type'] : null); - $not_entities_title_type = (!empty($opts['not_entities_title_type']) ? $opts['not_entities_title_type'] : null); - $entities_title_links_dbpedia = (!empty($opts['entities_title_links_dbpedia']) ? $opts['entities_title_links_dbpedia'] : null); - $not_entities_title_links_dbpedia = (!empty($opts['not_entities_title_links_dbpedia']) ? $opts['not_entities_title_links_dbpedia'] : null); - $entities_body_text = (!empty($opts['entities_body_text']) ? $opts['entities_body_text'] : null); - $not_entities_body_text = (!empty($opts['not_entities_body_text']) ? $opts['not_entities_body_text'] : null); - $entities_body_type = (!empty($opts['entities_body_type']) ? $opts['entities_body_type'] : null); - $not_entities_body_type = (!empty($opts['not_entities_body_type']) ? $opts['not_entities_body_type'] : null); - $entities_body_links_dbpedia = (!empty($opts['entities_body_links_dbpedia']) ? $opts['entities_body_links_dbpedia'] : null); - $not_entities_body_links_dbpedia = (!empty($opts['not_entities_body_links_dbpedia']) ? $opts['not_entities_body_links_dbpedia'] : null); - $sentiment_title_polarity = (!empty($opts['sentiment_title_polarity']) ? $opts['sentiment_title_polarity'] : null); - $not_sentiment_title_polarity = (!empty($opts['not_sentiment_title_polarity']) ? $opts['not_sentiment_title_polarity'] : null); - $sentiment_body_polarity = (!empty($opts['sentiment_body_polarity']) ? $opts['sentiment_body_polarity'] : null); - $not_sentiment_body_polarity = (!empty($opts['not_sentiment_body_polarity']) ? $opts['not_sentiment_body_polarity'] : null); - $media_images_count_min = (!empty($opts['media_images_count_min']) ? $opts['media_images_count_min'] : null); - $media_images_count_max = (!empty($opts['media_images_count_max']) ? $opts['media_images_count_max'] : null); - $media_images_width_min = (!empty($opts['media_images_width_min']) ? $opts['media_images_width_min'] : null); - $media_images_width_max = (!empty($opts['media_images_width_max']) ? $opts['media_images_width_max'] : null); - $media_images_height_min = (!empty($opts['media_images_height_min']) ? $opts['media_images_height_min'] : null); - $media_images_height_max = (!empty($opts['media_images_height_max']) ? $opts['media_images_height_max'] : null); - $media_images_content_length_min = (!empty($opts['media_images_content_length_min']) ? $opts['media_images_content_length_min'] : null); - $media_images_content_length_max = (!empty($opts['media_images_content_length_max']) ? $opts['media_images_content_length_max'] : null); - $media_images_format = (!empty($opts['media_images_format']) ? $opts['media_images_format'] : null); - $not_media_images_format = (!empty($opts['not_media_images_format']) ? $opts['not_media_images_format'] : null); - $media_videos_count_min = (!empty($opts['media_videos_count_min']) ? $opts['media_videos_count_min'] : null); - $media_videos_count_max = (!empty($opts['media_videos_count_max']) ? $opts['media_videos_count_max'] : null); - $author_id = (!empty($opts['author_id']) ? $opts['author_id'] : null); - $not_author_id = (!empty($opts['not_author_id']) ? $opts['not_author_id'] : null); - $author_name = (!empty($opts['author_name']) ? $opts['author_name'] : null); - $not_author_name = (!empty($opts['not_author_name']) ? $opts['not_author_name'] : null); - $source_id = (!empty($opts['source_id']) ? $opts['source_id'] : null); - $not_source_id = (!empty($opts['not_source_id']) ? $opts['not_source_id'] : null); - $source_name = (!empty($opts['source_name']) ? $opts['source_name'] : null); - $not_source_name = (!empty($opts['not_source_name']) ? $opts['not_source_name'] : null); - $source_domain = (!empty($opts['source_domain']) ? $opts['source_domain'] : null); - $not_source_domain = (!empty($opts['not_source_domain']) ? $opts['not_source_domain'] : null); - $source_locations_country = (!empty($opts['source_locations_country']) ? $opts['source_locations_country'] : null); - $not_source_locations_country = (!empty($opts['not_source_locations_country']) ? $opts['not_source_locations_country'] : null); - $source_locations_state = (!empty($opts['source_locations_state']) ? $opts['source_locations_state'] : null); - $not_source_locations_state = (!empty($opts['not_source_locations_state']) ? $opts['not_source_locations_state'] : null); - $source_locations_city = (!empty($opts['source_locations_city']) ? $opts['source_locations_city'] : null); - $not_source_locations_city = (!empty($opts['not_source_locations_city']) ? $opts['not_source_locations_city'] : null); - $source_scopes_country = (!empty($opts['source_scopes_country']) ? $opts['source_scopes_country'] : null); - $not_source_scopes_country = (!empty($opts['not_source_scopes_country']) ? $opts['not_source_scopes_country'] : null); - $source_scopes_state = (!empty($opts['source_scopes_state']) ? $opts['source_scopes_state'] : null); - $not_source_scopes_state = (!empty($opts['not_source_scopes_state']) ? $opts['not_source_scopes_state'] : null); - $source_scopes_city = (!empty($opts['source_scopes_city']) ? $opts['source_scopes_city'] : null); - $not_source_scopes_city = (!empty($opts['not_source_scopes_city']) ? $opts['not_source_scopes_city'] : null); - $source_scopes_level = (!empty($opts['source_scopes_level']) ? $opts['source_scopes_level'] : null); - $not_source_scopes_level = (!empty($opts['not_source_scopes_level']) ? $opts['not_source_scopes_level'] : null); - $source_links_in_count_min = (!empty($opts['source_links_in_count_min']) ? $opts['source_links_in_count_min'] : null); - $source_links_in_count_max = (!empty($opts['source_links_in_count_max']) ? $opts['source_links_in_count_max'] : null); - $source_rankings_alexa_rank_min = (!empty($opts['source_rankings_alexa_rank_min']) ? $opts['source_rankings_alexa_rank_min'] : null); - $source_rankings_alexa_rank_max = (!empty($opts['source_rankings_alexa_rank_max']) ? $opts['source_rankings_alexa_rank_max'] : null); - $source_rankings_alexa_country = (!empty($opts['source_rankings_alexa_country']) ? $opts['source_rankings_alexa_country'] : null); - $social_shares_count_facebook_min = (!empty($opts['social_shares_count_facebook_min']) ? $opts['social_shares_count_facebook_min'] : null); - $social_shares_count_facebook_max = (!empty($opts['social_shares_count_facebook_max']) ? $opts['social_shares_count_facebook_max'] : null); - $social_shares_count_google_plus_min = (!empty($opts['social_shares_count_google_plus_min']) ? $opts['social_shares_count_google_plus_min'] : null); - $social_shares_count_google_plus_max = (!empty($opts['social_shares_count_google_plus_max']) ? $opts['social_shares_count_google_plus_max'] : null); - $social_shares_count_linkedin_min = (!empty($opts['social_shares_count_linkedin_min']) ? $opts['social_shares_count_linkedin_min'] : null); - $social_shares_count_linkedin_max = (!empty($opts['social_shares_count_linkedin_max']) ? $opts['social_shares_count_linkedin_max'] : null); - $social_shares_count_reddit_min = (!empty($opts['social_shares_count_reddit_min']) ? $opts['social_shares_count_reddit_min'] : null); - $social_shares_count_reddit_max = (!empty($opts['social_shares_count_reddit_max']) ? $opts['social_shares_count_reddit_max'] : null); + // unbox the parameters from the associative array + $field = array_key_exists('field', $associative_array) ? $associative_array['field'] : null; + $id = array_key_exists('id', $associative_array) ? $associative_array['id'] : null; + $notId = array_key_exists('notId', $associative_array) ? $associative_array['notId'] : null; + $title = array_key_exists('title', $associative_array) ? $associative_array['title'] : null; + $body = array_key_exists('body', $associative_array) ? $associative_array['body'] : null; + $text = array_key_exists('text', $associative_array) ? $associative_array['text'] : null; + $translationsEnTitle = array_key_exists('translationsEnTitle', $associative_array) ? $associative_array['translationsEnTitle'] : null; + $translationsEnBody = array_key_exists('translationsEnBody', $associative_array) ? $associative_array['translationsEnBody'] : null; + $translationsEnText = array_key_exists('translationsEnText', $associative_array) ? $associative_array['translationsEnText'] : null; + $language = array_key_exists('language', $associative_array) ? $associative_array['language'] : null; + $notLanguage = array_key_exists('notLanguage', $associative_array) ? $associative_array['notLanguage'] : null; + $publishedAtStart = array_key_exists('publishedAtStart', $associative_array) ? $associative_array['publishedAtStart'] : null; + $publishedAtEnd = array_key_exists('publishedAtEnd', $associative_array) ? $associative_array['publishedAtEnd'] : null; + $categoriesTaxonomy = array_key_exists('categoriesTaxonomy', $associative_array) ? $associative_array['categoriesTaxonomy'] : null; + $categoriesConfident = array_key_exists('categoriesConfident', $associative_array) ? $associative_array['categoriesConfident'] : true; + $categoriesId = array_key_exists('categoriesId', $associative_array) ? $associative_array['categoriesId'] : null; + $notCategoriesId = array_key_exists('notCategoriesId', $associative_array) ? $associative_array['notCategoriesId'] : null; + $categoriesLevel = array_key_exists('categoriesLevel', $associative_array) ? $associative_array['categoriesLevel'] : null; + $notCategoriesLevel = array_key_exists('notCategoriesLevel', $associative_array) ? $associative_array['notCategoriesLevel'] : null; + $entitiesTitleText = array_key_exists('entitiesTitleText', $associative_array) ? $associative_array['entitiesTitleText'] : null; + $notEntitiesTitleText = array_key_exists('notEntitiesTitleText', $associative_array) ? $associative_array['notEntitiesTitleText'] : null; + $entitiesTitleType = array_key_exists('entitiesTitleType', $associative_array) ? $associative_array['entitiesTitleType'] : null; + $notEntitiesTitleType = array_key_exists('notEntitiesTitleType', $associative_array) ? $associative_array['notEntitiesTitleType'] : null; + $entitiesTitleLinksDbpedia = array_key_exists('entitiesTitleLinksDbpedia', $associative_array) ? $associative_array['entitiesTitleLinksDbpedia'] : null; + $notEntitiesTitleLinksDbpedia = array_key_exists('notEntitiesTitleLinksDbpedia', $associative_array) ? $associative_array['notEntitiesTitleLinksDbpedia'] : null; + $entitiesBodyText = array_key_exists('entitiesBodyText', $associative_array) ? $associative_array['entitiesBodyText'] : null; + $notEntitiesBodyText = array_key_exists('notEntitiesBodyText', $associative_array) ? $associative_array['notEntitiesBodyText'] : null; + $entitiesBodyType = array_key_exists('entitiesBodyType', $associative_array) ? $associative_array['entitiesBodyType'] : null; + $notEntitiesBodyType = array_key_exists('notEntitiesBodyType', $associative_array) ? $associative_array['notEntitiesBodyType'] : null; + $entitiesBodyLinksDbpedia = array_key_exists('entitiesBodyLinksDbpedia', $associative_array) ? $associative_array['entitiesBodyLinksDbpedia'] : null; + $notEntitiesBodyLinksDbpedia = array_key_exists('notEntitiesBodyLinksDbpedia', $associative_array) ? $associative_array['notEntitiesBodyLinksDbpedia'] : null; + $sentimentTitlePolarity = array_key_exists('sentimentTitlePolarity', $associative_array) ? $associative_array['sentimentTitlePolarity'] : null; + $notSentimentTitlePolarity = array_key_exists('notSentimentTitlePolarity', $associative_array) ? $associative_array['notSentimentTitlePolarity'] : null; + $sentimentBodyPolarity = array_key_exists('sentimentBodyPolarity', $associative_array) ? $associative_array['sentimentBodyPolarity'] : null; + $notSentimentBodyPolarity = array_key_exists('notSentimentBodyPolarity', $associative_array) ? $associative_array['notSentimentBodyPolarity'] : null; + $mediaImagesCountMin = array_key_exists('mediaImagesCountMin', $associative_array) ? $associative_array['mediaImagesCountMin'] : null; + $mediaImagesCountMax = array_key_exists('mediaImagesCountMax', $associative_array) ? $associative_array['mediaImagesCountMax'] : null; + $mediaImagesWidthMin = array_key_exists('mediaImagesWidthMin', $associative_array) ? $associative_array['mediaImagesWidthMin'] : null; + $mediaImagesWidthMax = array_key_exists('mediaImagesWidthMax', $associative_array) ? $associative_array['mediaImagesWidthMax'] : null; + $mediaImagesHeightMin = array_key_exists('mediaImagesHeightMin', $associative_array) ? $associative_array['mediaImagesHeightMin'] : null; + $mediaImagesHeightMax = array_key_exists('mediaImagesHeightMax', $associative_array) ? $associative_array['mediaImagesHeightMax'] : null; + $mediaImagesContentLengthMin = array_key_exists('mediaImagesContentLengthMin', $associative_array) ? $associative_array['mediaImagesContentLengthMin'] : null; + $mediaImagesContentLengthMax = array_key_exists('mediaImagesContentLengthMax', $associative_array) ? $associative_array['mediaImagesContentLengthMax'] : null; + $mediaImagesFormat = array_key_exists('mediaImagesFormat', $associative_array) ? $associative_array['mediaImagesFormat'] : null; + $notMediaImagesFormat = array_key_exists('notMediaImagesFormat', $associative_array) ? $associative_array['notMediaImagesFormat'] : null; + $mediaVideosCountMin = array_key_exists('mediaVideosCountMin', $associative_array) ? $associative_array['mediaVideosCountMin'] : null; + $mediaVideosCountMax = array_key_exists('mediaVideosCountMax', $associative_array) ? $associative_array['mediaVideosCountMax'] : null; + $authorId = array_key_exists('authorId', $associative_array) ? $associative_array['authorId'] : null; + $notAuthorId = array_key_exists('notAuthorId', $associative_array) ? $associative_array['notAuthorId'] : null; + $authorName = array_key_exists('authorName', $associative_array) ? $associative_array['authorName'] : null; + $notAuthorName = array_key_exists('notAuthorName', $associative_array) ? $associative_array['notAuthorName'] : null; + $sourceId = array_key_exists('sourceId', $associative_array) ? $associative_array['sourceId'] : null; + $notSourceId = array_key_exists('notSourceId', $associative_array) ? $associative_array['notSourceId'] : null; + $sourceName = array_key_exists('sourceName', $associative_array) ? $associative_array['sourceName'] : null; + $notSourceName = array_key_exists('notSourceName', $associative_array) ? $associative_array['notSourceName'] : null; + $sourceDomain = array_key_exists('sourceDomain', $associative_array) ? $associative_array['sourceDomain'] : null; + $notSourceDomain = array_key_exists('notSourceDomain', $associative_array) ? $associative_array['notSourceDomain'] : null; + $sourceLocationsCountry = array_key_exists('sourceLocationsCountry', $associative_array) ? $associative_array['sourceLocationsCountry'] : null; + $notSourceLocationsCountry = array_key_exists('notSourceLocationsCountry', $associative_array) ? $associative_array['notSourceLocationsCountry'] : null; + $sourceLocationsState = array_key_exists('sourceLocationsState', $associative_array) ? $associative_array['sourceLocationsState'] : null; + $notSourceLocationsState = array_key_exists('notSourceLocationsState', $associative_array) ? $associative_array['notSourceLocationsState'] : null; + $sourceLocationsCity = array_key_exists('sourceLocationsCity', $associative_array) ? $associative_array['sourceLocationsCity'] : null; + $notSourceLocationsCity = array_key_exists('notSourceLocationsCity', $associative_array) ? $associative_array['notSourceLocationsCity'] : null; + $sourceScopesCountry = array_key_exists('sourceScopesCountry', $associative_array) ? $associative_array['sourceScopesCountry'] : null; + $notSourceScopesCountry = array_key_exists('notSourceScopesCountry', $associative_array) ? $associative_array['notSourceScopesCountry'] : null; + $sourceScopesState = array_key_exists('sourceScopesState', $associative_array) ? $associative_array['sourceScopesState'] : null; + $notSourceScopesState = array_key_exists('notSourceScopesState', $associative_array) ? $associative_array['notSourceScopesState'] : null; + $sourceScopesCity = array_key_exists('sourceScopesCity', $associative_array) ? $associative_array['sourceScopesCity'] : null; + $notSourceScopesCity = array_key_exists('notSourceScopesCity', $associative_array) ? $associative_array['notSourceScopesCity'] : null; + $sourceScopesLevel = array_key_exists('sourceScopesLevel', $associative_array) ? $associative_array['sourceScopesLevel'] : null; + $notSourceScopesLevel = array_key_exists('notSourceScopesLevel', $associative_array) ? $associative_array['notSourceScopesLevel'] : null; + $sourceLinksInCountMin = array_key_exists('sourceLinksInCountMin', $associative_array) ? $associative_array['sourceLinksInCountMin'] : null; + $sourceLinksInCountMax = array_key_exists('sourceLinksInCountMax', $associative_array) ? $associative_array['sourceLinksInCountMax'] : null; + $sourceRankingsAlexaRankMin = array_key_exists('sourceRankingsAlexaRankMin', $associative_array) ? $associative_array['sourceRankingsAlexaRankMin'] : null; + $sourceRankingsAlexaRankMax = array_key_exists('sourceRankingsAlexaRankMax', $associative_array) ? $associative_array['sourceRankingsAlexaRankMax'] : null; + $sourceRankingsAlexaCountry = array_key_exists('sourceRankingsAlexaCountry', $associative_array) ? $associative_array['sourceRankingsAlexaCountry'] : null; + $socialSharesCountFacebookMin = array_key_exists('socialSharesCountFacebookMin', $associative_array) ? $associative_array['socialSharesCountFacebookMin'] : null; + $socialSharesCountFacebookMax = array_key_exists('socialSharesCountFacebookMax', $associative_array) ? $associative_array['socialSharesCountFacebookMax'] : null; + $socialSharesCountGooglePlusMin = array_key_exists('socialSharesCountGooglePlusMin', $associative_array) ? $associative_array['socialSharesCountGooglePlusMin'] : null; + $socialSharesCountGooglePlusMax = array_key_exists('socialSharesCountGooglePlusMax', $associative_array) ? $associative_array['socialSharesCountGooglePlusMax'] : null; + $socialSharesCountLinkedinMin = array_key_exists('socialSharesCountLinkedinMin', $associative_array) ? $associative_array['socialSharesCountLinkedinMin'] : null; + $socialSharesCountLinkedinMax = array_key_exists('socialSharesCountLinkedinMax', $associative_array) ? $associative_array['socialSharesCountLinkedinMax'] : null; + $socialSharesCountRedditMin = array_key_exists('socialSharesCountRedditMin', $associative_array) ? $associative_array['socialSharesCountRedditMin'] : null; + $socialSharesCountRedditMax = array_key_exists('socialSharesCountRedditMax', $associative_array) ? $associative_array['socialSharesCountRedditMax'] : null; + // verify the required parameter 'field' is set - if ($field === null) { - throw new \InvalidArgumentException('Missing the required parameter $field when calling listTrends'); + if ($field === null || (is_array($field) && count($field) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $field when calling listTrends' + ); } - if (!is_null($media_images_count_min) && ($media_images_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesCountMin !== null && $mediaImagesCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_images_count_max) && ($media_images_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_count_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesCountMax !== null && $mediaImagesCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesCountMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_images_width_min) && ($media_images_width_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesWidthMin !== null && $mediaImagesWidthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_images_width_max) && ($media_images_width_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_width_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesWidthMax !== null && $mediaImagesWidthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesWidthMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_images_height_min) && ($media_images_height_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesHeightMin !== null && $mediaImagesHeightMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_images_height_max) && ($media_images_height_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_height_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesHeightMax !== null && $mediaImagesHeightMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesHeightMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_images_content_length_min) && ($media_images_content_length_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesContentLengthMin !== null && $mediaImagesContentLengthMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_images_content_length_max) && ($media_images_content_length_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_images_content_length_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaImagesContentLengthMax !== null && $mediaImagesContentLengthMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaImagesContentLengthMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_videos_count_min) && ($media_videos_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaVideosCountMin !== null && $mediaVideosCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($media_videos_count_max) && ($media_videos_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$media_videos_count_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($mediaVideosCountMax !== null && $mediaVideosCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$mediaVideosCountMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($source_links_in_count_min) && ($source_links_in_count_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($sourceLinksInCountMin !== null && $sourceLinksInCountMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($source_links_in_count_max) && ($source_links_in_count_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_links_in_count_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($sourceLinksInCountMax !== null && $sourceLinksInCountMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceLinksInCountMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_min) && ($source_rankings_alexa_rank_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMin !== null && $sourceRankingsAlexaRankMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($source_rankings_alexa_rank_max) && ($source_rankings_alexa_rank_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$source_rankings_alexa_rank_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($sourceRankingsAlexaRankMax !== null && $sourceRankingsAlexaRankMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$sourceRankingsAlexaRankMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_min) && ($social_shares_count_facebook_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountFacebookMin !== null && $socialSharesCountFacebookMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_facebook_max) && ($social_shares_count_facebook_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_facebook_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountFacebookMax !== null && $socialSharesCountFacebookMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountFacebookMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_min) && ($social_shares_count_google_plus_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMin !== null && $socialSharesCountGooglePlusMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_google_plus_max) && ($social_shares_count_google_plus_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_google_plus_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountGooglePlusMax !== null && $socialSharesCountGooglePlusMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountGooglePlusMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_min) && ($social_shares_count_linkedin_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountLinkedinMin !== null && $socialSharesCountLinkedinMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_linkedin_max) && ($social_shares_count_linkedin_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_linkedin_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountLinkedinMax !== null && $socialSharesCountLinkedinMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountLinkedinMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_min) && ($social_shares_count_reddit_min <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_min" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountRedditMin !== null && $socialSharesCountRedditMin <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMin" when calling DefaultApi.listTrends, must be bigger than 0.'); } - if (!is_null($social_shares_count_reddit_max) && ($social_shares_count_reddit_max <= 0)) { - throw new \InvalidArgumentException('invalid value for "$social_shares_count_reddit_max" when calling DefaultApi.listTrends, must be bigger than 0.'); + if ($socialSharesCountRedditMax !== null && $socialSharesCountRedditMax <= 0) { + throw new \InvalidArgumentException('invalid value for "$socialSharesCountRedditMax" when calling DefaultApi.listTrends, must be bigger than 0.'); } - // parse inputs - $resourcePath = "/trends"; - $httpBody = ''; + + $resourcePath = '/trends'; + $formParams = []; $queryParams = []; $headerParams = []; - $formParams = []; - $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'text/xml']); - if (!is_null($_header_accept)) { - $headerParams['Accept'] = $_header_accept; - } - $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/x-www-form-urlencoded']); + $httpBody = ''; + $multipart = false; // query params - if (is_array($id)) { - $id = $this->apiClient->getSerializer()->serializeCollection($id, 'multi', true); - } if ($id !== null) { - $queryParams['id[]'] = $this->apiClient->getSerializer()->toQueryValue($id); + $queryParams['id[]'] = $id; } // query params - if (is_array($not_id)) { - $not_id = $this->apiClient->getSerializer()->serializeCollection($not_id, 'multi', true); - } - if ($not_id !== null) { - $queryParams['!id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_id); + if ($notId !== null) { + $queryParams['!id[]'] = $notId; } // query params if ($title !== null) { - $queryParams['title'] = $this->apiClient->getSerializer()->toQueryValue($title); + $queryParams['title'] = $title; } // query params if ($body !== null) { - $queryParams['body'] = $this->apiClient->getSerializer()->toQueryValue($body); + $queryParams['body'] = $body; } // query params if ($text !== null) { - $queryParams['text'] = $this->apiClient->getSerializer()->toQueryValue($text); + $queryParams['text'] = $text; } // query params - if (is_array($language)) { - $language = $this->apiClient->getSerializer()->serializeCollection($language, 'multi', true); - } - if ($language !== null) { - $queryParams['language[]'] = $this->apiClient->getSerializer()->toQueryValue($language); + if ($translationsEnTitle !== null) { + $queryParams['translations.en.title'] = $translationsEnTitle; } // query params - if (is_array($not_language)) { - $not_language = $this->apiClient->getSerializer()->serializeCollection($not_language, 'multi', true); - } - if ($not_language !== null) { - $queryParams['!language[]'] = $this->apiClient->getSerializer()->toQueryValue($not_language); + if ($translationsEnBody !== null) { + $queryParams['translations.en.body'] = $translationsEnBody; } // query params - if ($published_at_start !== null) { - $queryParams['published_at.start'] = $this->apiClient->getSerializer()->toQueryValue($published_at_start); + if ($translationsEnText !== null) { + $queryParams['translations.en.text'] = $translationsEnText; } // query params - if ($published_at_end !== null) { - $queryParams['published_at.end'] = $this->apiClient->getSerializer()->toQueryValue($published_at_end); + if ($language !== null) { + $queryParams['language[]'] = $language; } // query params - if ($categories_taxonomy !== null) { - $queryParams['categories.taxonomy'] = $this->apiClient->getSerializer()->toQueryValue($categories_taxonomy); + if ($notLanguage !== null) { + $queryParams['!language[]'] = $notLanguage; } // query params - if ($categories_confident !== null) { - $queryParams['categories.confident'] = $this->apiClient->getSerializer()->toQueryValue($categories_confident); + if ($publishedAtStart !== null) { + $queryParams['published_at.start'] = $publishedAtStart; } // query params - if (is_array($categories_id)) { - $categories_id = $this->apiClient->getSerializer()->serializeCollection($categories_id, 'multi', true); - } - if ($categories_id !== null) { - $queryParams['categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_id); + if ($publishedAtEnd !== null) { + $queryParams['published_at.end'] = $publishedAtEnd; } // query params - if (is_array($not_categories_id)) { - $not_categories_id = $this->apiClient->getSerializer()->serializeCollection($not_categories_id, 'multi', true); - } - if ($not_categories_id !== null) { - $queryParams['!categories.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_id); + if ($categoriesTaxonomy !== null) { + $queryParams['categories.taxonomy'] = $categoriesTaxonomy; } // query params - if (is_array($categories_level)) { - $categories_level = $this->apiClient->getSerializer()->serializeCollection($categories_level, 'multi', true); - } - if ($categories_level !== null) { - $queryParams['categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($categories_level); + if ($categoriesConfident !== null) { + $queryParams['categories.confident'] = $categoriesConfident; } // query params - if (is_array($not_categories_level)) { - $not_categories_level = $this->apiClient->getSerializer()->serializeCollection($not_categories_level, 'multi', true); - } - if ($not_categories_level !== null) { - $queryParams['!categories.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_categories_level); + if ($categoriesId !== null) { + $queryParams['categories.id[]'] = $categoriesId; } // query params - if (is_array($entities_title_text)) { - $entities_title_text = $this->apiClient->getSerializer()->serializeCollection($entities_title_text, 'multi', true); - } - if ($entities_title_text !== null) { - $queryParams['entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_text); + if ($notCategoriesId !== null) { + $queryParams['!categories.id[]'] = $notCategoriesId; } // query params - if (is_array($not_entities_title_text)) { - $not_entities_title_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_text, 'multi', true); - } - if ($not_entities_title_text !== null) { - $queryParams['!entities.title.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_text); + if ($categoriesLevel !== null) { + $queryParams['categories.level[]'] = $categoriesLevel; } // query params - if (is_array($entities_title_type)) { - $entities_title_type = $this->apiClient->getSerializer()->serializeCollection($entities_title_type, 'multi', true); - } - if ($entities_title_type !== null) { - $queryParams['entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_type); + if ($notCategoriesLevel !== null) { + $queryParams['!categories.level[]'] = $notCategoriesLevel; } // query params - if (is_array($not_entities_title_type)) { - $not_entities_title_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_type, 'multi', true); - } - if ($not_entities_title_type !== null) { - $queryParams['!entities.title.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_type); + if ($entitiesTitleText !== null) { + $queryParams['entities.title.text[]'] = $entitiesTitleText; } // query params - if (is_array($entities_title_links_dbpedia)) { - $entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_title_links_dbpedia, 'multi', true); - } - if ($entities_title_links_dbpedia !== null) { - $queryParams['entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_title_links_dbpedia); + if ($notEntitiesTitleText !== null) { + $queryParams['!entities.title.text[]'] = $notEntitiesTitleText; } // query params - if (is_array($not_entities_title_links_dbpedia)) { - $not_entities_title_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_title_links_dbpedia, 'multi', true); - } - if ($not_entities_title_links_dbpedia !== null) { - $queryParams['!entities.title.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_title_links_dbpedia); + if ($entitiesTitleType !== null) { + $queryParams['entities.title.type[]'] = $entitiesTitleType; } // query params - if (is_array($entities_body_text)) { - $entities_body_text = $this->apiClient->getSerializer()->serializeCollection($entities_body_text, 'multi', true); - } - if ($entities_body_text !== null) { - $queryParams['entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_text); + if ($notEntitiesTitleType !== null) { + $queryParams['!entities.title.type[]'] = $notEntitiesTitleType; } // query params - if (is_array($not_entities_body_text)) { - $not_entities_body_text = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_text, 'multi', true); - } - if ($not_entities_body_text !== null) { - $queryParams['!entities.body.text[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_text); + if ($entitiesTitleLinksDbpedia !== null) { + $queryParams['entities.title.links.dbpedia[]'] = $entitiesTitleLinksDbpedia; } // query params - if (is_array($entities_body_type)) { - $entities_body_type = $this->apiClient->getSerializer()->serializeCollection($entities_body_type, 'multi', true); - } - if ($entities_body_type !== null) { - $queryParams['entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_type); + if ($notEntitiesTitleLinksDbpedia !== null) { + $queryParams['!entities.title.links.dbpedia[]'] = $notEntitiesTitleLinksDbpedia; } // query params - if (is_array($not_entities_body_type)) { - $not_entities_body_type = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_type, 'multi', true); - } - if ($not_entities_body_type !== null) { - $queryParams['!entities.body.type[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_type); + if ($entitiesBodyText !== null) { + $queryParams['entities.body.text[]'] = $entitiesBodyText; } // query params - if (is_array($entities_body_links_dbpedia)) { - $entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($entities_body_links_dbpedia, 'multi', true); - } - if ($entities_body_links_dbpedia !== null) { - $queryParams['entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($entities_body_links_dbpedia); + if ($notEntitiesBodyText !== null) { + $queryParams['!entities.body.text[]'] = $notEntitiesBodyText; } // query params - if (is_array($not_entities_body_links_dbpedia)) { - $not_entities_body_links_dbpedia = $this->apiClient->getSerializer()->serializeCollection($not_entities_body_links_dbpedia, 'multi', true); - } - if ($not_entities_body_links_dbpedia !== null) { - $queryParams['!entities.body.links.dbpedia[]'] = $this->apiClient->getSerializer()->toQueryValue($not_entities_body_links_dbpedia); + if ($entitiesBodyType !== null) { + $queryParams['entities.body.type[]'] = $entitiesBodyType; } // query params - if ($sentiment_title_polarity !== null) { - $queryParams['sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_title_polarity); + if ($notEntitiesBodyType !== null) { + $queryParams['!entities.body.type[]'] = $notEntitiesBodyType; } // query params - if ($not_sentiment_title_polarity !== null) { - $queryParams['!sentiment.title.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_title_polarity); + if ($entitiesBodyLinksDbpedia !== null) { + $queryParams['entities.body.links.dbpedia[]'] = $entitiesBodyLinksDbpedia; } // query params - if ($sentiment_body_polarity !== null) { - $queryParams['sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($sentiment_body_polarity); + if ($notEntitiesBodyLinksDbpedia !== null) { + $queryParams['!entities.body.links.dbpedia[]'] = $notEntitiesBodyLinksDbpedia; } // query params - if ($not_sentiment_body_polarity !== null) { - $queryParams['!sentiment.body.polarity'] = $this->apiClient->getSerializer()->toQueryValue($not_sentiment_body_polarity); + if ($sentimentTitlePolarity !== null) { + $queryParams['sentiment.title.polarity'] = $sentimentTitlePolarity; } // query params - if ($media_images_count_min !== null) { - $queryParams['media.images.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_min); + if ($notSentimentTitlePolarity !== null) { + $queryParams['!sentiment.title.polarity'] = $notSentimentTitlePolarity; } // query params - if ($media_images_count_max !== null) { - $queryParams['media.images.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_count_max); + if ($sentimentBodyPolarity !== null) { + $queryParams['sentiment.body.polarity'] = $sentimentBodyPolarity; } // query params - if ($media_images_width_min !== null) { - $queryParams['media.images.width.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_min); + if ($notSentimentBodyPolarity !== null) { + $queryParams['!sentiment.body.polarity'] = $notSentimentBodyPolarity; } // query params - if ($media_images_width_max !== null) { - $queryParams['media.images.width.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_width_max); + if ($mediaImagesCountMin !== null) { + $queryParams['media.images.count.min'] = $mediaImagesCountMin; } // query params - if ($media_images_height_min !== null) { - $queryParams['media.images.height.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_min); + if ($mediaImagesCountMax !== null) { + $queryParams['media.images.count.max'] = $mediaImagesCountMax; } // query params - if ($media_images_height_max !== null) { - $queryParams['media.images.height.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_height_max); + if ($mediaImagesWidthMin !== null) { + $queryParams['media.images.width.min'] = $mediaImagesWidthMin; } // query params - if ($media_images_content_length_min !== null) { - $queryParams['media.images.content_length.min'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_min); + if ($mediaImagesWidthMax !== null) { + $queryParams['media.images.width.max'] = $mediaImagesWidthMax; } // query params - if ($media_images_content_length_max !== null) { - $queryParams['media.images.content_length.max'] = $this->apiClient->getSerializer()->toQueryValue($media_images_content_length_max); + if ($mediaImagesHeightMin !== null) { + $queryParams['media.images.height.min'] = $mediaImagesHeightMin; } // query params - if (is_array($media_images_format)) { - $media_images_format = $this->apiClient->getSerializer()->serializeCollection($media_images_format, 'multi', true); - } - if ($media_images_format !== null) { - $queryParams['media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($media_images_format); + if ($mediaImagesHeightMax !== null) { + $queryParams['media.images.height.max'] = $mediaImagesHeightMax; } // query params - if (is_array($not_media_images_format)) { - $not_media_images_format = $this->apiClient->getSerializer()->serializeCollection($not_media_images_format, 'multi', true); - } - if ($not_media_images_format !== null) { - $queryParams['!media.images.format[]'] = $this->apiClient->getSerializer()->toQueryValue($not_media_images_format); + if ($mediaImagesContentLengthMin !== null) { + $queryParams['media.images.content_length.min'] = $mediaImagesContentLengthMin; } // query params - if ($media_videos_count_min !== null) { - $queryParams['media.videos.count.min'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_min); + if ($mediaImagesContentLengthMax !== null) { + $queryParams['media.images.content_length.max'] = $mediaImagesContentLengthMax; } // query params - if ($media_videos_count_max !== null) { - $queryParams['media.videos.count.max'] = $this->apiClient->getSerializer()->toQueryValue($media_videos_count_max); + if ($mediaImagesFormat !== null) { + $queryParams['media.images.format[]'] = $mediaImagesFormat; } // query params - if (is_array($author_id)) { - $author_id = $this->apiClient->getSerializer()->serializeCollection($author_id, 'multi', true); - } - if ($author_id !== null) { - $queryParams['author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($author_id); + if ($notMediaImagesFormat !== null) { + $queryParams['!media.images.format[]'] = $notMediaImagesFormat; } // query params - if (is_array($not_author_id)) { - $not_author_id = $this->apiClient->getSerializer()->serializeCollection($not_author_id, 'multi', true); - } - if ($not_author_id !== null) { - $queryParams['!author.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_author_id); + if ($mediaVideosCountMin !== null) { + $queryParams['media.videos.count.min'] = $mediaVideosCountMin; } // query params - if ($author_name !== null) { - $queryParams['author.name'] = $this->apiClient->getSerializer()->toQueryValue($author_name); + if ($mediaVideosCountMax !== null) { + $queryParams['media.videos.count.max'] = $mediaVideosCountMax; } // query params - if ($not_author_name !== null) { - $queryParams['!author.name'] = $this->apiClient->getSerializer()->toQueryValue($not_author_name); + if ($authorId !== null) { + $queryParams['author.id[]'] = $authorId; } // query params - if (is_array($source_id)) { - $source_id = $this->apiClient->getSerializer()->serializeCollection($source_id, 'multi', true); - } - if ($source_id !== null) { - $queryParams['source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($source_id); + if ($notAuthorId !== null) { + $queryParams['!author.id[]'] = $notAuthorId; } // query params - if (is_array($not_source_id)) { - $not_source_id = $this->apiClient->getSerializer()->serializeCollection($not_source_id, 'multi', true); - } - if ($not_source_id !== null) { - $queryParams['!source.id[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_id); + if ($authorName !== null) { + $queryParams['author.name'] = $authorName; } // query params - if (is_array($source_name)) { - $source_name = $this->apiClient->getSerializer()->serializeCollection($source_name, 'multi', true); - } - if ($source_name !== null) { - $queryParams['source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($source_name); + if ($notAuthorName !== null) { + $queryParams['!author.name'] = $notAuthorName; } // query params - if (is_array($not_source_name)) { - $not_source_name = $this->apiClient->getSerializer()->serializeCollection($not_source_name, 'multi', true); - } - if ($not_source_name !== null) { - $queryParams['!source.name[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_name); + if ($sourceId !== null) { + $queryParams['source.id[]'] = $sourceId; } // query params - if (is_array($source_domain)) { - $source_domain = $this->apiClient->getSerializer()->serializeCollection($source_domain, 'multi', true); - } - if ($source_domain !== null) { - $queryParams['source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($source_domain); + if ($notSourceId !== null) { + $queryParams['!source.id[]'] = $notSourceId; } // query params - if (is_array($not_source_domain)) { - $not_source_domain = $this->apiClient->getSerializer()->serializeCollection($not_source_domain, 'multi', true); - } - if ($not_source_domain !== null) { - $queryParams['!source.domain[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_domain); + if ($sourceName !== null) { + $queryParams['source.name[]'] = $sourceName; } // query params - if (is_array($source_locations_country)) { - $source_locations_country = $this->apiClient->getSerializer()->serializeCollection($source_locations_country, 'multi', true); - } - if ($source_locations_country !== null) { - $queryParams['source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_country); + if ($notSourceName !== null) { + $queryParams['!source.name[]'] = $notSourceName; } // query params - if (is_array($not_source_locations_country)) { - $not_source_locations_country = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_country, 'multi', true); - } - if ($not_source_locations_country !== null) { - $queryParams['!source.locations.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_country); + if ($sourceDomain !== null) { + $queryParams['source.domain[]'] = $sourceDomain; } // query params - if (is_array($source_locations_state)) { - $source_locations_state = $this->apiClient->getSerializer()->serializeCollection($source_locations_state, 'multi', true); - } - if ($source_locations_state !== null) { - $queryParams['source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_state); + if ($notSourceDomain !== null) { + $queryParams['!source.domain[]'] = $notSourceDomain; } // query params - if (is_array($not_source_locations_state)) { - $not_source_locations_state = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_state, 'multi', true); - } - if ($not_source_locations_state !== null) { - $queryParams['!source.locations.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_state); + if ($sourceLocationsCountry !== null) { + $queryParams['source.locations.country[]'] = $sourceLocationsCountry; } // query params - if (is_array($source_locations_city)) { - $source_locations_city = $this->apiClient->getSerializer()->serializeCollection($source_locations_city, 'multi', true); - } - if ($source_locations_city !== null) { - $queryParams['source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_locations_city); + if ($notSourceLocationsCountry !== null) { + $queryParams['!source.locations.country[]'] = $notSourceLocationsCountry; } // query params - if (is_array($not_source_locations_city)) { - $not_source_locations_city = $this->apiClient->getSerializer()->serializeCollection($not_source_locations_city, 'multi', true); - } - if ($not_source_locations_city !== null) { - $queryParams['!source.locations.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_locations_city); + if ($sourceLocationsState !== null) { + $queryParams['source.locations.state[]'] = $sourceLocationsState; } // query params - if (is_array($source_scopes_country)) { - $source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($source_scopes_country, 'multi', true); - } - if ($source_scopes_country !== null) { - $queryParams['source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_country); + if ($notSourceLocationsState !== null) { + $queryParams['!source.locations.state[]'] = $notSourceLocationsState; } // query params - if (is_array($not_source_scopes_country)) { - $not_source_scopes_country = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_country, 'multi', true); - } - if ($not_source_scopes_country !== null) { - $queryParams['!source.scopes.country[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_country); + if ($sourceLocationsCity !== null) { + $queryParams['source.locations.city[]'] = $sourceLocationsCity; } // query params - if (is_array($source_scopes_state)) { - $source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($source_scopes_state, 'multi', true); - } - if ($source_scopes_state !== null) { - $queryParams['source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_state); + if ($notSourceLocationsCity !== null) { + $queryParams['!source.locations.city[]'] = $notSourceLocationsCity; } // query params - if (is_array($not_source_scopes_state)) { - $not_source_scopes_state = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_state, 'multi', true); - } - if ($not_source_scopes_state !== null) { - $queryParams['!source.scopes.state[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_state); + if ($sourceScopesCountry !== null) { + $queryParams['source.scopes.country[]'] = $sourceScopesCountry; } // query params - if (is_array($source_scopes_city)) { - $source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($source_scopes_city, 'multi', true); - } - if ($source_scopes_city !== null) { - $queryParams['source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_city); + if ($notSourceScopesCountry !== null) { + $queryParams['!source.scopes.country[]'] = $notSourceScopesCountry; } // query params - if (is_array($not_source_scopes_city)) { - $not_source_scopes_city = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_city, 'multi', true); - } - if ($not_source_scopes_city !== null) { - $queryParams['!source.scopes.city[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_city); + if ($sourceScopesState !== null) { + $queryParams['source.scopes.state[]'] = $sourceScopesState; } // query params - if (is_array($source_scopes_level)) { - $source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($source_scopes_level, 'multi', true); + if ($notSourceScopesState !== null) { + $queryParams['!source.scopes.state[]'] = $notSourceScopesState; } - if ($source_scopes_level !== null) { - $queryParams['source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($source_scopes_level); + // query params + if ($sourceScopesCity !== null) { + $queryParams['source.scopes.city[]'] = $sourceScopesCity; } // query params - if (is_array($not_source_scopes_level)) { - $not_source_scopes_level = $this->apiClient->getSerializer()->serializeCollection($not_source_scopes_level, 'multi', true); + if ($notSourceScopesCity !== null) { + $queryParams['!source.scopes.city[]'] = $notSourceScopesCity; } - if ($not_source_scopes_level !== null) { - $queryParams['!source.scopes.level[]'] = $this->apiClient->getSerializer()->toQueryValue($not_source_scopes_level); + // query params + if ($sourceScopesLevel !== null) { + $queryParams['source.scopes.level[]'] = $sourceScopesLevel; } // query params - if ($source_links_in_count_min !== null) { - $queryParams['source.links_in_count.min'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_min); + if ($notSourceScopesLevel !== null) { + $queryParams['!source.scopes.level[]'] = $notSourceScopesLevel; } // query params - if ($source_links_in_count_max !== null) { - $queryParams['source.links_in_count.max'] = $this->apiClient->getSerializer()->toQueryValue($source_links_in_count_max); + if ($sourceLinksInCountMin !== null) { + $queryParams['source.links_in_count.min'] = $sourceLinksInCountMin; } // query params - if ($source_rankings_alexa_rank_min !== null) { - $queryParams['source.rankings.alexa.rank.min'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_min); + if ($sourceLinksInCountMax !== null) { + $queryParams['source.links_in_count.max'] = $sourceLinksInCountMax; } // query params - if ($source_rankings_alexa_rank_max !== null) { - $queryParams['source.rankings.alexa.rank.max'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_rank_max); + if ($sourceRankingsAlexaRankMin !== null) { + $queryParams['source.rankings.alexa.rank.min'] = $sourceRankingsAlexaRankMin; } // query params - if (is_array($source_rankings_alexa_country)) { - $source_rankings_alexa_country = $this->apiClient->getSerializer()->serializeCollection($source_rankings_alexa_country, 'multi', true); + if ($sourceRankingsAlexaRankMax !== null) { + $queryParams['source.rankings.alexa.rank.max'] = $sourceRankingsAlexaRankMax; } - if ($source_rankings_alexa_country !== null) { - $queryParams['source.rankings.alexa.country[]'] = $this->apiClient->getSerializer()->toQueryValue($source_rankings_alexa_country); + // query params + if ($sourceRankingsAlexaCountry !== null) { + $queryParams['source.rankings.alexa.country[]'] = $sourceRankingsAlexaCountry; } // query params - if ($social_shares_count_facebook_min !== null) { - $queryParams['social_shares_count.facebook.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_min); + if ($socialSharesCountFacebookMin !== null) { + $queryParams['social_shares_count.facebook.min'] = $socialSharesCountFacebookMin; } // query params - if ($social_shares_count_facebook_max !== null) { - $queryParams['social_shares_count.facebook.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_facebook_max); + if ($socialSharesCountFacebookMax !== null) { + $queryParams['social_shares_count.facebook.max'] = $socialSharesCountFacebookMax; } // query params - if ($social_shares_count_google_plus_min !== null) { - $queryParams['social_shares_count.google_plus.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_min); + if ($socialSharesCountGooglePlusMin !== null) { + $queryParams['social_shares_count.google_plus.min'] = $socialSharesCountGooglePlusMin; } // query params - if ($social_shares_count_google_plus_max !== null) { - $queryParams['social_shares_count.google_plus.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_google_plus_max); + if ($socialSharesCountGooglePlusMax !== null) { + $queryParams['social_shares_count.google_plus.max'] = $socialSharesCountGooglePlusMax; } // query params - if ($social_shares_count_linkedin_min !== null) { - $queryParams['social_shares_count.linkedin.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_min); + if ($socialSharesCountLinkedinMin !== null) { + $queryParams['social_shares_count.linkedin.min'] = $socialSharesCountLinkedinMin; } // query params - if ($social_shares_count_linkedin_max !== null) { - $queryParams['social_shares_count.linkedin.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_linkedin_max); + if ($socialSharesCountLinkedinMax !== null) { + $queryParams['social_shares_count.linkedin.max'] = $socialSharesCountLinkedinMax; } // query params - if ($social_shares_count_reddit_min !== null) { - $queryParams['social_shares_count.reddit.min'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_min); + if ($socialSharesCountRedditMin !== null) { + $queryParams['social_shares_count.reddit.min'] = $socialSharesCountRedditMin; } // query params - if ($social_shares_count_reddit_max !== null) { - $queryParams['social_shares_count.reddit.max'] = $this->apiClient->getSerializer()->toQueryValue($social_shares_count_reddit_max); + if ($socialSharesCountRedditMax !== null) { + $queryParams['social_shares_count.reddit.max'] = $socialSharesCountRedditMax; } // query params if ($field !== null) { - $queryParams['field'] = $this->apiClient->getSerializer()->toQueryValue($field); + $queryParams['field'] = $field; + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + [] + ); } - // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); - // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } } elseif (count($formParams) > 0) { - $httpBody = $formParams; // for HTTP post (form) + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } } + // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; } // this endpoint requires API key authentication - $apiKey = $this->apiClient->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-ID'); - if (strlen($apiKey) !== 0) { - $headerParams['X-AYLIEN-NewsAPI-Application-ID'] = $apiKey; + $apiKey = $this->config->getApiKeyWithPrefix('X-AYLIEN-NewsAPI-Application-Key'); + if ($apiKey !== null) { + $headers['X-AYLIEN-NewsAPI-Application-Key'] = $apiKey; } - // make the API Call - try { - list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, - 'GET', - $queryParams, - $httpBody, - $headerParams, - '\Aylien\NewsApi\Models\Trends', - '/trends' - ); - return [$this->apiClient->getSerializer()->deserialize($response, '\Aylien\NewsApi\Models\Trends', $httpHeader), $statusCode, $httpHeader]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Trends', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 404: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 422: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 429: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Aylien\NewsApi\Models\Errors', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; - } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } - throw $e; + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } } + + return $options; } } diff --git a/lib/ApiClient.php b/lib/ApiClient.php deleted file mode 100644 index fdbba10..0000000 --- a/lib/ApiClient.php +++ /dev/null @@ -1,373 +0,0 @@ -config = $config; - $this->serializer = new ObjectSerializer(); - } - - /** - * Get the config - * - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Get the serializer - * - * @return ObjectSerializer - */ - public function getSerializer() - { - return $this->serializer; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->config->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->config->getApiKey($apiKeyIdentifier); - - if (!isset($apiKey)) { - return null; - } - - if (isset($prefix)) { - $keyWithPrefix = $prefix." ".$apiKey; - } else { - $keyWithPrefix = $apiKey; - } - - return $keyWithPrefix; - } - - /** - * Make the HTTP call (Sync) - * - * @param string $resourcePath path to method endpoint - * @param string $method method to call - * @param array $queryParams parameters to be place in query URL - * @param array $postData parameters to be placed in POST body - * @param array $headerParams parameters to be place in request header - * @param string $responseType expected response type of the endpoint - * @param string $endpointPath path to method endpoint before expanding parameters - * - * @throws \Aylien\NewsApi\ApiException on a non 2xx response - * @return mixed - */ - public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) - { - $headers = []; - - // construct the http header - $headerParams = array_merge( - (array)$this->config->getDefaultHeaders(), - (array)$headerParams - ); - - foreach ($headerParams as $key => $val) { - $headers[] = "$key: $val"; - } - - // form data - if ($postData and in_array('Content-Type: application/x-www-form-urlencoded', $headers, true)) { - $postData = preg_replace("/%5B[0-9]+%5D=/i", "=", http_build_query($postData)); - } elseif ((is_object($postData) or is_array($postData)) and !in_array('Content-Type: multipart/form-data', $headers, true)) { // json model - $postData = json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($postData)); - } - - $url = $this->config->getHost() . $resourcePath; - - $curl = curl_init(); - // set timeout, if needed - if ($this->config->getCurlTimeout() !== 0) { - curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); - } - // set connect timeout, if needed - if ($this->config->getCurlConnectTimeout() != 0) { - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout()); - } - - // return the result on success, rather than just true - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - - // disable SSL verification, if needed - if ($this->config->getSSLVerification() === false) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); - } - - if ($this->config->getCurlProxyHost()) { - curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost()); - } - - if ($this->config->getCurlProxyPort()) { - curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort()); - } - - if ($this->config->getCurlProxyType()) { - curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType()); - } - - if ($this->config->getCurlProxyUser()) { - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword()); - } - - if (!empty($queryParams)) { - $url = ($url . '?' . preg_replace("/%5B[0-9]+%5D=/i", "=", http_build_query($queryParams))); - } - - if ($method === self::$POST) { - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$HEAD) { - curl_setopt($curl, CURLOPT_NOBODY, true); - } elseif ($method === self::$OPTIONS) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "OPTIONS"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$PATCH) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$PUT) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$DELETE) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method !== self::$GET) { - throw new ApiException('Method ' . $method . ' is not recognized.'); - } - curl_setopt($curl, CURLOPT_URL, $url); - - // Set user agent - curl_setopt($curl, CURLOPT_USERAGENT, $this->config->getUserAgent()); - - // debugging for curl - if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); - - curl_setopt($curl, CURLOPT_VERBOSE, 1); - curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); - } else { - curl_setopt($curl, CURLOPT_VERBOSE, 0); - } - - // obtain the HTTP response headers - curl_setopt($curl, CURLOPT_HEADER, 1); - - // Make the request - $response = curl_exec($curl); - $http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); - $http_header = $this->httpParseHeaders(substr($response, 0, $http_header_size)); - $http_body = substr($response, $http_header_size); - $response_info = curl_getinfo($curl); - - // debug HTTP response body - if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); - } - - // Handle the response - if ($response_info['http_code'] === 0) { - $curl_error_message = curl_error($curl); - - // curl_exec can sometimes fail but still return a blank message from curl_error(). - if (!empty($curl_error_message)) { - $error_message = "API call to $url failed: $curl_error_message"; - } else { - $error_message = "API call to $url failed, but for an unknown reason. " . - "This could happen if you are disconnected from the network."; - } - - $exception = new ApiException($error_message, 0, null, null); - $exception->setResponseObject($response_info); - throw $exception; - } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { - // return raw body if response is a file - if ($responseType === '\SplFileObject' || $responseType === 'string') { - return [$http_body, $response_info['http_code'], $http_header]; - } - - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - } else { - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - - throw new ApiException( - "[".$response_info['http_code']."] Error connecting to the API ($url)", - $response_info['http_code'], - $http_header, - $data - ); - } - return [$data, $response_info['http_code'], $http_header]; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return string Accept (e.g. application/json) - */ - public function selectHeaderAccept($accept) - { - if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { - return null; - } elseif (preg_grep("/application\/json/i", $accept)) { - return 'application/json'; - } else { - return implode(',', $accept); - } - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $content_type Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - public function selectHeaderContentType($content_type) - { - if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $content_type)) { - return 'application/json'; - } else { - return implode(',', $content_type); - } - } - - /** - * Return an array of HTTP response headers - * - * @param string $raw_headers A string of raw HTTP response headers - * - * @return string[] Array of HTTP response heaers - */ - protected function httpParseHeaders($raw_headers) - { - // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 - $headers = []; - $key = ''; - - foreach (explode("\n", $raw_headers) as $h) { - $h = explode(':', $h, 2); - - if (isset($h[1])) { - if (!isset($headers[$h[0]])) { - $headers[$h[0]] = trim($h[1]); - } elseif (is_array($headers[$h[0]])) { - $headers[$h[0]] = array_merge($headers[$h[0]], [trim($h[1])]); - } else { - $headers[$h[0]] = array_merge([$headers[$h[0]]], [trim($h[1])]); - } - - $key = $h[0]; - } else { - if (substr($h[0], 0, 1) === "\t") { - $headers[$key] .= "\r\n\t".trim($h[0]); - } elseif (!$key) { - $headers[0] = trim($h[0]); - } - trim($h[0]); - } - } - - return $headers; - } -} diff --git a/lib/ApiException.php b/lib/ApiException.php index c3153ed..a06be8f 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -5,31 +5,26 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi; @@ -40,9 +35,8 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ApiException extends Exception { @@ -57,7 +51,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[] + * @var string[]|null */ protected $responseHeaders; @@ -71,12 +65,12 @@ class ApiException extends Exception /** * Constructor * - * @param string $message Error message - * @param int $code HTTP status code - * @param string $responseHeaders HTTP response header - * @param mixed $responseBody HTTP body of the server response either as Json or string + * @param string $message Error message + * @param int $code HTTP status code + * @param string[]|null $responseHeaders HTTP response header + * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -86,7 +80,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = null, $ /** * Gets the HTTP response header * - * @return string HTTP response header + * @return string[]|null HTTP response header */ public function getResponseHeaders() { @@ -96,7 +90,7 @@ public function getResponseHeaders() /** * Gets the HTTP body of the server response either as Json or string * - * @return mixed HTTP body of the server response either as Json or string + * @return mixed HTTP body of the server response either as \stdClass or string */ public function getResponseBody() { diff --git a/lib/Configuration.php b/lib/Configuration.php index 62f878f..46b0318 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -5,31 +5,26 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi; @@ -39,13 +34,12 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class Configuration { - private static $defaultConfiguration = null; + private static $defaultConfiguration; /** * Associate array to store API key(s) @@ -62,7 +56,7 @@ class Configuration protected $apiKeyPrefixes = []; /** - * Access token for OAuth + * Access token for OAuth/Bearer authentication * * @var string */ @@ -82,40 +76,19 @@ class Configuration */ protected $password = ''; - /** - * The default header(s) - * - * @var array - */ - protected $defaultHeaders = []; - /** * The host * * @var string */ - protected $host = 'https://api.newsapi.aylien.com/api/v1'; - - /** - * Timeout (second) of the HTTP request, by default set to 0, no timeout - * - * @var string - */ - protected $curlTimeout = 0; - - /** - * Timeout (second) of the HTTP connection, by default set to 0, no timeout - * - * @var string - */ - protected $curlConnectTimeout = 0; + protected $host = 'https://api.aylien.com/news'; /** - * User agent of the HTTP request, set to "aylien-news-api/1.0.0/php" by default + * User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default * * @var string */ - protected $userAgent = "aylien-news-api/1.0.0/php"; + protected $userAgent = 'OpenAPI-Generator/3.0.0/PHP'; /** * Debug switch (default set to false) @@ -138,51 +111,6 @@ class Configuration */ protected $tempFolderPath; - /** - * Indicates if SSL verification should be enabled or disabled. - * - * This is useful if the host uses a self-signed SSL certificate. - * - * @var boolean True if the certificate should be validated, false otherwise. - */ - protected $sslVerification = true; - - /** - * Curl proxy host - * - * @var string - */ - protected $proxyHost; - - /** - * Curl proxy port - * - * @var integer - */ - protected $proxyPort; - - /** - * Curl proxy type, e.g. CURLPROXY_HTTP or CURLPROXY_SOCKS5 - * - * @see https://secure.php.net/manual/en/function.curl-setopt.php - * @var integer - */ - protected $proxyType; - - /** - * Curl proxy username - * - * @var string - */ - protected $proxyUser; - - /** - * Curl proxy password - * - * @var string - */ - protected $proxyPassword; - /** * Constructor */ @@ -197,7 +125,7 @@ public function __construct() * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $key API key or token * - * @return Configuration + * @return $this */ public function setApiKey($apiKeyIdentifier, $key) { @@ -223,7 +151,7 @@ public function getApiKey($apiKeyIdentifier) * @param string $apiKeyIdentifier API key identifier (authentication scheme) * @param string $prefix API key prefix, e.g. Bearer * - * @return Configuration + * @return $this */ public function setApiKeyPrefix($apiKeyIdentifier, $prefix) { @@ -248,7 +176,7 @@ public function getApiKeyPrefix($apiKeyIdentifier) * * @param string $accessToken Token for OAuth * - * @return Configuration + * @return $this */ public function setAccessToken($accessToken) { @@ -271,7 +199,7 @@ public function getAccessToken() * * @param string $username Username for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setUsername($username) { @@ -294,7 +222,7 @@ public function getUsername() * * @param string $password Password for HTTP basic authentication * - * @return Configuration + * @return $this */ public function setPassword($password) { @@ -312,52 +240,12 @@ public function getPassword() return $this->password; } - /** - * Adds a default header - * - * @param string $headerName header name (e.g. Token) - * @param string $headerValue header value (e.g. 1z8wp3) - * - * @return Configuration - */ - public function addDefaultHeader($headerName, $headerValue) - { - if (!is_string($headerName)) { - throw new \InvalidArgumentException('Header name must be a string.'); - } - - $this->defaultHeaders[$headerName] = $headerValue; - return $this; - } - - /** - * Gets the default header - * - * @return array An array of default header(s) - */ - public function getDefaultHeaders() - { - return $this->defaultHeaders; - } - - /** - * Deletes a default header - * - * @param string $headerName the header to delete - * - * @return Configuration - */ - public function deleteDefaultHeader($headerName) - { - unset($this->defaultHeaders[$headerName]); - } - /** * Sets the host * * @param string $host Host * - * @return Configuration + * @return $this */ public function setHost($host) { @@ -380,7 +268,8 @@ public function getHost() * * @param string $userAgent the user agent of the api client * - * @return Configuration + * @throws \InvalidArgumentException + * @return $this */ public function setUserAgent($userAgent) { @@ -402,182 +291,12 @@ public function getUserAgent() return $this->userAgent; } - /** - * Sets the HTTP timeout value - * - * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] - * - * @return Configuration - */ - public function setCurlTimeout($seconds) - { - if (!is_numeric($seconds) || $seconds < 0) { - throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.'); - } - - $this->curlTimeout = $seconds; - return $this; - } - - /** - * Gets the HTTP timeout value - * - * @return string HTTP timeout value - */ - public function getCurlTimeout() - { - return $this->curlTimeout; - } - - /** - * Sets the HTTP connect timeout value - * - * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] - * - * @return Configuration - */ - public function setCurlConnectTimeout($seconds) - { - if (!is_numeric($seconds) || $seconds < 0) { - throw new \InvalidArgumentException('Connect timeout value must be numeric and a non-negative number.'); - } - - $this->curlConnectTimeout = $seconds; - return $this; - } - - /** - * Gets the HTTP connect timeout value - * - * @return string HTTP connect timeout value - */ - public function getCurlConnectTimeout() - { - return $this->curlConnectTimeout; - } - - - /** - * Sets the HTTP Proxy Host - * - * @param string $proxyHost HTTP Proxy URL - * - * @return ApiClient - */ - public function setCurlProxyHost($proxyHost) - { - $this->proxyHost = $proxyHost; - return $this; - } - - /** - * Gets the HTTP Proxy Host - * - * @return string - */ - public function getCurlProxyHost() - { - return $this->proxyHost; - } - - /** - * Sets the HTTP Proxy Port - * - * @param integer $proxyPort HTTP Proxy Port - * - * @return ApiClient - */ - public function setCurlProxyPort($proxyPort) - { - $this->proxyPort = $proxyPort; - return $this; - } - - /** - * Gets the HTTP Proxy Port - * - * @return integer - */ - public function getCurlProxyPort() - { - return $this->proxyPort; - } - - /** - * Sets the HTTP Proxy Type - * - * @param integer $proxyType HTTP Proxy Type - * - * @return ApiClient - */ - public function setCurlProxyType($proxyType) - { - $this->proxyType = $proxyType; - return $this; - } - - /** - * Gets the HTTP Proxy Type - * - * @return integer - */ - public function getCurlProxyType() - { - return $this->proxyType; - } - - /** - * Sets the HTTP Proxy User - * - * @param string $proxyUser HTTP Proxy User - * - * @return ApiClient - */ - public function setCurlProxyUser($proxyUser) - { - $this->proxyUser = $proxyUser; - return $this; - } - - /** - * Gets the HTTP Proxy User - * - * @return string - */ - public function getCurlProxyUser() - { - return $this->proxyUser; - } - - /** - * Sets the HTTP Proxy Password - * - * @param string $proxyPassword HTTP Proxy Password - * - * @return ApiClient - */ - public function setCurlProxyPassword($proxyPassword) - { - $this->proxyPassword = $proxyPassword; - return $this; - } - - /** - * Gets the HTTP Proxy Password - * - * @return string - */ - public function getCurlProxyPassword() - { - return $this->proxyPassword; - } - /** * Sets debug flag * * @param bool $debug Debug flag * - * @return Configuration + * @return $this */ public function setDebug($debug) { @@ -600,7 +319,7 @@ public function getDebug() * * @param string $debugFile Debug file * - * @return Configuration + * @return $this */ public function setDebugFile($debugFile) { @@ -623,7 +342,7 @@ public function getDebugFile() * * @param string $tempFolderPath Temp folder path * - * @return Configuration + * @return $this */ public function setTempFolderPath($tempFolderPath) { @@ -641,29 +360,6 @@ public function getTempFolderPath() return $this->tempFolderPath; } - /** - * Sets if SSL verification should be enabled or disabled - * - * @param boolean $sslVerification True if the certificate should be validated, false otherwise - * - * @return Configuration - */ - public function setSSLVerification($sslVerification) - { - $this->sslVerification = $sslVerification; - return $this; - } - - /** - * Gets if SSL verification should be enabled or disabled - * - * @return boolean True if the certificate should be validated, false otherwise - */ - public function getSSLVerification() - { - return $this->sslVerification; - } - /** * Gets the default configuration instance * @@ -699,11 +395,91 @@ public static function toDebugReport() { $report = 'PHP SDK (Aylien\NewsApi) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . phpversion() . PHP_EOL; - $report .= ' OpenAPI Spec Version: 1.0' . PHP_EOL; - $report .= ' SDK Package Version: 1.0.0' . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 3.0' . PHP_EOL; + $report .= ' SDK Package Version: 3.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return an array of host settings + */ + public function getHostSettings() + { + return array( + array( + "url" => "https://api.aylien.com/news", + "description" => "No description provided", + ) + ); + } + + /** + * Returns URL based on the index and variables + * + * @param index array index of the host settings + * @param variables hash of variable and the corresponding value (optional) + * @return URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + if (null === $variables) { + $variables = array(); + } + + $hosts = $this->getHostSettings(); + + // check array index out of bound + if ($index < 0 || $index >= sizeof($hosts)) { + throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); + } + + $host = $hosts[$index]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (in_array($variables[$name], $variable["enum_values"])) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } } diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php new file mode 100644 index 0000000..e8fd28b --- /dev/null +++ b/lib/HeaderSelector.php @@ -0,0 +1,110 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} + diff --git a/lib/Models/Author.php b/lib/Models/Author.php index b14c98b..ba1389e 100644 --- a/lib/Models/Author.php +++ b/lib/Models/Author.php @@ -6,228 +6,292 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Author Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Author implements ArrayAccess +class Author implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Author'; + protected static $openAPIModelName = 'Author'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ + 'avatarUrl' => 'string', 'id' => 'int', - 'name' => 'string', - 'avatar_url' => 'string' + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'avatarUrl' => null, + 'id' => 'int64', + 'name' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ + 'avatarUrl' => 'avatar_url', 'id' => 'id', - 'name' => 'name', - 'avatar_url' => 'avatar_url' + 'name' => 'name' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ + 'avatarUrl' => 'setAvatarUrl', 'id' => 'setId', - 'name' => 'setName', - 'avatar_url' => 'setAvatarUrl' + 'name' => 'setName' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ + 'avatarUrl' => 'getAvatarUrl', 'id' => 'getId', - 'name' => 'getName', - 'avatar_url' => 'getAvatarUrl' + 'name' => 'getName' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['avatarUrl'] = isset($data['avatarUrl']) ? $data['avatarUrl'] : null; $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['avatar_url'] = isset($data['avatar_url']) ? $data['avatar_url'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets id - * @return int + * Gets avatarUrl + * + * @return string|null */ - public function getId() + public function getAvatarUrl() { - return $this->container['id']; + return $this->container['avatarUrl']; } /** - * Sets id - * @param int $id A unique identification for the author + * Sets avatarUrl + * + * @param string|null $avatarUrl A URL which points to the author avatar + * * @return $this */ - public function setId($id) + public function setAvatarUrl($avatarUrl) { - $this->container['id'] = $id; + $this->container['avatarUrl'] = $avatarUrl; return $this; } /** - * Gets name - * @return string + * Gets id + * + * @return int|null */ - public function getName() + public function getId() { - return $this->container['name']; + return $this->container['id']; } /** - * Sets name - * @param string $name The extracted author full name + * Sets id + * + * @param int|null $id A unique identification for the author + * * @return $this */ - public function setName($name) + public function setId($id) { - $this->container['name'] = $name; + $this->container['id'] = $id; return $this; } /** - * Gets avatar_url - * @return string + * Gets name + * + * @return string|null */ - public function getAvatarUrl() + public function getName() { - return $this->container['avatar_url']; + return $this->container['name']; } /** - * Sets avatar_url - * @param string $avatar_url A URL which points to the author avatar + * Sets name + * + * @param string|null $name The extracted author full name + * * @return $this */ - public function setAvatarUrl($avatar_url) + public function setName($name) { - $this->container['avatar_url'] = $avatar_url; + $this->container['name'] = $name; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -237,7 +301,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -247,8 +313,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -262,7 +330,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -272,15 +342,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Autocomplete.php b/lib/Models/Autocomplete.php index d2e22e4..6a808b3 100644 --- a/lib/Models/Autocomplete.php +++ b/lib/Models/Autocomplete.php @@ -6,71 +6,95 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Autocomplete Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Autocomplete implements ArrayAccess +class Autocomplete implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Autocomplete'; + protected static $openAPIModelName = 'Autocomplete'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'id' => 'string', 'text' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'text' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -78,9 +102,9 @@ public static function apiTypes() 'text' => 'text' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -88,9 +112,9 @@ public static function apiTypes() 'text' => 'setText' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -98,34 +122,63 @@ public static function apiTypes() 'text' => 'getText' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -134,33 +187,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets id - * @return string + * + * @return string|null */ public function getId() { @@ -169,7 +222,9 @@ public function getId() /** * Sets id - * @param string $id ID of the autocomplete + * + * @param string|null $id ID of the autocomplete + * * @return $this */ public function setId($id) @@ -181,7 +236,8 @@ public function setId($id) /** * Gets text - * @return string + * + * @return string|null */ public function getText() { @@ -190,7 +246,9 @@ public function getText() /** * Sets text - * @param string $text Text of the autocomplete + * + * @param string|null $text Text of the autocomplete + * * @return $this */ public function setText($text) @@ -201,7 +259,9 @@ public function setText($text) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Autocompletes.php b/lib/Models/Autocompletes.php index 02bf44d..d343471 100644 --- a/lib/Models/Autocompletes.php +++ b/lib/Models/Autocompletes.php @@ -6,122 +6,174 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Autocompletes Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Autocompletes implements ArrayAccess +class Autocompletes implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Autocompletes'; + protected static $openAPIModelName = 'Autocompletes'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'autocompletes' => '\Aylien\NewsApi\Models\Autocomplete[]' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'autocompletes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'autocompletes' => 'autocompletes' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'autocompletes' => 'setAutocompletes' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'autocompletes' => 'getAutocompletes' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -129,33 +181,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets autocompletes - * @return \Aylien\NewsApi\Models\Autocomplete[] + * + * @return \Aylien\NewsApi\Models\Autocomplete[]|null */ public function getAutocompletes() { @@ -164,7 +216,9 @@ public function getAutocompletes() /** * Sets autocompletes - * @param \Aylien\NewsApi\Models\Autocomplete[] $autocompletes An array of autocompletes + * + * @param \Aylien\NewsApi\Models\Autocomplete[]|null $autocompletes An array of autocompletes + * * @return $this */ public function setAutocompletes($autocompletes) @@ -175,7 +229,9 @@ public function setAutocompletes($autocompletes) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -185,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -195,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -210,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -220,15 +282,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Category.php b/lib/Models/Category.php index 4c57816..e258e7f 100644 --- a/lib/Models/Category.php +++ b/lib/Models/Category.php @@ -6,129 +6,183 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Category Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Category implements ArrayAccess +class Category implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Category'; + protected static $openAPIModelName = 'Category'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ + 'confident' => 'bool', 'id' => 'string', - 'taxonomy' => 'string', 'level' => 'int', + 'links' => '\Aylien\NewsApi\Models\CategoryLinks', 'score' => 'double', - 'confident' => 'bool', - 'links' => '\Aylien\NewsApi\Models\CategoryLinks' + 'taxonomy' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'confident' => null, + 'id' => null, + 'level' => 'int32', + 'links' => null, + 'score' => 'double', + 'taxonomy' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ + 'confident' => 'confident', 'id' => 'id', - 'taxonomy' => 'taxonomy', 'level' => 'level', + 'links' => 'links', 'score' => 'score', - 'confident' => 'confident', - 'links' => 'links' + 'taxonomy' => 'taxonomy' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ + 'confident' => 'setConfident', 'id' => 'setId', - 'taxonomy' => 'setTaxonomy', 'level' => 'setLevel', + 'links' => 'setLinks', 'score' => 'setScore', - 'confident' => 'setConfident', - 'links' => 'setLinks' + 'taxonomy' => 'setTaxonomy' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ + 'confident' => 'getConfident', 'id' => 'getId', - 'taxonomy' => 'getTaxonomy', 'level' => 'getLevel', + 'links' => 'getLinks', 'score' => 'getScore', - 'confident' => 'getConfident', - 'links' => 'getLinks' + 'taxonomy' => 'getTaxonomy' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + const TAXONOMY_IAB_QAG = 'iab-qag'; const TAXONOMY_IPTC_SUBJECTCODE = 'iptc-subjectcode'; @@ -136,6 +190,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getTaxonomyAllowableValues() @@ -149,107 +204,111 @@ public function getTaxonomyAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['confident'] = isset($data['confident']) ? $data['confident'] : null; $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['taxonomy'] = isset($data['taxonomy']) ? $data['taxonomy'] : null; $this->container['level'] = isset($data['level']) ? $data['level'] : null; - $this->container['score'] = isset($data['score']) ? $data['score'] : null; - $this->container['confident'] = isset($data['confident']) ? $data['confident'] : null; $this->container['links'] = isset($data['links']) ? $data['links'] : null; + $this->container['score'] = isset($data['score']) ? $data['score'] : null; + $this->container['taxonomy'] = isset($data['taxonomy']) ? $data['taxonomy'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; - - $allowed_values = ["iab-qag", "iptc-subjectcode"]; - if (!in_array($this->container['taxonomy'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'taxonomy', must be one of 'iab-qag', 'iptc-subjectcode'."; + $invalidProperties = []; + + $allowedValues = $this->getTaxonomyAllowableValues(); + if (!is_null($this->container['taxonomy']) && !in_array($this->container['taxonomy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'taxonomy', must be one of '%s'", + implode("', '", $allowedValues) + ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - $allowed_values = ["iab-qag", "iptc-subjectcode"]; - if (!in_array($this->container['taxonomy'], $allowed_values)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets id - * @return string + * Gets confident + * + * @return bool|null */ - public function getId() + public function getConfident() { - return $this->container['id']; + return $this->container['confident']; } /** - * Sets id - * @param string $id The ID of the category + * Sets confident + * + * @param bool|null $confident It defines whether the extracted category is confident or not + * * @return $this */ - public function setId($id) + public function setConfident($confident) { - $this->container['id'] = $id; + $this->container['confident'] = $confident; return $this; } /** - * Gets taxonomy - * @return string + * Gets id + * + * @return string|null */ - public function getTaxonomy() + public function getId() { - return $this->container['taxonomy']; + return $this->container['id']; } /** - * Sets taxonomy - * @param string $taxonomy The taxonomy of the category + * Sets id + * + * @param string|null $id The ID of the category + * * @return $this */ - public function setTaxonomy($taxonomy) + public function setId($id) { - $allowed_values = array('iab-qag', 'iptc-subjectcode'); - if (!is_null($taxonomy) && (!in_array($taxonomy, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'taxonomy', must be one of 'iab-qag', 'iptc-subjectcode'"); - } - $this->container['taxonomy'] = $taxonomy; + $this->container['id'] = $id; return $this; } /** * Gets level - * @return int + * + * @return int|null */ public function getLevel() { @@ -258,7 +317,9 @@ public function getLevel() /** * Sets level - * @param int $level The level of the category + * + * @param int|null $level The level of the category + * * @return $this */ public function setLevel($level) @@ -269,70 +330,90 @@ public function setLevel($level) } /** - * Gets score - * @return double + * Gets links + * + * @return \Aylien\NewsApi\Models\CategoryLinks|null */ - public function getScore() + public function getLinks() { - return $this->container['score']; + return $this->container['links']; } /** - * Sets score - * @param double $score The score of the category + * Sets links + * + * @param \Aylien\NewsApi\Models\CategoryLinks|null $links links + * * @return $this */ - public function setScore($score) + public function setLinks($links) { - $this->container['score'] = $score; + $this->container['links'] = $links; return $this; } /** - * Gets confident - * @return bool + * Gets score + * + * @return double|null */ - public function getConfident() + public function getScore() { - return $this->container['confident']; + return $this->container['score']; } /** - * Sets confident - * @param bool $confident It defines whether the extracted category is confident or not + * Sets score + * + * @param double|null $score The score of the category + * * @return $this */ - public function setConfident($confident) + public function setScore($score) { - $this->container['confident'] = $confident; + $this->container['score'] = $score; return $this; } /** - * Gets links - * @return \Aylien\NewsApi\Models\CategoryLinks + * Gets taxonomy + * + * @return string|null */ - public function getLinks() + public function getTaxonomy() { - return $this->container['links']; + return $this->container['taxonomy']; } /** - * Sets links - * @param \Aylien\NewsApi\Models\CategoryLinks $links Related links for the category + * Sets taxonomy + * + * @param string|null $taxonomy The taxonomy of the category + * * @return $this */ - public function setLinks($links) + public function setTaxonomy($taxonomy) { - $this->container['links'] = $links; + $allowedValues = $this->getTaxonomyAllowableValues(); + if (!is_null($taxonomy) && !in_array($taxonomy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'taxonomy', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['taxonomy'] = $taxonomy; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -342,7 +423,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -352,8 +435,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -367,7 +452,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -377,15 +464,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/CategoryLinks.php b/lib/Models/CategoryLinks.php index 467c273..b96b4e0 100644 --- a/lib/Models/CategoryLinks.php +++ b/lib/Models/CategoryLinks.php @@ -6,202 +6,262 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * CategoryLinks Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class CategoryLinks implements ArrayAccess +class CategoryLinks implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'CategoryLinks'; + protected static $openAPIModelName = 'CategoryLinks'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'parent' => 'string', + 'self' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'self' => 'string', - 'parent' => 'string' + protected static $openAPIFormats = [ + 'parent' => null, + 'self' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'self' => 'self', - 'parent' => 'parent' + 'parent' => 'parent', + 'self' => 'self' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'self' => 'setSelf', - 'parent' => 'setParent' + 'parent' => 'setParent', + 'self' => 'setSelf' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'self' => 'getSelf', - 'parent' => 'getParent' + 'parent' => 'getParent', + 'self' => 'getSelf' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['self'] = isset($data['self']) ? $data['self'] : null; $this->container['parent'] = isset($data['parent']) ? $data['parent'] : null; + $this->container['self'] = isset($data['self']) ? $data['self'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets self - * @return string + * Gets parent + * + * @return string|null */ - public function getSelf() + public function getParent() { - return $this->container['self']; + return $this->container['parent']; } /** - * Sets self - * @param string $self A URL pointing to the category + * Sets parent + * + * @param string|null $parent A URL pointing to the parent category + * * @return $this */ - public function setSelf($self) + public function setParent($parent) { - $this->container['self'] = $self; + $this->container['parent'] = $parent; return $this; } /** - * Gets parent - * @return string + * Gets self + * + * @return string|null */ - public function getParent() + public function getSelf() { - return $this->container['parent']; + return $this->container['self']; } /** - * Sets parent - * @param string $parent A URL pointing to the parent category + * Sets self + * + * @param string|null $self A URL pointing to the category + * * @return $this */ - public function setParent($parent) + public function setSelf($self) { - $this->container['parent'] = $parent; + $this->container['self'] = $self; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Cluster.php b/lib/Models/Cluster.php new file mode 100644 index 0000000..a3efdd4 --- /dev/null +++ b/lib/Models/Cluster.php @@ -0,0 +1,477 @@ + '\DateTime', + 'id' => 'int', + 'latestStory' => '\DateTime', + 'location' => '\Aylien\NewsApi\Models\Location', + 'representativeStory' => '\Aylien\NewsApi\Models\RepresentativeStory', + 'storyCount' => 'int', + 'time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'earliestStory' => 'date-time', + 'id' => 'int64', + 'latestStory' => 'date-time', + 'location' => null, + 'representativeStory' => null, + 'storyCount' => 'int32', + 'time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'earliestStory' => 'earliest_story', + 'id' => 'id', + 'latestStory' => 'latest_story', + 'location' => 'location', + 'representativeStory' => 'representative_story', + 'storyCount' => 'story_count', + 'time' => 'time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'earliestStory' => 'setEarliestStory', + 'id' => 'setId', + 'latestStory' => 'setLatestStory', + 'location' => 'setLocation', + 'representativeStory' => 'setRepresentativeStory', + 'storyCount' => 'setStoryCount', + 'time' => 'setTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'earliestStory' => 'getEarliestStory', + 'id' => 'getId', + 'latestStory' => 'getLatestStory', + 'location' => 'getLocation', + 'representativeStory' => 'getRepresentativeStory', + 'storyCount' => 'getStoryCount', + 'time' => 'getTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['earliestStory'] = isset($data['earliestStory']) ? $data['earliestStory'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['latestStory'] = isset($data['latestStory']) ? $data['latestStory'] : null; + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['representativeStory'] = isset($data['representativeStory']) ? $data['representativeStory'] : null; + $this->container['storyCount'] = isset($data['storyCount']) ? $data['storyCount'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets earliestStory + * + * @return \DateTime|null + */ + public function getEarliestStory() + { + return $this->container['earliestStory']; + } + + /** + * Sets earliestStory + * + * @param \DateTime|null $earliestStory Publication date of the earliest story in cluster + * + * @return $this + */ + public function setEarliestStory($earliestStory) + { + $this->container['earliestStory'] = $earliestStory; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the cluster which is a unique identification + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets latestStory + * + * @return \DateTime|null + */ + public function getLatestStory() + { + return $this->container['latestStory']; + } + + /** + * Sets latestStory + * + * @param \DateTime|null $latestStory Publication date of the latest story in cluster + * + * @return $this + */ + public function setLatestStory($latestStory) + { + $this->container['latestStory'] = $latestStory; + + return $this; + } + + /** + * Gets location + * + * @return \Aylien\NewsApi\Models\Location|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \Aylien\NewsApi\Models\Location|null $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets representativeStory + * + * @return \Aylien\NewsApi\Models\RepresentativeStory|null + */ + public function getRepresentativeStory() + { + return $this->container['representativeStory']; + } + + /** + * Sets representativeStory + * + * @param \Aylien\NewsApi\Models\RepresentativeStory|null $representativeStory representativeStory + * + * @return $this + */ + public function setRepresentativeStory($representativeStory) + { + $this->container['representativeStory'] = $representativeStory; + + return $this; + } + + /** + * Gets storyCount + * + * @return int|null + */ + public function getStoryCount() + { + return $this->container['storyCount']; + } + + /** + * Sets storyCount + * + * @param int|null $storyCount Number of stories associated with the cluster + * + * @return $this + */ + public function setStoryCount($storyCount) + { + $this->container['storyCount'] = $storyCount; + + return $this; + } + + /** + * Gets time + * + * @return \DateTime|null + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param \DateTime|null $time Time of the event + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/Models/Clusters.php b/lib/Models/Clusters.php new file mode 100644 index 0000000..9b029b2 --- /dev/null +++ b/lib/Models/Clusters.php @@ -0,0 +1,357 @@ + 'int', + 'clusters' => '\Aylien\NewsApi\Models\Cluster[]', + 'nextPageCursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'clusterCount' => 'int64', + 'clusters' => null, + 'nextPageCursor' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'clusterCount' => 'cluster_count', + 'clusters' => 'clusters', + 'nextPageCursor' => 'next_page_cursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'clusterCount' => 'setClusterCount', + 'clusters' => 'setClusters', + 'nextPageCursor' => 'setNextPageCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'clusterCount' => 'getClusterCount', + 'clusters' => 'getClusters', + 'nextPageCursor' => 'getNextPageCursor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['clusterCount'] = isset($data['clusterCount']) ? $data['clusterCount'] : null; + $this->container['clusters'] = isset($data['clusters']) ? $data['clusters'] : null; + $this->container['nextPageCursor'] = isset($data['nextPageCursor']) ? $data['nextPageCursor'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets clusterCount + * + * @return int|null + */ + public function getClusterCount() + { + return $this->container['clusterCount']; + } + + /** + * Sets clusterCount + * + * @param int|null $clusterCount The total number of clusters + * + * @return $this + */ + public function setClusterCount($clusterCount) + { + $this->container['clusterCount'] = $clusterCount; + + return $this; + } + + /** + * Gets clusters + * + * @return \Aylien\NewsApi\Models\Cluster[]|null + */ + public function getClusters() + { + return $this->container['clusters']; + } + + /** + * Sets clusters + * + * @param \Aylien\NewsApi\Models\Cluster[]|null $clusters An array of clusters + * + * @return $this + */ + public function setClusters($clusters) + { + $this->container['clusters'] = $clusters; + + return $this; + } + + /** + * Gets nextPageCursor + * + * @return string|null + */ + public function getNextPageCursor() + { + return $this->container['nextPageCursor']; + } + + /** + * Sets nextPageCursor + * + * @param string|null $nextPageCursor The next page cursor + * + * @return $this + */ + public function setNextPageCursor($nextPageCursor) + { + $this->container['nextPageCursor'] = $nextPageCursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/Models/Coverages.php b/lib/Models/Coverages.php index 8dd36df..aafa086 100644 --- a/lib/Models/Coverages.php +++ b/lib/Models/Coverages.php @@ -6,306 +6,352 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Coverages Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Coverages implements ArrayAccess +class Coverages implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Coverages'; + protected static $openAPIModelName = 'Coverages'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'story_title' => 'string', - 'story_body' => 'string', - 'story_published_at' => '\DateTime', - 'story_language' => 'string', + protected static $openAPITypes = [ 'coverages' => '\Aylien\NewsApi\Models\Story[]', - 'clusters' => '\Aylien\NewsApi\Models\StoryCluster[]' + 'storyBody' => 'string', + 'storyLanguage' => 'string', + 'storyPublishedAt' => '\DateTime', + 'storyTitle' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'coverages' => null, + 'storyBody' => null, + 'storyLanguage' => null, + 'storyPublishedAt' => 'date-time', + 'storyTitle' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'story_title' => 'story_title', - 'story_body' => 'story_body', - 'story_published_at' => 'story_published_at', - 'story_language' => 'story_language', 'coverages' => 'coverages', - 'clusters' => 'clusters' + 'storyBody' => 'story_body', + 'storyLanguage' => 'story_language', + 'storyPublishedAt' => 'story_published_at', + 'storyTitle' => 'story_title' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'story_title' => 'setStoryTitle', - 'story_body' => 'setStoryBody', - 'story_published_at' => 'setStoryPublishedAt', - 'story_language' => 'setStoryLanguage', 'coverages' => 'setCoverages', - 'clusters' => 'setClusters' + 'storyBody' => 'setStoryBody', + 'storyLanguage' => 'setStoryLanguage', + 'storyPublishedAt' => 'setStoryPublishedAt', + 'storyTitle' => 'setStoryTitle' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'story_title' => 'getStoryTitle', - 'story_body' => 'getStoryBody', - 'story_published_at' => 'getStoryPublishedAt', - 'story_language' => 'getStoryLanguage', 'coverages' => 'getCoverages', - 'clusters' => 'getClusters' + 'storyBody' => 'getStoryBody', + 'storyLanguage' => 'getStoryLanguage', + 'storyPublishedAt' => 'getStoryPublishedAt', + 'storyTitle' => 'getStoryTitle' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['story_title'] = isset($data['story_title']) ? $data['story_title'] : null; - $this->container['story_body'] = isset($data['story_body']) ? $data['story_body'] : null; - $this->container['story_published_at'] = isset($data['story_published_at']) ? $data['story_published_at'] : null; - $this->container['story_language'] = isset($data['story_language']) ? $data['story_language'] : null; $this->container['coverages'] = isset($data['coverages']) ? $data['coverages'] : null; - $this->container['clusters'] = isset($data['clusters']) ? $data['clusters'] : null; + $this->container['storyBody'] = isset($data['storyBody']) ? $data['storyBody'] : null; + $this->container['storyLanguage'] = isset($data['storyLanguage']) ? $data['storyLanguage'] : null; + $this->container['storyPublishedAt'] = isset($data['storyPublishedAt']) ? $data['storyPublishedAt'] : null; + $this->container['storyTitle'] = isset($data['storyTitle']) ? $data['storyTitle'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets story_title - * @return string + * Gets coverages + * + * @return \Aylien\NewsApi\Models\Story[]|null */ - public function getStoryTitle() + public function getCoverages() { - return $this->container['story_title']; + return $this->container['coverages']; } /** - * Sets story_title - * @param string $story_title The input story title + * Sets coverages + * + * @param \Aylien\NewsApi\Models\Story[]|null $coverages An array of coverages for the input story + * * @return $this */ - public function setStoryTitle($story_title) + public function setCoverages($coverages) { - $this->container['story_title'] = $story_title; + $this->container['coverages'] = $coverages; return $this; } /** - * Gets story_body - * @return string + * Gets storyBody + * + * @return string|null */ public function getStoryBody() { - return $this->container['story_body']; - } - - /** - * Sets story_body - * @param string $story_body The input story body - * @return $this - */ - public function setStoryBody($story_body) - { - $this->container['story_body'] = $story_body; - - return $this; + return $this->container['storyBody']; } /** - * Gets story_published_at - * @return \DateTime - */ - public function getStoryPublishedAt() - { - return $this->container['story_published_at']; - } - - /** - * Sets story_published_at - * @param \DateTime $story_published_at The input story published date + * Sets storyBody + * + * @param string|null $storyBody The input story body + * * @return $this */ - public function setStoryPublishedAt($story_published_at) + public function setStoryBody($storyBody) { - $this->container['story_published_at'] = $story_published_at; + $this->container['storyBody'] = $storyBody; return $this; } /** - * Gets story_language - * @return string + * Gets storyLanguage + * + * @return string|null */ public function getStoryLanguage() { - return $this->container['story_language']; + return $this->container['storyLanguage']; } /** - * Sets story_language - * @param string $story_language The input story language + * Sets storyLanguage + * + * @param string|null $storyLanguage The input story language + * * @return $this */ - public function setStoryLanguage($story_language) + public function setStoryLanguage($storyLanguage) { - $this->container['story_language'] = $story_language; + $this->container['storyLanguage'] = $storyLanguage; return $this; } /** - * Gets coverages - * @return \Aylien\NewsApi\Models\Story[] + * Gets storyPublishedAt + * + * @return \DateTime|null */ - public function getCoverages() + public function getStoryPublishedAt() { - return $this->container['coverages']; + return $this->container['storyPublishedAt']; } /** - * Sets coverages - * @param \Aylien\NewsApi\Models\Story[] $coverages An array of coverages for the input story + * Sets storyPublishedAt + * + * @param \DateTime|null $storyPublishedAt The input story published date + * * @return $this */ - public function setCoverages($coverages) + public function setStoryPublishedAt($storyPublishedAt) { - $this->container['coverages'] = $coverages; + $this->container['storyPublishedAt'] = $storyPublishedAt; return $this; } /** - * Gets clusters - * @return \Aylien\NewsApi\Models\StoryCluster[] + * Gets storyTitle + * + * @return string|null */ - public function getClusters() + public function getStoryTitle() { - return $this->container['clusters']; + return $this->container['storyTitle']; } /** - * Sets clusters - * @param \Aylien\NewsApi\Models\StoryCluster[] $clusters An array of clusters + * Sets storyTitle + * + * @param string|null $storyTitle The input story title + * * @return $this */ - public function setClusters($clusters) + public function setStoryTitle($storyTitle) { - $this->container['clusters'] = $clusters; + $this->container['storyTitle'] = $storyTitle; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -315,7 +361,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -325,8 +373,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -340,7 +390,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -350,15 +402,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Entities.php b/lib/Models/Entities.php index d3bd810..773b44b 100644 --- a/lib/Models/Entities.php +++ b/lib/Models/Entities.php @@ -6,202 +6,262 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Entities Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Entities implements ArrayAccess +class Entities implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Entities'; + protected static $openAPIModelName = 'Entities'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'body' => '\Aylien\NewsApi\Models\Entity[]', + 'title' => '\Aylien\NewsApi\Models\Entity[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'title' => '\Aylien\NewsApi\Models\Entity[]', - 'body' => '\Aylien\NewsApi\Models\Entity[]' + protected static $openAPIFormats = [ + 'body' => null, + 'title' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'title' => 'title', - 'body' => 'body' + 'body' => 'body', + 'title' => 'title' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'title' => 'setTitle', - 'body' => 'setBody' + 'body' => 'setBody', + 'title' => 'setTitle' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'title' => 'getTitle', - 'body' => 'getBody' + 'body' => 'getBody', + 'title' => 'getTitle' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['title'] = isset($data['title']) ? $data['title'] : null; $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets title - * @return \Aylien\NewsApi\Models\Entity[] + * Gets body + * + * @return \Aylien\NewsApi\Models\Entity[]|null */ - public function getTitle() + public function getBody() { - return $this->container['title']; + return $this->container['body']; } /** - * Sets title - * @param \Aylien\NewsApi\Models\Entity[] $title An array of extracted entities from the story title + * Sets body + * + * @param \Aylien\NewsApi\Models\Entity[]|null $body An array of extracted entities from the story body + * * @return $this */ - public function setTitle($title) + public function setBody($body) { - $this->container['title'] = $title; + $this->container['body'] = $body; return $this; } /** - * Gets body - * @return \Aylien\NewsApi\Models\Entity[] + * Gets title + * + * @return \Aylien\NewsApi\Models\Entity[]|null */ - public function getBody() + public function getTitle() { - return $this->container['body']; + return $this->container['title']; } /** - * Sets body - * @param \Aylien\NewsApi\Models\Entity[] $body An array of extracted entities from the story body + * Sets title + * + * @param \Aylien\NewsApi\Models\Entity[]|null $title An array of extracted entities from the story title + * * @return $this */ - public function setBody($body) + public function setTitle($title) { - $this->container['body'] = $body; + $this->container['title'] = $title; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Entity.php b/lib/Models/Entity.php index f9891e7..2bcf5f1 100644 --- a/lib/Models/Entity.php +++ b/lib/Models/Entity.php @@ -6,211 +6,288 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Entity Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Entity implements ArrayAccess +class Entity implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Entity'; + protected static $openAPIModelName = 'Entity'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ + 'indices' => 'int[][]', + 'links' => '\Aylien\NewsApi\Models\EntityLinks', + 'score' => 'double', 'text' => 'string', + 'types' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'indices' => 'int32', + 'links' => null, 'score' => 'double', - 'types' => 'string[]', - 'links' => '\Aylien\NewsApi\Models\EntityLinks', - 'indices' => 'int[][]' + 'text' => null, + 'types' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'text' => 'text', - 'score' => 'score', - 'types' => 'types', + 'indices' => 'indices', 'links' => 'links', - 'indices' => 'indices' + 'score' => 'score', + 'text' => 'text', + 'types' => 'types' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'text' => 'setText', - 'score' => 'setScore', - 'types' => 'setTypes', + 'indices' => 'setIndices', 'links' => 'setLinks', - 'indices' => 'setIndices' + 'score' => 'setScore', + 'text' => 'setText', + 'types' => 'setTypes' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'text' => 'getText', - 'score' => 'getScore', - 'types' => 'getTypes', + 'indices' => 'getIndices', 'links' => 'getLinks', - 'indices' => 'getIndices' + 'score' => 'getScore', + 'text' => 'getText', + 'types' => 'getTypes' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['text'] = isset($data['text']) ? $data['text'] : null; + $this->container['indices'] = isset($data['indices']) ? $data['indices'] : null; + $this->container['links'] = isset($data['links']) ? $data['links'] : null; $this->container['score'] = isset($data['score']) ? $data['score'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; $this->container['types'] = isset($data['types']) ? $data['types'] : null; - $this->container['links'] = isset($data['links']) ? $data['links'] : null; - $this->container['indices'] = isset($data['indices']) ? $data['indices'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if (!is_null($this->container['score']) && ($this->container['score'] > 1)) { - $invalid_properties[] = "invalid value for 'score', must be smaller than or equal to 1."; + $invalidProperties[] = "invalid value for 'score', must be smaller than or equal to 1."; } if (!is_null($this->container['score']) && ($this->container['score'] < 0)) { - $invalid_properties[] = "invalid value for 'score', must be bigger than or equal to 0."; + $invalidProperties[] = "invalid value for 'score', must be bigger than or equal to 0."; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { + return count($this->listInvalidProperties()) === 0; + } - if ($this->container['score'] > 1) { - return false; - } - if ($this->container['score'] < 0) { - return false; - } - return true; + + /** + * Gets indices + * + * @return int[][]|null + */ + public function getIndices() + { + return $this->container['indices']; } + /** + * Sets indices + * + * @param int[][]|null $indices The indices of the entity text + * + * @return $this + */ + public function setIndices($indices) + { + $this->container['indices'] = $indices; + + return $this; + } /** - * Gets text - * @return string + * Gets links + * + * @return \Aylien\NewsApi\Models\EntityLinks|null */ - public function getText() + public function getLinks() { - return $this->container['text']; + return $this->container['links']; } /** - * Sets text - * @param string $text The entity text + * Sets links + * + * @param \Aylien\NewsApi\Models\EntityLinks|null $links links + * * @return $this */ - public function setText($text) + public function setLinks($links) { - $this->container['text'] = $text; + $this->container['links'] = $links; return $this; } /** * Gets score - * @return double + * + * @return double|null */ public function getScore() { @@ -219,7 +296,9 @@ public function getScore() /** * Sets score - * @param double $score The entity score + * + * @param double|null $score The entity score + * * @return $this */ public function setScore($score) @@ -238,70 +317,57 @@ public function setScore($score) } /** - * Gets types - * @return string[] - */ - public function getTypes() - { - return $this->container['types']; - } - - /** - * Sets types - * @param string[] $types An array of the dbpedia types - * @return $this - */ - public function setTypes($types) - { - $this->container['types'] = $types; - - return $this; - } - - /** - * Gets links - * @return \Aylien\NewsApi\Models\EntityLinks + * Gets text + * + * @return string|null */ - public function getLinks() + public function getText() { - return $this->container['links']; + return $this->container['text']; } /** - * Sets links - * @param \Aylien\NewsApi\Models\EntityLinks $links Related links to the entity + * Sets text + * + * @param string|null $text The entity text + * * @return $this */ - public function setLinks($links) + public function setText($text) { - $this->container['links'] = $links; + $this->container['text'] = $text; return $this; } /** - * Gets indices - * @return int[][] + * Gets types + * + * @return string[]|null */ - public function getIndices() + public function getTypes() { - return $this->container['indices']; + return $this->container['types']; } /** - * Sets indices - * @param int[][] $indices The indices of the entity text + * Sets types + * + * @param string[]|null $types An array of the dbpedia types + * * @return $this */ - public function setIndices($indices) + public function setTypes($types) { - $this->container['indices'] = $indices; + $this->container['types'] = $types; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -311,7 +377,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -321,8 +389,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -336,7 +406,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -346,15 +418,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/EntityLinks.php b/lib/Models/EntityLinks.php index fc41a42..136518b 100644 --- a/lib/Models/EntityLinks.php +++ b/lib/Models/EntityLinks.php @@ -6,122 +6,174 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * EntityLinks Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class EntityLinks implements ArrayAccess +class EntityLinks implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'EntityLinks'; + protected static $openAPIModelName = 'EntityLinks'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'dbpedia' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'dbpedia' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'dbpedia' => 'dbpedia' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'dbpedia' => 'setDbpedia' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'dbpedia' => 'getDbpedia' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -129,33 +181,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets dbpedia - * @return string + * + * @return string|null */ public function getDbpedia() { @@ -164,7 +216,9 @@ public function getDbpedia() /** * Sets dbpedia - * @param string $dbpedia A dbpedia resource URL + * + * @param string|null $dbpedia A dbpedia resource URL + * * @return $this */ public function setDbpedia($dbpedia) @@ -175,7 +229,9 @@ public function setDbpedia($dbpedia) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -185,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -195,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -210,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -220,15 +282,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Error.php b/lib/Models/Error.php index 0565c31..f9559c0 100644 --- a/lib/Models/Error.php +++ b/lib/Models/Error.php @@ -6,306 +6,382 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Error Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Error implements ArrayAccess +class Error implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Error'; + protected static $openAPIModelName = 'Error'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ + 'code' => 'string', + 'detail' => 'string', 'id' => 'string', 'links' => '\Aylien\NewsApi\Models\ErrorLinks', 'status' => 'string', - 'code' => 'string', - 'title' => 'string', - 'detail' => 'string' + 'title' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'code' => null, + 'detail' => null, + 'id' => null, + 'links' => null, + 'status' => null, + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ + 'code' => 'code', + 'detail' => 'detail', 'id' => 'id', 'links' => 'links', 'status' => 'status', - 'code' => 'code', - 'title' => 'title', - 'detail' => 'detail' + 'title' => 'title' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ + 'code' => 'setCode', + 'detail' => 'setDetail', 'id' => 'setId', 'links' => 'setLinks', 'status' => 'setStatus', - 'code' => 'setCode', - 'title' => 'setTitle', - 'detail' => 'setDetail' + 'title' => 'setTitle' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ + 'code' => 'getCode', + 'detail' => 'getDetail', 'id' => 'getId', 'links' => 'getLinks', 'status' => 'getStatus', - 'code' => 'getCode', - 'title' => 'getTitle', - 'detail' => 'getDetail' + 'title' => 'getTitle' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['detail'] = isset($data['detail']) ? $data['detail'] : null; $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['links'] = isset($data['links']) ? $data['links'] : null; $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['code'] = isset($data['code']) ? $data['code'] : null; $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['detail'] = isset($data['detail']) ? $data['detail'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets id - * @return string + * Gets code + * + * @return string|null */ - public function getId() + public function getCode() { - return $this->container['id']; + return $this->container['code']; } /** - * Sets id - * @param string $id + * Sets code + * + * @param string|null $code code + * * @return $this */ - public function setId($id) + public function setCode($code) { - $this->container['id'] = $id; + $this->container['code'] = $code; return $this; } /** - * Gets links - * @return \Aylien\NewsApi\Models\ErrorLinks + * Gets detail + * + * @return string|null */ - public function getLinks() + public function getDetail() { - return $this->container['links']; + return $this->container['detail']; } /** - * Sets links - * @param \Aylien\NewsApi\Models\ErrorLinks $links + * Sets detail + * + * @param string|null $detail detail + * * @return $this */ - public function setLinks($links) + public function setDetail($detail) { - $this->container['links'] = $links; + $this->container['detail'] = $detail; return $this; } /** - * Gets status - * @return string + * Gets id + * + * @return string|null */ - public function getStatus() + public function getId() { - return $this->container['status']; + return $this->container['id']; } /** - * Sets status - * @param string $status + * Sets id + * + * @param string|null $id id + * * @return $this */ - public function setStatus($status) + public function setId($id) { - $this->container['status'] = $status; + $this->container['id'] = $id; return $this; } /** - * Gets code - * @return string + * Gets links + * + * @return \Aylien\NewsApi\Models\ErrorLinks|null */ - public function getCode() + public function getLinks() { - return $this->container['code']; + return $this->container['links']; } /** - * Sets code - * @param string $code + * Sets links + * + * @param \Aylien\NewsApi\Models\ErrorLinks|null $links links + * * @return $this */ - public function setCode($code) + public function setLinks($links) { - $this->container['code'] = $code; + $this->container['links'] = $links; return $this; } /** - * Gets title - * @return string + * Gets status + * + * @return string|null */ - public function getTitle() + public function getStatus() { - return $this->container['title']; + return $this->container['status']; } /** - * Sets title - * @param string $title + * Sets status + * + * @param string|null $status status + * * @return $this */ - public function setTitle($title) + public function setStatus($status) { - $this->container['title'] = $title; + $this->container['status'] = $status; return $this; } /** - * Gets detail - * @return string + * Gets title + * + * @return string|null */ - public function getDetail() + public function getTitle() { - return $this->container['detail']; + return $this->container['title']; } /** - * Sets detail - * @param string $detail + * Sets title + * + * @param string|null $title title + * * @return $this */ - public function setDetail($detail) + public function setTitle($title) { - $this->container['detail'] = $detail; + $this->container['title'] = $title; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -315,7 +391,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -325,8 +403,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -340,7 +420,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -350,15 +432,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/ErrorLinks.php b/lib/Models/ErrorLinks.php index b9c38e0..25823e6 100644 --- a/lib/Models/ErrorLinks.php +++ b/lib/Models/ErrorLinks.php @@ -6,122 +6,174 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * ErrorLinks Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class ErrorLinks implements ArrayAccess +class ErrorLinks implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'ErrorLinks'; + protected static $openAPIModelName = 'ErrorLinks'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'about' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'about' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'about' => 'about' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'about' => 'setAbout' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'about' => 'getAbout' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -129,33 +181,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets about - * @return string + * + * @return string|null */ public function getAbout() { @@ -164,7 +216,9 @@ public function getAbout() /** * Sets about - * @param string $about + * + * @param string|null $about about + * * @return $this */ public function setAbout($about) @@ -175,7 +229,9 @@ public function setAbout($about) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -185,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -195,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -210,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -220,15 +282,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Errors.php b/lib/Models/Errors.php index eef2ef6..0f6fa34 100644 --- a/lib/Models/Errors.php +++ b/lib/Models/Errors.php @@ -6,122 +6,174 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Errors Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Errors implements ArrayAccess +class Errors implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Errors'; + protected static $openAPIModelName = 'Errors'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'errors' => '\Aylien\NewsApi\Models\Error[]' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'errors' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'errors' => 'errors' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'errors' => 'setErrors' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'errors' => 'getErrors' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -129,33 +181,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets errors - * @return \Aylien\NewsApi\Models\Error[] + * + * @return \Aylien\NewsApi\Models\Error[]|null */ public function getErrors() { @@ -164,7 +216,9 @@ public function getErrors() /** * Sets errors - * @param \Aylien\NewsApi\Models\Error[] $errors + * + * @param \Aylien\NewsApi\Models\Error[]|null $errors errors + * * @return $this */ public function setErrors($errors) @@ -175,7 +229,9 @@ public function setErrors($errors) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -185,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -195,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -210,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -220,15 +282,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/HistogramInterval.php b/lib/Models/HistogramInterval.php index 67fe508..c19c3f5 100644 --- a/lib/Models/HistogramInterval.php +++ b/lib/Models/HistogramInterval.php @@ -6,71 +6,95 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * HistogramInterval Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class HistogramInterval implements ArrayAccess +class HistogramInterval implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'HistogramInterval'; + protected static $openAPIModelName = 'HistogramInterval'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'bin' => 'int', 'count' => 'int' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'bin' => 'int32', + 'count' => 'int32' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -78,9 +102,9 @@ public static function apiTypes() 'count' => 'count' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -88,9 +112,9 @@ public static function apiTypes() 'count' => 'setCount' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -98,34 +122,63 @@ public static function apiTypes() 'count' => 'getCount' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -134,33 +187,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets bin - * @return int + * + * @return int|null */ public function getBin() { @@ -169,7 +222,9 @@ public function getBin() /** * Sets bin - * @param int $bin Histogram bin + * + * @param int|null $bin Histogram bin + * * @return $this */ public function setBin($bin) @@ -181,7 +236,8 @@ public function setBin($bin) /** * Gets count - * @return int + * + * @return int|null */ public function getCount() { @@ -190,7 +246,9 @@ public function getCount() /** * Sets count - * @param int $count Histogram bin size + * + * @param int|null $count Histogram bin size + * * @return $this */ public function setCount($count) @@ -201,7 +259,9 @@ public function setCount($count) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Histograms.php b/lib/Models/Histograms.php index 1ff0131..e0cccc6 100644 --- a/lib/Models/Histograms.php +++ b/lib/Models/Histograms.php @@ -6,280 +6,352 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Histograms Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Histograms implements ArrayAccess +class Histograms implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Histograms'; + protected static $openAPIModelName = 'Histograms'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'intervals' => '\Aylien\NewsApi\Models\HistogramInterval[]', - 'interval_start' => 'int', - 'interval_end' => 'int', - 'interval_width' => 'int', - 'field' => 'string' + protected static $openAPITypes = [ + 'field' => 'string', + 'intervalEnd' => 'int', + 'intervalStart' => 'int', + 'intervalWidth' => 'int', + 'intervals' => '\Aylien\NewsApi\Models\HistogramInterval[]' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'field' => null, + 'intervalEnd' => 'int32', + 'intervalStart' => 'int32', + 'intervalWidth' => 'int32', + 'intervals' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'intervals' => 'intervals', - 'interval_start' => 'interval.start', - 'interval_end' => 'interval.end', - 'interval_width' => 'interval.width', - 'field' => 'field' + 'field' => 'field', + 'intervalEnd' => 'interval.end', + 'intervalStart' => 'interval.start', + 'intervalWidth' => 'interval.width', + 'intervals' => 'intervals' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'intervals' => 'setIntervals', - 'interval_start' => 'setIntervalStart', - 'interval_end' => 'setIntervalEnd', - 'interval_width' => 'setIntervalWidth', - 'field' => 'setField' + 'field' => 'setField', + 'intervalEnd' => 'setIntervalEnd', + 'intervalStart' => 'setIntervalStart', + 'intervalWidth' => 'setIntervalWidth', + 'intervals' => 'setIntervals' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'intervals' => 'getIntervals', - 'interval_start' => 'getIntervalStart', - 'interval_end' => 'getIntervalEnd', - 'interval_width' => 'getIntervalWidth', - 'field' => 'getField' + 'field' => 'getField', + 'intervalEnd' => 'getIntervalEnd', + 'intervalStart' => 'getIntervalStart', + 'intervalWidth' => 'getIntervalWidth', + 'intervals' => 'getIntervals' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['intervals'] = isset($data['intervals']) ? $data['intervals'] : null; - $this->container['interval_start'] = isset($data['interval_start']) ? $data['interval_start'] : null; - $this->container['interval_end'] = isset($data['interval_end']) ? $data['interval_end'] : null; - $this->container['interval_width'] = isset($data['interval_width']) ? $data['interval_width'] : null; $this->container['field'] = isset($data['field']) ? $data['field'] : null; + $this->container['intervalEnd'] = isset($data['intervalEnd']) ? $data['intervalEnd'] : null; + $this->container['intervalStart'] = isset($data['intervalStart']) ? $data['intervalStart'] : null; + $this->container['intervalWidth'] = isset($data['intervalWidth']) ? $data['intervalWidth'] : null; + $this->container['intervals'] = isset($data['intervals']) ? $data['intervals'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets intervals - * @return \Aylien\NewsApi\Models\HistogramInterval[] + * Gets field + * + * @return string|null */ - public function getIntervals() + public function getField() { - return $this->container['intervals']; + return $this->container['field']; } /** - * Sets intervals - * @param \Aylien\NewsApi\Models\HistogramInterval[] $intervals The intervals of the histograms + * Sets field + * + * @param string|null $field field + * * @return $this */ - public function setIntervals($intervals) + public function setField($field) { - $this->container['intervals'] = $intervals; + $this->container['field'] = $field; return $this; } /** - * Gets interval_start - * @return int + * Gets intervalEnd + * + * @return int|null */ - public function getIntervalStart() + public function getIntervalEnd() { - return $this->container['interval_start']; + return $this->container['intervalEnd']; } /** - * Sets interval_start - * @param int $interval_start The start interval of the histogram + * Sets intervalEnd + * + * @param int|null $intervalEnd The end interval of the histogram + * * @return $this */ - public function setIntervalStart($interval_start) + public function setIntervalEnd($intervalEnd) { - $this->container['interval_start'] = $interval_start; + $this->container['intervalEnd'] = $intervalEnd; return $this; } /** - * Gets interval_end - * @return int + * Gets intervalStart + * + * @return int|null */ - public function getIntervalEnd() + public function getIntervalStart() { - return $this->container['interval_end']; + return $this->container['intervalStart']; } /** - * Sets interval_end - * @param int $interval_end The end interval of the histogram + * Sets intervalStart + * + * @param int|null $intervalStart The start interval of the histogram + * * @return $this */ - public function setIntervalEnd($interval_end) + public function setIntervalStart($intervalStart) { - $this->container['interval_end'] = $interval_end; + $this->container['intervalStart'] = $intervalStart; return $this; } /** - * Gets interval_width - * @return int + * Gets intervalWidth + * + * @return int|null */ public function getIntervalWidth() { - return $this->container['interval_width']; + return $this->container['intervalWidth']; } /** - * Sets interval_width - * @param int $interval_width The width of the histogram + * Sets intervalWidth + * + * @param int|null $intervalWidth The width of the histogram + * * @return $this */ - public function setIntervalWidth($interval_width) + public function setIntervalWidth($intervalWidth) { - $this->container['interval_width'] = $interval_width; + $this->container['intervalWidth'] = $intervalWidth; return $this; } /** - * Gets field - * @return string + * Gets intervals + * + * @return \Aylien\NewsApi\Models\HistogramInterval[]|null */ - public function getField() + public function getIntervals() { - return $this->container['field']; + return $this->container['intervals']; } /** - * Sets field - * @param string $field + * Sets intervals + * + * @param \Aylien\NewsApi\Models\HistogramInterval[]|null $intervals The intervals of the histograms + * * @return $this */ - public function setField($field) + public function setIntervals($intervals) { - $this->container['field'] = $field; + $this->container['intervals'] = $intervals; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -289,7 +361,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -299,8 +373,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -314,7 +390,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -324,15 +402,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Location.php b/lib/Models/Location.php index d59b3e6..7177e71 100644 --- a/lib/Models/Location.php +++ b/lib/Models/Location.php @@ -6,228 +6,292 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Location Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Location implements ArrayAccess +class Location implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Location'; + protected static $openAPIModelName = 'Location'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ + 'city' => 'string', 'country' => 'string', - 'state' => 'string', - 'city' => 'string' + 'state' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'state' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ + 'city' => 'city', 'country' => 'country', - 'state' => 'state', - 'city' => 'city' + 'state' => 'state' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ + 'city' => 'setCity', 'country' => 'setCountry', - 'state' => 'setState', - 'city' => 'setCity' + 'state' => 'setState' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ + 'city' => 'getCity', 'country' => 'getCountry', - 'state' => 'getState', - 'city' => 'getCity' + 'state' => 'getState' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['city'] = isset($data['city']) ? $data['city'] : null; $this->container['country'] = isset($data['country']) ? $data['country'] : null; $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['city'] = isset($data['city']) ? $data['city'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets country - * @return string + * Gets city + * + * @return string|null */ - public function getCountry() + public function getCity() { - return $this->container['country']; + return $this->container['city']; } /** - * Sets country - * @param string $country The country code of the location. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. + * Sets city + * + * @param string|null $city The city of the location + * * @return $this */ - public function setCountry($country) + public function setCity($city) { - $this->container['country'] = $country; + $this->container['city'] = $city; return $this; } /** - * Gets state - * @return string + * Gets country + * + * @return string|null */ - public function getState() + public function getCountry() { - return $this->container['state']; + return $this->container['country']; } /** - * Sets state - * @param string $state The state of the location + * Sets country + * + * @param string|null $country The country code of the location. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. + * * @return $this */ - public function setState($state) + public function setCountry($country) { - $this->container['state'] = $state; + $this->container['country'] = $country; return $this; } /** - * Gets city - * @return string + * Gets state + * + * @return string|null */ - public function getCity() + public function getState() { - return $this->container['city']; + return $this->container['state']; } /** - * Sets city - * @param string $city The city of the location + * Sets state + * + * @param string|null $state The state of the location + * * @return $this */ - public function setCity($city) + public function setState($state) { - $this->container['city'] = $city; + $this->container['state'] = $state; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -237,7 +301,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -247,8 +313,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -262,7 +330,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -272,15 +342,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Media.php b/lib/Models/Media.php index 6a301e0..304dbe2 100644 --- a/lib/Models/Media.php +++ b/lib/Models/Media.php @@ -6,131 +6,183 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Media Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Media implements ArrayAccess +class Media implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Media'; + protected static $openAPIModelName = 'Media'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ + 'contentLength' => 'int', + 'format' => 'string', + 'height' => 'int', 'type' => 'string', 'url' => 'string', - 'format' => 'string', - 'content_length' => 'int', - 'width' => 'int', - 'height' => 'int' + 'width' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'contentLength' => 'int32', + 'format' => null, + 'height' => 'int32', + 'type' => null, + 'url' => null, + 'width' => 'int32' ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ + 'contentLength' => 'content_length', + 'format' => 'format', + 'height' => 'height', 'type' => 'type', 'url' => 'url', - 'format' => 'format', - 'content_length' => 'content_length', - 'width' => 'width', - 'height' => 'height' + 'width' => 'width' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ + 'contentLength' => 'setContentLength', + 'format' => 'setFormat', + 'height' => 'setHeight', 'type' => 'setType', 'url' => 'setUrl', - 'format' => 'setFormat', - 'content_length' => 'setContentLength', - 'width' => 'setWidth', - 'height' => 'setHeight' + 'width' => 'setWidth' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ + 'contentLength' => 'getContentLength', + 'format' => 'getFormat', + 'height' => 'getHeight', 'type' => 'getType', 'url' => 'getUrl', - 'format' => 'getFormat', - 'content_length' => 'getContentLength', - 'width' => 'getWidth', - 'height' => 'getHeight' + 'width' => 'getWidth' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } - const TYPE_IMAGE = 'image'; - const TYPE_VIDEO = 'video'; + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + const FORMAT_BMP = 'BMP'; const FORMAT_GIF = 'GIF'; const FORMAT_JPEG = 'JPEG'; @@ -141,23 +193,14 @@ public static function getters() const FORMAT_CUR = 'CUR'; const FORMAT_WEBP = 'WEBP'; const FORMAT_SVG = 'SVG'; + const TYPE_IMAGE = 'image'; + const TYPE_VIDEO = 'video'; /** * Gets allowable values of the enum - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_IMAGE, - self::TYPE_VIDEO, - ]; - } - - /** - * Gets allowable values of the enum + * * @return string[] */ public function getFormatAllowableValues() @@ -176,206 +219,249 @@ public function getFormatAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_IMAGE, + self::TYPE_VIDEO, + ]; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['contentLength'] = isset($data['contentLength']) ? $data['contentLength'] : null; + $this->container['format'] = isset($data['format']) ? $data['format'] : null; + $this->container['height'] = isset($data['height']) ? $data['height'] : null; $this->container['type'] = isset($data['type']) ? $data['type'] : null; $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['format'] = isset($data['format']) ? $data['format'] : null; - $this->container['content_length'] = isset($data['content_length']) ? $data['content_length'] : null; $this->container['width'] = isset($data['width']) ? $data['width'] : null; - $this->container['height'] = isset($data['height']) ? $data['height'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; - - $allowed_values = ["image", "video"]; - if (!in_array($this->container['type'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'type', must be one of 'image', 'video'."; + $invalidProperties = []; + + $allowedValues = $this->getFormatAllowableValues(); + if (!is_null($this->container['format']) && !in_array($this->container['format'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'format', must be one of '%s'", + implode("', '", $allowedValues) + ); } - $allowed_values = ["BMP", "GIF", "JPEG", "PNG", "TIFF", "PSD", "ICO", "CUR", "WEBP", "SVG"]; - if (!in_array($this->container['format'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'format', must be one of 'BMP', 'GIF', 'JPEG', 'PNG', 'TIFF', 'PSD', 'ICO', 'CUR', 'WEBP', 'SVG'."; + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - $allowed_values = ["image", "video"]; - if (!in_array($this->container['type'], $allowed_values)) { - return false; - } - $allowed_values = ["BMP", "GIF", "JPEG", "PNG", "TIFF", "PSD", "ICO", "CUR", "WEBP", "SVG"]; - if (!in_array($this->container['format'], $allowed_values)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets type - * @return string + * Gets contentLength + * + * @return int|null */ - public function getType() + public function getContentLength() { - return $this->container['type']; + return $this->container['contentLength']; } /** - * Sets type - * @param string $type The type of media + * Sets contentLength + * + * @param int|null $contentLength The content length of media + * * @return $this */ - public function setType($type) + public function setContentLength($contentLength) { - $allowed_values = array('image', 'video'); - if (!is_null($type) && (!in_array($type, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'type', must be one of 'image', 'video'"); - } - $this->container['type'] = $type; + $this->container['contentLength'] = $contentLength; return $this; } /** - * Gets url - * @return string + * Gets format + * + * @return string|null */ - public function getUrl() + public function getFormat() { - return $this->container['url']; + return $this->container['format']; } /** - * Sets url - * @param string $url A URL which points to the media file + * Sets format + * + * @param string|null $format The format of media + * * @return $this */ - public function setUrl($url) + public function setFormat($format) { - $this->container['url'] = $url; + $allowedValues = $this->getFormatAllowableValues(); + if (!is_null($format) && !in_array($format, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'format', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['format'] = $format; return $this; } /** - * Gets format - * @return string + * Gets height + * + * @return int|null */ - public function getFormat() + public function getHeight() { - return $this->container['format']; + return $this->container['height']; } /** - * Sets format - * @param string $format The format of media + * Sets height + * + * @param int|null $height The height of media + * * @return $this */ - public function setFormat($format) + public function setHeight($height) { - $allowed_values = array('BMP', 'GIF', 'JPEG', 'PNG', 'TIFF', 'PSD', 'ICO', 'CUR', 'WEBP', 'SVG'); - if (!is_null($format) && (!in_array($format, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'format', must be one of 'BMP', 'GIF', 'JPEG', 'PNG', 'TIFF', 'PSD', 'ICO', 'CUR', 'WEBP', 'SVG'"); - } - $this->container['format'] = $format; + $this->container['height'] = $height; return $this; } /** - * Gets content_length - * @return int + * Gets type + * + * @return string|null */ - public function getContentLength() + public function getType() { - return $this->container['content_length']; + return $this->container['type']; } /** - * Sets content_length - * @param int $content_length The content length of media + * Sets type + * + * @param string|null $type The type of media + * * @return $this */ - public function setContentLength($content_length) + public function setType($type) { - $this->container['content_length'] = $content_length; + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; return $this; } /** - * Gets width - * @return int + * Gets url + * + * @return string|null */ - public function getWidth() + public function getUrl() { - return $this->container['width']; + return $this->container['url']; } /** - * Sets width - * @param int $width The width of media + * Sets url + * + * @param string|null $url A URL which points to the media file + * * @return $this */ - public function setWidth($width) + public function setUrl($url) { - $this->container['width'] = $width; + $this->container['url'] = $url; return $this; } /** - * Gets height - * @return int + * Gets width + * + * @return int|null */ - public function getHeight() + public function getWidth() { - return $this->container['height']; + return $this->container['width']; } /** - * Sets height - * @param int $height The height of media + * Sets width + * + * @param int|null $width The width of media + * * @return $this */ - public function setHeight($height) + public function setWidth($width) { - $this->container['height'] = $height; + $this->container['width'] = $width; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -385,7 +471,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -395,8 +483,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -410,7 +500,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -420,15 +512,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/ModelInterface.php b/lib/Models/ModelInterface.php new file mode 100644 index 0000000..786ef3c --- /dev/null +++ b/lib/Models/ModelInterface.php @@ -0,0 +1,96 @@ + 'int', + protected static $openAPITypes = [ 'country' => 'string', - 'fetched_at' => '\DateTime' + 'fetchedAt' => '\DateTime', + 'rank' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'country' => null, + 'fetchedAt' => 'date-time', + 'rank' => 'int32' ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'rank' => 'rank', 'country' => 'country', - 'fetched_at' => 'fetched_at' + 'fetchedAt' => 'fetched_at', + 'rank' => 'rank' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'rank' => 'setRank', 'country' => 'setCountry', - 'fetched_at' => 'setFetchedAt' + 'fetchedAt' => 'setFetchedAt', + 'rank' => 'setRank' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'rank' => 'getRank', 'country' => 'getCountry', - 'fetched_at' => 'getFetchedAt' + 'fetchedAt' => 'getFetchedAt', + 'rank' => 'getRank' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['rank'] = isset($data['rank']) ? $data['rank'] : null; $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['fetched_at'] = isset($data['fetched_at']) ? $data['fetched_at'] : null; + $this->container['fetchedAt'] = isset($data['fetchedAt']) ? $data['fetchedAt'] : null; + $this->container['rank'] = isset($data['rank']) ? $data['rank'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets rank - * @return int + * Gets country + * + * @return string|null */ - public function getRank() + public function getCountry() { - return $this->container['rank']; + return $this->container['country']; } /** - * Sets rank - * @param int $rank The rank + * Sets country + * + * @param string|null $country The country code which the rank is in it + * * @return $this */ - public function setRank($rank) + public function setCountry($country) { - $this->container['rank'] = $rank; + $this->container['country'] = $country; return $this; } /** - * Gets country - * @return string + * Gets fetchedAt + * + * @return \DateTime|null */ - public function getCountry() + public function getFetchedAt() { - return $this->container['country']; + return $this->container['fetchedAt']; } /** - * Sets country - * @param string $country The country code which the rank is in it + * Sets fetchedAt + * + * @param \DateTime|null $fetchedAt The fetched date of the rank + * * @return $this */ - public function setCountry($country) + public function setFetchedAt($fetchedAt) { - $this->container['country'] = $country; + $this->container['fetchedAt'] = $fetchedAt; return $this; } /** - * Gets fetched_at - * @return \DateTime + * Gets rank + * + * @return int|null */ - public function getFetchedAt() + public function getRank() { - return $this->container['fetched_at']; + return $this->container['rank']; } /** - * Sets fetched_at - * @param \DateTime $fetched_at The fetched date of the rank + * Sets rank + * + * @param int|null $rank The rank + * * @return $this */ - public function setFetchedAt($fetched_at) + public function setRank($rank) { - $this->container['fetched_at'] = $fetched_at; + $this->container['rank'] = $rank; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -237,7 +301,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -247,8 +313,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -262,7 +330,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -272,15 +342,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Rankings.php b/lib/Models/Rankings.php index 0354323..83d8e63 100644 --- a/lib/Models/Rankings.php +++ b/lib/Models/Rankings.php @@ -6,122 +6,174 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Rankings Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Rankings implements ArrayAccess +class Rankings implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Rankings'; + protected static $openAPIModelName = 'Rankings'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'alexa' => '\Aylien\NewsApi\Models\Rank[]' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'alexa' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'alexa' => 'alexa' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'alexa' => 'setAlexa' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'alexa' => 'getAlexa' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -129,33 +181,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets alexa - * @return \Aylien\NewsApi\Models\Rank[] + * + * @return \Aylien\NewsApi\Models\Rank[]|null */ public function getAlexa() { @@ -164,7 +216,9 @@ public function getAlexa() /** * Sets alexa - * @param \Aylien\NewsApi\Models\Rank[] $alexa + * + * @param \Aylien\NewsApi\Models\Rank[]|null $alexa alexa + * * @return $this */ public function setAlexa($alexa) @@ -175,7 +229,9 @@ public function setAlexa($alexa) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -185,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -195,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -210,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -220,15 +282,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/RelatedStories.php b/lib/Models/RelatedStories.php index ff86920..41c8a1a 100644 --- a/lib/Models/RelatedStories.php +++ b/lib/Models/RelatedStories.php @@ -6,280 +6,322 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * RelatedStories Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class RelatedStories implements ArrayAccess +class RelatedStories implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'RelatedStories'; + protected static $openAPIModelName = 'RelatedStories'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'relatedStories' => '\Aylien\NewsApi\Models\Story[]', + 'storyBody' => 'string', + 'storyLanguage' => 'string', + 'storyTitle' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'story_title' => 'string', - 'story_body' => 'string', - 'story_language' => 'string', - 'related_stories' => '\Aylien\NewsApi\Models\Story[]', - 'clusters' => '\Aylien\NewsApi\Models\StoryCluster[]' + protected static $openAPIFormats = [ + 'relatedStories' => null, + 'storyBody' => null, + 'storyLanguage' => null, + 'storyTitle' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'story_title' => 'story_title', - 'story_body' => 'story_body', - 'story_language' => 'story_language', - 'related_stories' => 'related_stories', - 'clusters' => 'clusters' + 'relatedStories' => 'related_stories', + 'storyBody' => 'story_body', + 'storyLanguage' => 'story_language', + 'storyTitle' => 'story_title' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'story_title' => 'setStoryTitle', - 'story_body' => 'setStoryBody', - 'story_language' => 'setStoryLanguage', - 'related_stories' => 'setRelatedStories', - 'clusters' => 'setClusters' + 'relatedStories' => 'setRelatedStories', + 'storyBody' => 'setStoryBody', + 'storyLanguage' => 'setStoryLanguage', + 'storyTitle' => 'setStoryTitle' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'story_title' => 'getStoryTitle', - 'story_body' => 'getStoryBody', - 'story_language' => 'getStoryLanguage', - 'related_stories' => 'getRelatedStories', - 'clusters' => 'getClusters' + 'relatedStories' => 'getRelatedStories', + 'storyBody' => 'getStoryBody', + 'storyLanguage' => 'getStoryLanguage', + 'storyTitle' => 'getStoryTitle' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['story_title'] = isset($data['story_title']) ? $data['story_title'] : null; - $this->container['story_body'] = isset($data['story_body']) ? $data['story_body'] : null; - $this->container['story_language'] = isset($data['story_language']) ? $data['story_language'] : null; - $this->container['related_stories'] = isset($data['related_stories']) ? $data['related_stories'] : null; - $this->container['clusters'] = isset($data['clusters']) ? $data['clusters'] : null; + $this->container['relatedStories'] = isset($data['relatedStories']) ? $data['relatedStories'] : null; + $this->container['storyBody'] = isset($data['storyBody']) ? $data['storyBody'] : null; + $this->container['storyLanguage'] = isset($data['storyLanguage']) ? $data['storyLanguage'] : null; + $this->container['storyTitle'] = isset($data['storyTitle']) ? $data['storyTitle'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets story_title - * @return string + * Gets relatedStories + * + * @return \Aylien\NewsApi\Models\Story[]|null */ - public function getStoryTitle() + public function getRelatedStories() { - return $this->container['story_title']; + return $this->container['relatedStories']; } /** - * Sets story_title - * @param string $story_title The input story title + * Sets relatedStories + * + * @param \Aylien\NewsApi\Models\Story[]|null $relatedStories An array of related stories for the input story + * * @return $this */ - public function setStoryTitle($story_title) + public function setRelatedStories($relatedStories) { - $this->container['story_title'] = $story_title; + $this->container['relatedStories'] = $relatedStories; return $this; } /** - * Gets story_body - * @return string + * Gets storyBody + * + * @return string|null */ public function getStoryBody() { - return $this->container['story_body']; + return $this->container['storyBody']; } /** - * Sets story_body - * @param string $story_body The input story body + * Sets storyBody + * + * @param string|null $storyBody The input story body + * * @return $this */ - public function setStoryBody($story_body) + public function setStoryBody($storyBody) { - $this->container['story_body'] = $story_body; + $this->container['storyBody'] = $storyBody; return $this; } /** - * Gets story_language - * @return string + * Gets storyLanguage + * + * @return string|null */ public function getStoryLanguage() { - return $this->container['story_language']; + return $this->container['storyLanguage']; } /** - * Sets story_language - * @param string $story_language The input story language - * @return $this - */ - public function setStoryLanguage($story_language) - { - $this->container['story_language'] = $story_language; - - return $this; - } - - /** - * Gets related_stories - * @return \Aylien\NewsApi\Models\Story[] - */ - public function getRelatedStories() - { - return $this->container['related_stories']; - } - - /** - * Sets related_stories - * @param \Aylien\NewsApi\Models\Story[] $related_stories An array of related stories for the input story + * Sets storyLanguage + * + * @param string|null $storyLanguage The input story language + * * @return $this */ - public function setRelatedStories($related_stories) + public function setStoryLanguage($storyLanguage) { - $this->container['related_stories'] = $related_stories; + $this->container['storyLanguage'] = $storyLanguage; return $this; } /** - * Gets clusters - * @return \Aylien\NewsApi\Models\StoryCluster[] + * Gets storyTitle + * + * @return string|null */ - public function getClusters() + public function getStoryTitle() { - return $this->container['clusters']; + return $this->container['storyTitle']; } /** - * Sets clusters - * @param \Aylien\NewsApi\Models\StoryCluster[] $clusters An array of clusters + * Sets storyTitle + * + * @param string|null $storyTitle The input story title + * * @return $this */ - public function setClusters($clusters) + public function setStoryTitle($storyTitle) { - $this->container['clusters'] = $clusters; + $this->container['storyTitle'] = $storyTitle; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -289,7 +331,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -299,8 +343,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -314,7 +360,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -324,15 +372,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/RepresentativeStory.php b/lib/Models/RepresentativeStory.php new file mode 100644 index 0000000..e8d1b92 --- /dev/null +++ b/lib/Models/RepresentativeStory.php @@ -0,0 +1,387 @@ + 'int', + 'permalink' => 'string', + 'publishedAt' => '\DateTime', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => 'int64', + 'permalink' => null, + 'publishedAt' => 'date-time', + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'permalink' => 'permalink', + 'publishedAt' => 'published_at', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'permalink' => 'setPermalink', + 'publishedAt' => 'setPublishedAt', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'permalink' => 'getPermalink', + 'publishedAt' => 'getPublishedAt', + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['permalink'] = isset($data['permalink']) ? $data['permalink'] : null; + $this->container['publishedAt'] = isset($data['publishedAt']) ? $data['publishedAt'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the story which is a unique identification + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets permalink + * + * @return string|null + */ + public function getPermalink() + { + return $this->container['permalink']; + } + + /** + * Sets permalink + * + * @param string|null $permalink The story permalink URL + * + * @return $this + */ + public function setPermalink($permalink) + { + $this->container['permalink'] = $permalink; + + return $this; + } + + /** + * Gets publishedAt + * + * @return \DateTime|null + */ + public function getPublishedAt() + { + return $this->container['publishedAt']; + } + + /** + * Sets publishedAt + * + * @param \DateTime|null $publishedAt Published date of the story + * + * @return $this + */ + public function setPublishedAt($publishedAt) + { + $this->container['publishedAt'] = $publishedAt; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Title of the story + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/Models/Scope.php b/lib/Models/Scope.php index 7218eb8..8647fdf 100644 --- a/lib/Models/Scope.php +++ b/lib/Models/Scope.php @@ -6,121 +6,173 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Scope Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Scope implements ArrayAccess +class Scope implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Scope'; + protected static $openAPIModelName = 'Scope'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'country' => 'string', - 'state' => 'string', + protected static $openAPITypes = [ 'city' => 'string', - 'level' => 'string' + 'country' => 'string', + 'level' => 'string', + 'state' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'city' => null, + 'country' => null, + 'level' => null, + 'state' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'country' => 'country', - 'state' => 'state', 'city' => 'city', - 'level' => 'level' + 'country' => 'country', + 'level' => 'level', + 'state' => 'state' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'country' => 'setCountry', - 'state' => 'setState', 'city' => 'setCity', - 'level' => 'setLevel' + 'country' => 'setCountry', + 'level' => 'setLevel', + 'state' => 'setState' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'country' => 'getCountry', - 'state' => 'getState', 'city' => 'getCity', - 'level' => 'getLevel' + 'country' => 'getCountry', + 'level' => 'getLevel', + 'state' => 'getState' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + const LEVEL_INTERNATIONAL = 'international'; const LEVEL_NATIONAL = 'national'; const LEVEL_LOCAL = 'local'; @@ -129,6 +181,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getLevelAllowableValues() @@ -143,146 +196,166 @@ public function getLevelAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; $this->container['city'] = isset($data['city']) ? $data['city'] : null; + $this->container['country'] = isset($data['country']) ? $data['country'] : null; $this->container['level'] = isset($data['level']) ? $data['level'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; - - $allowed_values = ["international", "national", "local"]; - if (!in_array($this->container['level'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'level', must be one of 'international', 'national', 'local'."; + $invalidProperties = []; + + $allowedValues = $this->getLevelAllowableValues(); + if (!is_null($this->container['level']) && !in_array($this->container['level'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'level', must be one of '%s'", + implode("', '", $allowedValues) + ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - $allowed_values = ["international", "national", "local"]; - if (!in_array($this->container['level'], $allowed_values)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets country - * @return string + * Gets city + * + * @return string|null */ - public function getCountry() + public function getCity() { - return $this->container['country']; + return $this->container['city']; } /** - * Sets country - * @param string $country The source scope by country code. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. + * Sets city + * + * @param string|null $city The scope by city + * * @return $this */ - public function setCountry($country) + public function setCity($city) { - $this->container['country'] = $country; + $this->container['city'] = $city; return $this; } /** - * Gets state - * @return string + * Gets country + * + * @return string|null */ - public function getState() + public function getCountry() { - return $this->container['state']; + return $this->container['country']; } /** - * Sets state - * @param string $state The scope by state + * Sets country + * + * @param string|null $country The source scope by country code. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. + * * @return $this */ - public function setState($state) + public function setCountry($country) { - $this->container['state'] = $state; + $this->container['country'] = $country; return $this; } /** - * Gets city - * @return string + * Gets level + * + * @return string|null */ - public function getCity() + public function getLevel() { - return $this->container['city']; + return $this->container['level']; } /** - * Sets city - * @param string $city The scope by city + * Sets level + * + * @param string|null $level The scope by level + * * @return $this */ - public function setCity($city) + public function setLevel($level) { - $this->container['city'] = $city; + $allowedValues = $this->getLevelAllowableValues(); + if (!is_null($level) && !in_array($level, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'level', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['level'] = $level; return $this; } /** - * Gets level - * @return string + * Gets state + * + * @return string|null */ - public function getLevel() + public function getState() { - return $this->container['level']; + return $this->container['state']; } /** - * Sets level - * @param string $level The scope by level + * Sets state + * + * @param string|null $state The scope by state + * * @return $this */ - public function setLevel($level) + public function setState($state) { - $allowed_values = array('international', 'national', 'local'); - if (!is_null($level) && (!in_array($level, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'level', must be one of 'international', 'national', 'local'"); - } - $this->container['level'] = $level; + $this->container['state'] = $state; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -292,7 +365,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -302,8 +377,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -317,7 +394,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -327,15 +406,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Sentiment.php b/lib/Models/Sentiment.php index 0e02815..2aff4e2 100644 --- a/lib/Models/Sentiment.php +++ b/lib/Models/Sentiment.php @@ -6,71 +6,95 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Sentiment Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Sentiment implements ArrayAccess +class Sentiment implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Sentiment'; + protected static $openAPIModelName = 'Sentiment'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'polarity' => 'string', 'score' => 'double' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'polarity' => null, + 'score' => 'double' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -78,9 +102,9 @@ public static function apiTypes() 'score' => 'score' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -88,9 +112,9 @@ public static function apiTypes() 'score' => 'setScore' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -98,21 +122,47 @@ public static function apiTypes() 'score' => 'getScore' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + const POLARITY_POSITIVE = 'positive'; const POLARITY_NEUTRAL = 'neutral'; const POLARITY_NEGATIVE = 'negative'; @@ -121,6 +171,7 @@ public static function getters() /** * Gets allowable values of the enum + * * @return string[] */ public function getPolarityAllowableValues() @@ -135,13 +186,16 @@ public function getPolarityAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -150,56 +204,49 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; - - $allowed_values = ["positive", "neutral", "negative"]; - if (!in_array($this->container['polarity'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'polarity', must be one of 'positive', 'neutral', 'negative'."; + $invalidProperties = []; + + $allowedValues = $this->getPolarityAllowableValues(); + if (!is_null($this->container['polarity']) && !in_array($this->container['polarity'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'polarity', must be one of '%s'", + implode("', '", $allowedValues) + ); } if (!is_null($this->container['score']) && ($this->container['score'] > 1)) { - $invalid_properties[] = "invalid value for 'score', must be smaller than or equal to 1."; + $invalidProperties[] = "invalid value for 'score', must be smaller than or equal to 1."; } if (!is_null($this->container['score']) && ($this->container['score'] < 0)) { - $invalid_properties[] = "invalid value for 'score', must be bigger than or equal to 0."; + $invalidProperties[] = "invalid value for 'score', must be bigger than or equal to 0."; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - $allowed_values = ["positive", "neutral", "negative"]; - if (!in_array($this->container['polarity'], $allowed_values)) { - return false; - } - if ($this->container['score'] > 1) { - return false; - } - if ($this->container['score'] < 0) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets polarity - * @return string + * + * @return string|null */ public function getPolarity() { @@ -208,14 +255,21 @@ public function getPolarity() /** * Sets polarity - * @param string $polarity Polarity of the sentiment + * + * @param string|null $polarity Polarity of the sentiment + * * @return $this */ public function setPolarity($polarity) { - $allowed_values = array('positive', 'neutral', 'negative'); - if (!is_null($polarity) && (!in_array($polarity, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'polarity', must be one of 'positive', 'neutral', 'negative'"); + $allowedValues = $this->getPolarityAllowableValues(); + if (!is_null($polarity) && !in_array($polarity, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'polarity', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); } $this->container['polarity'] = $polarity; @@ -224,7 +278,8 @@ public function setPolarity($polarity) /** * Gets score - * @return double + * + * @return double|null */ public function getScore() { @@ -233,7 +288,9 @@ public function getScore() /** * Sets score - * @param double $score Polarity score of the sentiment + * + * @param double|null $score Polarity score of the sentiment + * * @return $this */ public function setScore($score) @@ -252,7 +309,9 @@ public function setScore($score) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -262,7 +321,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -272,8 +333,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -287,7 +350,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -297,15 +362,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Sentiments.php b/lib/Models/Sentiments.php index 21e13d7..d52b1e9 100644 --- a/lib/Models/Sentiments.php +++ b/lib/Models/Sentiments.php @@ -6,202 +6,262 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Sentiments Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Sentiments implements ArrayAccess +class Sentiments implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Sentiments'; + protected static $openAPIModelName = 'Sentiments'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'body' => '\Aylien\NewsApi\Models\Sentiment', + 'title' => '\Aylien\NewsApi\Models\Sentiment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'title' => '\Aylien\NewsApi\Models\Sentiment', - 'body' => '\Aylien\NewsApi\Models\Sentiment' + protected static $openAPIFormats = [ + 'body' => null, + 'title' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'title' => 'title', - 'body' => 'body' + 'body' => 'body', + 'title' => 'title' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'title' => 'setTitle', - 'body' => 'setBody' + 'body' => 'setBody', + 'title' => 'setTitle' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'title' => 'getTitle', - 'body' => 'getBody' + 'body' => 'getBody', + 'title' => 'getTitle' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['title'] = isset($data['title']) ? $data['title'] : null; $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets title - * @return \Aylien\NewsApi\Models\Sentiment + * Gets body + * + * @return \Aylien\NewsApi\Models\Sentiment|null */ - public function getTitle() + public function getBody() { - return $this->container['title']; + return $this->container['body']; } /** - * Sets title - * @param \Aylien\NewsApi\Models\Sentiment $title The sentiment for the story title + * Sets body + * + * @param \Aylien\NewsApi\Models\Sentiment|null $body body + * * @return $this */ - public function setTitle($title) + public function setBody($body) { - $this->container['title'] = $title; + $this->container['body'] = $body; return $this; } /** - * Gets body - * @return \Aylien\NewsApi\Models\Sentiment + * Gets title + * + * @return \Aylien\NewsApi\Models\Sentiment|null */ - public function getBody() + public function getTitle() { - return $this->container['body']; + return $this->container['title']; } /** - * Sets body - * @param \Aylien\NewsApi\Models\Sentiment $body The sentiment for the story body + * Sets title + * + * @param \Aylien\NewsApi\Models\Sentiment|null $title title + * * @return $this */ - public function setBody($body) + public function setTitle($title) { - $this->container['body'] = $body; + $this->container['title'] = $title; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/ShareCount.php b/lib/Models/ShareCount.php index 201492f..9bd84f4 100644 --- a/lib/Models/ShareCount.php +++ b/lib/Models/ShareCount.php @@ -6,161 +6,214 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * ShareCount Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class ShareCount implements ArrayAccess +class ShareCount implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'ShareCount'; + protected static $openAPIModelName = 'ShareCount'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'count' => 'int', - 'fetched_at' => '\DateTime' + 'fetchedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'count' => 'int32', + 'fetchedAt' => 'date-time' ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'count' => 'count', - 'fetched_at' => 'fetched_at' + 'fetchedAt' => 'fetched_at' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'count' => 'setCount', - 'fetched_at' => 'setFetchedAt' + 'fetchedAt' => 'setFetchedAt' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'count' => 'getCount', - 'fetched_at' => 'getFetchedAt' + 'fetchedAt' => 'getFetchedAt' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { $this->container['count'] = isset($data['count']) ? $data['count'] : null; - $this->container['fetched_at'] = isset($data['fetched_at']) ? $data['fetched_at'] : null; + $this->container['fetchedAt'] = isset($data['fetchedAt']) ? $data['fetchedAt'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets count - * @return int + * + * @return int|null */ public function getCount() { @@ -169,7 +222,9 @@ public function getCount() /** * Sets count - * @param int $count The number of shares + * + * @param int|null $count The number of shares + * * @return $this */ public function setCount($count) @@ -180,28 +235,33 @@ public function setCount($count) } /** - * Gets fetched_at - * @return \DateTime + * Gets fetchedAt + * + * @return \DateTime|null */ public function getFetchedAt() { - return $this->container['fetched_at']; + return $this->container['fetchedAt']; } /** - * Sets fetched_at - * @param \DateTime $fetched_at The fetched date of the shares + * Sets fetchedAt + * + * @param \DateTime|null $fetchedAt The fetched date of the shares + * * @return $this */ - public function setFetchedAt($fetched_at) + public function setFetchedAt($fetchedAt) { - $this->container['fetched_at'] = $fetched_at; + $this->container['fetchedAt'] = $fetchedAt; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/ShareCounts.php b/lib/Models/ShareCounts.php index abd7e63..904d8cf 100644 --- a/lib/Models/ShareCounts.php +++ b/lib/Models/ShareCounts.php @@ -6,171 +6,226 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * ShareCounts Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class ShareCounts implements ArrayAccess +class ShareCounts implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'ShareCounts'; + protected static $openAPIModelName = 'ShareCounts'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'facebook' => '\Aylien\NewsApi\Models\ShareCount[]', - 'google_plus' => '\Aylien\NewsApi\Models\ShareCount[]', + 'googlePlus' => '\Aylien\NewsApi\Models\ShareCount[]', 'linkedin' => '\Aylien\NewsApi\Models\ShareCount[]', 'reddit' => '\Aylien\NewsApi\Models\ShareCount[]' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'facebook' => null, + 'googlePlus' => null, + 'linkedin' => null, + 'reddit' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'facebook' => 'facebook', - 'google_plus' => 'google_plus', + 'googlePlus' => 'google_plus', 'linkedin' => 'linkedin', 'reddit' => 'reddit' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'facebook' => 'setFacebook', - 'google_plus' => 'setGooglePlus', + 'googlePlus' => 'setGooglePlus', 'linkedin' => 'setLinkedin', 'reddit' => 'setReddit' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'facebook' => 'getFacebook', - 'google_plus' => 'getGooglePlus', + 'googlePlus' => 'getGooglePlus', 'linkedin' => 'getLinkedin', 'reddit' => 'getReddit' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { $this->container['facebook'] = isset($data['facebook']) ? $data['facebook'] : null; - $this->container['google_plus'] = isset($data['google_plus']) ? $data['google_plus'] : null; + $this->container['googlePlus'] = isset($data['googlePlus']) ? $data['googlePlus'] : null; $this->container['linkedin'] = isset($data['linkedin']) ? $data['linkedin'] : null; $this->container['reddit'] = isset($data['reddit']) ? $data['reddit'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets facebook - * @return \Aylien\NewsApi\Models\ShareCount[] + * + * @return \Aylien\NewsApi\Models\ShareCount[]|null */ public function getFacebook() { @@ -179,7 +234,9 @@ public function getFacebook() /** * Sets facebook - * @param \Aylien\NewsApi\Models\ShareCount[] $facebook Facebook shares count + * + * @param \Aylien\NewsApi\Models\ShareCount[]|null $facebook Facebook shares count + * * @return $this */ public function setFacebook($facebook) @@ -190,29 +247,33 @@ public function setFacebook($facebook) } /** - * Gets google_plus - * @return \Aylien\NewsApi\Models\ShareCount[] + * Gets googlePlus + * + * @return \Aylien\NewsApi\Models\ShareCount[]|null */ public function getGooglePlus() { - return $this->container['google_plus']; + return $this->container['googlePlus']; } /** - * Sets google_plus - * @param \Aylien\NewsApi\Models\ShareCount[] $google_plus Google Plus shares count + * Sets googlePlus + * + * @param \Aylien\NewsApi\Models\ShareCount[]|null $googlePlus Google Plus shares count + * * @return $this */ - public function setGooglePlus($google_plus) + public function setGooglePlus($googlePlus) { - $this->container['google_plus'] = $google_plus; + $this->container['googlePlus'] = $googlePlus; return $this; } /** * Gets linkedin - * @return \Aylien\NewsApi\Models\ShareCount[] + * + * @return \Aylien\NewsApi\Models\ShareCount[]|null */ public function getLinkedin() { @@ -221,7 +282,9 @@ public function getLinkedin() /** * Sets linkedin - * @param \Aylien\NewsApi\Models\ShareCount[] $linkedin LinkedIn shares count + * + * @param \Aylien\NewsApi\Models\ShareCount[]|null $linkedin LinkedIn shares count + * * @return $this */ public function setLinkedin($linkedin) @@ -233,7 +296,8 @@ public function setLinkedin($linkedin) /** * Gets reddit - * @return \Aylien\NewsApi\Models\ShareCount[] + * + * @return \Aylien\NewsApi\Models\ShareCount[]|null */ public function getReddit() { @@ -242,7 +306,9 @@ public function getReddit() /** * Sets reddit - * @param \Aylien\NewsApi\Models\ShareCount[] $reddit Reddit shares count + * + * @param \Aylien\NewsApi\Models\ShareCount[]|null $reddit Reddit shares count + * * @return $this */ public function setReddit($reddit) @@ -253,7 +319,9 @@ public function setReddit($reddit) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -263,7 +331,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -273,8 +343,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -288,7 +360,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -298,15 +372,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Source.php b/lib/Models/Source.php index 7fa88be..483e947 100644 --- a/lib/Models/Source.php +++ b/lib/Models/Source.php @@ -6,395 +6,484 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Source Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Source implements ArrayAccess +class Source implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Source'; + protected static $openAPIModelName = 'Source'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'id' => 'int', - 'name' => 'string', - 'title' => 'string', + protected static $openAPITypes = [ 'description' => 'string', - 'links_in_count' => 'int', - 'home_page_url' => 'string', 'domain' => 'string', - 'logo_url' => 'string', + 'homePageUrl' => 'string', + 'id' => 'int', + 'linksInCount' => 'int', 'locations' => '\Aylien\NewsApi\Models\Location[]', + 'logoUrl' => 'string', + 'name' => 'string', + 'rankings' => '\Aylien\NewsApi\Models\Rankings', 'scopes' => '\Aylien\NewsApi\Models\Scope[]', - 'rankings' => '\Aylien\NewsApi\Models\Rankings' + 'title' => 'string' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'description' => null, + 'domain' => null, + 'homePageUrl' => null, + 'id' => 'int32', + 'linksInCount' => 'int32', + 'locations' => null, + 'logoUrl' => null, + 'name' => null, + 'rankings' => null, + 'scopes' => null, + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'id' => 'id', - 'name' => 'name', - 'title' => 'title', 'description' => 'description', - 'links_in_count' => 'links_in_count', - 'home_page_url' => 'home_page_url', 'domain' => 'domain', - 'logo_url' => 'logo_url', + 'homePageUrl' => 'home_page_url', + 'id' => 'id', + 'linksInCount' => 'links_in_count', 'locations' => 'locations', + 'logoUrl' => 'logo_url', + 'name' => 'name', + 'rankings' => 'rankings', 'scopes' => 'scopes', - 'rankings' => 'rankings' + 'title' => 'title' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'id' => 'setId', - 'name' => 'setName', - 'title' => 'setTitle', 'description' => 'setDescription', - 'links_in_count' => 'setLinksInCount', - 'home_page_url' => 'setHomePageUrl', 'domain' => 'setDomain', - 'logo_url' => 'setLogoUrl', + 'homePageUrl' => 'setHomePageUrl', + 'id' => 'setId', + 'linksInCount' => 'setLinksInCount', 'locations' => 'setLocations', + 'logoUrl' => 'setLogoUrl', + 'name' => 'setName', + 'rankings' => 'setRankings', 'scopes' => 'setScopes', - 'rankings' => 'setRankings' + 'title' => 'setTitle' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'id' => 'getId', - 'name' => 'getName', - 'title' => 'getTitle', 'description' => 'getDescription', - 'links_in_count' => 'getLinksInCount', - 'home_page_url' => 'getHomePageUrl', 'domain' => 'getDomain', - 'logo_url' => 'getLogoUrl', + 'homePageUrl' => 'getHomePageUrl', + 'id' => 'getId', + 'linksInCount' => 'getLinksInCount', 'locations' => 'getLocations', + 'logoUrl' => 'getLogoUrl', + 'name' => 'getName', + 'rankings' => 'getRankings', 'scopes' => 'getScopes', - 'rankings' => 'getRankings' + 'title' => 'getTitle' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['links_in_count'] = isset($data['links_in_count']) ? $data['links_in_count'] : null; - $this->container['home_page_url'] = isset($data['home_page_url']) ? $data['home_page_url'] : null; $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; - $this->container['logo_url'] = isset($data['logo_url']) ? $data['logo_url'] : null; + $this->container['homePageUrl'] = isset($data['homePageUrl']) ? $data['homePageUrl'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['linksInCount'] = isset($data['linksInCount']) ? $data['linksInCount'] : null; $this->container['locations'] = isset($data['locations']) ? $data['locations'] : null; - $this->container['scopes'] = isset($data['scopes']) ? $data['scopes'] : null; + $this->container['logoUrl'] = isset($data['logoUrl']) ? $data['logoUrl'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['rankings'] = isset($data['rankings']) ? $data['rankings'] : null; + $this->container['scopes'] = isset($data['scopes']) ? $data['scopes'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets id - * @return int + * Gets description + * + * @return string|null */ - public function getId() + public function getDescription() { - return $this->container['id']; + return $this->container['description']; } /** - * Sets id - * @param int $id The source id which is a unique value + * Sets description + * + * @param string|null $description A general explanation about the source + * * @return $this */ - public function setId($id) + public function setDescription($description) { - $this->container['id'] = $id; + $this->container['description'] = $description; return $this; } /** - * Gets name - * @return string + * Gets domain + * + * @return string|null */ - public function getName() + public function getDomain() { - return $this->container['name']; + return $this->container['domain']; } /** - * Sets name - * @param string $name The source name + * Sets domain + * + * @param string|null $domain The domain name of the source which is extracted from the source URL + * * @return $this */ - public function setName($name) + public function setDomain($domain) { - $this->container['name'] = $name; + $this->container['domain'] = $domain; return $this; } /** - * Gets title - * @return string + * Gets homePageUrl + * + * @return string|null */ - public function getTitle() + public function getHomePageUrl() { - return $this->container['title']; + return $this->container['homePageUrl']; } /** - * Sets title - * @param string $title The title of the home page URL + * Sets homePageUrl + * + * @param string|null $homePageUrl The home page URL of the source + * * @return $this */ - public function setTitle($title) + public function setHomePageUrl($homePageUrl) { - $this->container['title'] = $title; + $this->container['homePageUrl'] = $homePageUrl; return $this; } /** - * Gets description - * @return string + * Gets id + * + * @return int|null */ - public function getDescription() + public function getId() { - return $this->container['description']; + return $this->container['id']; } /** - * Sets description - * @param string $description A general explanation about the source + * Sets id + * + * @param int|null $id The source id which is a unique value + * * @return $this */ - public function setDescription($description) + public function setId($id) { - $this->container['description'] = $description; + $this->container['id'] = $id; return $this; } /** - * Gets links_in_count - * @return int + * Gets linksInCount + * + * @return int|null */ public function getLinksInCount() { - return $this->container['links_in_count']; + return $this->container['linksInCount']; } /** - * Sets links_in_count - * @param int $links_in_count The number of websites that link to the source + * Sets linksInCount + * + * @param int|null $linksInCount The number of websites that link to the source + * * @return $this */ - public function setLinksInCount($links_in_count) + public function setLinksInCount($linksInCount) { - $this->container['links_in_count'] = $links_in_count; + $this->container['linksInCount'] = $linksInCount; return $this; } /** - * Gets home_page_url - * @return string + * Gets locations + * + * @return \Aylien\NewsApi\Models\Location[]|null */ - public function getHomePageUrl() + public function getLocations() { - return $this->container['home_page_url']; + return $this->container['locations']; } /** - * Sets home_page_url - * @param string $home_page_url The home page URL of the source + * Sets locations + * + * @param \Aylien\NewsApi\Models\Location[]|null $locations The source locations which are tend to be the physical locations of the source, e.g. BBC headquarter is located in London. + * * @return $this */ - public function setHomePageUrl($home_page_url) + public function setLocations($locations) { - $this->container['home_page_url'] = $home_page_url; + $this->container['locations'] = $locations; return $this; } /** - * Gets domain - * @return string + * Gets logoUrl + * + * @return string|null */ - public function getDomain() + public function getLogoUrl() { - return $this->container['domain']; + return $this->container['logoUrl']; } /** - * Sets domain - * @param string $domain The domain name of the source which is extracted from the source URL + * Sets logoUrl + * + * @param string|null $logoUrl A URL which points to the source logo + * * @return $this */ - public function setDomain($domain) + public function setLogoUrl($logoUrl) { - $this->container['domain'] = $domain; + $this->container['logoUrl'] = $logoUrl; return $this; } /** - * Gets logo_url - * @return string + * Gets name + * + * @return string|null */ - public function getLogoUrl() + public function getName() { - return $this->container['logo_url']; + return $this->container['name']; } /** - * Sets logo_url - * @param string $logo_url A URL which points to the source logo + * Sets name + * + * @param string|null $name The source name + * * @return $this */ - public function setLogoUrl($logo_url) + public function setName($name) { - $this->container['logo_url'] = $logo_url; + $this->container['name'] = $name; return $this; } /** - * Gets locations - * @return \Aylien\NewsApi\Models\Location[] + * Gets rankings + * + * @return \Aylien\NewsApi\Models\Rankings|null */ - public function getLocations() + public function getRankings() { - return $this->container['locations']; + return $this->container['rankings']; } /** - * Sets locations - * @param \Aylien\NewsApi\Models\Location[] $locations The source locations which are tend to be the physical locations of the source, e.g. BBC headquarter is located in London. + * Sets rankings + * + * @param \Aylien\NewsApi\Models\Rankings|null $rankings rankings + * * @return $this */ - public function setLocations($locations) + public function setRankings($rankings) { - $this->container['locations'] = $locations; + $this->container['rankings'] = $rankings; return $this; } /** * Gets scopes - * @return \Aylien\NewsApi\Models\Scope[] + * + * @return \Aylien\NewsApi\Models\Scope[]|null */ public function getScopes() { @@ -403,7 +492,9 @@ public function getScopes() /** * Sets scopes - * @param \Aylien\NewsApi\Models\Scope[] $scopes The source scopes which is tend to be scope locations of the source, e.g. BBC scopes is international. + * + * @param \Aylien\NewsApi\Models\Scope[]|null $scopes The source scopes which is tend to be scope locations of the source, e.g. BBC scopes is international. + * * @return $this */ public function setScopes($scopes) @@ -414,28 +505,33 @@ public function setScopes($scopes) } /** - * Gets rankings - * @return \Aylien\NewsApi\Models\Rankings + * Gets title + * + * @return string|null */ - public function getRankings() + public function getTitle() { - return $this->container['rankings']; + return $this->container['title']; } /** - * Sets rankings - * @param \Aylien\NewsApi\Models\Rankings $rankings The web rankings of the source + * Sets title + * + * @param string|null $title The title of the home page URL + * * @return $this */ - public function setRankings($rankings) + public function setTitle($title) { - $this->container['rankings'] = $rankings; + $this->container['title'] = $title; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -445,7 +541,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -455,8 +553,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -470,7 +570,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -480,15 +582,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Stories.php b/lib/Models/Stories.php index a1736cf..77666af 100644 --- a/lib/Models/Stories.php +++ b/lib/Models/Stories.php @@ -6,228 +6,262 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Stories Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Stories implements ArrayAccess +class Stories implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Stories'; + protected static $openAPIModelName = 'Stories'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'nextPageCursor' => 'string', + 'stories' => '\Aylien\NewsApi\Models\Story[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'stories' => '\Aylien\NewsApi\Models\Story[]', - 'clusters' => '\Aylien\NewsApi\Models\StoryCluster[]', - 'next_page_cursor' => 'string' + protected static $openAPIFormats = [ + 'nextPageCursor' => null, + 'stories' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'stories' => 'stories', - 'clusters' => 'clusters', - 'next_page_cursor' => 'next_page_cursor' + 'nextPageCursor' => 'next_page_cursor', + 'stories' => 'stories' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'stories' => 'setStories', - 'clusters' => 'setClusters', - 'next_page_cursor' => 'setNextPageCursor' + 'nextPageCursor' => 'setNextPageCursor', + 'stories' => 'setStories' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'stories' => 'getStories', - 'clusters' => 'getClusters', - 'next_page_cursor' => 'getNextPageCursor' + 'nextPageCursor' => 'getNextPageCursor', + 'stories' => 'getStories' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { + $this->container['nextPageCursor'] = isset($data['nextPageCursor']) ? $data['nextPageCursor'] : null; $this->container['stories'] = isset($data['stories']) ? $data['stories'] : null; - $this->container['clusters'] = isset($data['clusters']) ? $data['clusters'] : null; - $this->container['next_page_cursor'] = isset($data['next_page_cursor']) ? $data['next_page_cursor'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets stories - * @return \Aylien\NewsApi\Models\Story[] - */ - public function getStories() - { - return $this->container['stories']; - } - - /** - * Sets stories - * @param \Aylien\NewsApi\Models\Story[] $stories An array of stories - * @return $this - */ - public function setStories($stories) - { - $this->container['stories'] = $stories; - - return $this; - } - - /** - * Gets clusters - * @return \Aylien\NewsApi\Models\StoryCluster[] + * Gets nextPageCursor + * + * @return string|null */ - public function getClusters() + public function getNextPageCursor() { - return $this->container['clusters']; + return $this->container['nextPageCursor']; } /** - * Sets clusters - * @param \Aylien\NewsApi\Models\StoryCluster[] $clusters An array of clusters + * Sets nextPageCursor + * + * @param string|null $nextPageCursor The next page cursor + * * @return $this */ - public function setClusters($clusters) + public function setNextPageCursor($nextPageCursor) { - $this->container['clusters'] = $clusters; + $this->container['nextPageCursor'] = $nextPageCursor; return $this; } /** - * Gets next_page_cursor - * @return string + * Gets stories + * + * @return \Aylien\NewsApi\Models\Story[]|null */ - public function getNextPageCursor() + public function getStories() { - return $this->container['next_page_cursor']; + return $this->container['stories']; } /** - * Sets next_page_cursor - * @param string $next_page_cursor The next page cursor + * Sets stories + * + * @param \Aylien\NewsApi\Models\Story[]|null $stories An array of stories + * * @return $this */ - public function setNextPageCursor($next_page_cursor) + public function setStories($stories) { - $this->container['next_page_cursor'] = $next_page_cursor; + $this->container['stories'] = $stories; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -237,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -247,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -262,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -272,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Story.php b/lib/Models/Story.php index 3d4fe90..3c39775 100644 --- a/lib/Models/Story.php +++ b/lib/Models/Story.php @@ -6,398 +6,526 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Story Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Story implements ArrayAccess +class Story implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Story'; + protected static $openAPIModelName = 'Story'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'id' => 'int', - 'title' => 'string', - 'body' => 'string', - 'summary' => '\Aylien\NewsApi\Models\Summary', - 'source' => '\Aylien\NewsApi\Models\Source', + protected static $openAPITypes = [ 'author' => '\Aylien\NewsApi\Models\Author', + 'body' => 'string', + 'categories' => '\Aylien\NewsApi\Models\Category[]', + 'charactersCount' => 'int', + 'clusters' => 'int[]', 'entities' => '\Aylien\NewsApi\Models\Entities', - 'keywords' => 'string[]', 'hashtags' => 'string[]', - 'characters_count' => 'int', - 'words_count' => 'int', - 'sentences_count' => 'int', - 'paragraphs_count' => 'int', - 'categories' => '\Aylien\NewsApi\Models\Category[]', - 'social_shares_count' => '\Aylien\NewsApi\Models\ShareCounts', + 'id' => 'int', + 'keywords' => 'string[]', + 'language' => 'string', + 'links' => '\Aylien\NewsApi\Models\StoryLinks', 'media' => '\Aylien\NewsApi\Models\Media[]', + 'paragraphsCount' => 'int', + 'publishedAt' => '\DateTime', + 'sentencesCount' => 'int', 'sentiment' => '\Aylien\NewsApi\Models\Sentiments', - 'language' => 'string', - 'published_at' => '\DateTime', - 'links' => '\Aylien\NewsApi\Models\StoryLinks' + 'socialSharesCount' => '\Aylien\NewsApi\Models\ShareCounts', + 'source' => '\Aylien\NewsApi\Models\Source', + 'summary' => '\Aylien\NewsApi\Models\Summary', + 'title' => 'string', + 'translations' => '\Aylien\NewsApi\Models\StoryTranslations', + 'wordsCount' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'author' => null, + 'body' => null, + 'categories' => null, + 'charactersCount' => 'int32', + 'clusters' => 'int64', + 'entities' => null, + 'hashtags' => null, + 'id' => 'int64', + 'keywords' => null, + 'language' => null, + 'links' => null, + 'media' => null, + 'paragraphsCount' => 'int32', + 'publishedAt' => 'date-time', + 'sentencesCount' => 'int32', + 'sentiment' => null, + 'socialSharesCount' => null, + 'source' => null, + 'summary' => null, + 'title' => null, + 'translations' => null, + 'wordsCount' => 'int32' ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'id' => 'id', - 'title' => 'title', - 'body' => 'body', - 'summary' => 'summary', - 'source' => 'source', 'author' => 'author', + 'body' => 'body', + 'categories' => 'categories', + 'charactersCount' => 'characters_count', + 'clusters' => 'clusters', 'entities' => 'entities', - 'keywords' => 'keywords', 'hashtags' => 'hashtags', - 'characters_count' => 'characters_count', - 'words_count' => 'words_count', - 'sentences_count' => 'sentences_count', - 'paragraphs_count' => 'paragraphs_count', - 'categories' => 'categories', - 'social_shares_count' => 'social_shares_count', + 'id' => 'id', + 'keywords' => 'keywords', + 'language' => 'language', + 'links' => 'links', 'media' => 'media', + 'paragraphsCount' => 'paragraphs_count', + 'publishedAt' => 'published_at', + 'sentencesCount' => 'sentences_count', 'sentiment' => 'sentiment', - 'language' => 'language', - 'published_at' => 'published_at', - 'links' => 'links' + 'socialSharesCount' => 'social_shares_count', + 'source' => 'source', + 'summary' => 'summary', + 'title' => 'title', + 'translations' => 'translations', + 'wordsCount' => 'words_count' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'id' => 'setId', - 'title' => 'setTitle', - 'body' => 'setBody', - 'summary' => 'setSummary', - 'source' => 'setSource', 'author' => 'setAuthor', + 'body' => 'setBody', + 'categories' => 'setCategories', + 'charactersCount' => 'setCharactersCount', + 'clusters' => 'setClusters', 'entities' => 'setEntities', - 'keywords' => 'setKeywords', 'hashtags' => 'setHashtags', - 'characters_count' => 'setCharactersCount', - 'words_count' => 'setWordsCount', - 'sentences_count' => 'setSentencesCount', - 'paragraphs_count' => 'setParagraphsCount', - 'categories' => 'setCategories', - 'social_shares_count' => 'setSocialSharesCount', + 'id' => 'setId', + 'keywords' => 'setKeywords', + 'language' => 'setLanguage', + 'links' => 'setLinks', 'media' => 'setMedia', + 'paragraphsCount' => 'setParagraphsCount', + 'publishedAt' => 'setPublishedAt', + 'sentencesCount' => 'setSentencesCount', 'sentiment' => 'setSentiment', - 'language' => 'setLanguage', - 'published_at' => 'setPublishedAt', - 'links' => 'setLinks' + 'socialSharesCount' => 'setSocialSharesCount', + 'source' => 'setSource', + 'summary' => 'setSummary', + 'title' => 'setTitle', + 'translations' => 'setTranslations', + 'wordsCount' => 'setWordsCount' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'id' => 'getId', - 'title' => 'getTitle', - 'body' => 'getBody', - 'summary' => 'getSummary', - 'source' => 'getSource', 'author' => 'getAuthor', + 'body' => 'getBody', + 'categories' => 'getCategories', + 'charactersCount' => 'getCharactersCount', + 'clusters' => 'getClusters', 'entities' => 'getEntities', - 'keywords' => 'getKeywords', 'hashtags' => 'getHashtags', - 'characters_count' => 'getCharactersCount', - 'words_count' => 'getWordsCount', - 'sentences_count' => 'getSentencesCount', - 'paragraphs_count' => 'getParagraphsCount', - 'categories' => 'getCategories', - 'social_shares_count' => 'getSocialSharesCount', + 'id' => 'getId', + 'keywords' => 'getKeywords', + 'language' => 'getLanguage', + 'links' => 'getLinks', 'media' => 'getMedia', + 'paragraphsCount' => 'getParagraphsCount', + 'publishedAt' => 'getPublishedAt', + 'sentencesCount' => 'getSentencesCount', 'sentiment' => 'getSentiment', - 'language' => 'getLanguage', - 'published_at' => 'getPublishedAt', - 'links' => 'getLinks' + 'socialSharesCount' => 'getSocialSharesCount', + 'source' => 'getSource', + 'summary' => 'getSummary', + 'title' => 'getTitle', + 'translations' => 'getTranslations', + 'wordsCount' => 'getWordsCount' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['body'] = isset($data['body']) ? $data['body'] : null; - $this->container['summary'] = isset($data['summary']) ? $data['summary'] : null; - $this->container['source'] = isset($data['source']) ? $data['source'] : null; $this->container['author'] = isset($data['author']) ? $data['author'] : null; + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null; + $this->container['charactersCount'] = isset($data['charactersCount']) ? $data['charactersCount'] : null; + $this->container['clusters'] = isset($data['clusters']) ? $data['clusters'] : null; $this->container['entities'] = isset($data['entities']) ? $data['entities'] : null; - $this->container['keywords'] = isset($data['keywords']) ? $data['keywords'] : null; $this->container['hashtags'] = isset($data['hashtags']) ? $data['hashtags'] : null; - $this->container['characters_count'] = isset($data['characters_count']) ? $data['characters_count'] : null; - $this->container['words_count'] = isset($data['words_count']) ? $data['words_count'] : null; - $this->container['sentences_count'] = isset($data['sentences_count']) ? $data['sentences_count'] : null; - $this->container['paragraphs_count'] = isset($data['paragraphs_count']) ? $data['paragraphs_count'] : null; - $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null; - $this->container['social_shares_count'] = isset($data['social_shares_count']) ? $data['social_shares_count'] : null; - $this->container['media'] = isset($data['media']) ? $data['media'] : null; - $this->container['sentiment'] = isset($data['sentiment']) ? $data['sentiment'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['keywords'] = isset($data['keywords']) ? $data['keywords'] : null; $this->container['language'] = isset($data['language']) ? $data['language'] : null; - $this->container['published_at'] = isset($data['published_at']) ? $data['published_at'] : null; $this->container['links'] = isset($data['links']) ? $data['links'] : null; + $this->container['media'] = isset($data['media']) ? $data['media'] : null; + $this->container['paragraphsCount'] = isset($data['paragraphsCount']) ? $data['paragraphsCount'] : null; + $this->container['publishedAt'] = isset($data['publishedAt']) ? $data['publishedAt'] : null; + $this->container['sentencesCount'] = isset($data['sentencesCount']) ? $data['sentencesCount'] : null; + $this->container['sentiment'] = isset($data['sentiment']) ? $data['sentiment'] : null; + $this->container['socialSharesCount'] = isset($data['socialSharesCount']) ? $data['socialSharesCount'] : null; + $this->container['source'] = isset($data['source']) ? $data['source'] : null; + $this->container['summary'] = isset($data['summary']) ? $data['summary'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + $this->container['translations'] = isset($data['translations']) ? $data['translations'] : null; + $this->container['wordsCount'] = isset($data['wordsCount']) ? $data['wordsCount'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { + return count($this->listInvalidProperties()) === 0; + } - return true; + + /** + * Gets author + * + * @return \Aylien\NewsApi\Models\Author|null + */ + public function getAuthor() + { + return $this->container['author']; } + /** + * Sets author + * + * @param \Aylien\NewsApi\Models\Author|null $author author + * + * @return $this + */ + public function setAuthor($author) + { + $this->container['author'] = $author; + + return $this; + } /** - * Gets id - * @return int + * Gets body + * + * @return string|null */ - public function getId() + public function getBody() { - return $this->container['id']; + return $this->container['body']; } /** - * Sets id - * @param int $id ID of the story which is a unique identification + * Sets body + * + * @param string|null $body Body of the story + * * @return $this */ - public function setId($id) + public function setBody($body) { - $this->container['id'] = $id; + $this->container['body'] = $body; return $this; } /** - * Gets title - * @return string + * Gets categories + * + * @return \Aylien\NewsApi\Models\Category[]|null */ - public function getTitle() + public function getCategories() { - return $this->container['title']; + return $this->container['categories']; } /** - * Sets title - * @param string $title Title of the story + * Sets categories + * + * @param \Aylien\NewsApi\Models\Category[]|null $categories Suggested categories for the story + * * @return $this */ - public function setTitle($title) + public function setCategories($categories) { - $this->container['title'] = $title; + $this->container['categories'] = $categories; return $this; } /** - * Gets body - * @return string + * Gets charactersCount + * + * @return int|null */ - public function getBody() + public function getCharactersCount() { - return $this->container['body']; + return $this->container['charactersCount']; } /** - * Sets body - * @param string $body Body of the story + * Sets charactersCount + * + * @param int|null $charactersCount Character count of the story body + * * @return $this */ - public function setBody($body) + public function setCharactersCount($charactersCount) { - $this->container['body'] = $body; + $this->container['charactersCount'] = $charactersCount; return $this; } /** - * Gets summary - * @return \Aylien\NewsApi\Models\Summary + * Gets clusters + * + * @return int[]|null */ - public function getSummary() + public function getClusters() { - return $this->container['summary']; + return $this->container['clusters']; } /** - * Sets summary - * @param \Aylien\NewsApi\Models\Summary $summary The suggested story summary + * Sets clusters + * + * @param int[]|null $clusters An array of clusters the story is associated with + * * @return $this */ - public function setSummary($summary) + public function setClusters($clusters) { - $this->container['summary'] = $summary; + $this->container['clusters'] = $clusters; return $this; } /** - * Gets source - * @return \Aylien\NewsApi\Models\Source + * Gets entities + * + * @return \Aylien\NewsApi\Models\Entities|null */ - public function getSource() + public function getEntities() { - return $this->container['source']; + return $this->container['entities']; } /** - * Sets source - * @param \Aylien\NewsApi\Models\Source $source The story source + * Sets entities + * + * @param \Aylien\NewsApi\Models\Entities|null $entities entities + * * @return $this */ - public function setSource($source) + public function setEntities($entities) { - $this->container['source'] = $source; + $this->container['entities'] = $entities; return $this; } /** - * Gets author - * @return \Aylien\NewsApi\Models\Author + * Gets hashtags + * + * @return string[]|null */ - public function getAuthor() + public function getHashtags() { - return $this->container['author']; + return $this->container['hashtags']; } /** - * Sets author - * @param \Aylien\NewsApi\Models\Author $author The story author + * Sets hashtags + * + * @param string[]|null $hashtags An array of suggested Story hashtags + * * @return $this */ - public function setAuthor($author) + public function setHashtags($hashtags) { - $this->container['author'] = $author; + $this->container['hashtags'] = $hashtags; return $this; } /** - * Gets entities - * @return \Aylien\NewsApi\Models\Entities + * Gets id + * + * @return int|null */ - public function getEntities() + public function getId() { - return $this->container['entities']; + return $this->container['id']; } /** - * Sets entities - * @param \Aylien\NewsApi\Models\Entities $entities Extracted entities from the story title or body + * Sets id + * + * @param int|null $id ID of the story which is a unique identification + * * @return $this */ - public function setEntities($entities) + public function setId($id) { - $this->container['entities'] = $entities; + $this->container['id'] = $id; return $this; } /** * Gets keywords - * @return string[] + * + * @return string[]|null */ public function getKeywords() { @@ -406,7 +534,9 @@ public function getKeywords() /** * Sets keywords - * @param string[] $keywords Extracted keywords mentioned in the story title or body + * + * @param string[]|null $keywords Extracted keywords mentioned in the story title or body + * * @return $this */ public function setKeywords($keywords) @@ -417,259 +547,321 @@ public function setKeywords($keywords) } /** - * Gets hashtags - * @return string[] + * Gets language + * + * @return string|null */ - public function getHashtags() + public function getLanguage() { - return $this->container['hashtags']; + return $this->container['language']; } /** - * Sets hashtags - * @param string[] $hashtags An array of suggested Story hashtags + * Sets language + * + * @param string|null $language Language of the story + * * @return $this */ - public function setHashtags($hashtags) + public function setLanguage($language) { - $this->container['hashtags'] = $hashtags; + $this->container['language'] = $language; return $this; } /** - * Gets characters_count - * @return int + * Gets links + * + * @return \Aylien\NewsApi\Models\StoryLinks|null */ - public function getCharactersCount() + public function getLinks() { - return $this->container['characters_count']; + return $this->container['links']; } /** - * Sets characters_count - * @param int $characters_count Character count of the story body + * Sets links + * + * @param \Aylien\NewsApi\Models\StoryLinks|null $links links + * * @return $this */ - public function setCharactersCount($characters_count) + public function setLinks($links) { - $this->container['characters_count'] = $characters_count; + $this->container['links'] = $links; return $this; } /** - * Gets words_count - * @return int + * Gets media + * + * @return \Aylien\NewsApi\Models\Media[]|null */ - public function getWordsCount() + public function getMedia() { - return $this->container['words_count']; + return $this->container['media']; } /** - * Sets words_count - * @param int $words_count Word count of the story body + * Sets media + * + * @param \Aylien\NewsApi\Models\Media[]|null $media An array of extracted media such as images and videos + * * @return $this */ - public function setWordsCount($words_count) + public function setMedia($media) { - $this->container['words_count'] = $words_count; + $this->container['media'] = $media; return $this; } /** - * Gets sentences_count - * @return int + * Gets paragraphsCount + * + * @return int|null */ - public function getSentencesCount() + public function getParagraphsCount() { - return $this->container['sentences_count']; + return $this->container['paragraphsCount']; } /** - * Sets sentences_count - * @param int $sentences_count Sentence count of the story body + * Sets paragraphsCount + * + * @param int|null $paragraphsCount Paragraph count of the story body + * * @return $this */ - public function setSentencesCount($sentences_count) + public function setParagraphsCount($paragraphsCount) { - $this->container['sentences_count'] = $sentences_count; + $this->container['paragraphsCount'] = $paragraphsCount; return $this; } /** - * Gets paragraphs_count - * @return int + * Gets publishedAt + * + * @return \DateTime|null */ - public function getParagraphsCount() + public function getPublishedAt() { - return $this->container['paragraphs_count']; + return $this->container['publishedAt']; } /** - * Sets paragraphs_count - * @param int $paragraphs_count Paragraph count of the story body + * Sets publishedAt + * + * @param \DateTime|null $publishedAt Published date of the story + * * @return $this */ - public function setParagraphsCount($paragraphs_count) + public function setPublishedAt($publishedAt) { - $this->container['paragraphs_count'] = $paragraphs_count; + $this->container['publishedAt'] = $publishedAt; return $this; } /** - * Gets categories - * @return \Aylien\NewsApi\Models\Category[] + * Gets sentencesCount + * + * @return int|null */ - public function getCategories() + public function getSentencesCount() { - return $this->container['categories']; + return $this->container['sentencesCount']; } /** - * Sets categories - * @param \Aylien\NewsApi\Models\Category[] $categories Suggested categories for the story + * Sets sentencesCount + * + * @param int|null $sentencesCount Sentence count of the story body + * * @return $this */ - public function setCategories($categories) + public function setSentencesCount($sentencesCount) { - $this->container['categories'] = $categories; + $this->container['sentencesCount'] = $sentencesCount; + + return $this; + } + + /** + * Gets sentiment + * + * @return \Aylien\NewsApi\Models\Sentiments|null + */ + public function getSentiment() + { + return $this->container['sentiment']; + } + + /** + * Sets sentiment + * + * @param \Aylien\NewsApi\Models\Sentiments|null $sentiment sentiment + * + * @return $this + */ + public function setSentiment($sentiment) + { + $this->container['sentiment'] = $sentiment; return $this; } /** - * Gets social_shares_count - * @return \Aylien\NewsApi\Models\ShareCounts + * Gets socialSharesCount + * + * @return \Aylien\NewsApi\Models\ShareCounts|null */ public function getSocialSharesCount() { - return $this->container['social_shares_count']; + return $this->container['socialSharesCount']; } /** - * Sets social_shares_count - * @param \Aylien\NewsApi\Models\ShareCounts $social_shares_count Social shares count for the story + * Sets socialSharesCount + * + * @param \Aylien\NewsApi\Models\ShareCounts|null $socialSharesCount socialSharesCount + * * @return $this */ - public function setSocialSharesCount($social_shares_count) + public function setSocialSharesCount($socialSharesCount) { - $this->container['social_shares_count'] = $social_shares_count; + $this->container['socialSharesCount'] = $socialSharesCount; return $this; } /** - * Gets media - * @return \Aylien\NewsApi\Models\Media[] + * Gets source + * + * @return \Aylien\NewsApi\Models\Source|null */ - public function getMedia() + public function getSource() { - return $this->container['media']; + return $this->container['source']; } /** - * Sets media - * @param \Aylien\NewsApi\Models\Media[] $media An array of extracted media such as images and videos + * Sets source + * + * @param \Aylien\NewsApi\Models\Source|null $source source + * * @return $this */ - public function setMedia($media) + public function setSource($source) { - $this->container['media'] = $media; + $this->container['source'] = $source; return $this; } /** - * Gets sentiment - * @return \Aylien\NewsApi\Models\Sentiments + * Gets summary + * + * @return \Aylien\NewsApi\Models\Summary|null */ - public function getSentiment() + public function getSummary() { - return $this->container['sentiment']; + return $this->container['summary']; } /** - * Sets sentiment - * @param \Aylien\NewsApi\Models\Sentiments $sentiment Suggested sentiments for the story title or body + * Sets summary + * + * @param \Aylien\NewsApi\Models\Summary|null $summary summary + * * @return $this */ - public function setSentiment($sentiment) + public function setSummary($summary) { - $this->container['sentiment'] = $sentiment; + $this->container['summary'] = $summary; return $this; } /** - * Gets language - * @return string + * Gets title + * + * @return string|null */ - public function getLanguage() + public function getTitle() { - return $this->container['language']; + return $this->container['title']; } /** - * Sets language - * @param string $language Language of the story + * Sets title + * + * @param string|null $title Title of the story + * * @return $this */ - public function setLanguage($language) + public function setTitle($title) { - $this->container['language'] = $language; + $this->container['title'] = $title; return $this; } /** - * Gets published_at - * @return \DateTime + * Gets translations + * + * @return \Aylien\NewsApi\Models\StoryTranslations|null */ - public function getPublishedAt() + public function getTranslations() { - return $this->container['published_at']; + return $this->container['translations']; } /** - * Sets published_at - * @param \DateTime $published_at Published date of the story + * Sets translations + * + * @param \Aylien\NewsApi\Models\StoryTranslations|null $translations translations + * * @return $this */ - public function setPublishedAt($published_at) + public function setTranslations($translations) { - $this->container['published_at'] = $published_at; + $this->container['translations'] = $translations; return $this; } /** - * Gets links - * @return \Aylien\NewsApi\Models\StoryLinks + * Gets wordsCount + * + * @return int|null */ - public function getLinks() + public function getWordsCount() { - return $this->container['links']; + return $this->container['wordsCount']; } /** - * Sets links - * @param \Aylien\NewsApi\Models\StoryLinks $links Links which is related to the story + * Sets wordsCount + * + * @param int|null $wordsCount Word count of the story body + * * @return $this */ - public function setLinks($links) + public function setWordsCount($wordsCount) { - $this->container['links'] = $links; + $this->container['wordsCount'] = $wordsCount; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -679,7 +871,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -689,8 +883,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -704,7 +900,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -714,15 +912,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/StoryCluster.php b/lib/Models/StoryCluster.php index afab334..2954fd3 100644 --- a/lib/Models/StoryCluster.php +++ b/lib/Models/StoryCluster.php @@ -6,176 +6,232 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * StoryCluster Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class StoryCluster implements ArrayAccess +class StoryCluster implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'StoryCluster'; + protected static $openAPIModelName = 'StoryCluster'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'id' => 'int', 'phrases' => 'string[]', + 'score' => 'double', 'size' => 'int', - 'stories' => 'int[]', - 'score' => 'double' + 'stories' => 'int[]' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => 'int32', + 'phrases' => null, + 'score' => 'double', + 'size' => 'int32', + 'stories' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'id' => 'id', 'phrases' => 'phrases', + 'score' => 'score', 'size' => 'size', - 'stories' => 'stories', - 'score' => 'score' + 'stories' => 'stories' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'id' => 'setId', 'phrases' => 'setPhrases', + 'score' => 'setScore', 'size' => 'setSize', - 'stories' => 'setStories', - 'score' => 'setScore' + 'stories' => 'setStories' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'id' => 'getId', 'phrases' => 'getPhrases', + 'score' => 'getScore', 'size' => 'getSize', - 'stories' => 'getStories', - 'score' => 'getScore' + 'stories' => 'getStories' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['phrases'] = isset($data['phrases']) ? $data['phrases'] : null; + $this->container['score'] = isset($data['score']) ? $data['score'] : null; $this->container['size'] = isset($data['size']) ? $data['size'] : null; $this->container['stories'] = isset($data['stories']) ? $data['stories'] : null; - $this->container['score'] = isset($data['score']) ? $data['score'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets id - * @return int + * + * @return int|null */ public function getId() { @@ -184,7 +240,9 @@ public function getId() /** * Sets id - * @param int $id A unique identification for the cluster + * + * @param int|null $id A unique identification for the cluster + * * @return $this */ public function setId($id) @@ -196,7 +254,8 @@ public function setId($id) /** * Gets phrases - * @return string[] + * + * @return string[]|null */ public function getPhrases() { @@ -205,7 +264,9 @@ public function getPhrases() /** * Sets phrases - * @param string[] $phrases Suggested labels for the cluster + * + * @param string[]|null $phrases Suggested labels for the cluster + * * @return $this */ public function setPhrases($phrases) @@ -216,70 +277,81 @@ public function setPhrases($phrases) } /** - * Gets size - * @return int + * Gets score + * + * @return double|null */ - public function getSize() + public function getScore() { - return $this->container['size']; + return $this->container['score']; } /** - * Sets size - * @param int $size Size of the cluster + * Sets score + * + * @param double|null $score The cluster score + * * @return $this */ - public function setSize($size) + public function setScore($score) { - $this->container['size'] = $size; + $this->container['score'] = $score; return $this; } /** - * Gets stories - * @return int[] + * Gets size + * + * @return int|null */ - public function getStories() + public function getSize() { - return $this->container['stories']; + return $this->container['size']; } /** - * Sets stories - * @param int[] $stories Story ids which are in the cluster + * Sets size + * + * @param int|null $size Size of the cluster + * * @return $this */ - public function setStories($stories) + public function setSize($size) { - $this->container['stories'] = $stories; + $this->container['size'] = $size; return $this; } /** - * Gets score - * @return double + * Gets stories + * + * @return int[]|null */ - public function getScore() + public function getStories() { - return $this->container['score']; + return $this->container['stories']; } /** - * Sets score - * @param double $score The cluster score + * Sets stories + * + * @param int[]|null $stories Story ids which are in the cluster + * * @return $this */ - public function setScore($score) + public function setStories($stories) { - $this->container['score'] = $score; + $this->container['stories'] = $stories; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -289,7 +361,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -299,8 +373,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -314,7 +390,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -324,15 +402,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/StoryLinks.php b/lib/Models/StoryLinks.php index fa55456..f745506 100644 --- a/lib/Models/StoryLinks.php +++ b/lib/Models/StoryLinks.php @@ -6,254 +6,322 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * StoryLinks Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class StoryLinks implements ArrayAccess +class StoryLinks implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'StoryLinks'; + protected static $openAPIModelName = 'StoryLinks'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'permalink' => 'string', - 'related_stories' => 'string', + protected static $openAPITypes = [ + 'canonical' => 'string', 'coverages' => 'string', - 'canonical' => 'string' + 'permalink' => 'string', + 'relatedStories' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'canonical' => null, + 'coverages' => null, + 'permalink' => null, + 'relatedStories' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() { - return self::$apiTypes; + return self::$openAPIFormats; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'permalink' => 'permalink', - 'related_stories' => 'related_stories', + 'canonical' => 'canonical', 'coverages' => 'coverages', - 'canonical' => 'canonical' + 'permalink' => 'permalink', + 'relatedStories' => 'related_stories' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'permalink' => 'setPermalink', - 'related_stories' => 'setRelatedStories', + 'canonical' => 'setCanonical', 'coverages' => 'setCoverages', - 'canonical' => 'setCanonical' + 'permalink' => 'setPermalink', + 'relatedStories' => 'setRelatedStories' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'permalink' => 'getPermalink', - 'related_stories' => 'getRelatedStories', + 'canonical' => 'getCanonical', 'coverages' => 'getCoverages', - 'canonical' => 'getCanonical' + 'permalink' => 'getPermalink', + 'relatedStories' => 'getRelatedStories' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['permalink'] = isset($data['permalink']) ? $data['permalink'] : null; - $this->container['related_stories'] = isset($data['related_stories']) ? $data['related_stories'] : null; - $this->container['coverages'] = isset($data['coverages']) ? $data['coverages'] : null; $this->container['canonical'] = isset($data['canonical']) ? $data['canonical'] : null; + $this->container['coverages'] = isset($data['coverages']) ? $data['coverages'] : null; + $this->container['permalink'] = isset($data['permalink']) ? $data['permalink'] : null; + $this->container['relatedStories'] = isset($data['relatedStories']) ? $data['relatedStories'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets permalink - * @return string + * Gets canonical + * + * @return string|null */ - public function getPermalink() + public function getCanonical() { - return $this->container['permalink']; + return $this->container['canonical']; } /** - * Sets permalink - * @param string $permalink The story permalink URL + * Sets canonical + * + * @param string|null $canonical The story canonical URL + * * @return $this */ - public function setPermalink($permalink) + public function setCanonical($canonical) { - $this->container['permalink'] = $permalink; + $this->container['canonical'] = $canonical; return $this; } /** - * Gets related_stories - * @return string + * Gets coverages + * + * @return string|null */ - public function getRelatedStories() + public function getCoverages() { - return $this->container['related_stories']; + return $this->container['coverages']; } /** - * Sets related_stories - * @param string $related_stories The related stories URL + * Sets coverages + * + * @param string|null $coverages The coverages URL + * * @return $this */ - public function setRelatedStories($related_stories) + public function setCoverages($coverages) { - $this->container['related_stories'] = $related_stories; + $this->container['coverages'] = $coverages; return $this; } /** - * Gets coverages - * @return string + * Gets permalink + * + * @return string|null */ - public function getCoverages() + public function getPermalink() { - return $this->container['coverages']; + return $this->container['permalink']; } /** - * Sets coverages - * @param string $coverages The coverages URL + * Sets permalink + * + * @param string|null $permalink The story permalink URL + * * @return $this */ - public function setCoverages($coverages) + public function setPermalink($permalink) { - $this->container['coverages'] = $coverages; + $this->container['permalink'] = $permalink; return $this; } /** - * Gets canonical - * @return string + * Gets relatedStories + * + * @return string|null */ - public function getCanonical() + public function getRelatedStories() { - return $this->container['canonical']; + return $this->container['relatedStories']; } /** - * Sets canonical - * @param string $canonical The story canonical URL + * Sets relatedStories + * + * @param string|null $relatedStories The related stories URL + * * @return $this */ - public function setCanonical($canonical) + public function setRelatedStories($relatedStories) { - $this->container['canonical'] = $canonical; + $this->container['relatedStories'] = $relatedStories; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -263,7 +331,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -273,8 +343,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -288,7 +360,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -298,15 +372,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/StoryTranslations.php b/lib/Models/StoryTranslations.php new file mode 100644 index 0000000..ec21792 --- /dev/null +++ b/lib/Models/StoryTranslations.php @@ -0,0 +1,298 @@ + '\Aylien\NewsApi\Models\StoryTranslationsEn' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'en' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'en' => 'en' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'en' => 'setEn' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'en' => 'getEn' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['en'] = isset($data['en']) ? $data['en'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets en + * + * @return \Aylien\NewsApi\Models\StoryTranslationsEn|null + */ + public function getEn() + { + return $this->container['en']; + } + + /** + * Sets en + * + * @param \Aylien\NewsApi\Models\StoryTranslationsEn|null $en en + * + * @return $this + */ + public function setEn($en) + { + $this->container['en'] = $en; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/Models/StoryTranslationsEn.php b/lib/Models/StoryTranslationsEn.php new file mode 100644 index 0000000..93c9e65 --- /dev/null +++ b/lib/Models/StoryTranslationsEn.php @@ -0,0 +1,357 @@ + 'string', + 'text' => 'string', + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'body' => null, + 'text' => null, + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'body' => 'body', + 'text' => 'text', + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'body' => 'setBody', + 'text' => 'setText', + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'body' => 'getBody', + 'text' => 'getText', + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['text'] = isset($data['text']) ? $data['text'] : null; + $this->container['title'] = isset($data['title']) ? $data['title'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets body + * + * @return string|null + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string|null $body Translation of body + * + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets text + * + * @return string|null + */ + public function getText() + { + return $this->container['text']; + } + + /** + * Sets text + * + * @param string|null $text Translation of a concatenation of title and body + * + * @return $this + */ + public function setText($text) + { + $this->container['text'] = $text; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Translation of title + * + * @return $this + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/Models/Summary.php b/lib/Models/Summary.php index 3dfdab7..e632b93 100644 --- a/lib/Models/Summary.php +++ b/lib/Models/Summary.php @@ -6,122 +6,174 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Summary Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Summary implements ArrayAccess +class Summary implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Summary'; + protected static $openAPIModelName = 'Summary'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ + protected static $openAPITypes = [ 'sentences' => 'string[]' ]; - public static function apiTypes() + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'sentences' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ 'sentences' => 'sentences' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ 'sentences' => 'setSentences' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ 'sentences' => 'getSentences' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -129,33 +181,33 @@ public function __construct(array $data = null) } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets sentences - * @return string[] + * + * @return string[]|null */ public function getSentences() { @@ -164,7 +216,9 @@ public function getSentences() /** * Sets sentences - * @param string[] $sentences An array of the suggested summary sentences + * + * @param string[]|null $sentences An array of the suggested summary sentences + * * @return $this */ public function setSentences($sentences) @@ -175,7 +229,9 @@ public function setSentences($sentences) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -185,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -195,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -210,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -220,15 +282,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/TimeSeries.php b/lib/Models/TimeSeries.php index 0c1b525..0d9c24e 100644 --- a/lib/Models/TimeSeries.php +++ b/lib/Models/TimeSeries.php @@ -6,202 +6,262 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * TimeSeries Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class TimeSeries implements ArrayAccess +class TimeSeries implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'TimeSeries'; + protected static $openAPIModelName = 'TimeSeries'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'publishedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'published_at' => '\DateTime', - 'count' => 'int' + protected static $openAPIFormats = [ + 'count' => 'int32', + 'publishedAt' => 'date-time' ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'published_at' => 'published_at', - 'count' => 'count' + 'count' => 'count', + 'publishedAt' => 'published_at' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'published_at' => 'setPublishedAt', - 'count' => 'setCount' + 'count' => 'setCount', + 'publishedAt' => 'setPublishedAt' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'published_at' => 'getPublishedAt', - 'count' => 'getCount' + 'count' => 'getCount', + 'publishedAt' => 'getPublishedAt' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['published_at'] = isset($data['published_at']) ? $data['published_at'] : null; $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['publishedAt'] = isset($data['publishedAt']) ? $data['publishedAt'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets published_at - * @return \DateTime + * Gets count + * + * @return int|null */ - public function getPublishedAt() + public function getCount() { - return $this->container['published_at']; + return $this->container['count']; } /** - * Sets published_at - * @param \DateTime $published_at The published date of the time series bin + * Sets count + * + * @param int|null $count The count of time series bin + * * @return $this */ - public function setPublishedAt($published_at) + public function setCount($count) { - $this->container['published_at'] = $published_at; + $this->container['count'] = $count; return $this; } /** - * Gets count - * @return int + * Gets publishedAt + * + * @return \DateTime|null */ - public function getCount() + public function getPublishedAt() { - return $this->container['count']; + return $this->container['publishedAt']; } /** - * Sets count - * @param int $count The count of time series bin + * Sets publishedAt + * + * @param \DateTime|null $publishedAt The published date of the time series bin + * * @return $this */ - public function setCount($count) + public function setPublishedAt($publishedAt) { - $this->container['count'] = $count; + $this->container['publishedAt'] = $publishedAt; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/TimeSeriesList.php b/lib/Models/TimeSeriesList.php index da19f69..12236d7 100644 --- a/lib/Models/TimeSeriesList.php +++ b/lib/Models/TimeSeriesList.php @@ -6,254 +6,322 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * TimeSeriesList Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class TimeSeriesList implements ArrayAccess +class TimeSeriesList implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'TimeSeriesList'; + protected static $openAPIModelName = 'TimeSeriesList'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'time_series' => '\Aylien\NewsApi\Models\TimeSeries[]', + protected static $openAPITypes = [ 'period' => 'string', - 'published_at_start' => '\DateTime', - 'published_at_end' => '\DateTime' + 'publishedAtEnd' => '\DateTime', + 'publishedAtStart' => '\DateTime', + 'timeSeries' => '\Aylien\NewsApi\Models\TimeSeries[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'period' => null, + 'publishedAtEnd' => 'date-time', + 'publishedAtStart' => 'date-time', + 'timeSeries' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'time_series' => 'time_series', 'period' => 'period', - 'published_at_start' => 'published_at.start', - 'published_at_end' => 'published_at.end' + 'publishedAtEnd' => 'published_at.end', + 'publishedAtStart' => 'published_at.start', + 'timeSeries' => 'time_series' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'time_series' => 'setTimeSeries', 'period' => 'setPeriod', - 'published_at_start' => 'setPublishedAtStart', - 'published_at_end' => 'setPublishedAtEnd' + 'publishedAtEnd' => 'setPublishedAtEnd', + 'publishedAtStart' => 'setPublishedAtStart', + 'timeSeries' => 'setTimeSeries' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'time_series' => 'getTimeSeries', 'period' => 'getPeriod', - 'published_at_start' => 'getPublishedAtStart', - 'published_at_end' => 'getPublishedAtEnd' + 'publishedAtEnd' => 'getPublishedAtEnd', + 'publishedAtStart' => 'getPublishedAtStart', + 'timeSeries' => 'getTimeSeries' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['time_series'] = isset($data['time_series']) ? $data['time_series'] : null; $this->container['period'] = isset($data['period']) ? $data['period'] : null; - $this->container['published_at_start'] = isset($data['published_at_start']) ? $data['published_at_start'] : null; - $this->container['published_at_end'] = isset($data['published_at_end']) ? $data['published_at_end'] : null; + $this->container['publishedAtEnd'] = isset($data['publishedAtEnd']) ? $data['publishedAtEnd'] : null; + $this->container['publishedAtStart'] = isset($data['publishedAtStart']) ? $data['publishedAtStart'] : null; + $this->container['timeSeries'] = isset($data['timeSeries']) ? $data['timeSeries'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets time_series - * @return \Aylien\NewsApi\Models\TimeSeries[] + * Gets period + * + * @return string|null */ - public function getTimeSeries() + public function getPeriod() { - return $this->container['time_series']; + return $this->container['period']; } /** - * Sets time_series - * @param \Aylien\NewsApi\Models\TimeSeries[] $time_series An array of time series + * Sets period + * + * @param string|null $period The size of each date range expressed as an interval to be added to the lower bound. + * * @return $this */ - public function setTimeSeries($time_series) + public function setPeriod($period) { - $this->container['time_series'] = $time_series; + $this->container['period'] = $period; return $this; } /** - * Gets period - * @return string + * Gets publishedAtEnd + * + * @return \DateTime|null */ - public function getPeriod() + public function getPublishedAtEnd() { - return $this->container['period']; + return $this->container['publishedAtEnd']; } /** - * Sets period - * @param string $period The size of each date range expressed as an interval to be added to the lower bound. + * Sets publishedAtEnd + * + * @param \DateTime|null $publishedAtEnd The end published date of the time series + * * @return $this */ - public function setPeriod($period) + public function setPublishedAtEnd($publishedAtEnd) { - $this->container['period'] = $period; + $this->container['publishedAtEnd'] = $publishedAtEnd; return $this; } /** - * Gets published_at_start - * @return \DateTime + * Gets publishedAtStart + * + * @return \DateTime|null */ public function getPublishedAtStart() { - return $this->container['published_at_start']; + return $this->container['publishedAtStart']; } /** - * Sets published_at_start - * @param \DateTime $published_at_start The start published date of the time series + * Sets publishedAtStart + * + * @param \DateTime|null $publishedAtStart The start published date of the time series + * * @return $this */ - public function setPublishedAtStart($published_at_start) + public function setPublishedAtStart($publishedAtStart) { - $this->container['published_at_start'] = $published_at_start; + $this->container['publishedAtStart'] = $publishedAtStart; return $this; } /** - * Gets published_at_end - * @return \DateTime + * Gets timeSeries + * + * @return \Aylien\NewsApi\Models\TimeSeries[]|null */ - public function getPublishedAtEnd() + public function getTimeSeries() { - return $this->container['published_at_end']; + return $this->container['timeSeries']; } /** - * Sets published_at_end - * @param \DateTime $published_at_end The end published date of the time series + * Sets timeSeries + * + * @param \Aylien\NewsApi\Models\TimeSeries[]|null $timeSeries An array of time series + * * @return $this */ - public function setPublishedAtEnd($published_at_end) + public function setTimeSeries($timeSeries) { - $this->container['published_at_end'] = $published_at_end; + $this->container['timeSeries'] = $timeSeries; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -263,7 +331,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -273,8 +343,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -288,7 +360,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -298,15 +372,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Trend.php b/lib/Models/Trend.php index 9aa175d..119f47c 100644 --- a/lib/Models/Trend.php +++ b/lib/Models/Trend.php @@ -6,202 +6,262 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Trend Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Trend implements ArrayAccess +class Trend implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Trend'; + protected static $openAPIModelName = 'Trend'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'value' => 'string', - 'count' => 'int' + protected static $openAPIFormats = [ + 'count' => 'int32', + 'value' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'value' => 'value', - 'count' => 'count' + 'count' => 'count', + 'value' => 'value' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'value' => 'setValue', - 'count' => 'setCount' + 'count' => 'setCount', + 'value' => 'setValue' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'value' => 'getValue', - 'count' => 'getCount' + 'count' => 'getCount', + 'value' => 'getValue' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['value'] = isset($data['value']) ? $data['value'] : null; $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['value'] = isset($data['value']) ? $data['value'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets value - * @return string + * Gets count + * + * @return int|null */ - public function getValue() + public function getCount() { - return $this->container['value']; + return $this->container['count']; } /** - * Sets value - * @param string $value The value of the trend + * Sets count + * + * @param int|null $count The count of the trend + * * @return $this */ - public function setValue($value) + public function setCount($count) { - $this->container['value'] = $value; + $this->container['count'] = $count; return $this; } /** - * Gets count - * @return int + * Gets value + * + * @return string|null */ - public function getCount() + public function getValue() { - return $this->container['count']; + return $this->container['value']; } /** - * Sets count - * @param int $count The count of the trend + * Sets value + * + * @param string|null $value The value of the trend + * * @return $this */ - public function setCount($count) + public function setValue($value) { - $this->container['count'] = $count; + $this->container['value'] = $value; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/Models/Trends.php b/lib/Models/Trends.php index ecb2262..41d173c 100644 --- a/lib/Models/Trends.php +++ b/lib/Models/Trends.php @@ -6,202 +6,262 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi\Models; use \ArrayAccess; +use \Aylien\NewsApi\ObjectSerializer; /** * Trends Class Doc Comment * - * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @category Class + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class Trends implements ArrayAccess +class Trends implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ - protected static $apiModelName = 'Trends'; + protected static $openAPIModelName = 'Trends'; /** * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'field' => 'string', + 'trends' => '\Aylien\NewsApi\Models\Trend[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ - protected static $apiTypes = [ - 'trends' => '\Aylien\NewsApi\Models\Trend[]', - 'field' => 'string' + protected static $openAPIFormats = [ + 'field' => null, + 'trends' => null ]; - public static function apiTypes() + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() { - return self::$apiTypes; + return self::$openAPITypes; } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ - 'trends' => 'trends', - 'field' => 'field' + 'field' => 'field', + 'trends' => 'trends' ]; - /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ - 'trends' => 'setTrends', - 'field' => 'setField' + 'field' => 'setField', + 'trends' => 'setTrends' ]; - /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ - 'trends' => 'getTrends', - 'field' => 'getField' + 'field' => 'getField', + 'trends' => 'getTrends' ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ public static function attributeMap() { return self::$attributeMap; } + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ public static function setters() { return self::$setters; } + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ public static function getters() { return self::$getters; } + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['trends'] = isset($data['trends']) ? $data['trends'] : null; $this->container['field'] = isset($data['field']) ? $data['field'] : null; + $this->container['trends'] = isset($data['trends']) ? $data['trends'] : null; } /** - * show all the invalid properties with reasons. + * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** - * Gets trends - * @return \Aylien\NewsApi\Models\Trend[] + * Gets field + * + * @return string|null */ - public function getTrends() + public function getField() { - return $this->container['trends']; + return $this->container['field']; } /** - * Sets trends - * @param \Aylien\NewsApi\Models\Trend[] $trends An array of trends + * Sets field + * + * @param string|null $field The field of trends + * * @return $this */ - public function setTrends($trends) + public function setField($field) { - $this->container['trends'] = $trends; + $this->container['field'] = $field; return $this; } /** - * Gets field - * @return string + * Gets trends + * + * @return \Aylien\NewsApi\Models\Trend[]|null */ - public function getField() + public function getTrends() { - return $this->container['field']; + return $this->container['trends']; } /** - * Sets field - * @param string $field The field of trends + * Sets trends + * + * @param \Aylien\NewsApi\Models\Trend[]|null $trends An array of trends + * * @return $this */ - public function setField($field) + public function setTrends($trends) { - $this->container['field'] = $field; + $this->container['trends'] = $trends; return $this; } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -211,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -221,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -236,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -246,15 +312,15 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } - - return json_encode(\Aylien\NewsApi\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index df4b618..956e87e 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -6,58 +6,56 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * AYLIEN News API * - * AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Copyright 2017 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ namespace Aylien\NewsApi; +use Aylien\NewsApi\Models\ModelInterface; + /** * ObjectSerializer Class Doc Comment * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ObjectSerializer { /** * Serialize data * - * @param mixed $data the data to serialize + * @param mixed $data the data to serialize + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data * * @return string|object serialized form of $data */ - public static function sanitizeForSerialization($data) + public static function sanitizeForSerialization($data, $type = null, $format = null) { if (is_scalar($data) || null === $data) { return $data; } elseif ($data instanceof \DateTime) { - return $data->format(\DateTime::ATOM); + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); } elseif (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); @@ -65,10 +63,25 @@ public static function sanitizeForSerialization($data) return $data; } elseif (is_object($data)) { $values = []; - foreach (array_keys($data::apiTypes()) as $property) { - $getter = $data::getters()[$property]; - if ($data->$getter() !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null + && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($openAPIType, 'getAllowableEnumValues') + && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); } } return (object)$values; @@ -85,7 +98,7 @@ public static function sanitizeForSerialization($data) * * @return string the sanitized filename */ - public function sanitizeFilename($filename) + public static function sanitizeFilename($filename) { if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { return $match[1]; @@ -102,9 +115,9 @@ public function sanitizeFilename($filename) * * @return string the serialized object */ - public function toPathValue($value) + public static function toPathValue($value) { - return rawurlencode($this->toString($value)); + return rawurlencode(self::toString($value)); } /** @@ -117,12 +130,12 @@ public function toPathValue($value) * * @return string the serialized object */ - public function toQueryValue($object) + public static function toQueryValue($object) { if (is_array($object)) { - return $object; + return implode(',', $object); } else { - return $this->toString($object); + return self::toString($object); } } @@ -135,9 +148,9 @@ public function toQueryValue($object) * * @return string the header string */ - public function toHeaderValue($value) + public static function toHeaderValue($value) { - return $this->toString($value); + return self::toString($value); } /** @@ -149,12 +162,12 @@ public function toHeaderValue($value) * * @return string the form string */ - public function toFormValue($value) + public static function toFormValue($value) { if ($value instanceof \SplFileObject) { return $value->getRealPath(); } else { - return $this->toString($value); + return self::toString($value); } } @@ -162,15 +175,18 @@ public function toFormValue($value) * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". * - * @param string|\DateTime $value the value of the parameter + * @param string|bool|\DateTime $value the value of the parameter * * @return string the header string */ - public function toString($value) + public static function toString($value) { if ($value instanceof \DateTime) { // datetime in ISO8601 format return $value->format(\DateTime::ATOM); + } else if (is_bool($value)) { + return $value ? 'true' : 'false'; } else { return $value; } @@ -186,12 +202,12 @@ public function toString($value) * * @return string */ - public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) { if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. - return $collection; + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); } switch ($collectionFormat) { case 'pipes': @@ -218,13 +234,15 @@ public function serializeCollection(array $collection, $collectionFormat, $allow * @param string[] $httpHeaders HTTP headers * @param string $discriminator discriminator if polymorphism is used * - * @return object|array|null an single or an array of $class instances + * @return object|array|null a single or an array of $class instances */ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); $inner = substr($class, 4, -1); $deserialized = []; if (strrpos($inner, ",") !== false) { @@ -236,6 +254,7 @@ public static function deserialize($data, $class, $httpHeaders = null) } return $deserialized; } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; $subClass = substr($class, 0, -2); $values = []; foreach ($data as $key => $value) { @@ -261,21 +280,31 @@ public static function deserialize($data, $class, $httpHeaders = null) settype($data, $class); return $data; } elseif ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + // determine file name if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . sanitizeFilename($match[1]); + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } - $deserialized = new \SplFileObject($filename, "w"); - $byte_written = $deserialized->fwrite($data); - if (Configuration::getDefaultConfiguration()->getDebug()) { - error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); } + fclose($file); - return $deserialized; + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; } else { + $data = is_string($data) ? json_decode($data) : $data; // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { @@ -285,7 +314,7 @@ public static function deserialize($data, $class, $httpHeaders = null) } } $instance = new $class(); - foreach ($instance::apiTypes() as $property => $type) { + foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..aee703d --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,23 @@ + + + + + ./test/Api + ./test/Model + + + + + ./lib/Api + ./lib/Models + + + + + + diff --git a/test/Api/DefaultApiTest.php b/test/Api/DefaultApiTest.php index 35b2fa1..9d5c903 100644 --- a/test/Api/DefaultApiTest.php +++ b/test/Api/DefaultApiTest.php @@ -5,43 +5,43 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ + /** - * Copyright 2016 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * AYLIEN News API * - * http://www.apache.org/licenses/LICENSE-2.0 + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the endpoint. */ namespace Aylien\NewsApi; use \Aylien\NewsApi\Configuration; -use \Aylien\NewsApi\ApiClient; use \Aylien\NewsApi\ApiException; use \Aylien\NewsApi\ObjectSerializer; +use PHPUnit\Framework\TestCase; /** * DefaultApiTest Class Doc Comment * * @category Class - * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @package Aylien\NewsApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class DefaultApiTest extends \PHPUnit_Framework_TestCase +class DefaultApiTest extends TestCase { /** @@ -49,7 +49,6 @@ class DefaultApiTest extends \PHPUnit_Framework_TestCase */ public static function setUpBeforeClass() { - } /** @@ -57,7 +56,6 @@ public static function setUpBeforeClass() */ public function setUp() { - } /** @@ -65,7 +63,6 @@ public function setUp() */ public function tearDown() { - } /** @@ -73,7 +70,6 @@ public function tearDown() */ public static function tearDownAfterClass() { - } /** @@ -84,7 +80,16 @@ public static function tearDownAfterClass() */ public function testListAutocompletes() { + } + /** + * Test case for listClusters + * + * List Clusters. + * + */ + public function testListClusters() + { } /** @@ -95,7 +100,6 @@ public function testListAutocompletes() */ public function testListCoverages() { - } /** @@ -106,7 +110,6 @@ public function testListCoverages() */ public function testListHistograms() { - } /** @@ -117,7 +120,6 @@ public function testListHistograms() */ public function testListRelatedStories() { - } /** @@ -128,7 +130,6 @@ public function testListRelatedStories() */ public function testListStories() { - } /** @@ -139,7 +140,6 @@ public function testListStories() */ public function testListTimeSeries() { - } /** @@ -150,7 +150,5 @@ public function testListTimeSeries() */ public function testListTrends() { - } - } diff --git a/test/Model/AuthorTest.php b/test/Model/AuthorTest.php index 368f49a..03dc3ee 100644 --- a/test/Model/AuthorTest.php +++ b/test/Model/AuthorTest.php @@ -6,39 +6,41 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ + /** - * Copyright 2016 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * AYLIEN News API * - * http://www.apache.org/licenses/LICENSE-2.0 + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. */ namespace Aylien\NewsApi; +use PHPUnit\Framework\TestCase; + /** * AuthorTest Class Doc Comment * * @category Class - * @description + * @description Author * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class AuthorTest extends \PHPUnit_Framework_TestCase +class AuthorTest extends TestCase { /** @@ -46,7 +48,6 @@ class AuthorTest extends \PHPUnit_Framework_TestCase */ public static function setUpBeforeClass() { - } /** @@ -54,7 +55,6 @@ public static function setUpBeforeClass() */ public function setUp() { - } /** @@ -62,7 +62,6 @@ public function setUp() */ public function tearDown() { - } /** @@ -70,7 +69,6 @@ public function tearDown() */ public static function tearDownAfterClass() { - } /** @@ -78,31 +76,26 @@ public static function tearDownAfterClass() */ public function testAuthor() { - } /** - * Test attribute "id" + * Test attribute "avatarUrl" */ - public function testPropertyId() + public function testPropertyAvatarUrl() { - } /** - * Test attribute "name" + * Test attribute "id" */ - public function testPropertyName() + public function testPropertyId() { - } /** - * Test attribute "avatar_url" + * Test attribute "name" */ - public function testPropertyAvatarUrl() + public function testPropertyName() { - } - } diff --git a/test/Model/AutocompleteTest.php b/test/Model/AutocompleteTest.php index a362594..20227ef 100644 --- a/test/Model/AutocompleteTest.php +++ b/test/Model/AutocompleteTest.php @@ -6,39 +6,41 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ + /** - * Copyright 2016 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * AYLIEN News API * - * http://www.apache.org/licenses/LICENSE-2.0 + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. */ namespace Aylien\NewsApi; +use PHPUnit\Framework\TestCase; + /** * AutocompleteTest Class Doc Comment * * @category Class - * @description + * @description Autocomplete * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class AutocompleteTest extends \PHPUnit_Framework_TestCase +class AutocompleteTest extends TestCase { /** @@ -46,7 +48,6 @@ class AutocompleteTest extends \PHPUnit_Framework_TestCase */ public static function setUpBeforeClass() { - } /** @@ -54,7 +55,6 @@ public static function setUpBeforeClass() */ public function setUp() { - } /** @@ -62,7 +62,6 @@ public function setUp() */ public function tearDown() { - } /** @@ -70,7 +69,6 @@ public function tearDown() */ public static function tearDownAfterClass() { - } /** @@ -78,7 +76,6 @@ public static function tearDownAfterClass() */ public function testAutocomplete() { - } /** @@ -86,7 +83,6 @@ public function testAutocomplete() */ public function testPropertyId() { - } /** @@ -94,7 +90,5 @@ public function testPropertyId() */ public function testPropertyText() { - } - } diff --git a/test/Model/AutocompletesTest.php b/test/Model/AutocompletesTest.php index 51dbdbc..3972008 100644 --- a/test/Model/AutocompletesTest.php +++ b/test/Model/AutocompletesTest.php @@ -6,39 +6,41 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ + /** - * Copyright 2016 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * AYLIEN News API * - * http://www.apache.org/licenses/LICENSE-2.0 + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. */ namespace Aylien\NewsApi; +use PHPUnit\Framework\TestCase; + /** * AutocompletesTest Class Doc Comment * * @category Class - * @description + * @description Autocompletes * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class AutocompletesTest extends \PHPUnit_Framework_TestCase +class AutocompletesTest extends TestCase { /** @@ -46,7 +48,6 @@ class AutocompletesTest extends \PHPUnit_Framework_TestCase */ public static function setUpBeforeClass() { - } /** @@ -54,7 +55,6 @@ public static function setUpBeforeClass() */ public function setUp() { - } /** @@ -62,7 +62,6 @@ public function setUp() */ public function tearDown() { - } /** @@ -70,7 +69,6 @@ public function tearDown() */ public static function tearDownAfterClass() { - } /** @@ -78,7 +76,6 @@ public static function tearDownAfterClass() */ public function testAutocompletes() { - } /** @@ -86,7 +83,5 @@ public function testAutocompletes() */ public function testPropertyAutocompletes() { - } - } diff --git a/test/Model/CategoryLinksTest.php b/test/Model/CategoryLinksTest.php index 223f315..722d721 100644 --- a/test/Model/CategoryLinksTest.php +++ b/test/Model/CategoryLinksTest.php @@ -6,39 +6,41 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ + /** - * Copyright 2016 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * AYLIEN News API * - * http://www.apache.org/licenses/LICENSE-2.0 + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. */ namespace Aylien\NewsApi; +use PHPUnit\Framework\TestCase; + /** * CategoryLinksTest Class Doc Comment * * @category Class - * @description + * @description CategoryLinks * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class CategoryLinksTest extends \PHPUnit_Framework_TestCase +class CategoryLinksTest extends TestCase { /** @@ -46,7 +48,6 @@ class CategoryLinksTest extends \PHPUnit_Framework_TestCase */ public static function setUpBeforeClass() { - } /** @@ -54,7 +55,6 @@ public static function setUpBeforeClass() */ public function setUp() { - } /** @@ -62,7 +62,6 @@ public function setUp() */ public function tearDown() { - } /** @@ -70,7 +69,6 @@ public function tearDown() */ public static function tearDownAfterClass() { - } /** @@ -78,23 +76,19 @@ public static function tearDownAfterClass() */ public function testCategoryLinks() { - } /** - * Test attribute "self" + * Test attribute "parent" */ - public function testPropertySelf() + public function testPropertyParent() { - } /** - * Test attribute "parent" + * Test attribute "self" */ - public function testPropertyParent() + public function testPropertySelf() { - } - } diff --git a/test/Model/CategoryTest.php b/test/Model/CategoryTest.php index 7daec16..19b0d03 100644 --- a/test/Model/CategoryTest.php +++ b/test/Model/CategoryTest.php @@ -6,39 +6,41 @@ * * @category Class * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ + /** - * Copyright 2016 Aylien, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * AYLIEN News API * - * http://www.apache.org/licenses/LICENSE-2.0 + * The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The version of the OpenAPI document: 3.0 + * Contact: support@aylien.com + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 4.1.3-SNAPSHOT + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. */ namespace Aylien\NewsApi; +use PHPUnit\Framework\TestCase; + /** * CategoryTest Class Doc Comment * * @category Class - * @description + * @description Category * @package Aylien\NewsApi - * @author Hamed Ramezanian Nik - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 - * @link https://newsapi.aylien.com/ + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ -class CategoryTest extends \PHPUnit_Framework_TestCase +class CategoryTest extends TestCase { /** @@ -46,7 +48,6 @@ class CategoryTest extends \PHPUnit_Framework_TestCase */ public static function setUpBeforeClass() { - } /** @@ -54,7 +55,6 @@ public static function setUpBeforeClass() */ public function setUp() { - } /** @@ -62,7 +62,6 @@ public function setUp() */ public function tearDown() { - } /** @@ -70,7 +69,6 @@ public function tearDown() */ public static function tearDownAfterClass() { - } /** @@ -78,23 +76,20 @@ public static function tearDownAfterClass() */ public function testCategory() { - } /** - * Test attribute "id" + * Test attribute "confident" */ - public function testPropertyId() + public function testPropertyConfident() { - } /** - * Test attribute "taxonomy" + * Test attribute "id" */ - public function testPropertyTaxonomy() + public function testPropertyId() { - } /** @@ -102,31 +97,26 @@ public function testPropertyTaxonomy() */ public function testPropertyLevel() { - } /** - * Test attribute "score" + * Test attribute "links" */ - public function testPropertyScore() + public function testPropertyLinks() { - } /** - * Test attribute "confident" + * Test attribute "score" */ - public function testPropertyConfident() + public function testPropertyScore() { - } /** - * Test attribute "links" + * Test attribute "taxonomy" */ - public function testPropertyLinks() + public function testPropertyTaxonomy() { - } - } diff --git a/test/Model/ClusterTest.php b/test/Model/ClusterTest.php new file mode 100644 index 0000000..1e7b0b8 --- /dev/null +++ b/test/Model/ClusterTest.php @@ -0,0 +1,129 @@ +