diff --git a/.gitignore b/.gitignore index a655050..43995bd 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 06eda28..ec87108 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.3 \ No newline at end of file +4.2.3 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 86211e2..388de83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,9 @@ python: - "3.3" - "3.4" - "3.5" - #- "3.5-dev" # 3.5 development branch - #- "nightly" # points to the latest development branch e.g. 3.6-dev + - "3.6" + - "3.7" + - "3.8" # command to install dependencies install: "pip install -r requirements.txt" # command to run tests diff --git a/README.md b/README.md index d77c801..a11ee7c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# locationiq +# openapi-client LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 1.0.1 +- API version: 2.0.0 - Package version: 1.0.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen @@ -14,16 +14,16 @@ Python 2.7 and 3.4+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh -pip install git+https://github.com/location-iq/locationiq-python-client.git +pip install git+https://github.com/crystHopeunwired/locationiq-python-client.git ``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/location-iq/locationiq-python-client.git`) +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/crystHopeunwired/locationiq-python-client.git`) Then import the package: ```python -import locationiq +import openapi_client ``` ### Setuptools @@ -37,7 +37,7 @@ python setup.py install --user Then import the package: ```python -import locationiq +import openapi_client ``` ## Getting Started @@ -47,25 +47,29 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function import time -import locationiq -from locationiq.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint +configuration = openapi_client.Configuration() # Configure API key authorization: key -configuration = locationiq.Configuration() configuration.api_key['key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['key'] = 'Bearer' -# create an instance of the API class -api_instance = locationiq.BalanceApi(locationiq.ApiClient(configuration)) - -try: - api_response = api_instance.balance() - pprint(api_response) -except ApiException as e: - print("Exception when calling BalanceApi->balance: %s\n" % e) - +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.BalanceApi(api_client) + + try: + api_response = api_instance.balance() + pprint(api_response) + except ApiException as e: + print("Exception when calling BalanceApi->balance: %s\n" % e) + ``` ## Documentation for API Endpoints @@ -75,6 +79,10 @@ All URIs are relative to *https://eu1.locationiq.com/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *BalanceApi* | [**balance**](docs/BalanceApi.md#balance) | **GET** /balance.php | +*DirectionsApi* | [**directions**](docs/DirectionsApi.md#directions) | **GET** /directions/driving/{coordinates} | Directions Service +*MatchingApi* | [**matching**](docs/MatchingApi.md#matching) | **GET** /matching/driving/{coordinates} | Matching Service +*MatrixApi* | [**matrix**](docs/MatrixApi.md#matrix) | **GET** /matrix/driving/{coordinates} | Matrix Service +*NearestApi* | [**nearest**](docs/NearestApi.md#nearest) | **GET** /nearest/driving/{coordinates} | Nearest Service *SearchApi* | [**search**](docs/SearchApi.md#search) | **GET** /search.php | Forward Geocoding *ReverseApi* | [**reverse**](docs/ReverseApi.md#reverse) | **GET** /reverse.php | Reverse Geocoding @@ -84,8 +92,16 @@ Class | Method | HTTP request | Description - [Address](docs/Address.md) - [Balance](docs/Balance.md) - [Daybalance](docs/Daybalance.md) + - [DirectionsDirections](docs/DirectionsDirections.md) + - [DirectionsDirectionsRoutes](docs/DirectionsDirectionsRoutes.md) + - [DirectionsMatching](docs/DirectionsMatching.md) + - [DirectionsMatrix](docs/DirectionsMatrix.md) + - [DirectionsMatrixSources](docs/DirectionsMatrixSources.md) + - [DirectionsNearest](docs/DirectionsNearest.md) + - [DirectionsNearestWaypoints](docs/DirectionsNearestWaypoints.md) - [Error](docs/Error.md) - [Location](docs/Location.md) + - [Matchquality](docs/Matchquality.md) - [Namedetails](docs/Namedetails.md) diff --git a/docs/BalanceApi.md b/docs/BalanceApi.md index 222e35a..7d69d44 100644 --- a/docs/BalanceApi.md +++ b/docs/BalanceApi.md @@ -1,4 +1,4 @@ -# locationiq.BalanceApi +# openapi_client.BalanceApi All URIs are relative to *https://eu1.locationiq.com/v1* @@ -15,27 +15,32 @@ Method | HTTP request | Description The Balance API provides a count of request credits left in the user's account for the day. Balance is reset at midnight UTC everyday (00:00 UTC). ### Example + +* Api Key Authentication (key): ```python from __future__ import print_function import time -import locationiq -from locationiq.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint - +configuration = openapi_client.Configuration() # Configure API key authorization: key -configuration = locationiq.Configuration() configuration.api_key['key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['key'] = 'Bearer' -# create an instance of the API class -api_instance = locationiq.BalanceApi(locationiq.ApiClient(configuration)) - -try: - api_response = api_instance.balance() - pprint(api_response) -except ApiException as e: - print("Exception when calling BalanceApi->balance: %s\n" % e) +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.BalanceApi(api_client) + + try: + api_response = api_instance.balance() + pprint(api_response) + except ApiException as e: + print("Exception when calling BalanceApi->balance: %s\n" % e) ``` ### Parameters @@ -54,5 +59,16 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | The request has been made from an unauthorized domain. | - | +**404** | No location or places were found for the given input | - | +**429** | Request exceeded the rate-limits set on your account | - | +**500** | Internal Server Error | - | + [[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/DirectionsApi.md b/docs/DirectionsApi.md new file mode 100644 index 0000000..c4df7d3 --- /dev/null +++ b/docs/DirectionsApi.md @@ -0,0 +1,101 @@ +# openapi_client.DirectionsApi + +All URIs are relative to *https://eu1.locationiq.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**directions**](DirectionsApi.md#directions) | **GET** /directions/driving/{coordinates} | Directions Service + + +# **directions** +> DirectionsDirections directions(coordinates, bearings=bearings, radiuses=radiuses, generate_hints=generate_hints, approaches=approaches, exclude=exclude, alternatives=alternatives, steps=steps, annotations=annotations, geometries=geometries, overview=overview, continue_straight=continue_straight) + +Directions Service + +Finds the fastest route between coordinates in the supplied order. + +### Example + +* Api Key Authentication (key): +```python +from __future__ import print_function +import time +import openapi_client +from openapi_client.rest import ApiException +from pprint import pprint +configuration = openapi_client.Configuration() +# Configure API key authorization: key +configuration.api_key['key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['key'] = 'Bearer' + +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.DirectionsApi(api_client) + coordinates = '\"-0.16102,51.523854;-0.15797,51.52326;-0.161593,51.522550\"' # str | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 +bearings = '\"10,20;40,30;30,9\"' # str | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional) +radiuses = '\"500;200;300\"' # str | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional) +generate_hints = '\"false\"' # str | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional) +approaches = '\"curb;curb;curb\"' # str | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional) +exclude = '\"toll\"' # str | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional) +alternatives = 0 # float | Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] (optional) +steps = '\"true\"' # str | Returned route steps for each route leg [ true, false (default) ] (optional) +annotations = '"false"' # str | Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional) (default to '"false"') +geometries = '"polyline"' # str | Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional) (default to '"polyline"') +overview = '"simplified"' # str | Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional) (default to '"simplified"') +continue_straight = '"default"' # str | Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] (optional) (default to '"default"') + + try: + # Directions Service + api_response = api_instance.directions(coordinates, bearings=bearings, radiuses=radiuses, generate_hints=generate_hints, approaches=approaches, exclude=exclude, alternatives=alternatives, steps=steps, annotations=annotations, geometries=geometries, overview=overview, continue_straight=continue_straight) + pprint(api_response) + except ApiException as e: + print("Exception when calling DirectionsApi->directions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coordinates** | **str**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 | + **bearings** | **str**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional] + **radiuses** | **str**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional] + **generate_hints** | **str**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional] + **approaches** | **str**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional] + **exclude** | **str**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional] + **alternatives** | **float**| Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] | [optional] + **steps** | **str**| Returned route steps for each route leg [ true, false (default) ] | [optional] + **annotations** | **str**| Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] | [optional] [default to '"false"'] + **geometries** | **str**| Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] | [optional] [default to '"polyline"'] + **overview** | **str**| Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] | [optional] [default to '"simplified"'] + **continue_straight** | **str**| Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] | [optional] [default to '"default"'] + +### Return type + +[**DirectionsDirections**](DirectionsDirections.md) + +### Authorization + +[key](../README.md#key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | The request has been made from an unauthorized domain. | - | +**404** | No location or places were found for the given input | - | +**429** | Request exceeded the rate-limits set on your account | - | +**500** | Internal Server Error | - | + +[[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/DirectionsDirections.md b/docs/DirectionsDirections.md new file mode 100644 index 0000000..431600e --- /dev/null +++ b/docs/DirectionsDirections.md @@ -0,0 +1,12 @@ +# DirectionsDirections + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] +**waypoints** | **list[object]** | | [optional] +**routes** | [**list[DirectionsDirectionsRoutes]**](DirectionsDirectionsRoutes.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/DirectionsDirectionsRoutes.md b/docs/DirectionsDirectionsRoutes.md new file mode 100644 index 0000000..d92d294 --- /dev/null +++ b/docs/DirectionsDirectionsRoutes.md @@ -0,0 +1,15 @@ +# DirectionsDirectionsRoutes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**legs** | **list[object]** | | [optional] +**weight_name** | **str** | | [optional] +**geometry** | **str** | | [optional] +**weight** | **float** | | [optional] +**distance** | **float** | | [optional] +**duration** | **float** | | [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/DirectionsMatching.md b/docs/DirectionsMatching.md new file mode 100644 index 0000000..5f2b661 --- /dev/null +++ b/docs/DirectionsMatching.md @@ -0,0 +1,12 @@ +# DirectionsMatching + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] +**tracepoints** | **list[object]** | | [optional] +**matchings** | **list[object]** | | [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/DirectionsMatrix.md b/docs/DirectionsMatrix.md new file mode 100644 index 0000000..e96d0a6 --- /dev/null +++ b/docs/DirectionsMatrix.md @@ -0,0 +1,14 @@ +# DirectionsMatrix + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] +**distances** | **list[float]** | | [optional] +**fallback_speed_cells** | **list[float]** | | [optional] +**sources** | [**list[DirectionsMatrixSources]**](DirectionsMatrixSources.md) | | [optional] +**destinations** | [**list[DirectionsMatrixSources]**](DirectionsMatrixSources.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/DirectionsMatrixSources.md b/docs/DirectionsMatrixSources.md new file mode 100644 index 0000000..69d6761 --- /dev/null +++ b/docs/DirectionsMatrixSources.md @@ -0,0 +1,12 @@ +# DirectionsMatrixSources + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distance** | **float** | | [optional] +**location** | **list[float]** | | [optional] +**name** | **str** | | [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/DirectionsNearest.md b/docs/DirectionsNearest.md new file mode 100644 index 0000000..cd18288 --- /dev/null +++ b/docs/DirectionsNearest.md @@ -0,0 +1,11 @@ +# DirectionsNearest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] +**waypoints** | [**list[DirectionsNearestWaypoints]**](DirectionsNearestWaypoints.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/DirectionsNearestWaypoints.md b/docs/DirectionsNearestWaypoints.md new file mode 100644 index 0000000..91496c9 --- /dev/null +++ b/docs/DirectionsNearestWaypoints.md @@ -0,0 +1,13 @@ +# DirectionsNearestWaypoints + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nodes** | **list[float]** | | [optional] +**distance** | **float** | | [optional] +**location** | **list[float]** | | [optional] +**name** | **str** | | [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/Location.md b/docs/Location.md index bd2b293..f4ddd35 100644 --- a/docs/Location.md +++ b/docs/Location.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**distance** | **float** | | [optional] **place_id** | **str** | | [optional] **licence** | **str** | | [optional] **osm_type** | **str** | | [optional] @@ -16,6 +17,7 @@ Name | Type | Description | Notes **importance** | **float** | | [optional] **address** | [**Address**](Address.md) | | [optional] **namedetails** | [**Namedetails**](Namedetails.md) | | [optional] +**matchquality** | [**Matchquality**](Matchquality.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/MatchingApi.md b/docs/MatchingApi.md new file mode 100644 index 0000000..54452f3 --- /dev/null +++ b/docs/MatchingApi.md @@ -0,0 +1,105 @@ +# openapi_client.MatchingApi + +All URIs are relative to *https://eu1.locationiq.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**matching**](MatchingApi.md#matching) | **GET** /matching/driving/{coordinates} | Matching Service + + +# **matching** +> DirectionsMatching matching(coordinates, generate_hints=generate_hints, approaches=approaches, exclude=exclude, bearings=bearings, radiuses=radiuses, steps=steps, annotations=annotations, geometries=geometries, overview=overview, timestamps=timestamps, gaps=gaps, tidy=tidy, waypoints=waypoints) + +Matching Service + +Matching API matches or snaps given GPS points to the road network in the most plausible way. Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully. + +### Example + +* Api Key Authentication (key): +```python +from __future__ import print_function +import time +import openapi_client +from openapi_client.rest import ApiException +from pprint import pprint +configuration = openapi_client.Configuration() +# Configure API key authorization: key +configuration.api_key['key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['key'] = 'Bearer' + +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.MatchingApi(api_client) + coordinates = '\"-0.16102,51.523854;-0.15797,51.52326;-0.161593,51.522550\"' # str | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 +generate_hints = '\"false\"' # str | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional) +approaches = '\"curb;curb;curb\"' # str | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional) +exclude = '\"toll\"' # str | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional) +bearings = '\"None\"' # str | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional) +radiuses = '\"None\"' # str | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional) +steps = '\"true\"' # str | Returned route steps for each route leg [ true, false (default) ] (optional) +annotations = '"false"' # str | Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional) (default to '"false"') +geometries = '"polyline"' # str | Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional) (default to '"polyline"') +overview = '"simplified"' # str | Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional) (default to '"simplified"') +timestamps = '\"200;300;900\"' # str | Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch (optional) +gaps = '"split"' # str | Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] (optional) (default to '"split"') +tidy = '"false"' # str | Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] (optional) (default to '"false"') +waypoints = '\"0;1;2\"' # str | Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] (optional) + + try: + # Matching Service + api_response = api_instance.matching(coordinates, generate_hints=generate_hints, approaches=approaches, exclude=exclude, bearings=bearings, radiuses=radiuses, steps=steps, annotations=annotations, geometries=geometries, overview=overview, timestamps=timestamps, gaps=gaps, tidy=tidy, waypoints=waypoints) + pprint(api_response) + except ApiException as e: + print("Exception when calling MatchingApi->matching: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coordinates** | **str**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 | + **generate_hints** | **str**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional] + **approaches** | **str**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional] + **exclude** | **str**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional] + **bearings** | **str**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional] + **radiuses** | **str**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional] + **steps** | **str**| Returned route steps for each route leg [ true, false (default) ] | [optional] + **annotations** | **str**| Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] | [optional] [default to '"false"'] + **geometries** | **str**| Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] | [optional] [default to '"polyline"'] + **overview** | **str**| Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] | [optional] [default to '"simplified"'] + **timestamps** | **str**| Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch | [optional] + **gaps** | **str**| Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] | [optional] [default to '"split"'] + **tidy** | **str**| Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] | [optional] [default to '"false"'] + **waypoints** | **str**| Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] | [optional] + +### Return type + +[**DirectionsMatching**](DirectionsMatching.md) + +### Authorization + +[key](../README.md#key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | The request has been made from an unauthorized domain. | - | +**404** | No location or places were found for the given input | - | +**429** | Request exceeded the rate-limits set on your account | - | +**500** | Internal Server Error | - | + +[[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/Matchquality.md b/docs/Matchquality.md new file mode 100644 index 0000000..ec93f53 --- /dev/null +++ b/docs/Matchquality.md @@ -0,0 +1,12 @@ +# Matchquality + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**matchcode** | **str** | | [optional] +**matchtype** | **str** | | [optional] +**matchlevel** | **str** | | [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/MatrixApi.md b/docs/MatrixApi.md new file mode 100644 index 0000000..9cd8884 --- /dev/null +++ b/docs/MatrixApi.md @@ -0,0 +1,99 @@ +# openapi_client.MatrixApi + +All URIs are relative to *https://eu1.locationiq.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**matrix**](MatrixApi.md#matrix) | **GET** /matrix/driving/{coordinates} | Matrix Service + + +# **matrix** +> DirectionsMatrix matrix(coordinates, bearings=bearings, radiuses=radiuses, generate_hints=generate_hints, approaches=approaches, exclude=exclude, annotations=annotations, sources=sources, destinations=destinations, fallback_speed=fallback_speed, fallback_coordinate=fallback_coordinate) + +Matrix Service + +Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes. + +### Example + +* Api Key Authentication (key): +```python +from __future__ import print_function +import time +import openapi_client +from openapi_client.rest import ApiException +from pprint import pprint +configuration = openapi_client.Configuration() +# Configure API key authorization: key +configuration.api_key['key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['key'] = 'Bearer' + +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.MatrixApi(api_client) + coordinates = '\"-0.16102,51.523854;-0.15797,51.52326;-0.161593,51.522550\"' # str | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 +bearings = '\"10,20;40,30;30,9\"' # str | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional) +radiuses = '\"500;200;300\"' # str | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional) +generate_hints = '\"false\"' # str | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional) +approaches = '\"curb;curb;curb\"' # str | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional) +exclude = '\"toll\"' # str | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional) +annotations = '\"distance\"' # str | Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional) +sources = 0 # int | Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations (optional) +destinations = 2 # int | Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] (optional) +fallback_speed = 25.65 # float | If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 (optional) +fallback_coordinate = '"input"' # str | When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] (optional) (default to '"input"') + + try: + # Matrix Service + api_response = api_instance.matrix(coordinates, bearings=bearings, radiuses=radiuses, generate_hints=generate_hints, approaches=approaches, exclude=exclude, annotations=annotations, sources=sources, destinations=destinations, fallback_speed=fallback_speed, fallback_coordinate=fallback_coordinate) + pprint(api_response) + except ApiException as e: + print("Exception when calling MatrixApi->matrix: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coordinates** | **str**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 | + **bearings** | **str**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional] + **radiuses** | **str**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional] + **generate_hints** | **str**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional] + **approaches** | **str**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional] + **exclude** | **str**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional] + **annotations** | **str**| Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] | [optional] + **sources** | **int**| Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations | [optional] + **destinations** | **int**| Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] | [optional] + **fallback_speed** | **float**| If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 | [optional] + **fallback_coordinate** | **str**| When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] | [optional] [default to '"input"'] + +### Return type + +[**DirectionsMatrix**](DirectionsMatrix.md) + +### Authorization + +[key](../README.md#key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | The request has been made from an unauthorized domain. | - | +**404** | No location or places were found for the given input | - | +**429** | Request exceeded the rate-limits set on your account | - | +**500** | Internal Server Error | - | + +[[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/NearestApi.md b/docs/NearestApi.md new file mode 100644 index 0000000..cc749b9 --- /dev/null +++ b/docs/NearestApi.md @@ -0,0 +1,91 @@ +# openapi_client.NearestApi + +All URIs are relative to *https://eu1.locationiq.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**nearest**](NearestApi.md#nearest) | **GET** /nearest/driving/{coordinates} | Nearest Service + + +# **nearest** +> DirectionsNearest nearest(coordinates, generate_hints=generate_hints, exclude=exclude, bearings=bearings, radiuses=radiuses, approaches=approaches, number=number) + +Nearest Service + +Snaps a coordinate to the street network and returns the nearest n matches. Where coordinates only supports a single {longitude},{latitude} entry. + +### Example + +* Api Key Authentication (key): +```python +from __future__ import print_function +import time +import openapi_client +from openapi_client.rest import ApiException +from pprint import pprint +configuration = openapi_client.Configuration() +# Configure API key authorization: key +configuration.api_key['key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['key'] = 'Bearer' + +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.NearestApi(api_client) + coordinates = '\"-0.16102,51.523854\"' # str | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 +generate_hints = '\"false\"' # str | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional) +exclude = '\"toll\"' # str | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional) +bearings = '\"10,20\"' # str | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional) +radiuses = '\"1000\"' # str | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional) +approaches = '\"curb\"' # str | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional) +number = 3 # int | Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] (optional) + + try: + # Nearest Service + api_response = api_instance.nearest(coordinates, generate_hints=generate_hints, exclude=exclude, bearings=bearings, radiuses=radiuses, approaches=approaches, number=number) + pprint(api_response) + except ApiException as e: + print("Exception when calling NearestApi->nearest: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coordinates** | **str**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 | + **generate_hints** | **str**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional] + **exclude** | **str**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional] + **bearings** | **str**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional] + **radiuses** | **str**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional] + **approaches** | **str**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional] + **number** | **int**| Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] | [optional] + +### Return type + +[**DirectionsNearest**](DirectionsNearest.md) + +### Authorization + +[key](../README.md#key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | The request has been made from an unauthorized domain. | - | +**404** | No location or places were found for the given input | - | +**429** | Request exceeded the rate-limits set on your account | - | +**500** | Internal Server Error | - | + +[[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/ReverseApi.md b/docs/ReverseApi.md index c1bf5af..6fb3956 100644 --- a/docs/ReverseApi.md +++ b/docs/ReverseApi.md @@ -1,4 +1,4 @@ -# locationiq.ReverseApi +# openapi_client.ReverseApi All URIs are relative to *https://eu1.locationiq.com/v1* @@ -8,44 +8,51 @@ Method | HTTP request | Description # **reverse** -> Location reverse(lat, lon, format, normalizecity, addressdetails=addressdetails, accept_language=accept_language, namedetails=namedetails, extratags=extratags, statecode=statecode) +> Location reverse(lat, lon, format, normalizecity, addressdetails=addressdetails, accept_language=accept_language, namedetails=namedetails, extratags=extratags, statecode=statecode, showdistance=showdistance, postaladdress=postaladdress) Reverse Geocoding Reverse geocoding is the process of converting a coordinate or location (latitude, longitude) to a readable address or place name. This permits the identification of nearby street addresses, places, and/or area subdivisions such as a neighborhood, county, state, or country. ### Example + +* Api Key Authentication (key): ```python from __future__ import print_function import time -import locationiq -from locationiq.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint - +configuration = openapi_client.Configuration() # Configure API key authorization: key -configuration = locationiq.Configuration() configuration.api_key['key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['key'] = 'Bearer' -# create an instance of the API class -api_instance = locationiq.ReverseApi(locationiq.ApiClient(configuration)) -lat = 17.24 # float | Latitude of the location to generate an address for. -lon = 74.25 # float | Longitude of the location to generate an address for. -format = "json" # str | Format to geocode. Only JSON supported for SDKs +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.ReverseApi(api_client) + lat = 40.7487727 # float | Latitude of the location to generate an address for. +lon = -73.9849336 # float | Longitude of the location to generate an address for. +format = '\"json\"' # str | Format to geocode. Only JSON supported for SDKs normalizecity = 1 # int | Normalizes village to city level data to city addressdetails = 1 # int | Include a breakdown of the address into elements. Defaults to 1. (optional) (default to 1) -accept_language = "en" # str | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native (optional) +accept_language = '\"en\"' # str | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native (optional) namedetails = 0 # int | Include a list of alternative names in the results. These may include language variants, references, operator and brand. (optional) extratags = 0 # int | Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional) statecode = 0 # int | Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional) - -try: - # Reverse Geocoding - api_response = api_instance.reverse(lat, lon, format, normalizecity, addressdetails=addressdetails, accept_language=accept_language, namedetails=namedetails, extratags=extratags, statecode=statecode) - pprint(api_response) -except ApiException as e: - print("Exception when calling ReverseApi->reverse: %s\n" % e) +showdistance = 0 # int | Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] (optional) +postaladdress = 0 # int | Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional) + + try: + # Reverse Geocoding + api_response = api_instance.reverse(lat, lon, format, normalizecity, addressdetails=addressdetails, accept_language=accept_language, namedetails=namedetails, extratags=extratags, statecode=statecode, showdistance=showdistance, postaladdress=postaladdress) + pprint(api_response) + except ApiException as e: + print("Exception when calling ReverseApi->reverse: %s\n" % e) ``` ### Parameters @@ -61,6 +68,8 @@ Name | Type | Description | Notes **namedetails** | **int**| Include a list of alternative names in the results. These may include language variants, references, operator and brand. | [optional] **extratags** | **int**| Include additional information in the result if available, e.g. wikipedia link, opening hours. | [optional] **statecode** | **int**| Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 | [optional] + **showdistance** | **int**| Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] | [optional] + **postaladdress** | **int**| Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] | [optional] ### Return type @@ -75,5 +84,16 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | The request has been made from an unauthorized domain. | - | +**404** | No location or places were found for the given input | - | +**429** | Request exceeded the rate-limits set on your account | - | +**500** | Internal Server Error | - | + [[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/SearchApi.md b/docs/SearchApi.md index 4ba39f8..5631562 100644 --- a/docs/SearchApi.md +++ b/docs/SearchApi.md @@ -1,4 +1,4 @@ -# locationiq.SearchApi +# openapi_client.SearchApi All URIs are relative to *https://eu1.locationiq.com/v1* @@ -8,48 +8,55 @@ Method | HTTP request | Description # **search** -> list[Location] search(q, format, normalizecity, addressdetails=addressdetails, viewbox=viewbox, bounded=bounded, limit=limit, accept_language=accept_language, countrycodes=countrycodes, namedetails=namedetails, dedupe=dedupe, extratags=extratags, statecode=statecode) +> list[Location] search(q, format, normalizecity, addressdetails=addressdetails, viewbox=viewbox, bounded=bounded, limit=limit, accept_language=accept_language, countrycodes=countrycodes, namedetails=namedetails, dedupe=dedupe, extratags=extratags, statecode=statecode, matchquality=matchquality, postaladdress=postaladdress) Forward Geocoding The Search API allows converting addresses, such as a street address, into geographic coordinates (latitude and longitude). These coordinates can serve various use-cases, from placing markers on a map to helping algorithms determine nearby bus stops. This process is also known as Forward Geocoding. ### Example + +* Api Key Authentication (key): ```python from __future__ import print_function import time -import locationiq -from locationiq.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint - +configuration = openapi_client.Configuration() # Configure API key authorization: key -configuration = locationiq.Configuration() configuration.api_key['key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['key'] = 'Bearer' -# create an instance of the API class -api_instance = locationiq.SearchApi(locationiq.ApiClient(configuration)) -q = "Empire state building" # str | Address to geocode -format = "json" # str | Format to geocode. Only JSON supported for SDKs +# Defining host is optional and default to https://eu1.locationiq.com/v1 +configuration.host = "https://eu1.locationiq.com/v1" +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.SearchApi(api_client) + q = '\"Empire state building\"' # str | Address to geocode +format = '\"json\"' # str | Format to geocode. Only JSON supported for SDKs normalizecity = 1 # int | For responses with no city value in the address section, the next available element in this order - city_district, locality, town, borough, municipality, village, hamlet, quarter, neighbourhood - from the address section will be normalized to city. Defaults to 1 for SDKs. addressdetails = 1 # int | Include a breakdown of the address into elements. Defaults to 0. (optional) -viewbox = "-132.84908,47.69382,-70.44674,30.82531" # str | The preferred area to find search results. To restrict results to those within the viewbox, use along with the bounded option. Tuple of 4 floats. Any two corner points of the box - `max_lon,max_lat,min_lon,min_lat` or `min_lon,min_lat,max_lon,max_lat` - are accepted in any order as long as they span a real box. (optional) +viewbox = '\"-132.84908,47.69382,-70.44674,30.82531\"' # str | The preferred area to find search results. To restrict results to those within the viewbox, use along with the bounded option. Tuple of 4 floats. Any two corner points of the box - `max_lon,max_lat,min_lon,min_lat` or `min_lon,min_lat,max_lon,max_lat` - are accepted in any order as long as they span a real box. (optional) bounded = 1 # int | Restrict the results to only items contained with the viewbox (optional) limit = 10 # int | Limit the number of returned results. Default is 10. (optional) (default to 10) -accept_language = "en" # str | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native (optional) -countrycodes = "us" # str | Limit search to a list of countries. (optional) +accept_language = '\"en\"' # str | Preferred language order for showing search results, overrides the value specified in the Accept-Language HTTP header. Defaults to en. To use native language for the response when available, use accept-language=native (optional) +countrycodes = '\"us\"' # str | Limit search to a list of countries. (optional) namedetails = 1 # int | Include a list of alternative names in the results. These may include language variants, references, operator and brand. (optional) dedupe = 1 # int | Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. (optional) extratags = 0 # int | Include additional information in the result if available, e.g. wikipedia link, opening hours. (optional) statecode = 0 # int | Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 (optional) - -try: - # Forward Geocoding - api_response = api_instance.search(q, format, normalizecity, addressdetails=addressdetails, viewbox=viewbox, bounded=bounded, limit=limit, accept_language=accept_language, countrycodes=countrycodes, namedetails=namedetails, dedupe=dedupe, extratags=extratags, statecode=statecode) - pprint(api_response) -except ApiException as e: - print("Exception when calling SearchApi->search: %s\n" % e) +matchquality = 0 # int | Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] (optional) +postaladdress = 0 # int | Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] (optional) + + try: + # Forward Geocoding + api_response = api_instance.search(q, format, normalizecity, addressdetails=addressdetails, viewbox=viewbox, bounded=bounded, limit=limit, accept_language=accept_language, countrycodes=countrycodes, namedetails=namedetails, dedupe=dedupe, extratags=extratags, statecode=statecode, matchquality=matchquality, postaladdress=postaladdress) + pprint(api_response) + except ApiException as e: + print("Exception when calling SearchApi->search: %s\n" % e) ``` ### Parameters @@ -69,6 +76,8 @@ Name | Type | Description | Notes **dedupe** | **int**| Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. | [optional] **extratags** | **int**| Include additional information in the result if available, e.g. wikipedia link, opening hours. | [optional] **statecode** | **int**| Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 | [optional] + **matchquality** | **int**| Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] | [optional] + **postaladdress** | **int**| Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] | [optional] ### Return type @@ -83,5 +92,16 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | The request has been made from an unauthorized domain. | - | +**404** | No location or places were found for the given input | - | +**429** | Request exceeded the rate-limits set on your account | - | +**500** | Internal Server Error | - | + [[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/git_push.sh b/git_push.sh index e619bae..1346577 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,14 +1,20 @@ #!/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" +# 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="location-iq" + git_user_id="crystHopeunwired" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/locationiq/__init__.py b/locationiq/__init__.py deleted file mode 100644 index 4df56e8..0000000 --- a/locationiq/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - LocationIQ - - LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - - OpenAPI spec version: 1.0.1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -__version__ = "1.0.0" - -# import apis into sdk package -from locationiq.api.balance_api import BalanceApi -from locationiq.api.search_api import SearchApi -from locationiq.api.reverse_api import ReverseApi - -# import ApiClient -from locationiq.api_client import ApiClient -from locationiq.configuration import Configuration -# import models into sdk package -from locationiq.models.address import Address -from locationiq.models.balance import Balance -from locationiq.models.daybalance import Daybalance -from locationiq.models.error import Error -from locationiq.models.location import Location -from locationiq.models.namedetails import Namedetails diff --git a/locationiq/api/__init__.py b/locationiq/api/__init__.py deleted file mode 100644 index df05296..0000000 --- a/locationiq/api/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from locationiq.api.balance_api import BalanceApi -from locationiq.api.search_api import SearchApi -from locationiq.api.reverse_api import ReverseApi diff --git a/locationiq/configuration.py b/locationiq/configuration.py deleted file mode 100644 index fced9f0..0000000 --- a/locationiq/configuration.py +++ /dev/null @@ -1,235 +0,0 @@ -# coding: utf-8 - -""" - LocationIQ - - LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - - OpenAPI spec version: 1.0.1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -import six -from six.moves import http_client as httplib - - -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls): - if cls._default is None: - cls._default = type.__call__(cls) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(self): - """Constructor""" - # Default Base url - self.host = "https://eu1.locationiq.com/v1" - # Temp file folder for downloading files - self.temp_folder_path = None - - # Authentication Settings - # dict to store API key(s) - self.api_key = {} - # dict to store API prefix (e.g. Bearer) - self.api_key_prefix = {} - # Username for HTTP basic authentication - self.username = "" - # Password for HTTP basic authentication - self.password = "" - - # Logging Settings - self.logger = {} - self.logger["package_logger"] = logging.getLogger("locationiq") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - # Log format - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - # Log stream handler - self.logger_stream_handler = None - # Log file handler - self.logger_file_handler = None - # Debug file location - self.logger_file = None - # Debug switch - self.debug = False - - # SSL/TLS verification - # Set this to false to skip verifying SSL certificate when calling API - # from https server. - self.verify_ssl = True - # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None - # client certificate file - self.cert_file = None - # client key file - self.key_file = None - # Set this to True/False to enable/disable SSL hostname verification. - self.assert_hostname = None - - # urllib3 connection pool's maximum number of connections saved - # per pool. urllib3 uses 1 connection as default value, but this is - # not the best value when you are making a lot of possibly parallel - # requests to the same host, which is often the case here. - # cpu_count * 5 is used as default value to increase performance. - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - - # Proxy URL - self.proxy = None - # Safe chars for path_param - self.safe_chars_for_path_param = '' - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :return: The token for api key authentication. - """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - return urllib3.util.make_headers( - basic_auth=self.username + ':' + self.password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - return { - 'key': - { - 'type': 'api_key', - 'in': 'query', - 'key': 'key', - 'value': self.get_api_key_with_prefix('key') - }, - - } - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.1\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) diff --git a/locationiq/models/__init__.py b/locationiq/models/__init__.py deleted file mode 100644 index 5f2359f..0000000 --- a/locationiq/models/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - LocationIQ - - LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - - OpenAPI spec version: 1.0.1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from locationiq.models.address import Address -from locationiq.models.balance import Balance -from locationiq.models.daybalance import Daybalance -from locationiq.models.error import Error -from locationiq.models.location import Location -from locationiq.models.namedetails import Namedetails diff --git a/openapi_client/__init__.py b/openapi_client/__init__.py new file mode 100644 index 0000000..3df6704 --- /dev/null +++ b/openapi_client/__init__.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +# flake8: noqa + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0" + +# import apis into sdk package +from openapi_client.api.balance_api import BalanceApi +from openapi_client.api.directions_api import DirectionsApi +from openapi_client.api.matching_api import MatchingApi +from openapi_client.api.matrix_api import MatrixApi +from openapi_client.api.nearest_api import NearestApi +from openapi_client.api.search_api import SearchApi +from openapi_client.api.reverse_api import ReverseApi + +# import ApiClient +from openapi_client.api_client import ApiClient +from openapi_client.configuration import Configuration +from openapi_client.exceptions import OpenApiException +from openapi_client.exceptions import ApiTypeError +from openapi_client.exceptions import ApiValueError +from openapi_client.exceptions import ApiKeyError +from openapi_client.exceptions import ApiException +# import models into sdk package +from openapi_client.models.address import Address +from openapi_client.models.balance import Balance +from openapi_client.models.daybalance import Daybalance +from openapi_client.models.directions_directions import DirectionsDirections +from openapi_client.models.directions_directions_routes import DirectionsDirectionsRoutes +from openapi_client.models.directions_matching import DirectionsMatching +from openapi_client.models.directions_matrix import DirectionsMatrix +from openapi_client.models.directions_matrix_sources import DirectionsMatrixSources +from openapi_client.models.directions_nearest import DirectionsNearest +from openapi_client.models.directions_nearest_waypoints import DirectionsNearestWaypoints +from openapi_client.models.error import Error +from openapi_client.models.location import Location +from openapi_client.models.matchquality import Matchquality +from openapi_client.models.namedetails import Namedetails + diff --git a/openapi_client/api/__init__.py b/openapi_client/api/__init__.py new file mode 100644 index 0000000..57dcf6d --- /dev/null +++ b/openapi_client/api/__init__.py @@ -0,0 +1,12 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from openapi_client.api.balance_api import BalanceApi +from openapi_client.api.directions_api import DirectionsApi +from openapi_client.api.matching_api import MatchingApi +from openapi_client.api.matrix_api import MatrixApi +from openapi_client.api.nearest_api import NearestApi +from openapi_client.api.search_api import SearchApi +from openapi_client.api.reverse_api import ReverseApi diff --git a/locationiq/api/balance_api.py b/openapi_client/api/balance_api.py similarity index 70% rename from locationiq/api/balance_api.py rename to openapi_client/api/balance_api.py index 37f9d01..95bc00f 100644 --- a/locationiq/api/balance_api.py +++ b/openapi_client/api/balance_api.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -17,7 +17,11 @@ # python 2 and python 3 compatibility library import six -from locationiq.api_client import ApiClient +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) class BalanceApi(object): @@ -41,17 +45,20 @@ def balance(self, **kwargs): # noqa: E501 >>> thread = api.balance(async_req=True) >>> result = thread.get() - :param async_req bool + :param async_req bool: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. :return: Balance If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.balance_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.balance_with_http_info(**kwargs) # noqa: E501 - return data + return self.balance_with_http_info(**kwargs) # noqa: E501 def balance_with_http_info(self, **kwargs): # noqa: E501 """balance # noqa: E501 @@ -62,8 +69,17 @@ def balance_with_http_info(self, **kwargs): # noqa: E501 >>> thread = api.balance_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool - :return: Balance + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: tuple(Balance, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ @@ -78,7 +94,7 @@ def balance_with_http_info(self, **kwargs): # noqa: E501 for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method balance" % key ) diff --git a/openapi_client/api/directions_api.py b/openapi_client/api/directions_api.py new file mode 100644 index 0000000..9aec122 --- /dev/null +++ b/openapi_client/api/directions_api.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class DirectionsApi(object): + """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): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def directions(self, coordinates, **kwargs): # noqa: E501 + """Directions Service # noqa: E501 + + Finds the fastest route between coordinates in the supplied order. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.directions(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param float alternatives: Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] + :param str steps: Returned route steps for each route leg [ true, false (default) ] + :param str annotations: Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] + :param str geometries: Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] + :param str overview: Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] + :param str continue_straight: Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: DirectionsDirections + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.directions_with_http_info(coordinates, **kwargs) # noqa: E501 + + def directions_with_http_info(self, coordinates, **kwargs): # noqa: E501 + """Directions Service # noqa: E501 + + Finds the fastest route between coordinates in the supplied order. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.directions_with_http_info(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param float alternatives: Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] + :param str steps: Returned route steps for each route leg [ true, false (default) ] + :param str annotations: Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] + :param str geometries: Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] + :param str overview: Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] + :param str continue_straight: Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: tuple(DirectionsDirections, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['coordinates', 'bearings', 'radiuses', 'generate_hints', 'approaches', 'exclude', 'alternatives', 'steps', 'annotations', 'geometries', 'overview', 'continue_straight'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method directions" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'coordinates' is set + if self.api_client.client_side_validation and ('coordinates' not in local_var_params or # noqa: E501 + local_var_params['coordinates'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `coordinates` when calling `directions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'coordinates' in local_var_params: + path_params['coordinates'] = local_var_params['coordinates'] # noqa: E501 + + query_params = [] + if 'bearings' in local_var_params and local_var_params['bearings'] is not None: # noqa: E501 + query_params.append(('bearings', local_var_params['bearings'])) # noqa: E501 + if 'radiuses' in local_var_params and local_var_params['radiuses'] is not None: # noqa: E501 + query_params.append(('radiuses', local_var_params['radiuses'])) # noqa: E501 + if 'generate_hints' in local_var_params and local_var_params['generate_hints'] is not None: # noqa: E501 + query_params.append(('generate_hints', local_var_params['generate_hints'])) # noqa: E501 + if 'approaches' in local_var_params and local_var_params['approaches'] is not None: # noqa: E501 + query_params.append(('approaches', local_var_params['approaches'])) # noqa: E501 + if 'exclude' in local_var_params and local_var_params['exclude'] is not None: # noqa: E501 + query_params.append(('exclude', local_var_params['exclude'])) # noqa: E501 + if 'alternatives' in local_var_params and local_var_params['alternatives'] is not None: # noqa: E501 + query_params.append(('alternatives', local_var_params['alternatives'])) # noqa: E501 + if 'steps' in local_var_params and local_var_params['steps'] is not None: # noqa: E501 + query_params.append(('steps', local_var_params['steps'])) # noqa: E501 + if 'annotations' in local_var_params and local_var_params['annotations'] is not None: # noqa: E501 + query_params.append(('annotations', local_var_params['annotations'])) # noqa: E501 + if 'geometries' in local_var_params and local_var_params['geometries'] is not None: # noqa: E501 + query_params.append(('geometries', local_var_params['geometries'])) # noqa: E501 + if 'overview' in local_var_params and local_var_params['overview'] is not None: # noqa: E501 + query_params.append(('overview', local_var_params['overview'])) # noqa: E501 + if 'continue_straight' in local_var_params and local_var_params['continue_straight'] is not None: # noqa: E501 + query_params.append(('continue_straight', local_var_params['continue_straight'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['key'] # noqa: E501 + + return self.api_client.call_api( + '/directions/driving/{coordinates}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DirectionsDirections', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/openapi_client/api/matching_api.py b/openapi_client/api/matching_api.py new file mode 100644 index 0000000..41d925b --- /dev/null +++ b/openapi_client/api/matching_api.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class MatchingApi(object): + """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): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def matching(self, coordinates, **kwargs): # noqa: E501 + """Matching Service # noqa: E501 + + Matching API matches or snaps given GPS points to the road network in the most plausible way. Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.matching(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str steps: Returned route steps for each route leg [ true, false (default) ] + :param str annotations: Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] + :param str geometries: Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] + :param str overview: Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] + :param str timestamps: Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch + :param str gaps: Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] + :param str tidy: Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] + :param str waypoints: Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: DirectionsMatching + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.matching_with_http_info(coordinates, **kwargs) # noqa: E501 + + def matching_with_http_info(self, coordinates, **kwargs): # noqa: E501 + """Matching Service # noqa: E501 + + Matching API matches or snaps given GPS points to the road network in the most plausible way. Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found. The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.matching_with_http_info(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str steps: Returned route steps for each route leg [ true, false (default) ] + :param str annotations: Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] + :param str geometries: Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] + :param str overview: Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] + :param str timestamps: Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. [ {timestamp};{timestamp}[;{timestamp} ...] integer seconds since UNIX epoch + :param str gaps: Allows the input track splitting based on huge timestamp gaps between points. [ split (default), ignore ] + :param str tidy: Allows the input track modification to obtain better matching quality for noisy tracks. [ true, false (default) ] + :param str waypoints: Treats input coordinates indicated by given indices as waypoints in returned Match object. Default is to treat all input coordinates as waypoints. [ {index};{index};{index}... ] + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: tuple(DirectionsMatching, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['coordinates', 'generate_hints', 'approaches', 'exclude', 'bearings', 'radiuses', 'steps', 'annotations', 'geometries', 'overview', 'timestamps', 'gaps', 'tidy', 'waypoints'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method matching" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'coordinates' is set + if self.api_client.client_side_validation and ('coordinates' not in local_var_params or # noqa: E501 + local_var_params['coordinates'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `coordinates` when calling `matching`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'coordinates' in local_var_params: + path_params['coordinates'] = local_var_params['coordinates'] # noqa: E501 + + query_params = [] + if 'generate_hints' in local_var_params and local_var_params['generate_hints'] is not None: # noqa: E501 + query_params.append(('generate_hints', local_var_params['generate_hints'])) # noqa: E501 + if 'approaches' in local_var_params and local_var_params['approaches'] is not None: # noqa: E501 + query_params.append(('approaches', local_var_params['approaches'])) # noqa: E501 + if 'exclude' in local_var_params and local_var_params['exclude'] is not None: # noqa: E501 + query_params.append(('exclude', local_var_params['exclude'])) # noqa: E501 + if 'bearings' in local_var_params and local_var_params['bearings'] is not None: # noqa: E501 + query_params.append(('bearings', local_var_params['bearings'])) # noqa: E501 + if 'radiuses' in local_var_params and local_var_params['radiuses'] is not None: # noqa: E501 + query_params.append(('radiuses', local_var_params['radiuses'])) # noqa: E501 + if 'steps' in local_var_params and local_var_params['steps'] is not None: # noqa: E501 + query_params.append(('steps', local_var_params['steps'])) # noqa: E501 + if 'annotations' in local_var_params and local_var_params['annotations'] is not None: # noqa: E501 + query_params.append(('annotations', local_var_params['annotations'])) # noqa: E501 + if 'geometries' in local_var_params and local_var_params['geometries'] is not None: # noqa: E501 + query_params.append(('geometries', local_var_params['geometries'])) # noqa: E501 + if 'overview' in local_var_params and local_var_params['overview'] is not None: # noqa: E501 + query_params.append(('overview', local_var_params['overview'])) # noqa: E501 + if 'timestamps' in local_var_params and local_var_params['timestamps'] is not None: # noqa: E501 + query_params.append(('timestamps', local_var_params['timestamps'])) # noqa: E501 + if 'gaps' in local_var_params and local_var_params['gaps'] is not None: # noqa: E501 + query_params.append(('gaps', local_var_params['gaps'])) # noqa: E501 + if 'tidy' in local_var_params and local_var_params['tidy'] is not None: # noqa: E501 + query_params.append(('tidy', local_var_params['tidy'])) # noqa: E501 + if 'waypoints' in local_var_params and local_var_params['waypoints'] is not None: # noqa: E501 + query_params.append(('waypoints', local_var_params['waypoints'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['key'] # noqa: E501 + + return self.api_client.call_api( + '/matching/driving/{coordinates}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DirectionsMatching', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/openapi_client/api/matrix_api.py b/openapi_client/api/matrix_api.py new file mode 100644 index 0000000..b37213e --- /dev/null +++ b/openapi_client/api/matrix_api.py @@ -0,0 +1,185 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class MatrixApi(object): + """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): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def matrix(self, coordinates, **kwargs): # noqa: E501 + """Matrix Service # noqa: E501 + + Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.matrix(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param str annotations: Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] + :param int sources: Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations + :param int destinations: Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] + :param float fallback_speed: If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 + :param str fallback_coordinate: When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: DirectionsMatrix + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.matrix_with_http_info(coordinates, **kwargs) # noqa: E501 + + def matrix_with_http_info(self, coordinates, **kwargs): # noqa: E501 + """Matrix Service # noqa: E501 + + Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.matrix_with_http_info(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param str annotations: Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] + :param int sources: Use location with given index as source. [ {index};{index}[;{index} ...] or all (default) ] => index 0 <= integer < #locations + :param int destinations: Use location with given index as destination. [ {index};{index}[;{index} ...] or all (default) ] + :param float fallback_speed: If no route found between a source/destination pair, calculate the as-the-crow-flies distance, then use this speed to estimate duration. double > 0 + :param str fallback_coordinate: When using a fallback_speed, use the user-supplied coordinate (input), or the snapped location (snapped) for calculating distances. [ input (default), or snapped ] + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: tuple(DirectionsMatrix, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['coordinates', 'bearings', 'radiuses', 'generate_hints', 'approaches', 'exclude', 'annotations', 'sources', 'destinations', 'fallback_speed', 'fallback_coordinate'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method matrix" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'coordinates' is set + if self.api_client.client_side_validation and ('coordinates' not in local_var_params or # noqa: E501 + local_var_params['coordinates'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `coordinates` when calling `matrix`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'coordinates' in local_var_params: + path_params['coordinates'] = local_var_params['coordinates'] # noqa: E501 + + query_params = [] + if 'bearings' in local_var_params and local_var_params['bearings'] is not None: # noqa: E501 + query_params.append(('bearings', local_var_params['bearings'])) # noqa: E501 + if 'radiuses' in local_var_params and local_var_params['radiuses'] is not None: # noqa: E501 + query_params.append(('radiuses', local_var_params['radiuses'])) # noqa: E501 + if 'generate_hints' in local_var_params and local_var_params['generate_hints'] is not None: # noqa: E501 + query_params.append(('generate_hints', local_var_params['generate_hints'])) # noqa: E501 + if 'approaches' in local_var_params and local_var_params['approaches'] is not None: # noqa: E501 + query_params.append(('approaches', local_var_params['approaches'])) # noqa: E501 + if 'exclude' in local_var_params and local_var_params['exclude'] is not None: # noqa: E501 + query_params.append(('exclude', local_var_params['exclude'])) # noqa: E501 + if 'annotations' in local_var_params and local_var_params['annotations'] is not None: # noqa: E501 + query_params.append(('annotations', local_var_params['annotations'])) # noqa: E501 + if 'sources' in local_var_params and local_var_params['sources'] is not None: # noqa: E501 + query_params.append(('sources', local_var_params['sources'])) # noqa: E501 + if 'destinations' in local_var_params and local_var_params['destinations'] is not None: # noqa: E501 + query_params.append(('destinations', local_var_params['destinations'])) # noqa: E501 + if 'fallback_speed' in local_var_params and local_var_params['fallback_speed'] is not None: # noqa: E501 + query_params.append(('fallback_speed', local_var_params['fallback_speed'])) # noqa: E501 + if 'fallback_coordinate' in local_var_params and local_var_params['fallback_coordinate'] is not None: # noqa: E501 + query_params.append(('fallback_coordinate', local_var_params['fallback_coordinate'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['key'] # noqa: E501 + + return self.api_client.call_api( + '/matrix/driving/{coordinates}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DirectionsMatrix', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/openapi_client/api/nearest_api.py b/openapi_client/api/nearest_api.py new file mode 100644 index 0000000..59eb5e6 --- /dev/null +++ b/openapi_client/api/nearest_api.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class NearestApi(object): + """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): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def nearest(self, coordinates, **kwargs): # noqa: E501 + """Nearest Service # noqa: E501 + + Snaps a coordinate to the street network and returns the nearest n matches. Where coordinates only supports a single {longitude},{latitude} entry. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.nearest(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param int number: Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: DirectionsNearest + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.nearest_with_http_info(coordinates, **kwargs) # noqa: E501 + + def nearest_with_http_info(self, coordinates, **kwargs): # noqa: E501 + """Nearest Service # noqa: E501 + + Snaps a coordinate to the street network and returns the nearest n matches. Where coordinates only supports a single {longitude},{latitude} entry. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.nearest_with_http_info(coordinates, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 (required) + :param str generate_hints: Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String + :param str exclude: Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. + :param str bearings: Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 + :param str radiuses: Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) + :param str approaches: Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) + :param int number: Number of nearest segments that should be returned. [ integer >= 1 (default 1) ] + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: tuple(DirectionsNearest, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['coordinates', 'generate_hints', 'exclude', 'bearings', 'radiuses', 'approaches', 'number'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method nearest" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'coordinates' is set + if self.api_client.client_side_validation and ('coordinates' not in local_var_params or # noqa: E501 + local_var_params['coordinates'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `coordinates` when calling `nearest`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'coordinates' in local_var_params: + path_params['coordinates'] = local_var_params['coordinates'] # noqa: E501 + + query_params = [] + if 'generate_hints' in local_var_params and local_var_params['generate_hints'] is not None: # noqa: E501 + query_params.append(('generate_hints', local_var_params['generate_hints'])) # noqa: E501 + if 'exclude' in local_var_params and local_var_params['exclude'] is not None: # noqa: E501 + query_params.append(('exclude', local_var_params['exclude'])) # noqa: E501 + if 'bearings' in local_var_params and local_var_params['bearings'] is not None: # noqa: E501 + query_params.append(('bearings', local_var_params['bearings'])) # noqa: E501 + if 'radiuses' in local_var_params and local_var_params['radiuses'] is not None: # noqa: E501 + query_params.append(('radiuses', local_var_params['radiuses'])) # noqa: E501 + if 'approaches' in local_var_params and local_var_params['approaches'] is not None: # noqa: E501 + query_params.append(('approaches', local_var_params['approaches'])) # noqa: E501 + if 'number' in local_var_params and local_var_params['number'] is not None: # noqa: E501 + query_params.append(('number', local_var_params['number'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['key'] # noqa: E501 + + return self.api_client.call_api( + '/nearest/driving/{coordinates}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DirectionsNearest', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/locationiq/api/reverse_api.py b/openapi_client/api/reverse_api.py similarity index 56% rename from locationiq/api/reverse_api.py rename to openapi_client/api/reverse_api.py index 877588b..c5c0914 100644 --- a/locationiq/api/reverse_api.py +++ b/openapi_client/api/reverse_api.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -17,7 +17,11 @@ # python 2 and python 3 compatibility library import six -from locationiq.api_client import ApiClient +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) class ReverseApi(object): @@ -41,7 +45,7 @@ def reverse(self, lat, lon, format, normalizecity, **kwargs): # noqa: E501 >>> thread = api.reverse(lat, lon, format, normalizecity, async_req=True) >>> result = thread.get() - :param async_req bool + :param async_req bool: execute request asynchronously :param float lat: Latitude of the location to generate an address for. (required) :param float lon: Longitude of the location to generate an address for. (required) :param str format: Format to geocode. Only JSON supported for SDKs (required) @@ -51,16 +55,21 @@ def reverse(self, lat, lon, format, normalizecity, **kwargs): # noqa: E501 :param int namedetails: Include a list of alternative names in the results. These may include language variants, references, operator and brand. :param int extratags: Include additional information in the result if available, e.g. wikipedia link, opening hours. :param int statecode: Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 + :param int showdistance: Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] + :param int postaladdress: Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. :return: Location If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.reverse_with_http_info(lat, lon, format, normalizecity, **kwargs) # noqa: E501 - else: - (data) = self.reverse_with_http_info(lat, lon, format, normalizecity, **kwargs) # noqa: E501 - return data + return self.reverse_with_http_info(lat, lon, format, normalizecity, **kwargs) # noqa: E501 def reverse_with_http_info(self, lat, lon, format, normalizecity, **kwargs): # noqa: E501 """Reverse Geocoding # noqa: E501 @@ -71,7 +80,7 @@ def reverse_with_http_info(self, lat, lon, format, normalizecity, **kwargs): # >>> thread = api.reverse_with_http_info(lat, lon, format, normalizecity, async_req=True) >>> result = thread.get() - :param async_req bool + :param async_req bool: execute request asynchronously :param float lat: Latitude of the location to generate an address for. (required) :param float lon: Longitude of the location to generate an address for. (required) :param str format: Format to geocode. Only JSON supported for SDKs (required) @@ -81,14 +90,25 @@ def reverse_with_http_info(self, lat, lon, format, normalizecity, **kwargs): # :param int namedetails: Include a list of alternative names in the results. These may include language variants, references, operator and brand. :param int extratags: Include additional information in the result if available, e.g. wikipedia link, opening hours. :param int statecode: Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 - :return: Location + :param int showdistance: Returns the straight line distance (meters) between the input location and the result's location. Value is set in the distance key of the response. Defaults to 0 [0,1] + :param int postaladdress: Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: tuple(Location, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['lat', 'lon', 'format', 'normalizecity', 'addressdetails', 'accept_language', 'namedetails', 'extratags', 'statecode'] # noqa: E501 + all_params = ['lat', 'lon', 'format', 'normalizecity', 'addressdetails', 'accept_language', 'namedetails', 'extratags', 'statecode', 'showdistance', 'postaladdress'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,60 +116,64 @@ def reverse_with_http_info(self, lat, lon, format, normalizecity, **kwargs): # for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method reverse" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'lat' is set - if ('lat' not in local_var_params or - local_var_params['lat'] is None): - raise ValueError("Missing the required parameter `lat` when calling `reverse`") # noqa: E501 + if self.api_client.client_side_validation and ('lat' not in local_var_params or # noqa: E501 + local_var_params['lat'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `lat` when calling `reverse`") # noqa: E501 # verify the required parameter 'lon' is set - if ('lon' not in local_var_params or - local_var_params['lon'] is None): - raise ValueError("Missing the required parameter `lon` when calling `reverse`") # noqa: E501 + if self.api_client.client_side_validation and ('lon' not in local_var_params or # noqa: E501 + local_var_params['lon'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `lon` when calling `reverse`") # noqa: E501 # verify the required parameter 'format' is set - if ('format' not in local_var_params or - local_var_params['format'] is None): - raise ValueError("Missing the required parameter `format` when calling `reverse`") # noqa: E501 + if self.api_client.client_side_validation and ('format' not in local_var_params or # noqa: E501 + local_var_params['format'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `format` when calling `reverse`") # noqa: E501 # verify the required parameter 'normalizecity' is set - if ('normalizecity' not in local_var_params or - local_var_params['normalizecity'] is None): - raise ValueError("Missing the required parameter `normalizecity` when calling `reverse`") # noqa: E501 - - if 'lat' in local_var_params and local_var_params['lat'] > 90: # noqa: E501 - raise ValueError("Invalid value for parameter `lat` when calling `reverse`, must be a value less than or equal to `90`") # noqa: E501 - if 'lat' in local_var_params and local_var_params['lat'] < -90: # noqa: E501 - raise ValueError("Invalid value for parameter `lat` when calling `reverse`, must be a value greater than or equal to `-90`") # noqa: E501 - if 'lon' in local_var_params and local_var_params['lon'] > 180: # noqa: E501 - raise ValueError("Invalid value for parameter `lon` when calling `reverse`, must be a value less than or equal to `180`") # noqa: E501 - if 'lon' in local_var_params and local_var_params['lon'] < -180: # noqa: E501 - raise ValueError("Invalid value for parameter `lon` when calling `reverse`, must be a value greater than or equal to `-180`") # noqa: E501 + if self.api_client.client_side_validation and ('normalizecity' not in local_var_params or # noqa: E501 + local_var_params['normalizecity'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `normalizecity` when calling `reverse`") # noqa: E501 + + if self.api_client.client_side_validation and 'lat' in local_var_params and local_var_params['lat'] > 90: # noqa: E501 + raise ApiValueError("Invalid value for parameter `lat` when calling `reverse`, must be a value less than or equal to `90`") # noqa: E501 + if self.api_client.client_side_validation and 'lat' in local_var_params and local_var_params['lat'] < -90: # noqa: E501 + raise ApiValueError("Invalid value for parameter `lat` when calling `reverse`, must be a value greater than or equal to `-90`") # noqa: E501 + if self.api_client.client_side_validation and 'lon' in local_var_params and local_var_params['lon'] > 180: # noqa: E501 + raise ApiValueError("Invalid value for parameter `lon` when calling `reverse`, must be a value less than or equal to `180`") # noqa: E501 + if self.api_client.client_side_validation and 'lon' in local_var_params and local_var_params['lon'] < -180: # noqa: E501 + raise ApiValueError("Invalid value for parameter `lon` when calling `reverse`, must be a value greater than or equal to `-180`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'lat' in local_var_params: + if 'lat' in local_var_params and local_var_params['lat'] is not None: # noqa: E501 query_params.append(('lat', local_var_params['lat'])) # noqa: E501 - if 'lon' in local_var_params: + if 'lon' in local_var_params and local_var_params['lon'] is not None: # noqa: E501 query_params.append(('lon', local_var_params['lon'])) # noqa: E501 - if 'format' in local_var_params: + if 'format' in local_var_params and local_var_params['format'] is not None: # noqa: E501 query_params.append(('format', local_var_params['format'])) # noqa: E501 - if 'normalizecity' in local_var_params: + if 'normalizecity' in local_var_params and local_var_params['normalizecity'] is not None: # noqa: E501 query_params.append(('normalizecity', local_var_params['normalizecity'])) # noqa: E501 - if 'addressdetails' in local_var_params: + if 'addressdetails' in local_var_params and local_var_params['addressdetails'] is not None: # noqa: E501 query_params.append(('addressdetails', local_var_params['addressdetails'])) # noqa: E501 - if 'accept_language' in local_var_params: + if 'accept_language' in local_var_params and local_var_params['accept_language'] is not None: # noqa: E501 query_params.append(('accept-language', local_var_params['accept_language'])) # noqa: E501 - if 'namedetails' in local_var_params: + if 'namedetails' in local_var_params and local_var_params['namedetails'] is not None: # noqa: E501 query_params.append(('namedetails', local_var_params['namedetails'])) # noqa: E501 - if 'extratags' in local_var_params: + if 'extratags' in local_var_params and local_var_params['extratags'] is not None: # noqa: E501 query_params.append(('extratags', local_var_params['extratags'])) # noqa: E501 - if 'statecode' in local_var_params: + if 'statecode' in local_var_params and local_var_params['statecode'] is not None: # noqa: E501 query_params.append(('statecode', local_var_params['statecode'])) # noqa: E501 + if 'showdistance' in local_var_params and local_var_params['showdistance'] is not None: # noqa: E501 + query_params.append(('showdistance', local_var_params['showdistance'])) # noqa: E501 + if 'postaladdress' in local_var_params and local_var_params['postaladdress'] is not None: # noqa: E501 + query_params.append(('postaladdress', local_var_params['postaladdress'])) # noqa: E501 header_params = {} diff --git a/locationiq/api/search_api.py b/openapi_client/api/search_api.py similarity index 67% rename from locationiq/api/search_api.py rename to openapi_client/api/search_api.py index fb71713..9b01c4d 100644 --- a/locationiq/api/search_api.py +++ b/openapi_client/api/search_api.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -17,7 +17,11 @@ # python 2 and python 3 compatibility library import six -from locationiq.api_client import ApiClient +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) class SearchApi(object): @@ -41,7 +45,7 @@ def search(self, q, format, normalizecity, **kwargs): # noqa: E501 >>> thread = api.search(q, format, normalizecity, async_req=True) >>> result = thread.get() - :param async_req bool + :param async_req bool: execute request asynchronously :param str q: Address to geocode (required) :param str format: Format to geocode. Only JSON supported for SDKs (required) :param int normalizecity: For responses with no city value in the address section, the next available element in this order - city_district, locality, town, borough, municipality, village, hamlet, quarter, neighbourhood - from the address section will be normalized to city. Defaults to 1 for SDKs. (required) @@ -55,16 +59,21 @@ def search(self, q, format, normalizecity, **kwargs): # noqa: E501 :param int dedupe: Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. :param int extratags: Include additional information in the result if available, e.g. wikipedia link, opening hours. :param int statecode: Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 + :param int matchquality: Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] + :param int postaladdress: Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. :return: list[Location] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.search_with_http_info(q, format, normalizecity, **kwargs) # noqa: E501 - else: - (data) = self.search_with_http_info(q, format, normalizecity, **kwargs) # noqa: E501 - return data + return self.search_with_http_info(q, format, normalizecity, **kwargs) # noqa: E501 def search_with_http_info(self, q, format, normalizecity, **kwargs): # noqa: E501 """Forward Geocoding # noqa: E501 @@ -75,7 +84,7 @@ def search_with_http_info(self, q, format, normalizecity, **kwargs): # noqa: E5 >>> thread = api.search_with_http_info(q, format, normalizecity, async_req=True) >>> result = thread.get() - :param async_req bool + :param async_req bool: execute request asynchronously :param str q: Address to geocode (required) :param str format: Format to geocode. Only JSON supported for SDKs (required) :param int normalizecity: For responses with no city value in the address section, the next available element in this order - city_district, locality, town, borough, municipality, village, hamlet, quarter, neighbourhood - from the address section will be normalized to city. Defaults to 1 for SDKs. (required) @@ -89,14 +98,25 @@ def search_with_http_info(self, q, format, normalizecity, **kwargs): # noqa: E5 :param int dedupe: Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested. :param int extratags: Include additional information in the result if available, e.g. wikipedia link, opening hours. :param int statecode: Adds state or province code when available to the statecode key inside the address element. Currently supported for addresses in the USA, Canada and Australia. Defaults to 0 - :return: list[Location] + :param int matchquality: Returns additional information about quality of the result in a matchquality object. Read more Defaults to 0 [0,1] + :param int postaladdress: Returns address inside the postaladdress key, that is specifically formatted for each country. Currently supported for addresses in Germany. Defaults to 0 [0,1] + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :return: tuple(list[Location], status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['q', 'format', 'normalizecity', 'addressdetails', 'viewbox', 'bounded', 'limit', 'accept_language', 'countrycodes', 'namedetails', 'dedupe', 'extratags', 'statecode'] # noqa: E501 + all_params = ['q', 'format', 'normalizecity', 'addressdetails', 'viewbox', 'bounded', 'limit', 'accept_language', 'countrycodes', 'namedetails', 'dedupe', 'extratags', 'statecode', 'matchquality', 'postaladdress'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -104,56 +124,60 @@ def search_with_http_info(self, q, format, normalizecity, **kwargs): # noqa: E5 for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: - raise TypeError( + raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method search" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'q' is set - if ('q' not in local_var_params or - local_var_params['q'] is None): - raise ValueError("Missing the required parameter `q` when calling `search`") # noqa: E501 + if self.api_client.client_side_validation and ('q' not in local_var_params or # noqa: E501 + local_var_params['q'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `q` when calling `search`") # noqa: E501 # verify the required parameter 'format' is set - if ('format' not in local_var_params or - local_var_params['format'] is None): - raise ValueError("Missing the required parameter `format` when calling `search`") # noqa: E501 + if self.api_client.client_side_validation and ('format' not in local_var_params or # noqa: E501 + local_var_params['format'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `format` when calling `search`") # noqa: E501 # verify the required parameter 'normalizecity' is set - if ('normalizecity' not in local_var_params or - local_var_params['normalizecity'] is None): - raise ValueError("Missing the required parameter `normalizecity` when calling `search`") # noqa: E501 + if self.api_client.client_side_validation and ('normalizecity' not in local_var_params or # noqa: E501 + local_var_params['normalizecity'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `normalizecity` when calling `search`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'q' in local_var_params: + if 'q' in local_var_params and local_var_params['q'] is not None: # noqa: E501 query_params.append(('q', local_var_params['q'])) # noqa: E501 - if 'format' in local_var_params: + if 'format' in local_var_params and local_var_params['format'] is not None: # noqa: E501 query_params.append(('format', local_var_params['format'])) # noqa: E501 - if 'normalizecity' in local_var_params: + if 'normalizecity' in local_var_params and local_var_params['normalizecity'] is not None: # noqa: E501 query_params.append(('normalizecity', local_var_params['normalizecity'])) # noqa: E501 - if 'addressdetails' in local_var_params: + if 'addressdetails' in local_var_params and local_var_params['addressdetails'] is not None: # noqa: E501 query_params.append(('addressdetails', local_var_params['addressdetails'])) # noqa: E501 - if 'viewbox' in local_var_params: + if 'viewbox' in local_var_params and local_var_params['viewbox'] is not None: # noqa: E501 query_params.append(('viewbox', local_var_params['viewbox'])) # noqa: E501 - if 'bounded' in local_var_params: + if 'bounded' in local_var_params and local_var_params['bounded'] is not None: # noqa: E501 query_params.append(('bounded', local_var_params['bounded'])) # noqa: E501 - if 'limit' in local_var_params: + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'accept_language' in local_var_params: + if 'accept_language' in local_var_params and local_var_params['accept_language'] is not None: # noqa: E501 query_params.append(('accept-language', local_var_params['accept_language'])) # noqa: E501 - if 'countrycodes' in local_var_params: + if 'countrycodes' in local_var_params and local_var_params['countrycodes'] is not None: # noqa: E501 query_params.append(('countrycodes', local_var_params['countrycodes'])) # noqa: E501 - if 'namedetails' in local_var_params: + if 'namedetails' in local_var_params and local_var_params['namedetails'] is not None: # noqa: E501 query_params.append(('namedetails', local_var_params['namedetails'])) # noqa: E501 - if 'dedupe' in local_var_params: + if 'dedupe' in local_var_params and local_var_params['dedupe'] is not None: # noqa: E501 query_params.append(('dedupe', local_var_params['dedupe'])) # noqa: E501 - if 'extratags' in local_var_params: + if 'extratags' in local_var_params and local_var_params['extratags'] is not None: # noqa: E501 query_params.append(('extratags', local_var_params['extratags'])) # noqa: E501 - if 'statecode' in local_var_params: + if 'statecode' in local_var_params and local_var_params['statecode'] is not None: # noqa: E501 query_params.append(('statecode', local_var_params['statecode'])) # noqa: E501 + if 'matchquality' in local_var_params and local_var_params['matchquality'] is not None: # noqa: E501 + query_params.append(('matchquality', local_var_params['matchquality'])) # noqa: E501 + if 'postaladdress' in local_var_params and local_var_params['postaladdress'] is not None: # noqa: E501 + query_params.append(('postaladdress', local_var_params['postaladdress'])) # noqa: E501 header_params = {} diff --git a/locationiq/api_client.py b/openapi_client/api_client.py similarity index 87% rename from locationiq/api_client.py rename to openapi_client/api_client.py index 3befe20..eb1705f 100644 --- a/locationiq/api_client.py +++ b/openapi_client/api_client.py @@ -4,13 +4,15 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import +import atexit import datetime +from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -22,9 +24,10 @@ import six from six.moves.urllib.parse import quote -from locationiq.configuration import Configuration -import locationiq.models -from locationiq import rest +from openapi_client.configuration import Configuration +import openapi_client.models +from openapi_client import rest +from openapi_client.exceptions import ApiValueError class ApiClient(object): @@ -45,6 +48,8 @@ class ApiClient(object): the API. :param cookie: a cookie to include in the header when making calls to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types @@ -58,14 +63,15 @@ class ApiClient(object): 'datetime': datetime.datetime, 'object': object, } + _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None): + cookie=None, pool_threads=1): if configuration is None: configuration = Configuration() self.configuration = configuration + self.pool_threads = pool_threads - self.pool = ThreadPool() self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: @@ -73,10 +79,31 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.cookie = cookie # Set default User-Agent. self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation - def __del__(self): - self.pool.close() - self.pool.join() + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool @property def user_agent(self): @@ -95,7 +122,7 @@ def __call_api( query_params=None, header_params=None, body=None, post_params=None, files=None, response_type=None, auth_settings=None, _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): + _preload_content=True, _request_timeout=None, _host=None): config = self.configuration @@ -129,10 +156,11 @@ def __call_api( # post parameters if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) + post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) post_params = self.parameters_to_tuples(post_params, collection_formats) + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth(header_params, query_params, auth_settings) @@ -142,7 +170,11 @@ def __call_api( body = self.sanitize_for_serialization(body) # request url - url = self.configuration.host + resource_path + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path # perform request and return response response_data = self.request( @@ -244,12 +276,12 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} @@ -257,7 +289,7 @@ def __deserialize(self, data, klass): if klass in self.NATIVE_TYPES_MAPPING: klass = self.NATIVE_TYPES_MAPPING[klass] else: - klass = getattr(locationiq.models, klass) + klass = getattr(openapi_client.models, klass) if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) @@ -266,7 +298,7 @@ def __deserialize(self, data, klass): elif klass == datetime.date: return self.__deserialize_date(data) elif klass == datetime.datetime: - return self.__deserialize_datatime(data) + return self.__deserialize_datetime(data) else: return self.__deserialize_model(data, klass) @@ -275,7 +307,7 @@ def call_api(self, resource_path, method, body=None, post_params=None, files=None, response_type=None, auth_settings=None, async_req=None, _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): + _preload_content=True, _request_timeout=None, _host=None): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -318,17 +350,20 @@ def call_api(self, resource_path, method, body, post_params, files, response_type, auth_settings, _return_http_data_only, collection_formats, - _preload_content, _request_timeout) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout)) - return thread + _preload_content, _request_timeout, _host) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -350,10 +385,8 @@ def request(self, method, url, query_params=None, headers=None, return self.rest_client.OPTIONS(url, query_params=query_params, headers=headers, - post_params=post_params, _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + _request_timeout=_request_timeout) elif method == "POST": return self.rest_client.POST(url, query_params=query_params, @@ -386,7 +419,7 @@ def request(self, method, url, query_params=None, headers=None, _request_timeout=_request_timeout, body=body) else: - raise ValueError( + raise ApiValueError( "http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`." ) @@ -421,18 +454,14 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def prepare_post_parameters(self, post_params=None, files=None): + def files_parameters(self, files=None): """Builds form parameters. - :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - if post_params: - params = post_params - if files: for k, v in six.iteritems(files): if not v: @@ -494,14 +523,14 @@ def update_params_for_auth(self, headers, querys, auth_settings): for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if not auth_setting['value']: - continue + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: - raise ValueError( + raise ApiValueError( 'Authentication token must be in `query` or `header`' ) @@ -558,7 +587,6 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -568,7 +596,7 @@ def __deserialize_date(self, string): reason="Failed to parse `{0}` as date object".format(string) ) - def __deserialize_datatime(self, string): + def __deserialize_datetime(self, string): """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -577,7 +605,6 @@ def __deserialize_datatime(self, string): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string @@ -603,11 +630,11 @@ def __deserialize_model(self, data, klass): return data kwargs = {} - if klass.openapi_types is not None: + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): + if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] kwargs[attr] = self.__deserialize(value, attr_type) diff --git a/openapi_client/configuration.py b/openapi_client/configuration.py new file mode 100644 index 0000000..308d9d8 --- /dev/null +++ b/openapi_client/configuration.py @@ -0,0 +1,387 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of openapi_client.signing.HttpSigningConfiguration + + :Example: + + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + conf = openapi_client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = openapi_client.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the openapi_client.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = openapi_client.Configuration( + signing_info = openapi_client.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) + """ + + def __init__(self, host="https://eu1.locationiq.com/v1", + api_key=None, api_key_prefix=None, + username=None, password=None, + signing_info=None): + """Constructor + """ + self.host = host + """Default Base url + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("openapi_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Disable client side validation + self.client_side_validation = True + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'key' in self.api_key: + auth['key'] = { + 'type': 'api_key', + 'in': 'query', + 'key': 'key', + 'value': self.get_api_key_with_prefix('key') + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 2.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://eu1.locationiq.com/v1", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :return: URL based on host settings + """ + variables = {} if variables is None else variables + servers = self.get_host_settings() + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server['variables'].items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url diff --git a/openapi_client/exceptions.py b/openapi_client/exceptions.py new file mode 100644 index 0000000..1fb8cd6 --- /dev/null +++ b/openapi_client/exceptions.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/openapi_client/models/__init__.py b/openapi_client/models/__init__.py new file mode 100644 index 0000000..d8fb9fe --- /dev/null +++ b/openapi_client/models/__init__.py @@ -0,0 +1,30 @@ +# coding: utf-8 + +# flake8: noqa +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +# import models into model package +from openapi_client.models.address import Address +from openapi_client.models.balance import Balance +from openapi_client.models.daybalance import Daybalance +from openapi_client.models.directions_directions import DirectionsDirections +from openapi_client.models.directions_directions_routes import DirectionsDirectionsRoutes +from openapi_client.models.directions_matching import DirectionsMatching +from openapi_client.models.directions_matrix import DirectionsMatrix +from openapi_client.models.directions_matrix_sources import DirectionsMatrixSources +from openapi_client.models.directions_nearest import DirectionsNearest +from openapi_client.models.directions_nearest_waypoints import DirectionsNearestWaypoints +from openapi_client.models.error import Error +from openapi_client.models.location import Location +from openapi_client.models.matchquality import Matchquality +from openapi_client.models.namedetails import Namedetails diff --git a/locationiq/models/address.py b/openapi_client/models/address.py similarity index 96% rename from locationiq/models/address.py rename to openapi_client/models/address.py index 284297b..06f5b71 100644 --- a/locationiq/models/address.py +++ b/openapi_client/models/address.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -15,6 +15,8 @@ import six +from openapi_client.configuration import Configuration + class Address(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -76,8 +78,11 @@ class Address(object): 'state_code': 'state_code' } - def __init__(self, house_number=None, road=None, residential=None, borough=None, neighbourhood=None, quarter=None, hamlet=None, suburb=None, island=None, village=None, town=None, city=None, city_district=None, county=None, state=None, state_district=None, postcode=None, country=None, country_code=None, state_code=None): # noqa: E501 + def __init__(self, house_number=None, road=None, residential=None, borough=None, neighbourhood=None, quarter=None, hamlet=None, suburb=None, island=None, village=None, town=None, city=None, city_district=None, county=None, state=None, state_district=None, postcode=None, country=None, country_code=None, state_code=None, local_vars_configuration=None): # noqa: E501 """Address - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._house_number = None self._road = None @@ -599,8 +604,11 @@ def __eq__(self, other): if not isinstance(other, Address): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Address): + return True + + return self.to_dict() != other.to_dict() diff --git a/locationiq/models/balance.py b/openapi_client/models/balance.py similarity index 86% rename from locationiq/models/balance.py rename to openapi_client/models/balance.py index 102cf2f..eaca5a2 100644 --- a/locationiq/models/balance.py +++ b/openapi_client/models/balance.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -15,6 +15,8 @@ import six +from openapi_client.configuration import Configuration + class Balance(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Balance(object): 'balance': 'balance' } - def __init__(self, status=None, balance=None): # noqa: E501 + def __init__(self, status=None, balance=None, local_vars_configuration=None): # noqa: E501 """Balance - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._status = None self._balance = None @@ -131,8 +136,11 @@ def __eq__(self, other): if not isinstance(other, Balance): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Balance): + return True + + return self.to_dict() != other.to_dict() diff --git a/locationiq/models/daybalance.py b/openapi_client/models/daybalance.py similarity index 86% rename from locationiq/models/daybalance.py rename to openapi_client/models/daybalance.py index dc617ce..089037d 100644 --- a/locationiq/models/daybalance.py +++ b/openapi_client/models/daybalance.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -15,6 +15,8 @@ import six +from openapi_client.configuration import Configuration + class Daybalance(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Daybalance(object): 'bonus': 'bonus' } - def __init__(self, day=None, bonus=None): # noqa: E501 + def __init__(self, day=None, bonus=None, local_vars_configuration=None): # noqa: E501 """Daybalance - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._day = None self._bonus = None @@ -131,8 +136,11 @@ def __eq__(self, other): if not isinstance(other, Daybalance): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Daybalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/directions_directions.py b/openapi_client/models/directions_directions.py new file mode 100644 index 0000000..a427f0f --- /dev/null +++ b/openapi_client/models/directions_directions.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class DirectionsDirections(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'str', + 'waypoints': 'list[object]', + 'routes': 'list[DirectionsDirectionsRoutes]' + } + + attribute_map = { + 'code': 'code', + 'waypoints': 'waypoints', + 'routes': 'routes' + } + + def __init__(self, code=None, waypoints=None, routes=None, local_vars_configuration=None): # noqa: E501 + """DirectionsDirections - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._waypoints = None + self._routes = None + self.discriminator = None + + if code is not None: + self.code = code + if waypoints is not None: + self.waypoints = waypoints + if routes is not None: + self.routes = routes + + @property + def code(self): + """Gets the code of this DirectionsDirections. # noqa: E501 + + + :return: The code of this DirectionsDirections. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this DirectionsDirections. + + + :param code: The code of this DirectionsDirections. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def waypoints(self): + """Gets the waypoints of this DirectionsDirections. # noqa: E501 + + + :return: The waypoints of this DirectionsDirections. # noqa: E501 + :rtype: list[object] + """ + return self._waypoints + + @waypoints.setter + def waypoints(self, waypoints): + """Sets the waypoints of this DirectionsDirections. + + + :param waypoints: The waypoints of this DirectionsDirections. # noqa: E501 + :type: list[object] + """ + + self._waypoints = waypoints + + @property + def routes(self): + """Gets the routes of this DirectionsDirections. # noqa: E501 + + + :return: The routes of this DirectionsDirections. # noqa: E501 + :rtype: list[DirectionsDirectionsRoutes] + """ + return self._routes + + @routes.setter + def routes(self, routes): + """Sets the routes of this DirectionsDirections. + + + :param routes: The routes of this DirectionsDirections. # noqa: E501 + :type: list[DirectionsDirectionsRoutes] + """ + + self._routes = routes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DirectionsDirections): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DirectionsDirections): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/directions_directions_routes.py b/openapi_client/models/directions_directions_routes.py new file mode 100644 index 0000000..85a7cc4 --- /dev/null +++ b/openapi_client/models/directions_directions_routes.py @@ -0,0 +1,250 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class DirectionsDirectionsRoutes(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'legs': 'list[object]', + 'weight_name': 'str', + 'geometry': 'str', + 'weight': 'float', + 'distance': 'float', + 'duration': 'float' + } + + attribute_map = { + 'legs': 'legs', + 'weight_name': 'weight_name', + 'geometry': 'geometry', + 'weight': 'weight', + 'distance': 'distance', + 'duration': 'duration' + } + + def __init__(self, legs=None, weight_name=None, geometry=None, weight=None, distance=None, duration=None, local_vars_configuration=None): # noqa: E501 + """DirectionsDirectionsRoutes - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._legs = None + self._weight_name = None + self._geometry = None + self._weight = None + self._distance = None + self._duration = None + self.discriminator = None + + if legs is not None: + self.legs = legs + if weight_name is not None: + self.weight_name = weight_name + if geometry is not None: + self.geometry = geometry + if weight is not None: + self.weight = weight + if distance is not None: + self.distance = distance + if duration is not None: + self.duration = duration + + @property + def legs(self): + """Gets the legs of this DirectionsDirectionsRoutes. # noqa: E501 + + + :return: The legs of this DirectionsDirectionsRoutes. # noqa: E501 + :rtype: list[object] + """ + return self._legs + + @legs.setter + def legs(self, legs): + """Sets the legs of this DirectionsDirectionsRoutes. + + + :param legs: The legs of this DirectionsDirectionsRoutes. # noqa: E501 + :type: list[object] + """ + + self._legs = legs + + @property + def weight_name(self): + """Gets the weight_name of this DirectionsDirectionsRoutes. # noqa: E501 + + + :return: The weight_name of this DirectionsDirectionsRoutes. # noqa: E501 + :rtype: str + """ + return self._weight_name + + @weight_name.setter + def weight_name(self, weight_name): + """Sets the weight_name of this DirectionsDirectionsRoutes. + + + :param weight_name: The weight_name of this DirectionsDirectionsRoutes. # noqa: E501 + :type: str + """ + + self._weight_name = weight_name + + @property + def geometry(self): + """Gets the geometry of this DirectionsDirectionsRoutes. # noqa: E501 + + + :return: The geometry of this DirectionsDirectionsRoutes. # noqa: E501 + :rtype: str + """ + return self._geometry + + @geometry.setter + def geometry(self, geometry): + """Sets the geometry of this DirectionsDirectionsRoutes. + + + :param geometry: The geometry of this DirectionsDirectionsRoutes. # noqa: E501 + :type: str + """ + + self._geometry = geometry + + @property + def weight(self): + """Gets the weight of this DirectionsDirectionsRoutes. # noqa: E501 + + + :return: The weight of this DirectionsDirectionsRoutes. # noqa: E501 + :rtype: float + """ + return self._weight + + @weight.setter + def weight(self, weight): + """Sets the weight of this DirectionsDirectionsRoutes. + + + :param weight: The weight of this DirectionsDirectionsRoutes. # noqa: E501 + :type: float + """ + + self._weight = weight + + @property + def distance(self): + """Gets the distance of this DirectionsDirectionsRoutes. # noqa: E501 + + + :return: The distance of this DirectionsDirectionsRoutes. # noqa: E501 + :rtype: float + """ + return self._distance + + @distance.setter + def distance(self, distance): + """Sets the distance of this DirectionsDirectionsRoutes. + + + :param distance: The distance of this DirectionsDirectionsRoutes. # noqa: E501 + :type: float + """ + + self._distance = distance + + @property + def duration(self): + """Gets the duration of this DirectionsDirectionsRoutes. # noqa: E501 + + + :return: The duration of this DirectionsDirectionsRoutes. # noqa: E501 + :rtype: float + """ + return self._duration + + @duration.setter + def duration(self, duration): + """Sets the duration of this DirectionsDirectionsRoutes. + + + :param duration: The duration of this DirectionsDirectionsRoutes. # noqa: E501 + :type: float + """ + + self._duration = duration + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DirectionsDirectionsRoutes): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DirectionsDirectionsRoutes): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/directions_matching.py b/openapi_client/models/directions_matching.py new file mode 100644 index 0000000..a1bd8fb --- /dev/null +++ b/openapi_client/models/directions_matching.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class DirectionsMatching(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'str', + 'tracepoints': 'list[object]', + 'matchings': 'list[object]' + } + + attribute_map = { + 'code': 'code', + 'tracepoints': 'tracepoints', + 'matchings': 'matchings' + } + + def __init__(self, code=None, tracepoints=None, matchings=None, local_vars_configuration=None): # noqa: E501 + """DirectionsMatching - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._tracepoints = None + self._matchings = None + self.discriminator = None + + if code is not None: + self.code = code + if tracepoints is not None: + self.tracepoints = tracepoints + if matchings is not None: + self.matchings = matchings + + @property + def code(self): + """Gets the code of this DirectionsMatching. # noqa: E501 + + + :return: The code of this DirectionsMatching. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this DirectionsMatching. + + + :param code: The code of this DirectionsMatching. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def tracepoints(self): + """Gets the tracepoints of this DirectionsMatching. # noqa: E501 + + + :return: The tracepoints of this DirectionsMatching. # noqa: E501 + :rtype: list[object] + """ + return self._tracepoints + + @tracepoints.setter + def tracepoints(self, tracepoints): + """Sets the tracepoints of this DirectionsMatching. + + + :param tracepoints: The tracepoints of this DirectionsMatching. # noqa: E501 + :type: list[object] + """ + + self._tracepoints = tracepoints + + @property + def matchings(self): + """Gets the matchings of this DirectionsMatching. # noqa: E501 + + + :return: The matchings of this DirectionsMatching. # noqa: E501 + :rtype: list[object] + """ + return self._matchings + + @matchings.setter + def matchings(self, matchings): + """Sets the matchings of this DirectionsMatching. + + + :param matchings: The matchings of this DirectionsMatching. # noqa: E501 + :type: list[object] + """ + + self._matchings = matchings + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DirectionsMatching): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DirectionsMatching): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/directions_matrix.py b/openapi_client/models/directions_matrix.py new file mode 100644 index 0000000..138ce92 --- /dev/null +++ b/openapi_client/models/directions_matrix.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class DirectionsMatrix(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'str', + 'distances': 'list[float]', + 'fallback_speed_cells': 'list[float]', + 'sources': 'list[DirectionsMatrixSources]', + 'destinations': 'list[DirectionsMatrixSources]' + } + + attribute_map = { + 'code': 'code', + 'distances': 'distances', + 'fallback_speed_cells': 'fallback_speed_cells', + 'sources': 'sources', + 'destinations': 'destinations' + } + + def __init__(self, code=None, distances=None, fallback_speed_cells=None, sources=None, destinations=None, local_vars_configuration=None): # noqa: E501 + """DirectionsMatrix - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._distances = None + self._fallback_speed_cells = None + self._sources = None + self._destinations = None + self.discriminator = None + + if code is not None: + self.code = code + if distances is not None: + self.distances = distances + if fallback_speed_cells is not None: + self.fallback_speed_cells = fallback_speed_cells + if sources is not None: + self.sources = sources + if destinations is not None: + self.destinations = destinations + + @property + def code(self): + """Gets the code of this DirectionsMatrix. # noqa: E501 + + + :return: The code of this DirectionsMatrix. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this DirectionsMatrix. + + + :param code: The code of this DirectionsMatrix. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def distances(self): + """Gets the distances of this DirectionsMatrix. # noqa: E501 + + + :return: The distances of this DirectionsMatrix. # noqa: E501 + :rtype: list[float] + """ + return self._distances + + @distances.setter + def distances(self, distances): + """Sets the distances of this DirectionsMatrix. + + + :param distances: The distances of this DirectionsMatrix. # noqa: E501 + :type: list[float] + """ + + self._distances = distances + + @property + def fallback_speed_cells(self): + """Gets the fallback_speed_cells of this DirectionsMatrix. # noqa: E501 + + + :return: The fallback_speed_cells of this DirectionsMatrix. # noqa: E501 + :rtype: list[float] + """ + return self._fallback_speed_cells + + @fallback_speed_cells.setter + def fallback_speed_cells(self, fallback_speed_cells): + """Sets the fallback_speed_cells of this DirectionsMatrix. + + + :param fallback_speed_cells: The fallback_speed_cells of this DirectionsMatrix. # noqa: E501 + :type: list[float] + """ + + self._fallback_speed_cells = fallback_speed_cells + + @property + def sources(self): + """Gets the sources of this DirectionsMatrix. # noqa: E501 + + + :return: The sources of this DirectionsMatrix. # noqa: E501 + :rtype: list[DirectionsMatrixSources] + """ + return self._sources + + @sources.setter + def sources(self, sources): + """Sets the sources of this DirectionsMatrix. + + + :param sources: The sources of this DirectionsMatrix. # noqa: E501 + :type: list[DirectionsMatrixSources] + """ + + self._sources = sources + + @property + def destinations(self): + """Gets the destinations of this DirectionsMatrix. # noqa: E501 + + + :return: The destinations of this DirectionsMatrix. # noqa: E501 + :rtype: list[DirectionsMatrixSources] + """ + return self._destinations + + @destinations.setter + def destinations(self, destinations): + """Sets the destinations of this DirectionsMatrix. + + + :param destinations: The destinations of this DirectionsMatrix. # noqa: E501 + :type: list[DirectionsMatrixSources] + """ + + self._destinations = destinations + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DirectionsMatrix): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DirectionsMatrix): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/directions_matrix_sources.py b/openapi_client/models/directions_matrix_sources.py new file mode 100644 index 0000000..e9eaa1f --- /dev/null +++ b/openapi_client/models/directions_matrix_sources.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class DirectionsMatrixSources(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'distance': 'float', + 'location': 'list[float]', + 'name': 'str' + } + + attribute_map = { + 'distance': 'distance', + 'location': 'location', + 'name': 'name' + } + + def __init__(self, distance=None, location=None, name=None, local_vars_configuration=None): # noqa: E501 + """DirectionsMatrixSources - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._distance = None + self._location = None + self._name = None + self.discriminator = None + + if distance is not None: + self.distance = distance + if location is not None: + self.location = location + if name is not None: + self.name = name + + @property + def distance(self): + """Gets the distance of this DirectionsMatrixSources. # noqa: E501 + + + :return: The distance of this DirectionsMatrixSources. # noqa: E501 + :rtype: float + """ + return self._distance + + @distance.setter + def distance(self, distance): + """Sets the distance of this DirectionsMatrixSources. + + + :param distance: The distance of this DirectionsMatrixSources. # noqa: E501 + :type: float + """ + + self._distance = distance + + @property + def location(self): + """Gets the location of this DirectionsMatrixSources. # noqa: E501 + + + :return: The location of this DirectionsMatrixSources. # noqa: E501 + :rtype: list[float] + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this DirectionsMatrixSources. + + + :param location: The location of this DirectionsMatrixSources. # noqa: E501 + :type: list[float] + """ + + self._location = location + + @property + def name(self): + """Gets the name of this DirectionsMatrixSources. # noqa: E501 + + + :return: The name of this DirectionsMatrixSources. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DirectionsMatrixSources. + + + :param name: The name of this DirectionsMatrixSources. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DirectionsMatrixSources): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DirectionsMatrixSources): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/directions_nearest.py b/openapi_client/models/directions_nearest.py new file mode 100644 index 0000000..1eb4376 --- /dev/null +++ b/openapi_client/models/directions_nearest.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class DirectionsNearest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'str', + 'waypoints': 'list[DirectionsNearestWaypoints]' + } + + attribute_map = { + 'code': 'code', + 'waypoints': 'waypoints' + } + + def __init__(self, code=None, waypoints=None, local_vars_configuration=None): # noqa: E501 + """DirectionsNearest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._waypoints = None + self.discriminator = None + + if code is not None: + self.code = code + if waypoints is not None: + self.waypoints = waypoints + + @property + def code(self): + """Gets the code of this DirectionsNearest. # noqa: E501 + + + :return: The code of this DirectionsNearest. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this DirectionsNearest. + + + :param code: The code of this DirectionsNearest. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def waypoints(self): + """Gets the waypoints of this DirectionsNearest. # noqa: E501 + + + :return: The waypoints of this DirectionsNearest. # noqa: E501 + :rtype: list[DirectionsNearestWaypoints] + """ + return self._waypoints + + @waypoints.setter + def waypoints(self, waypoints): + """Sets the waypoints of this DirectionsNearest. + + + :param waypoints: The waypoints of this DirectionsNearest. # noqa: E501 + :type: list[DirectionsNearestWaypoints] + """ + + self._waypoints = waypoints + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DirectionsNearest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DirectionsNearest): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/directions_nearest_waypoints.py b/openapi_client/models/directions_nearest_waypoints.py new file mode 100644 index 0000000..64a7cd6 --- /dev/null +++ b/openapi_client/models/directions_nearest_waypoints.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class DirectionsNearestWaypoints(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'nodes': 'list[float]', + 'distance': 'float', + 'location': 'list[float]', + 'name': 'str' + } + + attribute_map = { + 'nodes': 'nodes', + 'distance': 'distance', + 'location': 'location', + 'name': 'name' + } + + def __init__(self, nodes=None, distance=None, location=None, name=None, local_vars_configuration=None): # noqa: E501 + """DirectionsNearestWaypoints - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._nodes = None + self._distance = None + self._location = None + self._name = None + self.discriminator = None + + if nodes is not None: + self.nodes = nodes + if distance is not None: + self.distance = distance + if location is not None: + self.location = location + if name is not None: + self.name = name + + @property + def nodes(self): + """Gets the nodes of this DirectionsNearestWaypoints. # noqa: E501 + + + :return: The nodes of this DirectionsNearestWaypoints. # noqa: E501 + :rtype: list[float] + """ + return self._nodes + + @nodes.setter + def nodes(self, nodes): + """Sets the nodes of this DirectionsNearestWaypoints. + + + :param nodes: The nodes of this DirectionsNearestWaypoints. # noqa: E501 + :type: list[float] + """ + + self._nodes = nodes + + @property + def distance(self): + """Gets the distance of this DirectionsNearestWaypoints. # noqa: E501 + + + :return: The distance of this DirectionsNearestWaypoints. # noqa: E501 + :rtype: float + """ + return self._distance + + @distance.setter + def distance(self, distance): + """Sets the distance of this DirectionsNearestWaypoints. + + + :param distance: The distance of this DirectionsNearestWaypoints. # noqa: E501 + :type: float + """ + + self._distance = distance + + @property + def location(self): + """Gets the location of this DirectionsNearestWaypoints. # noqa: E501 + + + :return: The location of this DirectionsNearestWaypoints. # noqa: E501 + :rtype: list[float] + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this DirectionsNearestWaypoints. + + + :param location: The location of this DirectionsNearestWaypoints. # noqa: E501 + :type: list[float] + """ + + self._location = location + + @property + def name(self): + """Gets the name of this DirectionsNearestWaypoints. # noqa: E501 + + + :return: The name of this DirectionsNearestWaypoints. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DirectionsNearestWaypoints. + + + :param name: The name of this DirectionsNearestWaypoints. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DirectionsNearestWaypoints): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DirectionsNearestWaypoints): + return True + + return self.to_dict() != other.to_dict() diff --git a/locationiq/models/error.py b/openapi_client/models/error.py similarity index 84% rename from locationiq/models/error.py rename to openapi_client/models/error.py index e9445b3..e9a48d9 100644 --- a/locationiq/models/error.py +++ b/openapi_client/models/error.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -15,6 +15,8 @@ import six +from openapi_client.configuration import Configuration + class Error(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Error(object): 'error': 'error' } - def __init__(self, error=None): # noqa: E501 + def __init__(self, error=None, local_vars_configuration=None): # noqa: E501 """Error - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._error = None self.discriminator = None @@ -105,8 +110,11 @@ def __eq__(self, other): if not isinstance(other, Error): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Error): + return True + + return self.to_dict() != other.to_dict() diff --git a/locationiq/models/location.py b/openapi_client/models/location.py similarity index 82% rename from locationiq/models/location.py rename to openapi_client/models/location.py index 2f81123..b1000f9 100644 --- a/locationiq/models/location.py +++ b/openapi_client/models/location.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -15,6 +15,8 @@ import six +from openapi_client.configuration import Configuration + class Location(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -31,6 +33,7 @@ class Location(object): and the value is json key in definition. """ openapi_types = { + 'distance': 'float', 'place_id': 'str', 'licence': 'str', 'osm_type': 'str', @@ -43,10 +46,12 @@ class Location(object): 'type': 'str', 'importance': 'float', 'address': 'Address', - 'namedetails': 'Namedetails' + 'namedetails': 'Namedetails', + 'matchquality': 'Matchquality' } attribute_map = { + 'distance': 'distance', 'place_id': 'place_id', 'licence': 'licence', 'osm_type': 'osm_type', @@ -59,12 +64,17 @@ class Location(object): 'type': 'type', 'importance': 'importance', 'address': 'address', - 'namedetails': 'namedetails' + 'namedetails': 'namedetails', + 'matchquality': 'matchquality' } - def __init__(self, place_id=None, licence=None, osm_type=None, osm_id=None, boundingbox=None, lat=None, lon=None, display_name=None, _class=None, type=None, importance=None, address=None, namedetails=None): # noqa: E501 + def __init__(self, distance=None, place_id=None, licence=None, osm_type=None, osm_id=None, boundingbox=None, lat=None, lon=None, display_name=None, _class=None, type=None, importance=None, address=None, namedetails=None, matchquality=None, local_vars_configuration=None): # noqa: E501 """Location - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + self._distance = None self._place_id = None self._licence = None self._osm_type = None @@ -78,8 +88,11 @@ def __init__(self, place_id=None, licence=None, osm_type=None, osm_id=None, boun self._importance = None self._address = None self._namedetails = None + self._matchquality = None self.discriminator = None + if distance is not None: + self.distance = distance if place_id is not None: self.place_id = place_id if licence is not None: @@ -106,6 +119,29 @@ def __init__(self, place_id=None, licence=None, osm_type=None, osm_id=None, boun self.address = address if namedetails is not None: self.namedetails = namedetails + if matchquality is not None: + self.matchquality = matchquality + + @property + def distance(self): + """Gets the distance of this Location. # noqa: E501 + + + :return: The distance of this Location. # noqa: E501 + :rtype: float + """ + return self._distance + + @distance.setter + def distance(self, distance): + """Sets the distance of this Location. + + + :param distance: The distance of this Location. # noqa: E501 + :type: float + """ + + self._distance = distance @property def place_id(self): @@ -380,6 +416,27 @@ def namedetails(self, namedetails): self._namedetails = namedetails + @property + def matchquality(self): + """Gets the matchquality of this Location. # noqa: E501 + + + :return: The matchquality of this Location. # noqa: E501 + :rtype: Matchquality + """ + return self._matchquality + + @matchquality.setter + def matchquality(self, matchquality): + """Sets the matchquality of this Location. + + + :param matchquality: The matchquality of this Location. # noqa: E501 + :type: Matchquality + """ + + self._matchquality = matchquality + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -417,8 +474,11 @@ def __eq__(self, other): if not isinstance(other, Location): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Location): + return True + + return self.to_dict() != other.to_dict() diff --git a/openapi_client/models/matchquality.py b/openapi_client/models/matchquality.py new file mode 100644 index 0000000..e6dbb9f --- /dev/null +++ b/openapi_client/models/matchquality.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from openapi_client.configuration import Configuration + + +class Matchquality(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'matchcode': 'str', + 'matchtype': 'str', + 'matchlevel': 'str' + } + + attribute_map = { + 'matchcode': 'matchcode', + 'matchtype': 'matchtype', + 'matchlevel': 'matchlevel' + } + + def __init__(self, matchcode=None, matchtype=None, matchlevel=None, local_vars_configuration=None): # noqa: E501 + """Matchquality - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._matchcode = None + self._matchtype = None + self._matchlevel = None + self.discriminator = None + + if matchcode is not None: + self.matchcode = matchcode + if matchtype is not None: + self.matchtype = matchtype + if matchlevel is not None: + self.matchlevel = matchlevel + + @property + def matchcode(self): + """Gets the matchcode of this Matchquality. # noqa: E501 + + + :return: The matchcode of this Matchquality. # noqa: E501 + :rtype: str + """ + return self._matchcode + + @matchcode.setter + def matchcode(self, matchcode): + """Sets the matchcode of this Matchquality. + + + :param matchcode: The matchcode of this Matchquality. # noqa: E501 + :type: str + """ + + self._matchcode = matchcode + + @property + def matchtype(self): + """Gets the matchtype of this Matchquality. # noqa: E501 + + + :return: The matchtype of this Matchquality. # noqa: E501 + :rtype: str + """ + return self._matchtype + + @matchtype.setter + def matchtype(self, matchtype): + """Sets the matchtype of this Matchquality. + + + :param matchtype: The matchtype of this Matchquality. # noqa: E501 + :type: str + """ + + self._matchtype = matchtype + + @property + def matchlevel(self): + """Gets the matchlevel of this Matchquality. # noqa: E501 + + + :return: The matchlevel of this Matchquality. # noqa: E501 + :rtype: str + """ + return self._matchlevel + + @matchlevel.setter + def matchlevel(self, matchlevel): + """Sets the matchlevel of this Matchquality. + + + :param matchlevel: The matchlevel of this Matchquality. # noqa: E501 + :type: str + """ + + self._matchlevel = matchlevel + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Matchquality): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Matchquality): + return True + + return self.to_dict() != other.to_dict() diff --git a/locationiq/models/namedetails.py b/openapi_client/models/namedetails.py similarity index 84% rename from locationiq/models/namedetails.py rename to openapi_client/models/namedetails.py index 4e396e3..504bce9 100644 --- a/locationiq/models/namedetails.py +++ b/openapi_client/models/namedetails.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -15,6 +15,8 @@ import six +from openapi_client.configuration import Configuration + class Namedetails(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Namedetails(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """Namedetails - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ def __eq__(self, other): if not isinstance(other, Namedetails): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Namedetails): + return True + + return self.to_dict() != other.to_dict() diff --git a/locationiq/rest.py b/openapi_client/rest.py similarity index 91% rename from locationiq/rest.py rename to openapi_client/rest.py index 0de47c1..f5909a6 100644 --- a/locationiq/rest.py +++ b/openapi_client/rest.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -22,11 +22,9 @@ # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import urlencode +import urllib3 -try: - import urllib3 -except ImportError: - raise ImportError('OpenAPI Python client requires urllib3.') +from openapi_client.exceptions import ApiException, ApiValueError logger = logging.getLogger(__name__) @@ -75,6 +73,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None): if configuration.assert_hostname is not None: addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + if maxsize is None: if configuration.connection_pool_maxsize is not None: maxsize = configuration.connection_pool_maxsize @@ -91,6 +92,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None): cert_file=configuration.cert_file, key_file=configuration.key_file, proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, **addition_pool_args ) else: @@ -130,7 +132,7 @@ def request(self, method, url, query_params=None, headers=None, 'PATCH', 'OPTIONS'] if post_params and body: - raise ValueError( + raise ApiValueError( "body parameter cannot be used with post_params parameter." ) @@ -187,7 +189,7 @@ def request(self, method, url, query_params=None, headers=None, # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form - elif isinstance(body, str): + elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( method, url, @@ -292,31 +294,3 @@ def PATCH(self, url, headers=None, query_params=None, post_params=None, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) - - -class ApiException(Exception): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message diff --git a/requirements.txt b/requirements.txt index bafdc07..eb358ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ certifi >= 14.05.14 +future; python_version<="2.7" six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py index 7d20de4..53d34c8 100644 --- a/setup.py +++ b/setup.py @@ -5,14 +5,14 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ from setuptools import setup, find_packages # noqa: H301 -NAME = "locationiq" +NAME = "openapi-client" VERSION = "1.0.0" # To install the library, run the following # @@ -27,11 +27,12 @@ name=NAME, version=VERSION, description="LocationIQ", - author_email="", + author="OpenAPI Generator community", + author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "LocationIQ"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 diff --git a/test-requirements.txt b/test-requirements.txt index 2702246..4ed3991 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,3 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/test/test_address.py b/test/test_address.py index 9f38adc..ccfff78 100644 --- a/test/test_address.py +++ b/test/test_address.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -13,11 +13,11 @@ from __future__ import absolute_import import unittest +import datetime -import locationiq -from locationiq.models.address import Address # noqa: E501 -from locationiq.rest import ApiException - +import openapi_client +from openapi_client.models.address import Address # noqa: E501 +from openapi_client.rest import ApiException class TestAddress(unittest.TestCase): """Address unit test stubs""" @@ -28,11 +28,43 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Address + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.address.Address() # noqa: E501 + if include_optional : + return Address( + house_number = '0', + road = '0', + residential = '0', + borough = '0', + neighbourhood = '0', + quarter = '0', + hamlet = '0', + suburb = '0', + island = '0', + village = '0', + town = '0', + city = '0', + city_district = '0', + county = '0', + state = '0', + state_district = '0', + postcode = '0', + country = '0', + country_code = '0', + state_code = '0' + ) + else : + return Address( + ) + def testAddress(self): """Test Address""" - # FIXME: construct object with mandatory attributes with example values - # model = locationiq.models.address.Address() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/test/test_balance.py b/test/test_balance.py index a4ac224..19ba6f6 100644 --- a/test/test_balance.py +++ b/test/test_balance.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -13,11 +13,11 @@ from __future__ import absolute_import import unittest +import datetime -import locationiq -from locationiq.models.balance import Balance # noqa: E501 -from locationiq.rest import ApiException - +import openapi_client +from openapi_client.models.balance import Balance # noqa: E501 +from openapi_client.rest import ApiException class TestBalance(unittest.TestCase): """Balance unit test stubs""" @@ -28,11 +28,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Balance + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.balance.Balance() # noqa: E501 + if include_optional : + return Balance( + status = '0', + balance = openapi_client.models.daybalance.daybalance( + day = 56, + bonus = 56, ) + ) + else : + return Balance( + ) + def testBalance(self): """Test Balance""" - # FIXME: construct object with mandatory attributes with example values - # model = locationiq.models.balance.Balance() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/test/test_balance_api.py b/test/test_balance_api.py index f7b31eb..21b7e66 100644 --- a/test/test_balance_api.py +++ b/test/test_balance_api.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -14,16 +14,16 @@ import unittest -import locationiq -from locationiq.api.balance_api import BalanceApi # noqa: E501 -from locationiq.rest import ApiException +import openapi_client +from openapi_client.api.balance_api import BalanceApi # noqa: E501 +from openapi_client.rest import ApiException class TestBalanceApi(unittest.TestCase): """BalanceApi unit test stubs""" def setUp(self): - self.api = locationiq.api.balance_api.BalanceApi() # noqa: E501 + self.api = openapi_client.api.balance_api.BalanceApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_daybalance.py b/test/test_daybalance.py index 074c8e7..9838414 100644 --- a/test/test_daybalance.py +++ b/test/test_daybalance.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -13,11 +13,11 @@ from __future__ import absolute_import import unittest +import datetime -import locationiq -from locationiq.models.daybalance import Daybalance # noqa: E501 -from locationiq.rest import ApiException - +import openapi_client +from openapi_client.models.daybalance import Daybalance # noqa: E501 +from openapi_client.rest import ApiException class TestDaybalance(unittest.TestCase): """Daybalance unit test stubs""" @@ -28,11 +28,25 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Daybalance + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.daybalance.Daybalance() # noqa: E501 + if include_optional : + return Daybalance( + day = 56, + bonus = 56 + ) + else : + return Daybalance( + ) + def testDaybalance(self): """Test Daybalance""" - # FIXME: construct object with mandatory attributes with example values - # model = locationiq.models.daybalance.Daybalance() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/test/test_directions_api.py b/test/test_directions_api.py new file mode 100644 index 0000000..d53b956 --- /dev/null +++ b/test/test_directions_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import openapi_client +from openapi_client.api.directions_api import DirectionsApi # noqa: E501 +from openapi_client.rest import ApiException + + +class TestDirectionsApi(unittest.TestCase): + """DirectionsApi unit test stubs""" + + def setUp(self): + self.api = openapi_client.api.directions_api.DirectionsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_directions(self): + """Test case for directions + + Directions Service # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_directions_directions.py b/test/test_directions_directions.py new file mode 100644 index 0000000..9148658 --- /dev/null +++ b/test/test_directions_directions.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.directions_directions import DirectionsDirections # noqa: E501 +from openapi_client.rest import ApiException + +class TestDirectionsDirections(unittest.TestCase): + """DirectionsDirections unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DirectionsDirections + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.directions_directions.DirectionsDirections() # noqa: E501 + if include_optional : + return DirectionsDirections( + code = '0', + waypoints = [ + None + ], + routes = [ + openapi_client.models.directions_directions_routes.directions_directions_routes( + legs = [ + None + ], + weight_name = '0', + geometry = '0', + weight = 1.337, + distance = 1.337, + duration = 1.337, ) + ] + ) + else : + return DirectionsDirections( + ) + + def testDirectionsDirections(self): + """Test DirectionsDirections""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_directions_directions_routes.py b/test/test_directions_directions_routes.py new file mode 100644 index 0000000..3845cc1 --- /dev/null +++ b/test/test_directions_directions_routes.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.directions_directions_routes import DirectionsDirectionsRoutes # noqa: E501 +from openapi_client.rest import ApiException + +class TestDirectionsDirectionsRoutes(unittest.TestCase): + """DirectionsDirectionsRoutes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DirectionsDirectionsRoutes + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.directions_directions_routes.DirectionsDirectionsRoutes() # noqa: E501 + if include_optional : + return DirectionsDirectionsRoutes( + legs = [ + None + ], + weight_name = '0', + geometry = '0', + weight = 1.337, + distance = 1.337, + duration = 1.337 + ) + else : + return DirectionsDirectionsRoutes( + ) + + def testDirectionsDirectionsRoutes(self): + """Test DirectionsDirectionsRoutes""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_directions_matching.py b/test/test_directions_matching.py new file mode 100644 index 0000000..ee77a8e --- /dev/null +++ b/test/test_directions_matching.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.directions_matching import DirectionsMatching # noqa: E501 +from openapi_client.rest import ApiException + +class TestDirectionsMatching(unittest.TestCase): + """DirectionsMatching unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DirectionsMatching + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.directions_matching.DirectionsMatching() # noqa: E501 + if include_optional : + return DirectionsMatching( + code = '0', + tracepoints = [ + None + ], + matchings = [ + None + ] + ) + else : + return DirectionsMatching( + ) + + def testDirectionsMatching(self): + """Test DirectionsMatching""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_directions_matrix.py b/test/test_directions_matrix.py new file mode 100644 index 0000000..56d8f40 --- /dev/null +++ b/test/test_directions_matrix.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.directions_matrix import DirectionsMatrix # noqa: E501 +from openapi_client.rest import ApiException + +class TestDirectionsMatrix(unittest.TestCase): + """DirectionsMatrix unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DirectionsMatrix + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.directions_matrix.DirectionsMatrix() # noqa: E501 + if include_optional : + return DirectionsMatrix( + code = '0', + distances = [ + 1.337 + ], + fallback_speed_cells = [ + 1.337 + ], + sources = [ + openapi_client.models.directions_matrix_sources.directions_matrix_sources( + distance = 1.337, + location = [ + 1.337 + ], + name = '0', ) + ], + destinations = [ + openapi_client.models.directions_matrix_sources.directions_matrix_sources( + distance = 1.337, + location = [ + 1.337 + ], + name = '0', ) + ] + ) + else : + return DirectionsMatrix( + ) + + def testDirectionsMatrix(self): + """Test DirectionsMatrix""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_directions_matrix_sources.py b/test/test_directions_matrix_sources.py new file mode 100644 index 0000000..4af8833 --- /dev/null +++ b/test/test_directions_matrix_sources.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.directions_matrix_sources import DirectionsMatrixSources # noqa: E501 +from openapi_client.rest import ApiException + +class TestDirectionsMatrixSources(unittest.TestCase): + """DirectionsMatrixSources unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DirectionsMatrixSources + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.directions_matrix_sources.DirectionsMatrixSources() # noqa: E501 + if include_optional : + return DirectionsMatrixSources( + distance = 1.337, + location = [ + 1.337 + ], + name = '0' + ) + else : + return DirectionsMatrixSources( + ) + + def testDirectionsMatrixSources(self): + """Test DirectionsMatrixSources""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_directions_nearest.py b/test/test_directions_nearest.py new file mode 100644 index 0000000..1db0778 --- /dev/null +++ b/test/test_directions_nearest.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.directions_nearest import DirectionsNearest # noqa: E501 +from openapi_client.rest import ApiException + +class TestDirectionsNearest(unittest.TestCase): + """DirectionsNearest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DirectionsNearest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.directions_nearest.DirectionsNearest() # noqa: E501 + if include_optional : + return DirectionsNearest( + code = '0', + waypoints = [ + openapi_client.models.directions_nearest_waypoints.directions_nearest_waypoints( + nodes = [ + 1.337 + ], + distance = 1.337, + location = [ + 1.337 + ], + name = '0', ) + ] + ) + else : + return DirectionsNearest( + ) + + def testDirectionsNearest(self): + """Test DirectionsNearest""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_directions_nearest_waypoints.py b/test/test_directions_nearest_waypoints.py new file mode 100644 index 0000000..db38719 --- /dev/null +++ b/test/test_directions_nearest_waypoints.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.directions_nearest_waypoints import DirectionsNearestWaypoints # noqa: E501 +from openapi_client.rest import ApiException + +class TestDirectionsNearestWaypoints(unittest.TestCase): + """DirectionsNearestWaypoints unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DirectionsNearestWaypoints + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.directions_nearest_waypoints.DirectionsNearestWaypoints() # noqa: E501 + if include_optional : + return DirectionsNearestWaypoints( + nodes = [ + 1.337 + ], + distance = 1.337, + location = [ + 1.337 + ], + name = '0' + ) + else : + return DirectionsNearestWaypoints( + ) + + def testDirectionsNearestWaypoints(self): + """Test DirectionsNearestWaypoints""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_error.py b/test/test_error.py index f1e2fd9..716dc6c 100644 --- a/test/test_error.py +++ b/test/test_error.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -13,11 +13,11 @@ from __future__ import absolute_import import unittest +import datetime -import locationiq -from locationiq.models.error import Error # noqa: E501 -from locationiq.rest import ApiException - +import openapi_client +from openapi_client.models.error import Error # noqa: E501 +from openapi_client.rest import ApiException class TestError(unittest.TestCase): """Error unit test stubs""" @@ -28,11 +28,24 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.error.Error() # noqa: E501 + if include_optional : + return Error( + error = '0' + ) + else : + return Error( + ) + def testError(self): """Test Error""" - # FIXME: construct object with mandatory attributes with example values - # model = locationiq.models.error.Error() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/test/test_location.py b/test/test_location.py index 804c267..8c29cf1 100644 --- a/test/test_location.py +++ b/test/test_location.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -13,11 +13,11 @@ from __future__ import absolute_import import unittest +import datetime -import locationiq -from locationiq.models.location import Location # noqa: E501 -from locationiq.rest import ApiException - +import openapi_client +from openapi_client.models.location import Location # noqa: E501 +from openapi_client.rest import ApiException class TestLocation(unittest.TestCase): """Location unit test stubs""" @@ -28,11 +28,43 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Location + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.location.Location() # noqa: E501 + if include_optional : + return Location( + distance = 1.337, + place_id = '0', + licence = '0', + osm_type = '0', + osm_id = '0', + boundingbox = [ + '0' + ], + lat = '0', + lon = '0', + display_name = '0', + _class = '0', + type = '0', + importance = 1.337, + address = {"house_number":"3894","road":"Spring Mill Way","residential":"Hunter’s Point","village":"Landen","city":"Landen","county":"Warren County","state":"Ohio","postcode":"45039","country":"United States of America","country_code":"us","state_code":"oh"}, + namedetails = {"name":"\"Empire State Building\""}, + matchquality = openapi_client.models.matchquality.matchquality( + matchcode = '0', + matchtype = '0', + matchlevel = '0', ) + ) + else : + return Location( + ) + def testLocation(self): """Test Location""" - # FIXME: construct object with mandatory attributes with example values - # model = locationiq.models.location.Location() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/test/test_matching_api.py b/test/test_matching_api.py new file mode 100644 index 0000000..e8d7310 --- /dev/null +++ b/test/test_matching_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import openapi_client +from openapi_client.api.matching_api import MatchingApi # noqa: E501 +from openapi_client.rest import ApiException + + +class TestMatchingApi(unittest.TestCase): + """MatchingApi unit test stubs""" + + def setUp(self): + self.api = openapi_client.api.matching_api.MatchingApi() # noqa: E501 + + def tearDown(self): + pass + + def test_matching(self): + """Test case for matching + + Matching Service # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_matchquality.py b/test/test_matchquality.py new file mode 100644 index 0000000..74f103f --- /dev/null +++ b/test/test_matchquality.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import openapi_client +from openapi_client.models.matchquality import Matchquality # noqa: E501 +from openapi_client.rest import ApiException + +class TestMatchquality(unittest.TestCase): + """Matchquality unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Matchquality + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.matchquality.Matchquality() # noqa: E501 + if include_optional : + return Matchquality( + matchcode = '0', + matchtype = '0', + matchlevel = '0' + ) + else : + return Matchquality( + ) + + def testMatchquality(self): + """Test Matchquality""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_matrix_api.py b/test/test_matrix_api.py new file mode 100644 index 0000000..dd849de --- /dev/null +++ b/test/test_matrix_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import openapi_client +from openapi_client.api.matrix_api import MatrixApi # noqa: E501 +from openapi_client.rest import ApiException + + +class TestMatrixApi(unittest.TestCase): + """MatrixApi unit test stubs""" + + def setUp(self): + self.api = openapi_client.api.matrix_api.MatrixApi() # noqa: E501 + + def tearDown(self): + pass + + def test_matrix(self): + """Test case for matrix + + Matrix Service # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_namedetails.py b/test/test_namedetails.py index 10ae8b8..94f938a 100644 --- a/test/test_namedetails.py +++ b/test/test_namedetails.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -13,11 +13,11 @@ from __future__ import absolute_import import unittest +import datetime -import locationiq -from locationiq.models.namedetails import Namedetails # noqa: E501 -from locationiq.rest import ApiException - +import openapi_client +from openapi_client.models.namedetails import Namedetails # noqa: E501 +from openapi_client.rest import ApiException class TestNamedetails(unittest.TestCase): """Namedetails unit test stubs""" @@ -28,11 +28,24 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Namedetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = openapi_client.models.namedetails.Namedetails() # noqa: E501 + if include_optional : + return Namedetails( + name = '0' + ) + else : + return Namedetails( + ) + def testNamedetails(self): """Test Namedetails""" - # FIXME: construct object with mandatory attributes with example values - # model = locationiq.models.namedetails.Namedetails() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/test/test_nearest_api.py b/test/test_nearest_api.py new file mode 100644 index 0000000..c5f0b95 --- /dev/null +++ b/test/test_nearest_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + LocationIQ + + LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 + + The version of the OpenAPI document: 2.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import openapi_client +from openapi_client.api.nearest_api import NearestApi # noqa: E501 +from openapi_client.rest import ApiException + + +class TestNearestApi(unittest.TestCase): + """NearestApi unit test stubs""" + + def setUp(self): + self.api = openapi_client.api.nearest_api.NearestApi() # noqa: E501 + + def tearDown(self): + pass + + def test_nearest(self): + """Test case for nearest + + Nearest Service # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_reverse_api.py b/test/test_reverse_api.py index d9c6ed2..b1ca933 100644 --- a/test/test_reverse_api.py +++ b/test/test_reverse_api.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -14,16 +14,16 @@ import unittest -import locationiq -from locationiq.api.reverse_api import ReverseApi # noqa: E501 -from locationiq.rest import ApiException +import openapi_client +from openapi_client.api.reverse_api import ReverseApi # noqa: E501 +from openapi_client.rest import ApiException class TestReverseApi(unittest.TestCase): """ReverseApi unit test stubs""" def setUp(self): - self.api = locationiq.api.reverse_api.ReverseApi() # noqa: E501 + self.api = openapi_client.api.reverse_api.ReverseApi() # noqa: E501 def tearDown(self): pass diff --git a/test/test_search_api.py b/test/test_search_api.py index 5420619..0f3739d 100644 --- a/test/test_search_api.py +++ b/test/test_search_api.py @@ -5,7 +5,7 @@ LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started. # noqa: E501 - OpenAPI spec version: 1.0.1 + The version of the OpenAPI document: 2.0.0 Generated by: https://openapi-generator.tech """ @@ -14,16 +14,16 @@ import unittest -import locationiq -from locationiq.api.search_api import SearchApi # noqa: E501 -from locationiq.rest import ApiException +import openapi_client +from openapi_client.api.search_api import SearchApi # noqa: E501 +from openapi_client.rest import ApiException class TestSearchApi(unittest.TestCase): """SearchApi unit test stubs""" def setUp(self): - self.api = locationiq.api.search_api.SearchApi() # noqa: E501 + self.api = openapi_client.api.search_api.SearchApi() # noqa: E501 def tearDown(self): pass diff --git a/tox.ini b/tox.ini index 3d0be61..b97a256 100644 --- a/tox.ini +++ b/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] + pytest --cov=openapi_client