# coding: utf-8

"""
    World News API

    The world's news wrapped into a single API.

    The version of the OpenAPI document: 1.0
    Contact: mail@worldnewsapi.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBool, StrictStr, field_validator
from typing import Optional, Union
from typing_extensions import Annotated
from worldnewsapi.models.extract_links_response import ExtractLinksResponse
from worldnewsapi.models.extract_news_response import ExtractNewsResponse
from worldnewsapi.models.geo_coordinates_response import GeoCoordinatesResponse
from worldnewsapi.models.search_news_response import SearchNewsResponse

from worldnewsapi.api_client import ApiClient, RequestSerialized
from worldnewsapi.api_response import ApiResponse
from worldnewsapi.rest import RESTResponseType


class NewsApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """
    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_call
    def extract_news(
        self,
        url: Annotated[StrictStr,
                       Field(description="The url of the news.")],
        analyze: Annotated[
            StrictBool,
            Field(description=
                  "Whether to analyze the news (extract entities etc.)")],
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ExtractNewsResponse:
        """Extract News

        Extract a news entry from a news site.

        :param url: The url of the news. (required)
        :type url: str
        :param analyze: Whether to analyze the news (extract entities etc.) (required)
        :type analyze: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._extract_news_serialize(url=url,
                                              analyze=analyze,
                                              _request_auth=_request_auth,
                                              _content_type=_content_type,
                                              _headers=_headers,
                                              _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ExtractNewsResponse",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def extract_news_with_http_info(
        self,
        url: Annotated[StrictStr,
                       Field(description="The url of the news.")],
        analyze: Annotated[
            StrictBool,
            Field(description=
                  "Whether to analyze the news (extract entities etc.)")],
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ExtractNewsResponse]:
        """Extract News

        Extract a news entry from a news site.

        :param url: The url of the news. (required)
        :type url: str
        :param analyze: Whether to analyze the news (extract entities etc.) (required)
        :type analyze: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._extract_news_serialize(url=url,
                                              analyze=analyze,
                                              _request_auth=_request_auth,
                                              _content_type=_content_type,
                                              _headers=_headers,
                                              _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ExtractNewsResponse",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def extract_news_without_preload_content(
        self,
        url: Annotated[StrictStr,
                       Field(description="The url of the news.")],
        analyze: Annotated[
            StrictBool,
            Field(description=
                  "Whether to analyze the news (extract entities etc.)")],
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Extract News

        Extract a news entry from a news site.

        :param url: The url of the news. (required)
        :type url: str
        :param analyze: Whether to analyze the news (extract entities etc.) (required)
        :type analyze: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._extract_news_serialize(url=url,
                                              analyze=analyze,
                                              _request_auth=_request_auth,
                                              _content_type=_content_type,
                                              _headers=_headers,
                                              _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ExtractNewsResponse",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        return response_data.response

    def _extract_news_serialize(
        self,
        url,
        analyze,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, str] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if url is not None:

            _query_params.append(('url', url))

        if analyze is not None:

            _query_params.append(('analyze', analyze))

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # authentication setting
        _auth_settings: List[str] = ['apiKey', 'headerApiKey']

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/extract-news',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth)

    @validate_call
    def extract_news_links(
        self,
        url: Annotated[
            StrictStr,
            Field(
                description="The url from which links should be extracted.")],
        api_key: Annotated[StrictStr,
                           Field(description="Your API key.")],
        prefix: Annotated[
            Optional[StrictStr],
            Field(description="The prefix the news links must start with."
                  )] = None,
        sub_domain: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include links to news on sub-domains."
            )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ExtractLinksResponse:
        """Extract News Links

        Extract a news links from a news website. 

        :param url: The url from which links should be extracted. (required)
        :type url: str
        :param api_key: Your API key. (required)
        :type api_key: str
        :param prefix: The prefix the news links must start with.
        :type prefix: str
        :param sub_domain: Whether to include links to news on sub-domains.
        :type sub_domain: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._extract_news_links_serialize(
            url=url,
            api_key=api_key,
            prefix=prefix,
            sub_domain=sub_domain,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ExtractLinksResponse",
            '401': None,
            '402': None,
            '403': None,
            '404': None,
            '429': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def extract_news_links_with_http_info(
        self,
        url: Annotated[
            StrictStr,
            Field(
                description="The url from which links should be extracted.")],
        api_key: Annotated[StrictStr,
                           Field(description="Your API key.")],
        prefix: Annotated[
            Optional[StrictStr],
            Field(description="The prefix the news links must start with."
                  )] = None,
        sub_domain: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include links to news on sub-domains."
            )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ExtractLinksResponse]:
        """Extract News Links

        Extract a news links from a news website. 

        :param url: The url from which links should be extracted. (required)
        :type url: str
        :param api_key: Your API key. (required)
        :type api_key: str
        :param prefix: The prefix the news links must start with.
        :type prefix: str
        :param sub_domain: Whether to include links to news on sub-domains.
        :type sub_domain: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._extract_news_links_serialize(
            url=url,
            api_key=api_key,
            prefix=prefix,
            sub_domain=sub_domain,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ExtractLinksResponse",
            '401': None,
            '402': None,
            '403': None,
            '404': None,
            '429': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def extract_news_links_without_preload_content(
        self,
        url: Annotated[
            StrictStr,
            Field(
                description="The url from which links should be extracted.")],
        api_key: Annotated[StrictStr,
                           Field(description="Your API key.")],
        prefix: Annotated[
            Optional[StrictStr],
            Field(description="The prefix the news links must start with."
                  )] = None,
        sub_domain: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include links to news on sub-domains."
            )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Extract News Links

        Extract a news links from a news website. 

        :param url: The url from which links should be extracted. (required)
        :type url: str
        :param api_key: Your API key. (required)
        :type api_key: str
        :param prefix: The prefix the news links must start with.
        :type prefix: str
        :param sub_domain: Whether to include links to news on sub-domains.
        :type sub_domain: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._extract_news_links_serialize(
            url=url,
            api_key=api_key,
            prefix=prefix,
            sub_domain=sub_domain,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ExtractLinksResponse",
            '401': None,
            '402': None,
            '403': None,
            '404': None,
            '429': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        return response_data.response

    def _extract_news_links_serialize(
        self,
        url,
        api_key,
        prefix,
        sub_domain,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, str] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if url is not None:

            _query_params.append(('url', url))

        if prefix is not None:

            _query_params.append(('prefix', prefix))

        if sub_domain is not None:

            _query_params.append(('sub-domain', sub_domain))

        if api_key is not None:

            _query_params.append(('api-key', api_key))

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # authentication setting
        _auth_settings: List[str] = ['apiKey', 'headerApiKey']

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/extract-news-links',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth)

    @validate_call
    def geo_coordinates(
        self,
        location: Annotated[
            StrictStr,
            Field(description=
                  "The address or name of the location, e.g. Tokyo, Japan.")],
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GeoCoordinatesResponse:
        """Get Geo Coordinates

        Get the geo coordinates for a location. The location can be an exact address but also just the name of a city or country.

        :param location: The address or name of the location, e.g. Tokyo, Japan. (required)
        :type location: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._geo_coordinates_serialize(location=location,
                                                 _request_auth=_request_auth,
                                                 _content_type=_content_type,
                                                 _headers=_headers,
                                                 _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GeoCoordinatesResponse",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def geo_coordinates_with_http_info(
        self,
        location: Annotated[
            StrictStr,
            Field(description=
                  "The address or name of the location, e.g. Tokyo, Japan.")],
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GeoCoordinatesResponse]:
        """Get Geo Coordinates

        Get the geo coordinates for a location. The location can be an exact address but also just the name of a city or country.

        :param location: The address or name of the location, e.g. Tokyo, Japan. (required)
        :type location: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._geo_coordinates_serialize(location=location,
                                                 _request_auth=_request_auth,
                                                 _content_type=_content_type,
                                                 _headers=_headers,
                                                 _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GeoCoordinatesResponse",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def geo_coordinates_without_preload_content(
        self,
        location: Annotated[
            StrictStr,
            Field(description=
                  "The address or name of the location, e.g. Tokyo, Japan.")],
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Geo Coordinates

        Get the geo coordinates for a location. The location can be an exact address but also just the name of a city or country.

        :param location: The address or name of the location, e.g. Tokyo, Japan. (required)
        :type location: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._geo_coordinates_serialize(location=location,
                                                 _request_auth=_request_auth,
                                                 _content_type=_content_type,
                                                 _headers=_headers,
                                                 _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GeoCoordinatesResponse",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        return response_data.response

    def _geo_coordinates_serialize(
        self,
        location,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, str] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if location is not None:

            _query_params.append(('location', location))

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # authentication setting
        _auth_settings: List[str] = ['apiKey', 'headerApiKey']

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/geo-coordinates',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth)

    @validate_call
    def news_website_to_rss_feed(
        self,
        url: Annotated[
            StrictStr,
            Field(
                description="The url from which links should be extracted.")],
        api_key: Annotated[StrictStr,
                           Field(description="Your API key.")],
        extract_news: Annotated[
            Optional[StrictBool],
            Field(
                description=
                "Whether extract news and add information such as description, publish date, and image to each item."
            )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """News Website to RSS Feed

        Turn a news website into an RSS feed. Any page of a news website can be turned into an RSS feed. Provide the URL to the page and the API will return an RSS feed with the latest news from that page. 

        :param url: The url from which links should be extracted. (required)
        :type url: str
        :param api_key: Your API key. (required)
        :type api_key: str
        :param extract_news: Whether extract news and add information such as description, publish date, and image to each item.
        :type extract_news: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._news_website_to_rss_feed_serialize(
            url=url,
            api_key=api_key,
            extract_news=extract_news,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '401': None,
            '402': None,
            '403': None,
            '404': None,
            '429': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def news_website_to_rss_feed_with_http_info(
        self,
        url: Annotated[
            StrictStr,
            Field(
                description="The url from which links should be extracted.")],
        api_key: Annotated[StrictStr,
                           Field(description="Your API key.")],
        extract_news: Annotated[
            Optional[StrictBool],
            Field(
                description=
                "Whether extract news and add information such as description, publish date, and image to each item."
            )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """News Website to RSS Feed

        Turn a news website into an RSS feed. Any page of a news website can be turned into an RSS feed. Provide the URL to the page and the API will return an RSS feed with the latest news from that page. 

        :param url: The url from which links should be extracted. (required)
        :type url: str
        :param api_key: Your API key. (required)
        :type api_key: str
        :param extract_news: Whether extract news and add information such as description, publish date, and image to each item.
        :type extract_news: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._news_website_to_rss_feed_serialize(
            url=url,
            api_key=api_key,
            extract_news=extract_news,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '401': None,
            '402': None,
            '403': None,
            '404': None,
            '429': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def news_website_to_rss_feed_without_preload_content(
        self,
        url: Annotated[
            StrictStr,
            Field(
                description="The url from which links should be extracted.")],
        api_key: Annotated[StrictStr,
                           Field(description="Your API key.")],
        extract_news: Annotated[
            Optional[StrictBool],
            Field(
                description=
                "Whether extract news and add information such as description, publish date, and image to each item."
            )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """News Website to RSS Feed

        Turn a news website into an RSS feed. Any page of a news website can be turned into an RSS feed. Provide the URL to the page and the API will return an RSS feed with the latest news from that page. 

        :param url: The url from which links should be extracted. (required)
        :type url: str
        :param api_key: Your API key. (required)
        :type api_key: str
        :param extract_news: Whether extract news and add information such as description, publish date, and image to each item.
        :type extract_news: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._news_website_to_rss_feed_serialize(
            url=url,
            api_key=api_key,
            extract_news=extract_news,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '401': None,
            '402': None,
            '403': None,
            '404': None,
            '429': None,
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        return response_data.response

    def _news_website_to_rss_feed_serialize(
        self,
        url,
        api_key,
        extract_news,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, str] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if url is not None:

            _query_params.append(('url', url))

        if extract_news is not None:

            _query_params.append(('extract-news', extract_news))

        if api_key is not None:

            _query_params.append(('api-key', api_key))

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/xml'])

        # authentication setting
        _auth_settings: List[str] = ['apiKey', 'headerApiKey']

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/feed.rss',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth)

    @validate_call
    def search_news(
        self,
        text: Annotated[
            Optional[StrictStr],
            Field(
                description="The text to match in the news content.")] = None,
        source_countries: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of ISO 3166 country codes from which the news should originate, e.g. gb,us."
            )] = None,
        language: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "The ISO 6391 language code of the news, e.g. \"en\" for English."
            )] = None,
        min_sentiment: Annotated[
            Optional[Union[Annotated[float,
                                     Field(le=1, strict=True, ge=-1)],
                           Annotated[int, Field(le=1, strict=True, ge=-1)]]],
            Field(
                description="The minimal sentiment of the news in range [-1,1]."
            )] = None,
        max_sentiment: Annotated[
            Optional[Union[Annotated[float,
                                     Field(le=1, strict=True, ge=-1)],
                           Annotated[int, Field(le=1, strict=True, ge=-1)]]],
            Field(
                description="The maximal sentiment of the news in range [-1,1]."
            )] = None,
        earliest_publish_date: Annotated[
            Optional[StrictStr],
            Field(
                description="The news must have been published after this date."
            )] = None,
        latest_publish_date: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "The news must have been published before this date.")] = None,
        news_sources: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of news sources from which the news should originate, e.g. https://www.bbc.co.uk"
            )] = None,
        authors: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of author names. Only news from any of the given authors will be returned."
            )] = None,
        entities: Annotated[
            Optional[StrictStr],
            Field(description="Filter news by entities, e.g. ORG:Tesla."
                  )] = None,
        location_filter: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "Filter news by radius around a certain location. Format is \"latitude,longitude,radius in kilometers\", e.g. 51.050407, 13.737262, 100"
            )] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]],
            Field(description="The number of news to skip in range [0,1000]"
                  )] = None,
        number: Annotated[
            Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
            Field(description="The number of news to return in range [1,100]"
                  )] = None,
        sort: Annotated[Optional[StrictStr],
                        Field(description="The sorting criteria.")] = None,
        sort_direction: Annotated[
            Optional[StrictStr],
            Field(description="Whether to sort ascending or descending."
                  )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SearchNewsResponse:
        """Search News

        Search for news.

        :param text: The text to match in the news content.
        :type text: str
        :param source_countries: A comma-separated list of ISO 3166 country codes from which the news should originate, e.g. gb,us.
        :type source_countries: str
        :param language: The ISO 6391 language code of the news, e.g. \"en\" for English.
        :type language: str
        :param min_sentiment: The minimal sentiment of the news in range [-1,1].
        :type min_sentiment: float
        :param max_sentiment: The maximal sentiment of the news in range [-1,1].
        :type max_sentiment: float
        :param earliest_publish_date: The news must have been published after this date.
        :type earliest_publish_date: str
        :param latest_publish_date: The news must have been published before this date.
        :type latest_publish_date: str
        :param news_sources: A comma-separated list of news sources from which the news should originate, e.g. https://www.bbc.co.uk
        :type news_sources: str
        :param authors: A comma-separated list of author names. Only news from any of the given authors will be returned.
        :type authors: str
        :param entities: Filter news by entities, e.g. ORG:Tesla.
        :type entities: str
        :param location_filter: Filter news by radius around a certain location. Format is \"latitude,longitude,radius in kilometers\", e.g. 51.050407, 13.737262, 100
        :type location_filter: str
        :param offset: The number of news to skip in range [0,1000]
        :type offset: int
        :param number: The number of news to return in range [1,100]
        :type number: int
        :param sort: The sorting criteria.
        :type sort: str
        :param sort_direction: Whether to sort ascending or descending.
        :type sort_direction: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._search_news_serialize(
            text=text,
            source_countries=source_countries,
            language=language,
            min_sentiment=min_sentiment,
            max_sentiment=max_sentiment,
            earliest_publish_date=earliest_publish_date,
            latest_publish_date=latest_publish_date,
            news_sources=news_sources,
            authors=authors,
            entities=entities,
            location_filter=location_filter,
            offset=offset,
            number=number,
            sort=sort,
            sort_direction=sort_direction,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SearchNewsResponse",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def search_news_with_http_info(
        self,
        text: Annotated[
            Optional[StrictStr],
            Field(
                description="The text to match in the news content.")] = None,
        source_countries: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of ISO 3166 country codes from which the news should originate, e.g. gb,us."
            )] = None,
        language: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "The ISO 6391 language code of the news, e.g. \"en\" for English."
            )] = None,
        min_sentiment: Annotated[
            Optional[Union[Annotated[float,
                                     Field(le=1, strict=True, ge=-1)],
                           Annotated[int, Field(le=1, strict=True, ge=-1)]]],
            Field(
                description="The minimal sentiment of the news in range [-1,1]."
            )] = None,
        max_sentiment: Annotated[
            Optional[Union[Annotated[float,
                                     Field(le=1, strict=True, ge=-1)],
                           Annotated[int, Field(le=1, strict=True, ge=-1)]]],
            Field(
                description="The maximal sentiment of the news in range [-1,1]."
            )] = None,
        earliest_publish_date: Annotated[
            Optional[StrictStr],
            Field(
                description="The news must have been published after this date."
            )] = None,
        latest_publish_date: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "The news must have been published before this date.")] = None,
        news_sources: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of news sources from which the news should originate, e.g. https://www.bbc.co.uk"
            )] = None,
        authors: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of author names. Only news from any of the given authors will be returned."
            )] = None,
        entities: Annotated[
            Optional[StrictStr],
            Field(description="Filter news by entities, e.g. ORG:Tesla."
                  )] = None,
        location_filter: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "Filter news by radius around a certain location. Format is \"latitude,longitude,radius in kilometers\", e.g. 51.050407, 13.737262, 100"
            )] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]],
            Field(description="The number of news to skip in range [0,1000]"
                  )] = None,
        number: Annotated[
            Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
            Field(description="The number of news to return in range [1,100]"
                  )] = None,
        sort: Annotated[Optional[StrictStr],
                        Field(description="The sorting criteria.")] = None,
        sort_direction: Annotated[
            Optional[StrictStr],
            Field(description="Whether to sort ascending or descending."
                  )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SearchNewsResponse]:
        """Search News

        Search for news.

        :param text: The text to match in the news content.
        :type text: str
        :param source_countries: A comma-separated list of ISO 3166 country codes from which the news should originate, e.g. gb,us.
        :type source_countries: str
        :param language: The ISO 6391 language code of the news, e.g. \"en\" for English.
        :type language: str
        :param min_sentiment: The minimal sentiment of the news in range [-1,1].
        :type min_sentiment: float
        :param max_sentiment: The maximal sentiment of the news in range [-1,1].
        :type max_sentiment: float
        :param earliest_publish_date: The news must have been published after this date.
        :type earliest_publish_date: str
        :param latest_publish_date: The news must have been published before this date.
        :type latest_publish_date: str
        :param news_sources: A comma-separated list of news sources from which the news should originate, e.g. https://www.bbc.co.uk
        :type news_sources: str
        :param authors: A comma-separated list of author names. Only news from any of the given authors will be returned.
        :type authors: str
        :param entities: Filter news by entities, e.g. ORG:Tesla.
        :type entities: str
        :param location_filter: Filter news by radius around a certain location. Format is \"latitude,longitude,radius in kilometers\", e.g. 51.050407, 13.737262, 100
        :type location_filter: str
        :param offset: The number of news to skip in range [0,1000]
        :type offset: int
        :param number: The number of news to return in range [1,100]
        :type number: int
        :param sort: The sorting criteria.
        :type sort: str
        :param sort_direction: Whether to sort ascending or descending.
        :type sort_direction: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._search_news_serialize(
            text=text,
            source_countries=source_countries,
            language=language,
            min_sentiment=min_sentiment,
            max_sentiment=max_sentiment,
            earliest_publish_date=earliest_publish_date,
            latest_publish_date=latest_publish_date,
            news_sources=news_sources,
            authors=authors,
            entities=entities,
            location_filter=location_filter,
            offset=offset,
            number=number,
            sort=sort,
            sort_direction=sort_direction,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SearchNewsResponse",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def search_news_without_preload_content(
        self,
        text: Annotated[
            Optional[StrictStr],
            Field(
                description="The text to match in the news content.")] = None,
        source_countries: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of ISO 3166 country codes from which the news should originate, e.g. gb,us."
            )] = None,
        language: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "The ISO 6391 language code of the news, e.g. \"en\" for English."
            )] = None,
        min_sentiment: Annotated[
            Optional[Union[Annotated[float,
                                     Field(le=1, strict=True, ge=-1)],
                           Annotated[int, Field(le=1, strict=True, ge=-1)]]],
            Field(
                description="The minimal sentiment of the news in range [-1,1]."
            )] = None,
        max_sentiment: Annotated[
            Optional[Union[Annotated[float,
                                     Field(le=1, strict=True, ge=-1)],
                           Annotated[int, Field(le=1, strict=True, ge=-1)]]],
            Field(
                description="The maximal sentiment of the news in range [-1,1]."
            )] = None,
        earliest_publish_date: Annotated[
            Optional[StrictStr],
            Field(
                description="The news must have been published after this date."
            )] = None,
        latest_publish_date: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "The news must have been published before this date.")] = None,
        news_sources: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of news sources from which the news should originate, e.g. https://www.bbc.co.uk"
            )] = None,
        authors: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "A comma-separated list of author names. Only news from any of the given authors will be returned."
            )] = None,
        entities: Annotated[
            Optional[StrictStr],
            Field(description="Filter news by entities, e.g. ORG:Tesla."
                  )] = None,
        location_filter: Annotated[
            Optional[StrictStr],
            Field(
                description=
                "Filter news by radius around a certain location. Format is \"latitude,longitude,radius in kilometers\", e.g. 51.050407, 13.737262, 100"
            )] = None,
        offset: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=0)]],
            Field(description="The number of news to skip in range [0,1000]"
                  )] = None,
        number: Annotated[
            Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
            Field(description="The number of news to return in range [1,100]"
                  )] = None,
        sort: Annotated[Optional[StrictStr],
                        Field(description="The sorting criteria.")] = None,
        sort_direction: Annotated[
            Optional[StrictStr],
            Field(description="Whether to sort ascending or descending."
                  )] = None,
        _request_timeout: Union[None, Annotated[StrictFloat,
                                                Field(gt=0)],
                                Tuple[Annotated[StrictFloat,
                                                Field(gt=0)],
                                      Annotated[StrictFloat,
                                                Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search News

        Search for news.

        :param text: The text to match in the news content.
        :type text: str
        :param source_countries: A comma-separated list of ISO 3166 country codes from which the news should originate, e.g. gb,us.
        :type source_countries: str
        :param language: The ISO 6391 language code of the news, e.g. \"en\" for English.
        :type language: str
        :param min_sentiment: The minimal sentiment of the news in range [-1,1].
        :type min_sentiment: float
        :param max_sentiment: The maximal sentiment of the news in range [-1,1].
        :type max_sentiment: float
        :param earliest_publish_date: The news must have been published after this date.
        :type earliest_publish_date: str
        :param latest_publish_date: The news must have been published before this date.
        :type latest_publish_date: str
        :param news_sources: A comma-separated list of news sources from which the news should originate, e.g. https://www.bbc.co.uk
        :type news_sources: str
        :param authors: A comma-separated list of author names. Only news from any of the given authors will be returned.
        :type authors: str
        :param entities: Filter news by entities, e.g. ORG:Tesla.
        :type entities: str
        :param location_filter: Filter news by radius around a certain location. Format is \"latitude,longitude,radius in kilometers\", e.g. 51.050407, 13.737262, 100
        :type location_filter: str
        :param offset: The number of news to skip in range [0,1000]
        :type offset: int
        :param number: The number of news to return in range [1,100]
        :type number: int
        :param sort: The sorting criteria.
        :type sort: str
        :param sort_direction: Whether to sort ascending or descending.
        :type sort_direction: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._search_news_serialize(
            text=text,
            source_countries=source_countries,
            language=language,
            min_sentiment=min_sentiment,
            max_sentiment=max_sentiment,
            earliest_publish_date=earliest_publish_date,
            latest_publish_date=latest_publish_date,
            news_sources=news_sources,
            authors=authors,
            entities=entities,
            location_filter=location_filter,
            offset=offset,
            number=number,
            sort=sort,
            sort_direction=sort_direction,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index)

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SearchNewsResponse",
        }
        response_data = self.api_client.call_api(
            *_param, _request_timeout=_request_timeout)
        return response_data.response

    def _search_news_serialize(
        self,
        text,
        source_countries,
        language,
        min_sentiment,
        max_sentiment,
        earliest_publish_date,
        latest_publish_date,
        news_sources,
        authors,
        entities,
        location_filter,
        offset,
        number,
        sort,
        sort_direction,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, str] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if text is not None:

            _query_params.append(('text', text))

        if source_countries is not None:

            _query_params.append(('source-countries', source_countries))

        if language is not None:

            _query_params.append(('language', language))

        if min_sentiment is not None:

            _query_params.append(('min-sentiment', min_sentiment))

        if max_sentiment is not None:

            _query_params.append(('max-sentiment', max_sentiment))

        if earliest_publish_date is not None:

            _query_params.append(
                ('earliest-publish-date', earliest_publish_date))

        if latest_publish_date is not None:

            _query_params.append(('latest-publish-date', latest_publish_date))

        if news_sources is not None:

            _query_params.append(('news-sources', news_sources))

        if authors is not None:

            _query_params.append(('authors', authors))

        if entities is not None:

            _query_params.append(('entities', entities))

        if location_filter is not None:

            _query_params.append(('location-filter', location_filter))

        if offset is not None:

            _query_params.append(('offset', offset))

        if number is not None:

            _query_params.append(('number', number))

        if sort is not None:

            _query_params.append(('sort', sort))

        if sort_direction is not None:

            _query_params.append(('sort-direction', sort_direction))

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # authentication setting
        _auth_settings: List[str] = ['apiKey', 'headerApiKey']

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/search-news',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth)
