diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000000000000000000000000000000000000..6388944f8e907deec719a1e96f141ccf8fe9b42d --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,38 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: scp_udg_client_rest Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..43995bd42fa23bbc4c3a59d5fb9da99042fcf139 --- /dev/null +++ b/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..ea2f4ec887fdf009376edb58fdd91b320a8187f4 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=scp_udg_client_rest + +pytest-3.7: + extends: .pytest + image: python:3.7-alpine +pytest-3.8: + extends: .pytest + image: python:3.8-alpine +pytest-3.9: + extends: .pytest + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000000000000000000000000000000000000..7484ee590a3894506cf063799b885428f95a71be --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000000000000000000000000000000000000..ce7f45df1f1d95cc940101fb8ffa96fbf77b38c6 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,116 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/Basic200Response.md +docs/BasicRequest.md +docs/DeepSearchingRequest.md +docs/IsAlive200Response.md +docs/Last200Response.md +docs/LastRequest.md +docs/Login200Response.md +docs/LoginRequest.md +docs/Push200Response.md +docs/PushRequest.md +docs/ScpsUrbandatasetSchema20.md +docs/ScpsUrbandatasetSchema20UrbanDataset.md +docs/ScpsUrbandatasetSchema20UrbanDatasetContext.md +docs/ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.md +docs/ScpsUrbandatasetSchema20UrbanDatasetContextProducer.md +docs/ScpsUrbandatasetSchema20UrbanDatasetSpecification.md +docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.md +docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.md +docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.md +docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.md +docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.md +docs/ScpsUrbandatasetSchema20UrbanDatasetValues.md +docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.md +docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.md +docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.md +docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.md +docs/SearchingByPropertyRequest.md +docs/SearchingRequest.md +docs/SpecificRequest.md +docs/TestGet200Response.md +docs/UrbanDatasetGatewayApi.md +git_push.sh +pyproject.toml +requirements.txt +scp_udg_client_rest/__init__.py +scp_udg_client_rest/api/__init__.py +scp_udg_client_rest/api/urban_dataset_gateway_api.py +scp_udg_client_rest/api_client.py +scp_udg_client_rest/api_response.py +scp_udg_client_rest/configuration.py +scp_udg_client_rest/exceptions.py +scp_udg_client_rest/models/__init__.py +scp_udg_client_rest/models/basic200_response.py +scp_udg_client_rest/models/basic_request.py +scp_udg_client_rest/models/deep_searching_request.py +scp_udg_client_rest/models/is_alive200_response.py +scp_udg_client_rest/models/last200_response.py +scp_udg_client_rest/models/last_request.py +scp_udg_client_rest/models/login200_response.py +scp_udg_client_rest/models/login_request.py +scp_udg_client_rest/models/push200_response.py +scp_udg_client_rest/models/push_request.py +scp_udg_client_rest/models/scps_urbandataset_schema20.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_coordinates.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_producer.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_id.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py +scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py +scp_udg_client_rest/models/searching_by_property_request.py +scp_udg_client_rest/models/searching_request.py +scp_udg_client_rest/models/specific_request.py +scp_udg_client_rest/models/test_get200_response.py +scp_udg_client_rest/py.typed +scp_udg_client_rest/rest.py +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_basic200_response.py +test/test_basic_request.py +test/test_deep_searching_request.py +test/test_is_alive200_response.py +test/test_last200_response.py +test/test_last_request.py +test/test_login200_response.py +test/test_login_request.py +test/test_push200_response.py +test/test_push_request.py +test/test_scps_urbandataset_schema20.py +test/test_scps_urbandataset_schema20_urban_dataset.py +test/test_scps_urbandataset_schema20_urban_dataset_context.py +test/test_scps_urbandataset_schema20_urban_dataset_context_coordinates.py +test/test_scps_urbandataset_schema20_urban_dataset_context_producer.py +test/test_scps_urbandataset_schema20_urban_dataset_specification.py +test/test_scps_urbandataset_schema20_urban_dataset_specification_id.py +test/test_scps_urbandataset_schema20_urban_dataset_specification_properties.py +test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py +test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py +test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py +test/test_scps_urbandataset_schema20_urban_dataset_values.py +test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner.py +test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py +test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py +test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py +test/test_searching_by_property_request.py +test/test_searching_request.py +test/test_specific_request.py +test/test_test_get200_response.py +test/test_urban_dataset_gateway_api.py +tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..1985849fb5896759c64a3349f243312c69d67c16 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.7.0 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..80789e9f804dff8996b89a4f42c7355eafb04499 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=scp_udg_client_rest diff --git a/docs/Basic200Response.md b/docs/Basic200Response.md new file mode 100644 index 0000000000000000000000000000000000000000..8a18f93749137adb9a4e0bc54778f6f6496e5d49 --- /dev/null +++ b/docs/Basic200Response.md @@ -0,0 +1,31 @@ +# Basic200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | +**message** | **str** | | +**dataset** | [**List[ScpsUrbandatasetSchema20]**](ScpsUrbandatasetSchema20.md) | An array of one or more UrbanDatasets, according to the SCPS Information 2.0 specification. | + +## Example + +```python +from scp_udg_client_rest.models.basic200_response import Basic200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of Basic200Response from a JSON string +basic200_response_instance = Basic200Response.from_json(json) +# print the JSON string representation of the object +print(Basic200Response.to_json()) + +# convert the object into a dict +basic200_response_dict = basic200_response_instance.to_dict() +# create an instance of Basic200Response from a dict +basic200_response_from_dict = Basic200Response.from_dict(basic200_response_dict) +``` +[[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/BasicRequest.md b/docs/BasicRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..9ced5038272c2d74ab94218020f3999f612f2f29 --- /dev/null +++ b/docs/BasicRequest.md @@ -0,0 +1,29 @@ +# BasicRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | | + +## Example + +```python +from scp_udg_client_rest.models.basic_request import BasicRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of BasicRequest from a JSON string +basic_request_instance = BasicRequest.from_json(json) +# print the JSON string representation of the object +print(BasicRequest.to_json()) + +# convert the object into a dict +basic_request_dict = basic_request_instance.to_dict() +# create an instance of BasicRequest from a dict +basic_request_from_dict = BasicRequest.from_dict(basic_request_dict) +``` +[[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/DeepSearchingRequest.md b/docs/DeepSearchingRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..9648c27eccd95df96e10af0f37178f7bde8f011c --- /dev/null +++ b/docs/DeepSearchingRequest.md @@ -0,0 +1,36 @@ +# DeepSearchingRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0) | +**period_start** | **str** | Date and time from which you want to specify the start of a time interval. | [optional] +**period_end** | **str** | Date and time from which you want to specify the end of a time interval. | [optional] +**center_latitude** | **str** | Latitude of the center where space research will be carried out. | [optional] +**center_longitude** | **str** | Longitude of the center on which space research will be carried out. | [optional] +**distance** | **str** | Radius of the circle, in meters, on which space research will be carried out. | [optional] +**property_label** | **str** | Property label to search on at the line level. | [optional] +**property_value** | **str** | Property value to be searched at the line level. | [optional] + +## Example + +```python +from scp_udg_client_rest.models.deep_searching_request import DeepSearchingRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DeepSearchingRequest from a JSON string +deep_searching_request_instance = DeepSearchingRequest.from_json(json) +# print the JSON string representation of the object +print(DeepSearchingRequest.to_json()) + +# convert the object into a dict +deep_searching_request_dict = deep_searching_request_instance.to_dict() +# create an instance of DeepSearchingRequest from a dict +deep_searching_request_from_dict = DeepSearchingRequest.from_dict(deep_searching_request_dict) +``` +[[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/IsAlive200Response.md b/docs/IsAlive200Response.md new file mode 100644 index 0000000000000000000000000000000000000000..16d00c6d434e93f4d1880e057ddfb0f7d61e6567 --- /dev/null +++ b/docs/IsAlive200Response.md @@ -0,0 +1,31 @@ +# IsAlive200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | +**message** | **str** | | +**username** | **str** | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.is_alive200_response import IsAlive200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of IsAlive200Response from a JSON string +is_alive200_response_instance = IsAlive200Response.from_json(json) +# print the JSON string representation of the object +print(IsAlive200Response.to_json()) + +# convert the object into a dict +is_alive200_response_dict = is_alive200_response_instance.to_dict() +# create an instance of IsAlive200Response from a dict +is_alive200_response_from_dict = IsAlive200Response.from_dict(is_alive200_response_dict) +``` +[[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/Last200Response.md b/docs/Last200Response.md new file mode 100644 index 0000000000000000000000000000000000000000..ab5136ab601649f0cef0a15b144b0bf81a3616d8 --- /dev/null +++ b/docs/Last200Response.md @@ -0,0 +1,31 @@ +# Last200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | +**message** | **str** | | +**dataset** | [**ScpsUrbandatasetSchema20**](ScpsUrbandatasetSchema20.md) | | + +## Example + +```python +from scp_udg_client_rest.models.last200_response import Last200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of Last200Response from a JSON string +last200_response_instance = Last200Response.from_json(json) +# print the JSON string representation of the object +print(Last200Response.to_json()) + +# convert the object into a dict +last200_response_dict = last200_response_instance.to_dict() +# create an instance of Last200Response from a dict +last200_response_from_dict = Last200Response.from_dict(last200_response_dict) +``` +[[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/LastRequest.md b/docs/LastRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..3f1461412c9225f97c6001b3492877cbfd818a18 --- /dev/null +++ b/docs/LastRequest.md @@ -0,0 +1,29 @@ +# LastRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0) | + +## Example + +```python +from scp_udg_client_rest.models.last_request import LastRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LastRequest from a JSON string +last_request_instance = LastRequest.from_json(json) +# print the JSON string representation of the object +print(LastRequest.to_json()) + +# convert the object into a dict +last_request_dict = last_request_instance.to_dict() +# create an instance of LastRequest from a dict +last_request_from_dict = LastRequest.from_dict(last_request_dict) +``` +[[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/Login200Response.md b/docs/Login200Response.md new file mode 100644 index 0000000000000000000000000000000000000000..311eed37211731716d045ef90e3ace02e60ec0ee --- /dev/null +++ b/docs/Login200Response.md @@ -0,0 +1,31 @@ +# Login200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | +**message** | **str** | | +**token** | **str** | | + +## Example + +```python +from scp_udg_client_rest.models.login200_response import Login200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of Login200Response from a JSON string +login200_response_instance = Login200Response.from_json(json) +# print the JSON string representation of the object +print(Login200Response.to_json()) + +# convert the object into a dict +login200_response_dict = login200_response_instance.to_dict() +# create an instance of Login200Response from a dict +login200_response_from_dict = Login200Response.from_dict(login200_response_dict) +``` +[[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/LoginRequest.md b/docs/LoginRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..19f22be12ca34127c91a104d31558a800efa8079 --- /dev/null +++ b/docs/LoginRequest.md @@ -0,0 +1,30 @@ +# LoginRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | | +**password** | **str** | | + +## Example + +```python +from scp_udg_client_rest.models.login_request import LoginRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginRequest from a JSON string +login_request_instance = LoginRequest.from_json(json) +# print the JSON string representation of the object +print(LoginRequest.to_json()) + +# convert the object into a dict +login_request_dict = login_request_instance.to_dict() +# create an instance of LoginRequest from a dict +login_request_from_dict = LoginRequest.from_dict(login_request_dict) +``` +[[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/Push200Response.md b/docs/Push200Response.md new file mode 100644 index 0000000000000000000000000000000000000000..e828c1396f85f7a38b9fbb654439559110480ea3 --- /dev/null +++ b/docs/Push200Response.md @@ -0,0 +1,31 @@ +# Push200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | +**message** | **str** | | +**detail** | **str** | | + +## Example + +```python +from scp_udg_client_rest.models.push200_response import Push200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of Push200Response from a JSON string +push200_response_instance = Push200Response.from_json(json) +# print the JSON string representation of the object +print(Push200Response.to_json()) + +# convert the object into a dict +push200_response_dict = push200_response_instance.to_dict() +# create an instance of Push200Response from a dict +push200_response_from_dict = Push200Response.from_dict(push200_response_dict) +``` +[[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/PushRequest.md b/docs/PushRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..36876c2f0d5ddd4c0ea9ade873380314875ec0fe --- /dev/null +++ b/docs/PushRequest.md @@ -0,0 +1,30 @@ +# PushRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0) | +**dataset** | [**ScpsUrbandatasetSchema20**](ScpsUrbandatasetSchema20.md) | | + +## Example + +```python +from scp_udg_client_rest.models.push_request import PushRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PushRequest from a JSON string +push_request_instance = PushRequest.from_json(json) +# print the JSON string representation of the object +print(PushRequest.to_json()) + +# convert the object into a dict +push_request_dict = push_request_instance.to_dict() +# create an instance of PushRequest from a dict +push_request_from_dict = PushRequest.from_dict(push_request_dict) +``` +[[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/ScpsUrbandatasetSchema20.md b/docs/ScpsUrbandatasetSchema20.md new file mode 100644 index 0000000000000000000000000000000000000000..ea41b64cc2add3b8420ab0840071cbcd657dae66 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20.md @@ -0,0 +1,29 @@ +# ScpsUrbandatasetSchema20 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**urban_dataset** | [**ScpsUrbandatasetSchema20UrbanDataset**](ScpsUrbandatasetSchema20UrbanDataset.md) | | + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20 import ScpsUrbandatasetSchema20 + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20 from a JSON string +scps_urbandataset_schema20_instance = ScpsUrbandatasetSchema20.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_dict = scps_urbandataset_schema20_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20 from a dict +scps_urbandataset_schema20_from_dict = ScpsUrbandatasetSchema20.from_dict(scps_urbandataset_schema20_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDataset.md b/docs/ScpsUrbandatasetSchema20UrbanDataset.md new file mode 100644 index 0000000000000000000000000000000000000000..67f7c79e2be1cac10339b7118c705bde93f12608 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDataset.md @@ -0,0 +1,31 @@ +# ScpsUrbandatasetSchema20UrbanDataset + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | [**ScpsUrbandatasetSchema20UrbanDatasetContext**](ScpsUrbandatasetSchema20UrbanDatasetContext.md) | | +**specification** | [**ScpsUrbandatasetSchema20UrbanDatasetSpecification**](ScpsUrbandatasetSchema20UrbanDatasetSpecification.md) | | +**values** | [**ScpsUrbandatasetSchema20UrbanDatasetValues**](ScpsUrbandatasetSchema20UrbanDatasetValues.md) | | + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset import ScpsUrbandatasetSchema20UrbanDataset + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDataset from a JSON string +scps_urbandataset_schema20_urban_dataset_instance = ScpsUrbandatasetSchema20UrbanDataset.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDataset.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_dict = scps_urbandataset_schema20_urban_dataset_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDataset from a dict +scps_urbandataset_schema20_urban_dataset_from_dict = ScpsUrbandatasetSchema20UrbanDataset.from_dict(scps_urbandataset_schema20_urban_dataset_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetContext.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetContext.md new file mode 100644 index 0000000000000000000000000000000000000000..9ee44bf9ba1fc7da0f5bca96e83b6fe997cd7ff5 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetContext.md @@ -0,0 +1,34 @@ +# ScpsUrbandatasetSchema20UrbanDatasetContext + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**producer** | [**ScpsUrbandatasetSchema20UrbanDatasetContextProducer**](ScpsUrbandatasetSchema20UrbanDatasetContextProducer.md) | | +**time_zone** | **str** | | +**timestamp** | **str** | | +**coordinates** | [**ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates**](ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.md) | | +**language** | **str** | | [optional] +**note** | **str** | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context import ScpsUrbandatasetSchema20UrbanDatasetContext + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetContext from a JSON string +scps_urbandataset_schema20_urban_dataset_context_instance = ScpsUrbandatasetSchema20UrbanDatasetContext.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetContext.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_context_dict = scps_urbandataset_schema20_urban_dataset_context_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetContext from a dict +scps_urbandataset_schema20_urban_dataset_context_from_dict = ScpsUrbandatasetSchema20UrbanDatasetContext.from_dict(scps_urbandataset_schema20_urban_dataset_context_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.md new file mode 100644 index 0000000000000000000000000000000000000000..784c5c14131b8307298e58ee439851d01b09c42e --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.md @@ -0,0 +1,32 @@ +# ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**format** | **str** | | [optional] +**latitude** | **float** | | +**longitude** | **float** | | +**height** | **float** | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_coordinates import ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates from a JSON string +scps_urbandataset_schema20_urban_dataset_context_coordinates_instance = ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_context_coordinates_dict = scps_urbandataset_schema20_urban_dataset_context_coordinates_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates from a dict +scps_urbandataset_schema20_urban_dataset_context_coordinates_from_dict = ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.from_dict(scps_urbandataset_schema20_urban_dataset_context_coordinates_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetContextProducer.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetContextProducer.md new file mode 100644 index 0000000000000000000000000000000000000000..58dc680c03ef13d4db8db65c934d1568aec8287d --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetContextProducer.md @@ -0,0 +1,30 @@ +# ScpsUrbandatasetSchema20UrbanDatasetContextProducer + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**scheme_id** | **str** | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_producer import ScpsUrbandatasetSchema20UrbanDatasetContextProducer + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextProducer from a JSON string +scps_urbandataset_schema20_urban_dataset_context_producer_instance = ScpsUrbandatasetSchema20UrbanDatasetContextProducer.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetContextProducer.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_context_producer_dict = scps_urbandataset_schema20_urban_dataset_context_producer_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextProducer from a dict +scps_urbandataset_schema20_urban_dataset_context_producer_from_dict = ScpsUrbandatasetSchema20UrbanDatasetContextProducer.from_dict(scps_urbandataset_schema20_urban_dataset_context_producer_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetSpecification.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecification.md new file mode 100644 index 0000000000000000000000000000000000000000..55972130e17f17b94eb92ae7efaa78313de9d672 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecification.md @@ -0,0 +1,33 @@ +# ScpsUrbandatasetSchema20UrbanDatasetSpecification + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **str** | | [optional] +**id** | [**ScpsUrbandatasetSchema20UrbanDatasetSpecificationId**](ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.md) | | +**name** | **str** | | +**uri** | **str** | | +**properties** | [**ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties**](ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.md) | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification import ScpsUrbandatasetSchema20UrbanDatasetSpecification + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecification from a JSON string +scps_urbandataset_schema20_urban_dataset_specification_instance = ScpsUrbandatasetSchema20UrbanDatasetSpecification.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetSpecification.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_specification_dict = scps_urbandataset_schema20_urban_dataset_specification_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecification from a dict +scps_urbandataset_schema20_urban_dataset_specification_from_dict = ScpsUrbandatasetSchema20UrbanDatasetSpecification.from_dict(scps_urbandataset_schema20_urban_dataset_specification_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.md new file mode 100644 index 0000000000000000000000000000000000000000..d80d9d77eb98c6940e447b9d6074236d566c6ec6 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.md @@ -0,0 +1,30 @@ +# ScpsUrbandatasetSchema20UrbanDatasetSpecificationId + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | +**scheme_id** | **str** | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_id import ScpsUrbandatasetSchema20UrbanDatasetSpecificationId + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationId from a JSON string +scps_urbandataset_schema20_urban_dataset_specification_id_instance = ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_specification_id_dict = scps_urbandataset_schema20_urban_dataset_specification_id_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationId from a dict +scps_urbandataset_schema20_urban_dataset_specification_id_from_dict = ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.from_dict(scps_urbandataset_schema20_urban_dataset_specification_id_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.md new file mode 100644 index 0000000000000000000000000000000000000000..07dbd892260aaa7273b4b5c0fd9874d7adb6604d --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.md @@ -0,0 +1,29 @@ +# ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**property_definition** | [**List[ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner]**](ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.md) | | + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties from a JSON string +scps_urbandataset_schema20_urban_dataset_specification_properties_instance = ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_dict = scps_urbandataset_schema20_urban_dataset_specification_properties_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties from a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_from_dict = ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.from_dict(scps_urbandataset_schema20_urban_dataset_specification_properties_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.md new file mode 100644 index 0000000000000000000000000000000000000000..bbd5e81dc73f256d2bfea1ea648005be605ce721 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.md @@ -0,0 +1,35 @@ +# ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**property_name** | **str** | | +**property_description** | **str** | | [optional] +**data_type** | **str** | | [optional] +**code_list** | **str** | | [optional] +**unit_of_measure** | **str** | | [optional] +**measurement_type** | **str** | | [optional] +**sub_properties** | [**ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties**](ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.md) | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner from a JSON string +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_instance = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_dict = scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner from a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_from_dict = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.from_dict(scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.md new file mode 100644 index 0000000000000000000000000000000000000000..ad657781c1cd9f5b2939d6793d3ae22d01625a27 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.md @@ -0,0 +1,28 @@ +# ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot from a JSON string +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not_instance = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not_dict = scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot from a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not_from_dict = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.from_dict(scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.md new file mode 100644 index 0000000000000000000000000000000000000000..e41fd87797d7a4a2226634a82b093da38312a94d --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.md @@ -0,0 +1,29 @@ +# ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**property_name** | **List[str]** | | + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties from a JSON string +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties_instance = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties_dict = scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties from a dict +scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties_from_dict = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties.from_dict(scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetValues.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetValues.md new file mode 100644 index 0000000000000000000000000000000000000000..445a04856bbae839370b693c533d54f85f53c691 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetValues.md @@ -0,0 +1,29 @@ +# ScpsUrbandatasetSchema20UrbanDatasetValues + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line** | [**List[ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner]**](ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.md) | | + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values import ScpsUrbandatasetSchema20UrbanDatasetValues + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValues from a JSON string +scps_urbandataset_schema20_urban_dataset_values_instance = ScpsUrbandatasetSchema20UrbanDatasetValues.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetValues.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_values_dict = scps_urbandataset_schema20_urban_dataset_values_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValues from a dict +scps_urbandataset_schema20_urban_dataset_values_from_dict = ScpsUrbandatasetSchema20UrbanDatasetValues.from_dict(scps_urbandataset_schema20_urban_dataset_values_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.md new file mode 100644 index 0000000000000000000000000000000000000000..ef6cbc51fa744a3086a64a629f1b1b60e7ddfdd9 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.md @@ -0,0 +1,34 @@ +# ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**description** | **str** | | [optional] +**timestamp** | **str** | | [optional] +**coordinates** | [**ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates**](ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.md) | | [optional] +**period** | [**ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod**](ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.md) | | [optional] +**var_property** | [**List[ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner]**](ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.md) | | + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner from a JSON string +scps_urbandataset_schema20_urban_dataset_values_line_inner_instance = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_dict = scps_urbandataset_schema20_urban_dataset_values_line_inner_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner from a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_from_dict = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.from_dict(scps_urbandataset_schema20_urban_dataset_values_line_inner_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.md new file mode 100644 index 0000000000000000000000000000000000000000..e43c847fb38015a32e6863bcdd2e6ce99695a850 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.md @@ -0,0 +1,30 @@ +# ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_ts** | **str** | | +**end_ts** | **str** | | + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_period import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod from a JSON string +scps_urbandataset_schema20_urban_dataset_values_line_inner_period_instance = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_period_dict = scps_urbandataset_schema20_urban_dataset_values_line_inner_period_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod from a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_period_from_dict = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.from_dict(scps_urbandataset_schema20_urban_dataset_values_line_inner_period_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.md new file mode 100644 index 0000000000000000000000000000000000000000..2f36c892f9dd40058580d02511a6e8f9ac741c70 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.md @@ -0,0 +1,31 @@ +# ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**val** | **str** | | [optional] +**var_property** | [**List[ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner]**](ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.md) | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner from a JSON string +scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_instance = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_dict = scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner from a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_from_dict = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.from_dict(scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_dict) +``` +[[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/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.md b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.md new file mode 100644 index 0000000000000000000000000000000000000000..dfc318930494aa098d936361471acd69c50693d9 --- /dev/null +++ b/docs/ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.md @@ -0,0 +1,30 @@ +# ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**val** | **str** | | [optional] + +## Example + +```python +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner from a JSON string +scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner_instance = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.from_json(json) +# print the JSON string representation of the object +print(ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.to_json()) + +# convert the object into a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner_dict = scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner_instance.to_dict() +# create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner from a dict +scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner_from_dict = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner.from_dict(scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner_dict) +``` +[[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/SearchingByPropertyRequest.md b/docs/SearchingByPropertyRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..10fe8e97c9585b4c78b39acef8567cb3c696c6d5 --- /dev/null +++ b/docs/SearchingByPropertyRequest.md @@ -0,0 +1,36 @@ +# SearchingByPropertyRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0) | +**property_name** | **str** | Name of the property being searched | +**property_value** | **str** | Value of the property being searched | +**period_start** | **str** | Date and time from which you want to specify the start of a time interval. | [optional] +**period_end** | **str** | Date and time from which you want to specify the end of a time interval. | [optional] +**center_latitude** | **str** | Latitude of the center where space research will be carried out. | [optional] +**center_longitude** | **str** | Longitude of the center on which space research will be carried out. | [optional] +**distance** | **str** | Radius of the circle, in meters, on which space research will be carried out. | [optional] + +## Example + +```python +from scp_udg_client_rest.models.searching_by_property_request import SearchingByPropertyRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchingByPropertyRequest from a JSON string +searching_by_property_request_instance = SearchingByPropertyRequest.from_json(json) +# print the JSON string representation of the object +print(SearchingByPropertyRequest.to_json()) + +# convert the object into a dict +searching_by_property_request_dict = searching_by_property_request_instance.to_dict() +# create an instance of SearchingByPropertyRequest from a dict +searching_by_property_request_from_dict = SearchingByPropertyRequest.from_dict(searching_by_property_request_dict) +``` +[[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/SearchingRequest.md b/docs/SearchingRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..70e6b19e80b0386b1fc3f475a57af7034802d4dd --- /dev/null +++ b/docs/SearchingRequest.md @@ -0,0 +1,34 @@ +# SearchingRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0) | +**period_start** | **str** | Date and time from which you want to specify the start of a time interval. | [optional] +**period_end** | **str** | Date and time from which you want to specify the end of a time interval. | [optional] +**center_latitude** | **str** | Latitude of the center where space research will be carried out. | [optional] +**center_longitude** | **str** | Longitude of the center on which space research will be carried out. | [optional] +**distance** | **str** | Radius of the circle, in meters, on which space research will be carried out. | [optional] + +## Example + +```python +from scp_udg_client_rest.models.searching_request import SearchingRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchingRequest from a JSON string +searching_request_instance = SearchingRequest.from_json(json) +# print the JSON string representation of the object +print(SearchingRequest.to_json()) + +# convert the object into a dict +searching_request_dict = searching_request_instance.to_dict() +# create an instance of SearchingRequest from a dict +searching_request_from_dict = SearchingRequest.from_dict(searching_request_dict) +``` +[[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/SpecificRequest.md b/docs/SpecificRequest.md new file mode 100644 index 0000000000000000000000000000000000000000..2d3d9e1044c60f8a7d64c0717e4dba560b08830f --- /dev/null +++ b/docs/SpecificRequest.md @@ -0,0 +1,30 @@ +# SpecificRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | | +**timestamp** | **datetime** | | + +## Example + +```python +from scp_udg_client_rest.models.specific_request import SpecificRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SpecificRequest from a JSON string +specific_request_instance = SpecificRequest.from_json(json) +# print the JSON string representation of the object +print(SpecificRequest.to_json()) + +# convert the object into a dict +specific_request_dict = specific_request_instance.to_dict() +# create an instance of SpecificRequest from a dict +specific_request_from_dict = SpecificRequest.from_dict(specific_request_dict) +``` +[[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/TestGet200Response.md b/docs/TestGet200Response.md new file mode 100644 index 0000000000000000000000000000000000000000..9d85a9646ed09f9e1050db0830e6766d0a778458 --- /dev/null +++ b/docs/TestGet200Response.md @@ -0,0 +1,30 @@ +# TestGet200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | +**message** | **str** | | + +## Example + +```python +from scp_udg_client_rest.models.test_get200_response import TestGet200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of TestGet200Response from a JSON string +test_get200_response_instance = TestGet200Response.from_json(json) +# print the JSON string representation of the object +print(TestGet200Response.to_json()) + +# convert the object into a dict +test_get200_response_dict = test_get200_response_instance.to_dict() +# create an instance of TestGet200Response from a dict +test_get200_response_from_dict = TestGet200Response.from_dict(test_get200_response_dict) +``` +[[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/UrbanDatasetGatewayApi.md b/docs/UrbanDatasetGatewayApi.md new file mode 100644 index 0000000000000000000000000000000000000000..a2177b749bfa77c4d0ec5e277b0bf376ee0c322e --- /dev/null +++ b/docs/UrbanDatasetGatewayApi.md @@ -0,0 +1,1010 @@ +# scp_udg_client_rest.UrbanDatasetGatewayApi + +All URIs are relative to *https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**basic**](UrbanDatasetGatewayApi.md#basic) | **POST** /basicRequest | Request an UrbanDataset, through the REQUEST / RESPONSE call, providing the identifier of the resource +[**deep_searching**](UrbanDatasetGatewayApi.md#deep_searching) | **POST** /deepSearchingRequest | Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at line level (elements of specification of the dataset value records, present in the format); with all optional parameters set to null, it achieves the same result as a basic Request +[**delete**](UrbanDatasetGatewayApi.md#delete) | **POST** /delete | Delete a particular UrbanDataset, providing the resource identifier and the specific generation timestamp +[**is_alive**](UrbanDatasetGatewayApi.md#is_alive) | **POST** /isAlive | Verify that the token is still valid +[**last**](UrbanDatasetGatewayApi.md#last) | **POST** /lastRequest | Request the last UrbanDataset generated through a REQUEST / RESPONSE call +[**login**](UrbanDatasetGatewayApi.md#login) | **POST** /login | Authenticate with the service that exposes this method through username and password, receiving in response a token that will use in subsequent calls +[**logout**](UrbanDatasetGatewayApi.md#logout) | **POST** /logout | Cancel authentication at the service that exposes this method making the token received in the previous login call invalid +[**push**](UrbanDatasetGatewayApi.md#push) | **POST** /push | Send an UrbanDataset via the PUSH call +[**searching**](UrbanDatasetGatewayApi.md#searching) | **POST** /searchingRequest | Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); with all optional parameters set to null, it achieves the same result as a basic Request +[**searching_by_property**](UrbanDatasetGatewayApi.md#searching_by_property) | **POST** /searchingByPropertyRequest | Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); searching among the UD properties that one is matching with the input property +[**specific**](UrbanDatasetGatewayApi.md#specific) | **POST** /specificRequest | Request a particular UrbanDataset, through a REQUEST / RESPONSE call, providing the identifier of the resource and the specific generation timestamp +[**test**](UrbanDatasetGatewayApi.md#test) | **POST** /test | Test the presence of the web service +[**test_get**](UrbanDatasetGatewayApi.md#test_get) | **GET** /test | Test the presence of the web service + + +# **basic** +> Basic200Response basic(basic_request=basic_request) + +Request an UrbanDataset, through the REQUEST / RESPONSE call, providing the identifier of the resource + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.basic200_response import Basic200Response +from scp_udg_client_rest.models.basic_request import BasicRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + basic_request = scp_udg_client_rest.BasicRequest() # BasicRequest | (optional) + + try: + # Request an UrbanDataset, through the REQUEST / RESPONSE call, providing the identifier of the resource + api_response = api_instance.basic(basic_request=basic_request) + print("The response of UrbanDatasetGatewayApi->basic:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->basic: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **basic_request** | [**BasicRequest**](BasicRequest.md)| | [optional] + +### Return type + +[**Basic200Response**](Basic200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **deep_searching** +> Basic200Response deep_searching(deep_searching_request=deep_searching_request) + +Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at line level (elements of specification of the dataset value records, present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.basic200_response import Basic200Response +from scp_udg_client_rest.models.deep_searching_request import DeepSearchingRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + deep_searching_request = scp_udg_client_rest.DeepSearchingRequest() # DeepSearchingRequest | (optional) + + try: + # Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at line level (elements of specification of the dataset value records, present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + api_response = api_instance.deep_searching(deep_searching_request=deep_searching_request) + print("The response of UrbanDatasetGatewayApi->deep_searching:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->deep_searching: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deep_searching_request** | [**DeepSearchingRequest**](DeepSearchingRequest.md)| | [optional] + +### Return type + +[**Basic200Response**](Basic200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **delete** +> TestGet200Response delete(specific_request=specific_request) + +Delete a particular UrbanDataset, providing the resource identifier and the specific generation timestamp + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.specific_request import SpecificRequest +from scp_udg_client_rest.models.test_get200_response import TestGet200Response +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + specific_request = scp_udg_client_rest.SpecificRequest() # SpecificRequest | (optional) + + try: + # Delete a particular UrbanDataset, providing the resource identifier and the specific generation timestamp + api_response = api_instance.delete(specific_request=specific_request) + print("The response of UrbanDatasetGatewayApi->delete:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **specific_request** | [**SpecificRequest**](SpecificRequest.md)| | [optional] + +### Return type + +[**TestGet200Response**](TestGet200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **is_alive** +> IsAlive200Response is_alive(body=body) + +Verify that the token is still valid + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.is_alive200_response import IsAlive200Response +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + body = 'body_example' # str | (optional) + + try: + # Verify that the token is still valid + api_response = api_instance.is_alive(body=body) + print("The response of UrbanDatasetGatewayApi->is_alive:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->is_alive: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| | [optional] + +### Return type + +[**IsAlive200Response**](IsAlive200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **last** +> Last200Response last(last_request) + +Request the last UrbanDataset generated through a REQUEST / RESPONSE call + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.last200_response import Last200Response +from scp_udg_client_rest.models.last_request import LastRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + last_request = {"resource_id":"SCP-1_SmartBuildingCasaccia-3_SmartBuildingAnomalies-1.0_20180125120000"} # LastRequest | + + try: + # Request the last UrbanDataset generated through a REQUEST / RESPONSE call + api_response = api_instance.last(last_request) + print("The response of UrbanDatasetGatewayApi->last:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->last: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **last_request** | [**LastRequest**](LastRequest.md)| | + +### Return type + +[**Last200Response**](Last200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **login** +> Login200Response login(login_request) + +Authenticate with the service that exposes this method through username and password, receiving in response a token that will use in subsequent calls + + + +### Example + + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.login200_response import Login200Response +from scp_udg_client_rest.models.login_request import LoginRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + login_request = scp_udg_client_rest.LoginRequest() # LoginRequest | + + try: + # Authenticate with the service that exposes this method through username and password, receiving in response a token that will use in subsequent calls + api_response = api_instance.login(login_request) + print("The response of UrbanDatasetGatewayApi->login:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->login: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **login_request** | [**LoginRequest**](LoginRequest.md)| | + +### Return type + +[**Login200Response**](Login200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **logout** +> TestGet200Response logout(body=body) + +Cancel authentication at the service that exposes this method making the token received in the previous login call invalid + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.test_get200_response import TestGet200Response +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + body = 'body_example' # str | (optional) + + try: + # Cancel authentication at the service that exposes this method making the token received in the previous login call invalid + api_response = api_instance.logout(body=body) + print("The response of UrbanDatasetGatewayApi->logout:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->logout: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| | [optional] + +### Return type + +[**TestGet200Response**](TestGet200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **push** +> Push200Response push(push_request) + +Send an UrbanDataset via the PUSH call + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.push200_response import Push200Response +from scp_udg_client_rest.models.push_request import PushRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + push_request = scp_udg_client_rest.PushRequest() # PushRequest | + + try: + # Send an UrbanDataset via the PUSH call + api_response = api_instance.push(push_request) + print("The response of UrbanDatasetGatewayApi->push:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->push: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **push_request** | [**PushRequest**](PushRequest.md)| | + +### Return type + +[**Push200Response**](Push200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The fields [CODE], [MSG] and [DETAIL] take specific values depending on the type of error/detail found | - | + +[[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) + +# **searching** +> Basic200Response searching(searching_request) + +Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.basic200_response import Basic200Response +from scp_udg_client_rest.models.searching_request import SearchingRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + searching_request = {"resource_id":"SCP-1_SmartBuildingCasaccia-3_SmartBuildingAnomalies-1.0_20180125120000"} # SearchingRequest | + + try: + # Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + api_response = api_instance.searching(searching_request) + print("The response of UrbanDatasetGatewayApi->searching:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->searching: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **searching_request** | [**SearchingRequest**](SearchingRequest.md)| | + +### Return type + +[**Basic200Response**](Basic200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **searching_by_property** +> Basic200Response searching_by_property(searching_by_property_request=searching_by_property_request) + +Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); searching among the UD properties that one is matching with the input property + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.basic200_response import Basic200Response +from scp_udg_client_rest.models.searching_by_property_request import SearchingByPropertyRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + searching_by_property_request = scp_udg_client_rest.SearchingByPropertyRequest() # SearchingByPropertyRequest | (optional) + + try: + # Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); searching among the UD properties that one is matching with the input property + api_response = api_instance.searching_by_property(searching_by_property_request=searching_by_property_request) + print("The response of UrbanDatasetGatewayApi->searching_by_property:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->searching_by_property: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **searching_by_property_request** | [**SearchingByPropertyRequest**](SearchingByPropertyRequest.md)| | [optional] + +### Return type + +[**Basic200Response**](Basic200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **specific** +> Last200Response specific(specific_request=specific_request) + +Request a particular UrbanDataset, through a REQUEST / RESPONSE call, providing the identifier of the resource and the specific generation timestamp + + + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.last200_response import Last200Response +from scp_udg_client_rest.models.specific_request import SpecificRequest +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scp_udg_client_rest.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + specific_request = scp_udg_client_rest.SpecificRequest() # SpecificRequest | (optional) + + try: + # Request a particular UrbanDataset, through a REQUEST / RESPONSE call, providing the identifier of the resource and the specific generation timestamp + api_response = api_instance.specific(specific_request=specific_request) + print("The response of UrbanDatasetGatewayApi->specific:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->specific: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **specific_request** | [**SpecificRequest**](SpecificRequest.md)| | [optional] + +### Return type + +[**Last200Response**](Last200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **test** +> TestGet200Response test(body=body) + +Test the presence of the web service + + + +### Example + + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.test_get200_response import TestGet200Response +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + body = 'body_example' # str | (optional) + + try: + # Test the presence of the web service + api_response = api_instance.test(body=body) + print("The response of UrbanDatasetGatewayApi->test:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->test: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| | [optional] + +### Return type + +[**TestGet200Response**](TestGet200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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) + +# **test_get** +> TestGet200Response test_get() + +Test the presence of the web service + + + +### Example + + +```python +import scp_udg_client_rest +from scp_udg_client_rest.models.test_get200_response import TestGet200Response +from scp_udg_client_rest.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway +# See configuration.py for a list of all supported configuration parameters. +configuration = scp_udg_client_rest.Configuration( + host = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" +) + + +# Enter a context with an instance of the API client +with scp_udg_client_rest.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scp_udg_client_rest.UrbanDatasetGatewayApi(api_client) + + try: + # Test the presence of the web service + api_response = api_instance.test_get() + print("The response of UrbanDatasetGatewayApi->test_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UrbanDatasetGatewayApi->test_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**TestGet200Response**](TestGet200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[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 new file mode 100644 index 0000000000000000000000000000000000000000..577b60f4135bdd9433c5efa9a0498bf3759411b9 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/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-petstore-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="crossserv.bologna.enea.it/gitlab" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="cross" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="scp_udg_client_python_rest" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..97b6588259bfa80585123e2cc480b44c8fb19e3e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[tool.poetry] +name = "scp_udg_client_rest" +version = "1.0.0" +description = "UrbanDatasetGateway - OpenAPI 3.0" +authors = ["Tito Brasolin "] +license = "Apache 2.0" +readme = "README.md" +repository = "https://github.com/cross/scp_udg_client_python_rest" +keywords = ["OpenAPI", "OpenAPI-Generator", "UrbanDatasetGateway - OpenAPI 3.0"] +include = ["scp_udg_client_rest/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "scp_udg_client_rest", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..cc85509ec516346ca9756bc6e557a2963203a040 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/scp_udg_client_rest/__init__.py b/scp_udg_client_rest/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..656a467c9ba00175687aac4dadaf48c5e98b3438 --- /dev/null +++ b/scp_udg_client_rest/__init__.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +# flake8: noqa + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# import apis into sdk package +from scp_udg_client_rest.api.urban_dataset_gateway_api import UrbanDatasetGatewayApi + +# import ApiClient +from scp_udg_client_rest.api_response import ApiResponse +from scp_udg_client_rest.api_client import ApiClient +from scp_udg_client_rest.configuration import Configuration +from scp_udg_client_rest.exceptions import OpenApiException +from scp_udg_client_rest.exceptions import ApiTypeError +from scp_udg_client_rest.exceptions import ApiValueError +from scp_udg_client_rest.exceptions import ApiKeyError +from scp_udg_client_rest.exceptions import ApiAttributeError +from scp_udg_client_rest.exceptions import ApiException + +# import models into sdk package +from scp_udg_client_rest.models.basic200_response import Basic200Response +from scp_udg_client_rest.models.basic_request import BasicRequest +from scp_udg_client_rest.models.deep_searching_request import DeepSearchingRequest +from scp_udg_client_rest.models.is_alive200_response import IsAlive200Response +from scp_udg_client_rest.models.last200_response import Last200Response +from scp_udg_client_rest.models.last_request import LastRequest +from scp_udg_client_rest.models.login200_response import Login200Response +from scp_udg_client_rest.models.login_request import LoginRequest +from scp_udg_client_rest.models.push200_response import Push200Response +from scp_udg_client_rest.models.push_request import PushRequest +from scp_udg_client_rest.models.scps_urbandataset_schema20 import ScpsUrbandatasetSchema20 +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset import ScpsUrbandatasetSchema20UrbanDataset +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context import ScpsUrbandatasetSchema20UrbanDatasetContext +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_coordinates import ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_producer import ScpsUrbandatasetSchema20UrbanDatasetContextProducer +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification import ScpsUrbandatasetSchema20UrbanDatasetSpecification +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_id import ScpsUrbandatasetSchema20UrbanDatasetSpecificationId +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values import ScpsUrbandatasetSchema20UrbanDatasetValues +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_period import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner +from scp_udg_client_rest.models.searching_by_property_request import SearchingByPropertyRequest +from scp_udg_client_rest.models.searching_request import SearchingRequest +from scp_udg_client_rest.models.specific_request import SpecificRequest +from scp_udg_client_rest.models.test_get200_response import TestGet200Response diff --git a/scp_udg_client_rest/api/__init__.py b/scp_udg_client_rest/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..add8c363f1d5c7cde870becc640018e3e4f0f1f0 --- /dev/null +++ b/scp_udg_client_rest/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from scp_udg_client_rest.api.urban_dataset_gateway_api import UrbanDatasetGatewayApi + diff --git a/scp_udg_client_rest/api/urban_dataset_gateway_api.py b/scp_udg_client_rest/api/urban_dataset_gateway_api.py new file mode 100644 index 0000000000000000000000000000000000000000..60ea64ae73267e2a437f62fe6f43ea93f2ad293f --- /dev/null +++ b/scp_udg_client_rest/api/urban_dataset_gateway_api.py @@ -0,0 +1,3557 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Optional +from scp_udg_client_rest.models.basic200_response import Basic200Response +from scp_udg_client_rest.models.basic_request import BasicRequest +from scp_udg_client_rest.models.deep_searching_request import DeepSearchingRequest +from scp_udg_client_rest.models.is_alive200_response import IsAlive200Response +from scp_udg_client_rest.models.last200_response import Last200Response +from scp_udg_client_rest.models.last_request import LastRequest +from scp_udg_client_rest.models.login200_response import Login200Response +from scp_udg_client_rest.models.login_request import LoginRequest +from scp_udg_client_rest.models.push200_response import Push200Response +from scp_udg_client_rest.models.push_request import PushRequest +from scp_udg_client_rest.models.searching_by_property_request import SearchingByPropertyRequest +from scp_udg_client_rest.models.searching_request import SearchingRequest +from scp_udg_client_rest.models.specific_request import SpecificRequest +from scp_udg_client_rest.models.test_get200_response import TestGet200Response + +from scp_udg_client_rest.api_client import ApiClient, RequestSerialized +from scp_udg_client_rest.api_response import ApiResponse +from scp_udg_client_rest.rest import RESTResponseType + + +class UrbanDatasetGatewayApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def basic( + self, + basic_request: Optional[BasicRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Basic200Response: + """Request an UrbanDataset, through the REQUEST / RESPONSE call, providing the identifier of the resource + + + + :param basic_request: + :type basic_request: BasicRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._basic_serialize( + basic_request=basic_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def basic_with_http_info( + self, + basic_request: Optional[BasicRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Basic200Response]: + """Request an UrbanDataset, through the REQUEST / RESPONSE call, providing the identifier of the resource + + + + :param basic_request: + :type basic_request: BasicRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._basic_serialize( + basic_request=basic_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def basic_without_preload_content( + self, + basic_request: Optional[BasicRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request an UrbanDataset, through the REQUEST / RESPONSE call, providing the identifier of the resource + + + + :param basic_request: + :type basic_request: BasicRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._basic_serialize( + basic_request=basic_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _basic_serialize( + self, + basic_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if basic_request is not None: + _body_params = basic_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/basicRequest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def deep_searching( + self, + deep_searching_request: Optional[DeepSearchingRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Basic200Response: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at line level (elements of specification of the dataset value records, present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + + :param deep_searching_request: + :type deep_searching_request: DeepSearchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._deep_searching_serialize( + deep_searching_request=deep_searching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def deep_searching_with_http_info( + self, + deep_searching_request: Optional[DeepSearchingRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Basic200Response]: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at line level (elements of specification of the dataset value records, present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + + :param deep_searching_request: + :type deep_searching_request: DeepSearchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._deep_searching_serialize( + deep_searching_request=deep_searching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def deep_searching_without_preload_content( + self, + deep_searching_request: Optional[DeepSearchingRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at line level (elements of specification of the dataset value records, present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + + :param deep_searching_request: + :type deep_searching_request: DeepSearchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._deep_searching_serialize( + deep_searching_request=deep_searching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _deep_searching_serialize( + self, + deep_searching_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if deep_searching_request is not None: + _body_params = deep_searching_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/deepSearchingRequest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete( + self, + specific_request: Optional[SpecificRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TestGet200Response: + """Delete a particular UrbanDataset, providing the resource identifier and the specific generation timestamp + + + + :param specific_request: + :type specific_request: SpecificRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_serialize( + specific_request=specific_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_with_http_info( + self, + specific_request: Optional[SpecificRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TestGet200Response]: + """Delete a particular UrbanDataset, providing the resource identifier and the specific generation timestamp + + + + :param specific_request: + :type specific_request: SpecificRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_serialize( + specific_request=specific_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_without_preload_content( + self, + specific_request: Optional[SpecificRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a particular UrbanDataset, providing the resource identifier and the specific generation timestamp + + + + :param specific_request: + :type specific_request: SpecificRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_serialize( + specific_request=specific_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_serialize( + self, + specific_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if specific_request is not None: + _body_params = specific_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/delete', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def is_alive( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IsAlive200Response: + """Verify that the token is still valid + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._is_alive_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IsAlive200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def is_alive_with_http_info( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IsAlive200Response]: + """Verify that the token is still valid + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._is_alive_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IsAlive200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def is_alive_without_preload_content( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Verify that the token is still valid + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._is_alive_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IsAlive200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _is_alive_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/isAlive', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def last( + self, + last_request: LastRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Last200Response: + """Request the last UrbanDataset generated through a REQUEST / RESPONSE call + + + + :param last_request: (required) + :type last_request: LastRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._last_serialize( + last_request=last_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Last200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def last_with_http_info( + self, + last_request: LastRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Last200Response]: + """Request the last UrbanDataset generated through a REQUEST / RESPONSE call + + + + :param last_request: (required) + :type last_request: LastRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._last_serialize( + last_request=last_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Last200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def last_without_preload_content( + self, + last_request: LastRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request the last UrbanDataset generated through a REQUEST / RESPONSE call + + + + :param last_request: (required) + :type last_request: LastRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._last_serialize( + last_request=last_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Last200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _last_serialize( + self, + last_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if last_request is not None: + _body_params = last_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/lastRequest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def login( + self, + login_request: LoginRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Login200Response: + """Authenticate with the service that exposes this method through username and password, receiving in response a token that will use in subsequent calls + + + + :param login_request: (required) + :type login_request: LoginRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_serialize( + login_request=login_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_with_http_info( + self, + login_request: LoginRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Login200Response]: + """Authenticate with the service that exposes this method through username and password, receiving in response a token that will use in subsequent calls + + + + :param login_request: (required) + :type login_request: LoginRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_serialize( + login_request=login_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def login_without_preload_content( + self, + login_request: LoginRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Authenticate with the service that exposes this method through username and password, receiving in response a token that will use in subsequent calls + + + + :param login_request: (required) + :type login_request: LoginRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_serialize( + login_request=login_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _login_serialize( + self, + login_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if login_request is not None: + _body_params = login_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def logout( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TestGet200Response: + """Cancel authentication at the service that exposes this method making the token received in the previous login call invalid + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logout_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def logout_with_http_info( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TestGet200Response]: + """Cancel authentication at the service that exposes this method making the token received in the previous login call invalid + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logout_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def logout_without_preload_content( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel authentication at the service that exposes this method making the token received in the previous login call invalid + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logout_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _logout_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/logout', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def push( + self, + push_request: PushRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Push200Response: + """Send an UrbanDataset via the PUSH call + + + + :param push_request: (required) + :type push_request: PushRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._push_serialize( + push_request=push_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Push200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def push_with_http_info( + self, + push_request: PushRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Push200Response]: + """Send an UrbanDataset via the PUSH call + + + + :param push_request: (required) + :type push_request: PushRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._push_serialize( + push_request=push_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Push200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def push_without_preload_content( + self, + push_request: PushRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send an UrbanDataset via the PUSH call + + + + :param push_request: (required) + :type push_request: PushRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._push_serialize( + push_request=push_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Push200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _push_serialize( + self, + push_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if push_request is not None: + _body_params = push_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/push', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def searching( + self, + searching_request: SearchingRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Basic200Response: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + + :param searching_request: (required) + :type searching_request: SearchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._searching_serialize( + searching_request=searching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def searching_with_http_info( + self, + searching_request: SearchingRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Basic200Response]: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + + :param searching_request: (required) + :type searching_request: SearchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._searching_serialize( + searching_request=searching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def searching_without_preload_content( + self, + searching_request: SearchingRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + + + + :param searching_request: (required) + :type searching_request: SearchingRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._searching_serialize( + searching_request=searching_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _searching_serialize( + self, + searching_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if searching_request is not None: + _body_params = searching_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/searchingRequest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def searching_by_property( + self, + searching_by_property_request: Optional[SearchingByPropertyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Basic200Response: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); searching among the UD properties that one is matching with the input property + + + + :param searching_by_property_request: + :type searching_by_property_request: SearchingByPropertyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._searching_by_property_serialize( + searching_by_property_request=searching_by_property_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def searching_by_property_with_http_info( + self, + searching_by_property_request: Optional[SearchingByPropertyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Basic200Response]: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); searching among the UD properties that one is matching with the input property + + + + :param searching_by_property_request: + :type searching_by_property_request: SearchingByPropertyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._searching_by_property_serialize( + searching_by_property_request=searching_by_property_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def searching_by_property_without_preload_content( + self, + searching_by_property_request: Optional[SearchingByPropertyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); searching among the UD properties that one is matching with the input property + + + + :param searching_by_property_request: + :type searching_by_property_request: SearchingByPropertyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._searching_by_property_serialize( + searching_by_property_request=searching_by_property_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Basic200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _searching_by_property_serialize( + self, + searching_by_property_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if searching_by_property_request is not None: + _body_params = searching_by_property_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/searchingByPropertyRequest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def specific( + self, + specific_request: Optional[SpecificRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Last200Response: + """Request a particular UrbanDataset, through a REQUEST / RESPONSE call, providing the identifier of the resource and the specific generation timestamp + + + + :param specific_request: + :type specific_request: SpecificRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._specific_serialize( + specific_request=specific_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Last200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def specific_with_http_info( + self, + specific_request: Optional[SpecificRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Last200Response]: + """Request a particular UrbanDataset, through a REQUEST / RESPONSE call, providing the identifier of the resource and the specific generation timestamp + + + + :param specific_request: + :type specific_request: SpecificRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._specific_serialize( + specific_request=specific_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Last200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def specific_without_preload_content( + self, + specific_request: Optional[SpecificRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request a particular UrbanDataset, through a REQUEST / RESPONSE call, providing the identifier of the resource and the specific generation timestamp + + + + :param specific_request: + :type specific_request: SpecificRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._specific_serialize( + specific_request=specific_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Last200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _specific_serialize( + self, + specific_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if specific_request is not None: + _body_params = specific_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/specificRequest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def test( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TestGet200Response: + """Test the presence of the web service + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def test_with_http_info( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TestGet200Response]: + """Test the presence of the web service + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def test_without_preload_content( + self, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Test the presence of the web service + + + + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/test', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def test_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TestGet200Response: + """Test the presence of the web service + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def test_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TestGet200Response]: + """Test the presence of the web service + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def test_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Test the presence of the web service + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TestGet200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/test', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/scp_udg_client_rest/api_client.py b/scp_udg_client_rest/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..15b9f4d4e3f7a40068014f4e0097d337e8ee66ce --- /dev/null +++ b/scp_udg_client_rest/api_client.py @@ -0,0 +1,782 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from scp_udg_client_rest.configuration import Configuration +from scp_udg_client_rest.api_response import ApiResponse, T as ApiResponseT +import scp_udg_client_rest.models +from scp_udg_client_rest import rest +from scp_udg_client_rest.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + 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 __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or 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 + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(scp_udg_client_rest.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files: Dict[str, Union[str, bytes]]): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/scp_udg_client_rest/api_response.py b/scp_udg_client_rest/api_response.py new file mode 100644 index 0000000000000000000000000000000000000000..9bc7c11f6b9f3fd7d144275aabe7082a7b83bfc5 --- /dev/null +++ b/scp_udg_client_rest/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/scp_udg_client_rest/configuration.py b/scp_udg_client_rest/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..285fdbb78cde4d95bac3cc19bfc8c61f87fdd96b --- /dev/null +++ b/scp_udg_client_rest/configuration.py @@ -0,0 +1,460 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import logging +from logging import FileHandler +import multiprocessing +import sys +from typing import Optional +import urllib3 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :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 access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + + :Example: + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, + ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None + ) -> None: + """Constructor + """ + self._base_path = "https://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + 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 + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("scp_udg_client_rest") + 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: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + 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 = ssl_ca_cert + """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.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + 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: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @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 self.logger.items(): + 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 self.logger.items(): + 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 self.logger.items(): + 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, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative 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, self.api_key.get(alias) if alias is not None else None) + 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 self.access_token is not None: + auth['bearerAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + 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://scp-casaccia.bologna.enea.it:8443/webservices/rest/UrbanDatasetGateway", + 'description': "SCP-Casaccia", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=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 + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + 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.get('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 + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/scp_udg_client_rest/exceptions.py b/scp_udg_client_rest/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..8ccad0e8024a3208af0239a43948e5fb25e16cf1 --- /dev/null +++ b/scp_udg_client_rest/exceptions.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +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) -> 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) -> 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 ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + 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(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> 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, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + 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.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/scp_udg_client_rest/models/__init__.py b/scp_udg_client_rest/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8f0df0e7c6bb21f456957ba25d08f24df841bdd1 --- /dev/null +++ b/scp_udg_client_rest/models/__init__.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +# flake8: noqa +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from scp_udg_client_rest.models.basic200_response import Basic200Response +from scp_udg_client_rest.models.basic_request import BasicRequest +from scp_udg_client_rest.models.deep_searching_request import DeepSearchingRequest +from scp_udg_client_rest.models.is_alive200_response import IsAlive200Response +from scp_udg_client_rest.models.last200_response import Last200Response +from scp_udg_client_rest.models.last_request import LastRequest +from scp_udg_client_rest.models.login200_response import Login200Response +from scp_udg_client_rest.models.login_request import LoginRequest +from scp_udg_client_rest.models.push200_response import Push200Response +from scp_udg_client_rest.models.push_request import PushRequest +from scp_udg_client_rest.models.scps_urbandataset_schema20 import ScpsUrbandatasetSchema20 +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset import ScpsUrbandatasetSchema20UrbanDataset +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context import ScpsUrbandatasetSchema20UrbanDatasetContext +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_coordinates import ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_producer import ScpsUrbandatasetSchema20UrbanDatasetContextProducer +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification import ScpsUrbandatasetSchema20UrbanDatasetSpecification +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_id import ScpsUrbandatasetSchema20UrbanDatasetSpecificationId +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values import ScpsUrbandatasetSchema20UrbanDatasetValues +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_period import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner +from scp_udg_client_rest.models.searching_by_property_request import SearchingByPropertyRequest +from scp_udg_client_rest.models.searching_request import SearchingRequest +from scp_udg_client_rest.models.specific_request import SpecificRequest +from scp_udg_client_rest.models.test_get200_response import TestGet200Response diff --git a/scp_udg_client_rest/models/basic200_response.py b/scp_udg_client_rest/models/basic200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..ab1bdf6c343284150fc1e6f675662cfb2b71e5cb --- /dev/null +++ b/scp_udg_client_rest/models/basic200_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from scp_udg_client_rest.models.scps_urbandataset_schema20 import ScpsUrbandatasetSchema20 +from typing import Optional, Set +from typing_extensions import Self + +class Basic200Response(BaseModel): + """ + Basic200Response + """ # noqa: E501 + code: StrictStr + message: StrictStr + dataset: List[ScpsUrbandatasetSchema20] = Field(description="An array of one or more UrbanDatasets, according to the SCPS Information 2.0 specification.") + __properties: ClassVar[List[str]] = ["code", "message", "dataset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Basic200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in dataset (list) + _items = [] + if self.dataset: + for _item in self.dataset: + if _item: + _items.append(_item.to_dict()) + _dict['dataset'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Basic200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "dataset": [ScpsUrbandatasetSchema20.from_dict(_item) for _item in obj["dataset"]] if obj.get("dataset") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/basic_request.py b/scp_udg_client_rest/models/basic_request.py new file mode 100644 index 0000000000000000000000000000000000000000..e884772e57849be6c695d6b7206529601ede3784 --- /dev/null +++ b/scp_udg_client_rest/models/basic_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class BasicRequest(BaseModel): + """ + BasicRequest + """ # noqa: E501 + resource_id: StrictStr + __properties: ClassVar[List[str]] = ["resource_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BasicRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BasicRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/deep_searching_request.py b/scp_udg_client_rest/models/deep_searching_request.py new file mode 100644 index 0000000000000000000000000000000000000000..8d33981813ff74d01f43451aaccc480003abbf0e --- /dev/null +++ b/scp_udg_client_rest/models/deep_searching_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DeepSearchingRequest(BaseModel): + """ + DeepSearchingRequest + """ # noqa: E501 + resource_id: StrictStr = Field(description="Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0)") + period_start: Optional[StrictStr] = Field(default=None, description="Date and time from which you want to specify the start of a time interval.") + period_end: Optional[StrictStr] = Field(default=None, description="Date and time from which you want to specify the end of a time interval.") + center_latitude: Optional[StrictStr] = Field(default=None, description="Latitude of the center where space research will be carried out.") + center_longitude: Optional[StrictStr] = Field(default=None, description="Longitude of the center on which space research will be carried out.") + distance: Optional[StrictStr] = Field(default=None, description="Radius of the circle, in meters, on which space research will be carried out.") + property_label: Optional[StrictStr] = Field(default=None, description="Property label to search on at the line level.") + property_value: Optional[StrictStr] = Field(default=None, description="Property value to be searched at the line level.") + __properties: ClassVar[List[str]] = ["resource_id", "period_start", "period_end", "center_latitude", "center_longitude", "distance", "property_label", "property_value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeepSearchingRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeepSearchingRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id"), + "period_start": obj.get("period_start"), + "period_end": obj.get("period_end"), + "center_latitude": obj.get("center_latitude"), + "center_longitude": obj.get("center_longitude"), + "distance": obj.get("distance"), + "property_label": obj.get("property_label"), + "property_value": obj.get("property_value") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/is_alive200_response.py b/scp_udg_client_rest/models/is_alive200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..74bca9be91eb750998c16b334aa6eef72919c453 --- /dev/null +++ b/scp_udg_client_rest/models/is_alive200_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class IsAlive200Response(BaseModel): + """ + IsAlive200Response + """ # noqa: E501 + code: StrictStr + message: StrictStr + username: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["code", "message", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IsAlive200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IsAlive200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "username": obj.get("username") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/last200_response.py b/scp_udg_client_rest/models/last200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..d19838f63acfea04c0da4821cd8780e720afd895 --- /dev/null +++ b/scp_udg_client_rest/models/last200_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from scp_udg_client_rest.models.scps_urbandataset_schema20 import ScpsUrbandatasetSchema20 +from typing import Optional, Set +from typing_extensions import Self + +class Last200Response(BaseModel): + """ + Last200Response + """ # noqa: E501 + code: StrictStr + message: StrictStr + dataset: ScpsUrbandatasetSchema20 + __properties: ClassVar[List[str]] = ["code", "message", "dataset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Last200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of dataset + if self.dataset: + _dict['dataset'] = self.dataset.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Last200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "dataset": ScpsUrbandatasetSchema20.from_dict(obj["dataset"]) if obj.get("dataset") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/last_request.py b/scp_udg_client_rest/models/last_request.py new file mode 100644 index 0000000000000000000000000000000000000000..ec01feeb57d1cc78ad2db4213d4e88db318227d2 --- /dev/null +++ b/scp_udg_client_rest/models/last_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class LastRequest(BaseModel): + """ + LastRequest + """ # noqa: E501 + resource_id: StrictStr = Field(description="Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0)") + __properties: ClassVar[List[str]] = ["resource_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LastRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LastRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/login200_response.py b/scp_udg_client_rest/models/login200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..92026acdd21a1d1b0a33d1eb0395bff6911aa245 --- /dev/null +++ b/scp_udg_client_rest/models/login200_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Login200Response(BaseModel): + """ + Login200Response + """ # noqa: E501 + code: StrictStr + message: StrictStr + token: StrictStr + __properties: ClassVar[List[str]] = ["code", "message", "token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Login200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Login200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "token": obj.get("token") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/login_request.py b/scp_udg_client_rest/models/login_request.py new file mode 100644 index 0000000000000000000000000000000000000000..b934deffc309e1fed5061de4a886d7ea6b612f3c --- /dev/null +++ b/scp_udg_client_rest/models/login_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class LoginRequest(BaseModel): + """ + LoginRequest + """ # noqa: E501 + username: StrictStr + password: StrictStr + __properties: ClassVar[List[str]] = ["username", "password"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoginRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LoginRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/push200_response.py b/scp_udg_client_rest/models/push200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..88f0476c792261b0411afb4f7ea086500519b6c8 --- /dev/null +++ b/scp_udg_client_rest/models/push200_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Push200Response(BaseModel): + """ + Push200Response + """ # noqa: E501 + code: StrictStr + message: StrictStr + detail: StrictStr + __properties: ClassVar[List[str]] = ["code", "message", "detail"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Push200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Push200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "detail": obj.get("detail") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/push_request.py b/scp_udg_client_rest/models/push_request.py new file mode 100644 index 0000000000000000000000000000000000000000..b269068acf1f92c4bad3920de002d77df7b8b968 --- /dev/null +++ b/scp_udg_client_rest/models/push_request.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from scp_udg_client_rest.models.scps_urbandataset_schema20 import ScpsUrbandatasetSchema20 +from typing import Optional, Set +from typing_extensions import Self + +class PushRequest(BaseModel): + """ + PushRequest + """ # noqa: E501 + resource_id: StrictStr = Field(description="Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0)") + dataset: ScpsUrbandatasetSchema20 + __properties: ClassVar[List[str]] = ["resource_id", "dataset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PushRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of dataset + if self.dataset: + _dict['dataset'] = self.dataset.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PushRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id"), + "dataset": ScpsUrbandatasetSchema20.from_dict(obj["dataset"]) if obj.get("dataset") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20.py b/scp_udg_client_rest/models/scps_urbandataset_schema20.py new file mode 100644 index 0000000000000000000000000000000000000000..76899ac1a5a6761e7a68e2e2355e3912bdd17ae0 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset import ScpsUrbandatasetSchema20UrbanDataset +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20(BaseModel): + """ + ScpsUrbandatasetSchema20 + """ # noqa: E501 + urban_dataset: ScpsUrbandatasetSchema20UrbanDataset = Field(alias="UrbanDataset") + __properties: ClassVar[List[str]] = ["UrbanDataset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of urban_dataset + if self.urban_dataset: + _dict['UrbanDataset'] = self.urban_dataset.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "UrbanDataset": ScpsUrbandatasetSchema20UrbanDataset.from_dict(obj["UrbanDataset"]) if obj.get("UrbanDataset") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..34c3df52593cc63151540029872100cef1a46750 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context import ScpsUrbandatasetSchema20UrbanDatasetContext +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification import ScpsUrbandatasetSchema20UrbanDatasetSpecification +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values import ScpsUrbandatasetSchema20UrbanDatasetValues +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDataset(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDataset + """ # noqa: E501 + context: ScpsUrbandatasetSchema20UrbanDatasetContext + specification: ScpsUrbandatasetSchema20UrbanDatasetSpecification + values: ScpsUrbandatasetSchema20UrbanDatasetValues + __properties: ClassVar[List[str]] = ["context", "specification", "values"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDataset from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of context + if self.context: + _dict['context'] = self.context.to_dict() + # override the default output from pydantic by calling `to_dict()` of specification + if self.specification: + _dict['specification'] = self.specification.to_dict() + # override the default output from pydantic by calling `to_dict()` of values + if self.values: + _dict['values'] = self.values.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDataset from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "context": ScpsUrbandatasetSchema20UrbanDatasetContext.from_dict(obj["context"]) if obj.get("context") is not None else None, + "specification": ScpsUrbandatasetSchema20UrbanDatasetSpecification.from_dict(obj["specification"]) if obj.get("specification") is not None else None, + "values": ScpsUrbandatasetSchema20UrbanDatasetValues.from_dict(obj["values"]) if obj.get("values") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context.py new file mode 100644 index 0000000000000000000000000000000000000000..5e8ee9be2e6aa91ed2947ed1fa9b143145e8c1ca --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_coordinates import ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_producer import ScpsUrbandatasetSchema20UrbanDatasetContextProducer +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetContext(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetContext + """ # noqa: E501 + producer: ScpsUrbandatasetSchema20UrbanDatasetContextProducer + time_zone: StrictStr = Field(alias="timeZone") + timestamp: Annotated[str, Field(strict=True)] + coordinates: ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates + language: Optional[StrictStr] = None + note: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["producer", "timeZone", "timestamp", "coordinates", "language", "note"] + + @field_validator('timestamp') + def timestamp_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(?:(?:(?=[02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-[0-2][0-9])|(?:(?![02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-(?:[0-1][0-9]|2[0-8])))T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$", value): + raise ValueError(r"must validate the regular expression /^(?:(?:(?=[02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-[0-2][0-9])|(?:(?![02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-(?:[0-1][0-9]|2[0-8])))T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetContext from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of producer + if self.producer: + _dict['producer'] = self.producer.to_dict() + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict['coordinates'] = self.coordinates.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetContext from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "producer": ScpsUrbandatasetSchema20UrbanDatasetContextProducer.from_dict(obj["producer"]) if obj.get("producer") is not None else None, + "timeZone": obj.get("timeZone"), + "timestamp": obj.get("timestamp"), + "coordinates": ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, + "language": obj.get("language"), + "note": obj.get("note") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_coordinates.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_coordinates.py new file mode 100644 index 0000000000000000000000000000000000000000..e6928aa181ad0ff96e6c1b6314092dee36556858 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_coordinates.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates + """ # noqa: E501 + format: Optional[StrictStr] = None + latitude: Union[StrictFloat, StrictInt] + longitude: Union[StrictFloat, StrictInt] + height: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["format", "latitude", "longitude", "height"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "format": obj.get("format"), + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude"), + "height": obj.get("height") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_producer.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_producer.py new file mode 100644 index 0000000000000000000000000000000000000000..a2cf85d989f322c2b2e8cf3b97a8e934c74ef071 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_context_producer.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetContextProducer(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetContextProducer + """ # noqa: E501 + id: StrictStr + scheme_id: Optional[StrictStr] = Field(default=None, alias="schemeID") + __properties: ClassVar[List[str]] = ["id", "schemeID"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextProducer from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetContextProducer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "schemeID": obj.get("schemeID") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification.py new file mode 100644 index 0000000000000000000000000000000000000000..a7dcbdceb1e29efbe91b23e60ec3f300d94b2257 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_id import ScpsUrbandatasetSchema20UrbanDatasetSpecificationId +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetSpecification(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetSpecification + """ # noqa: E501 + version: Optional[StrictStr] = None + id: ScpsUrbandatasetSchema20UrbanDatasetSpecificationId + name: StrictStr + uri: StrictStr + properties: Optional[ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties] = None + __properties: ClassVar[List[str]] = ["version", "id", "name", "uri", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecification from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of id + if self.id: + _dict['id'] = self.id.to_dict() + # override the default output from pydantic by calling `to_dict()` of properties + if self.properties: + _dict['properties'] = self.properties.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "version": obj.get("version"), + "id": ScpsUrbandatasetSchema20UrbanDatasetSpecificationId.from_dict(obj["id"]) if obj.get("id") is not None else None, + "name": obj.get("name"), + "uri": obj.get("uri"), + "properties": ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_id.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_id.py new file mode 100644 index 0000000000000000000000000000000000000000..19cbac0217e9f14ab844bea9577f1e537e0173ac --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_id.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetSpecificationId(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetSpecificationId + """ # noqa: E501 + value: StrictStr + scheme_id: Optional[StrictStr] = Field(default=None, alias="schemeID") + __properties: ClassVar[List[str]] = ["value", "schemeID"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "schemeID": obj.get("schemeID") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties.py new file mode 100644 index 0000000000000000000000000000000000000000..3fc7ce75828074149d671199674c236d1f3cfef2 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties + """ # noqa: E501 + property_definition: List[Optional[ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner]] = Field(alias="propertyDefinition") + __properties: ClassVar[List[str]] = ["propertyDefinition"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in property_definition (list) + _items = [] + if self.property_definition: + for _item in self.property_definition: + if _item: + _items.append(_item.to_dict()) + _dict['propertyDefinition'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "propertyDefinition": [ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner.from_dict(_item) for _item in obj["propertyDefinition"]] if obj.get("propertyDefinition") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..070b5cf7156eac097b75c8ed45925cab289d2eab --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner + """ # noqa: E501 + property_name: StrictStr = Field(alias="propertyName") + property_description: Optional[StrictStr] = Field(default=None, alias="propertyDescription") + data_type: Optional[StrictStr] = Field(default=None, alias="dataType") + code_list: Optional[StrictStr] = Field(default=None, alias="codeList") + unit_of_measure: Optional[StrictStr] = Field(default=None, alias="unitOfMeasure") + measurement_type: Optional[StrictStr] = Field(default=None, alias="measurementType") + sub_properties: Optional[ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties] = Field(default=None, alias="subProperties") + __properties: ClassVar[List[str]] = [] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py new file mode 100644 index 0000000000000000000000000000000000000000..adb4b7d832391c3197e88892a1a383d3d8c110b6 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +SCPSURBANDATASETSCHEMA20URBANDATASETSPECIFICATIONPROPERTIESPROPERTYDEFINITIONINNERNOT_ANY_OF_SCHEMAS = ["object"] + +class ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot + """ + + # data type: object + anyof_schema_1_validator: Optional[Any] = None + # data type: object + anyof_schema_2_validator: Optional[Any] = None + # data type: object + anyof_schema_3_validator: Optional[Any] = None + # data type: object + anyof_schema_4_validator: Optional[Any] = None + # data type: object + anyof_schema_5_validator: Optional[Any] = None + # data type: object + anyof_schema_6_validator: Optional[Any] = None + # data type: object + anyof_schema_7_validator: Optional[Any] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[object]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "object" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot.model_construct() + error_messages = [] + # validate data type: object + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_4_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_5_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_6_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_7_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into object + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_4_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_4_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_5_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_5_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_6_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_6_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_7_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_7_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot with anyOf schemas: object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py new file mode 100644 index 0000000000000000000000000000000000000000..089fe8800c72d88d20b88ff4b69b4177e668b71a --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties + """ # noqa: E501 + property_name: Annotated[List[StrictStr], Field(min_length=2)] = Field(alias="propertyName") + __properties: ClassVar[List[str]] = ["propertyName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "propertyName": obj.get("propertyName") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values.py new file mode 100644 index 0000000000000000000000000000000000000000..d79ced84d65af301ae1187839f957862cf35be14 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetValues(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetValues + """ # noqa: E501 + line: Annotated[List[ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner], Field(min_length=1)] + __properties: ClassVar[List[str]] = ["line"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValues from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in line (list) + _items = [] + if self.line: + for _item in self.line: + if _item: + _items.append(_item.to_dict()) + _dict['line'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValues from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "line": [ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner.from_dict(_item) for _item in obj["line"]] if obj.get("line") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..3bd911a422a5d09d2a575c044a0c84e787fd9f93 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_coordinates import ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_period import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner + """ # noqa: E501 + id: Optional[StrictInt] = None + description: Optional[StrictStr] = None + timestamp: Optional[StrictStr] = None + coordinates: Optional[ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates] = None + period: Optional[ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod] = None + var_property: Annotated[List[Optional[ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner]], Field(min_length=1)] = Field(alias="property") + __properties: ClassVar[List[str]] = ["id", "description", "timestamp", "coordinates", "period", "property"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict['coordinates'] = self.coordinates.to_dict() + # override the default output from pydantic by calling `to_dict()` of period + if self.period: + _dict['period'] = self.period.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in var_property (list) + _items = [] + if self.var_property: + for _item in self.var_property: + if _item: + _items.append(_item.to_dict()) + _dict['property'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "description": obj.get("description"), + "timestamp": obj.get("timestamp"), + "coordinates": ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, + "period": ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod.from_dict(obj["period"]) if obj.get("period") is not None else None, + "property": [ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner.from_dict(_item) for _item in obj["property"]] if obj.get("property") is not None else None + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py new file mode 100644 index 0000000000000000000000000000000000000000..aca838ecdab587bbf47e7cfa2c5d55951cb03251 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod + """ # noqa: E501 + start_ts: Annotated[str, Field(strict=True)] + end_ts: Annotated[str, Field(strict=True)] + __properties: ClassVar[List[str]] = ["start_ts", "end_ts"] + + @field_validator('start_ts') + def start_ts_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(?:(?:(?=[02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-[0-2][0-9])|(?:(?![02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-(?:[0-1][0-9]|2[0-8])))T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$", value): + raise ValueError(r"must validate the regular expression /^(?:(?:(?=[02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-[0-2][0-9])|(?:(?![02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-(?:[0-1][0-9]|2[0-8])))T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$/") + return value + + @field_validator('end_ts') + def end_ts_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(?:(?:(?=[02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-[0-2][0-9])|(?:(?![02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-(?:[0-1][0-9]|2[0-8])))T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$", value): + raise ValueError(r"must validate the regular expression /^(?:(?:(?=[02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-[0-2][0-9])|(?:(?![02468][048]00|[13579][26]00|[0-9]{2}0[48]|[0-9]{2}[2468][048]|[0-9]{2}[13579][26])[0-9]{4})-(?:(?:01|03|05|07|08|10|12)-(?:[0-2][0-9]|3[0-1])|(?:04|06|09|11)-(?:[0-2][0-9]|30)|02-(?:[0-1][0-9]|2[0-8])))T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "start_ts": obj.get("start_ts"), + "end_ts": obj.get("end_ts") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..ed1b0b8046198413ef6b572fef76a9b725a81c50 --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner + """ # noqa: E501 + name: StrictStr + val: Optional[StrictStr] = None + var_property: Optional[Annotated[List[Optional[ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner]], Field(min_length=2)]] = Field(default=None, alias="property") + __properties: ClassVar[List[str]] = [] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + }) + return _obj + + diff --git a/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..641b8d3db9a9c4866c4227eb00f4311ddd478d2c --- /dev/null +++ b/scp_udg_client_rest/models/scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner(BaseModel): + """ + ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner + """ # noqa: E501 + name: StrictStr + val: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = [] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + }) + return _obj + + diff --git a/scp_udg_client_rest/models/searching_by_property_request.py b/scp_udg_client_rest/models/searching_by_property_request.py new file mode 100644 index 0000000000000000000000000000000000000000..46d2f3eaf4f5404922720a89d58412aa9bb37618 --- /dev/null +++ b/scp_udg_client_rest/models/searching_by_property_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SearchingByPropertyRequest(BaseModel): + """ + SearchingByPropertyRequest + """ # noqa: E501 + resource_id: StrictStr = Field(description="Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0)") + property_name: StrictStr = Field(description="Name of the property being searched") + property_value: StrictStr = Field(description="Value of the property being searched") + period_start: Optional[StrictStr] = Field(default=None, description="Date and time from which you want to specify the start of a time interval.") + period_end: Optional[StrictStr] = Field(default=None, description="Date and time from which you want to specify the end of a time interval.") + center_latitude: Optional[StrictStr] = Field(default=None, description="Latitude of the center where space research will be carried out.") + center_longitude: Optional[StrictStr] = Field(default=None, description="Longitude of the center on which space research will be carried out.") + distance: Optional[StrictStr] = Field(default=None, description="Radius of the circle, in meters, on which space research will be carried out.") + __properties: ClassVar[List[str]] = ["resource_id", "property_name", "property_value", "period_start", "period_end", "center_latitude", "center_longitude", "distance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchingByPropertyRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchingByPropertyRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id"), + "property_name": obj.get("property_name"), + "property_value": obj.get("property_value"), + "period_start": obj.get("period_start"), + "period_end": obj.get("period_end"), + "center_latitude": obj.get("center_latitude"), + "center_longitude": obj.get("center_longitude"), + "distance": obj.get("distance") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/searching_request.py b/scp_udg_client_rest/models/searching_request.py new file mode 100644 index 0000000000000000000000000000000000000000..ee986939778e9ac07e2f691b2d1b3a549e3ca64f --- /dev/null +++ b/scp_udg_client_rest/models/searching_request.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SearchingRequest(BaseModel): + """ + SearchingRequest + """ # noqa: E501 + resource_id: StrictStr = Field(description="Uniquely identifies an UrbanDataset produced by a specific Solution producer (syntax defined in the SCPS Collaboration 2.0)") + period_start: Optional[StrictStr] = Field(default=None, description="Date and time from which you want to specify the start of a time interval.") + period_end: Optional[StrictStr] = Field(default=None, description="Date and time from which you want to specify the end of a time interval.") + center_latitude: Optional[StrictStr] = Field(default=None, description="Latitude of the center where space research will be carried out.") + center_longitude: Optional[StrictStr] = Field(default=None, description="Longitude of the center on which space research will be carried out.") + distance: Optional[StrictStr] = Field(default=None, description="Radius of the circle, in meters, on which space research will be carried out.") + __properties: ClassVar[List[str]] = ["resource_id", "period_start", "period_end", "center_latitude", "center_longitude", "distance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchingRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchingRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id"), + "period_start": obj.get("period_start"), + "period_end": obj.get("period_end"), + "center_latitude": obj.get("center_latitude"), + "center_longitude": obj.get("center_longitude"), + "distance": obj.get("distance") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/specific_request.py b/scp_udg_client_rest/models/specific_request.py new file mode 100644 index 0000000000000000000000000000000000000000..5ffa0d240fbe04b84d6ac3e8da063ae4a553b355 --- /dev/null +++ b/scp_udg_client_rest/models/specific_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SpecificRequest(BaseModel): + """ + SpecificRequest + """ # noqa: E501 + resource_id: StrictStr + timestamp: datetime + __properties: ClassVar[List[str]] = ["resource_id", "timestamp"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpecificRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpecificRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id"), + "timestamp": obj.get("timestamp") + }) + return _obj + + diff --git a/scp_udg_client_rest/models/test_get200_response.py b/scp_udg_client_rest/models/test_get200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..7e9bf9bb6aead68c6063a0d227d02b4d679493dc --- /dev/null +++ b/scp_udg_client_rest/models/test_get200_response.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class TestGet200Response(BaseModel): + """ + TestGet200Response + """ # noqa: E501 + code: StrictStr + message: StrictStr + __properties: ClassVar[List[str]] = ["code", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestGet200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestGet200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message") + }) + return _obj + + diff --git a/scp_udg_client_rest/py.typed b/scp_udg_client_rest/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/scp_udg_client_rest/rest.py b/scp_udg_client_rest/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..b0534fd8c198935b3e8100f5542aaf6f6a55a1d1 --- /dev/null +++ b/scp_udg_client_rest/rest.py @@ -0,0 +1,258 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from scp_udg_client_rest.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :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. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # 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) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..11433ee875ab7f4bbc10e8aeb98124c844ce64aa --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..544fb5c4a4e4812802af3399f1ea5f0872c48b37 --- /dev/null +++ b/setup.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "scp-udg-client-rest" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="UrbanDatasetGateway - OpenAPI 3.0", + author="Tito Brasolin", + author_email="tito.brasolin@kerberos.energy", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "UrbanDatasetGateway - OpenAPI 3.0"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache 2.0", + long_description_content_type='text/markdown', + long_description="""\ + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + """, # noqa: E501 + package_data={"scp_udg_client_rest": ["py.typed"]}, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8e6d8cb13749aa4e3a5e5bbada3cdb8508c192b5 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,5 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/test_basic200_response.py b/test/test_basic200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..0938e13baa7dae1ac26e3b43e02d1fd18b2ab539 --- /dev/null +++ b/test/test_basic200_response.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.basic200_response import Basic200Response + +class TestBasic200Response(unittest.TestCase): + """Basic200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Basic200Response: + """Test Basic200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Basic200Response` + """ + model = Basic200Response() + if include_optional: + return Basic200Response( + code = '', + message = '', + dataset = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2/0.scps-urbandataset-schema-2.0( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ), ) + ] + ) + else: + return Basic200Response( + code = '', + message = '', + dataset = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2/0.scps-urbandataset-schema-2.0( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ), ) + ], + ) + """ + + def testBasic200Response(self): + """Test Basic200Response""" + # 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_basic_request.py b/test/test_basic_request.py new file mode 100644 index 0000000000000000000000000000000000000000..08f4717efc9625ed0a6800dc05b62d0fc309d8a7 --- /dev/null +++ b/test/test_basic_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.basic_request import BasicRequest + +class TestBasicRequest(unittest.TestCase): + """BasicRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BasicRequest: + """Test BasicRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BasicRequest` + """ + model = BasicRequest() + if include_optional: + return BasicRequest( + resource_id = '' + ) + else: + return BasicRequest( + resource_id = '', + ) + """ + + def testBasicRequest(self): + """Test BasicRequest""" + # 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_deep_searching_request.py b/test/test_deep_searching_request.py new file mode 100644 index 0000000000000000000000000000000000000000..f1e9dc2ca0c54f6240b6eb63f73ac3e4adc826d1 --- /dev/null +++ b/test/test_deep_searching_request.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.deep_searching_request import DeepSearchingRequest + +class TestDeepSearchingRequest(unittest.TestCase): + """DeepSearchingRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeepSearchingRequest: + """Test DeepSearchingRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeepSearchingRequest` + """ + model = DeepSearchingRequest() + if include_optional: + return DeepSearchingRequest( + resource_id = '', + period_start = '', + period_end = '', + center_latitude = '', + center_longitude = '', + distance = '', + property_label = '', + property_value = '' + ) + else: + return DeepSearchingRequest( + resource_id = '', + ) + """ + + def testDeepSearchingRequest(self): + """Test DeepSearchingRequest""" + # 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_is_alive200_response.py b/test/test_is_alive200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..a705f8dcbeac2e1be42e1b16b010c178cab276bc --- /dev/null +++ b/test/test_is_alive200_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.is_alive200_response import IsAlive200Response + +class TestIsAlive200Response(unittest.TestCase): + """IsAlive200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IsAlive200Response: + """Test IsAlive200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `IsAlive200Response` + """ + model = IsAlive200Response() + if include_optional: + return IsAlive200Response( + code = '', + message = '', + username = '' + ) + else: + return IsAlive200Response( + code = '', + message = '', + ) + """ + + def testIsAlive200Response(self): + """Test IsAlive200Response""" + # 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_last200_response.py b/test/test_last200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..94d847ad59c4f0b5c927b61e44b044f9cdbbc938 --- /dev/null +++ b/test/test_last200_response.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.last200_response import Last200Response + +class TestLast200Response(unittest.TestCase): + """Last200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Last200Response: + """Test Last200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Last200Response` + """ + model = Last200Response() + if include_optional: + return Last200Response( + code = '', + message = '', + dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2/0.scps-urbandataset-schema-2.0( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ), ) + ) + else: + return Last200Response( + code = '', + message = '', + dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2/0.scps-urbandataset-schema-2.0( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ), ), + ) + """ + + def testLast200Response(self): + """Test Last200Response""" + # 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_last_request.py b/test/test_last_request.py new file mode 100644 index 0000000000000000000000000000000000000000..10c115963d4cec723846f7e30629e8998b773e92 --- /dev/null +++ b/test/test_last_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.last_request import LastRequest + +class TestLastRequest(unittest.TestCase): + """LastRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LastRequest: + """Test LastRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LastRequest` + """ + model = LastRequest() + if include_optional: + return LastRequest( + resource_id = '' + ) + else: + return LastRequest( + resource_id = '', + ) + """ + + def testLastRequest(self): + """Test LastRequest""" + # 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_login200_response.py b/test/test_login200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..87ef07ffb1fae26acc0703a1f89899e468e15cf4 --- /dev/null +++ b/test/test_login200_response.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.login200_response import Login200Response + +class TestLogin200Response(unittest.TestCase): + """Login200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Login200Response: + """Test Login200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Login200Response` + """ + model = Login200Response() + if include_optional: + return Login200Response( + code = '', + message = '', + token = '' + ) + else: + return Login200Response( + code = '', + message = '', + token = '', + ) + """ + + def testLogin200Response(self): + """Test Login200Response""" + # 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_login_request.py b/test/test_login_request.py new file mode 100644 index 0000000000000000000000000000000000000000..bc24c1c02b8bf605feaa2081ed3ef2da5e8bd184 --- /dev/null +++ b/test/test_login_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.login_request import LoginRequest + +class TestLoginRequest(unittest.TestCase): + """LoginRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoginRequest: + """Test LoginRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LoginRequest` + """ + model = LoginRequest() + if include_optional: + return LoginRequest( + username = '', + password = '' + ) + else: + return LoginRequest( + username = '', + password = '', + ) + """ + + def testLoginRequest(self): + """Test LoginRequest""" + # 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_push200_response.py b/test/test_push200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..196cf7dd78fb941be3580300991dc5321bbc7c2a --- /dev/null +++ b/test/test_push200_response.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.push200_response import Push200Response + +class TestPush200Response(unittest.TestCase): + """Push200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Push200Response: + """Test Push200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Push200Response` + """ + model = Push200Response() + if include_optional: + return Push200Response( + code = '', + message = '', + detail = '' + ) + else: + return Push200Response( + code = '', + message = '', + detail = '', + ) + """ + + def testPush200Response(self): + """Test Push200Response""" + # 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_push_request.py b/test/test_push_request.py new file mode 100644 index 0000000000000000000000000000000000000000..edb59363e4a2da92980cdab5e382474b9d584b7a --- /dev/null +++ b/test/test_push_request.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.push_request import PushRequest + +class TestPushRequest(unittest.TestCase): + """PushRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PushRequest: + """Test PushRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PushRequest` + """ + model = PushRequest() + if include_optional: + return PushRequest( + resource_id = '', + dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2/0.scps-urbandataset-schema-2.0( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ), ) + ) + else: + return PushRequest( + resource_id = '', + dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2/0.scps-urbandataset-schema-2.0( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ), ), + ) + """ + + def testPushRequest(self): + """Test PushRequest""" + # 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_scps_urbandataset_schema20.py b/test/test_scps_urbandataset_schema20.py new file mode 100644 index 0000000000000000000000000000000000000000..d46d48e7e0e0a300de12083a313f93127943d43d --- /dev/null +++ b/test/test_scps_urbandataset_schema20.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20 import ScpsUrbandatasetSchema20 + +class TestScpsUrbandatasetSchema20(unittest.TestCase): + """ScpsUrbandatasetSchema20 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20: + """Test ScpsUrbandatasetSchema20 + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20` + """ + model = ScpsUrbandatasetSchema20() + if include_optional: + return ScpsUrbandatasetSchema20( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ) + ) + else: + return ScpsUrbandatasetSchema20( + urban_dataset = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset.scps_urbandataset_schema_2_0_UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + description = '', + timestamp = '', + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), ), + ) + """ + + def testScpsUrbandatasetSchema20(self): + """Test ScpsUrbandatasetSchema20""" + # 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_scps_urbandataset_schema20_urban_dataset.py b/test/test_scps_urbandataset_schema20_urban_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..12fe954a0c1106a408aeafb7857e06ce3d4157d1 --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset import ScpsUrbandatasetSchema20UrbanDataset + +class TestScpsUrbandatasetSchema20UrbanDataset(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDataset unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDataset: + """Test ScpsUrbandatasetSchema20UrbanDataset + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDataset` + """ + model = ScpsUrbandatasetSchema20UrbanDataset() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + id = 56, + description = '', + timestamp = '', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ) + ) + else: + return ScpsUrbandatasetSchema20UrbanDataset( + context = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context.scps_urbandataset_schema_2_0_UrbanDataset_context( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '', ), + specification = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification.scps_urbandataset_schema_2_0_UrbanDataset_specification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ), ), + values = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values.scps_urbandataset_schema_2_0_UrbanDataset_values( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + id = 56, + description = '', + timestamp = '', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], ), + ) + """ + + def testScpsUrbandatasetSchema20UrbanDataset(self): + """Test ScpsUrbandatasetSchema20UrbanDataset""" + # 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_scps_urbandataset_schema20_urban_dataset_context.py b/test/test_scps_urbandataset_schema20_urban_dataset_context.py new file mode 100644 index 0000000000000000000000000000000000000000..c1606854b8f5d56fce99d06d8f3c2517eee63c0c --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_context.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context import ScpsUrbandatasetSchema20UrbanDatasetContext + +class TestScpsUrbandatasetSchema20UrbanDatasetContext(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetContext unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetContext: + """Test ScpsUrbandatasetSchema20UrbanDatasetContext + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetContext` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetContext() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetContext( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + language = '', + note = '' + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetContext( + producer = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_producer.scps_urbandataset_schema_2_0_UrbanDataset_context_producer( + id = '', + scheme_id = '', ), + time_zone = '', + timestamp = 'iR2M8880-03-31T10:01:39', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetContext(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetContext""" + # 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_scps_urbandataset_schema20_urban_dataset_context_coordinates.py b/test/test_scps_urbandataset_schema20_urban_dataset_context_coordinates.py new file mode 100644 index 0000000000000000000000000000000000000000..1f02f6bafe7b9f8168406fb2bc3a2c352b64c3fa --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_context_coordinates.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_coordinates import ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates + +class TestScpsUrbandatasetSchema20UrbanDatasetContextCoordinates(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates: + """Test ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337 + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates( + latitude = 1.337, + longitude = 1.337, + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetContextCoordinates(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetContextCoordinates""" + # 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_scps_urbandataset_schema20_urban_dataset_context_producer.py b/test/test_scps_urbandataset_schema20_urban_dataset_context_producer.py new file mode 100644 index 0000000000000000000000000000000000000000..3ea00aec4b41125a24532d115f2ad722766cfe1a --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_context_producer.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_context_producer import ScpsUrbandatasetSchema20UrbanDatasetContextProducer + +class TestScpsUrbandatasetSchema20UrbanDatasetContextProducer(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetContextProducer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetContextProducer: + """Test ScpsUrbandatasetSchema20UrbanDatasetContextProducer + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetContextProducer` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetContextProducer() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetContextProducer( + id = '', + scheme_id = '' + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetContextProducer( + id = '', + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetContextProducer(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetContextProducer""" + # 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_scps_urbandataset_schema20_urban_dataset_specification.py b/test/test_scps_urbandataset_schema20_urban_dataset_specification.py new file mode 100644 index 0000000000000000000000000000000000000000..2fc63e455387718a1c50fadcc69546d6650089ef --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_specification.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification import ScpsUrbandatasetSchema20UrbanDatasetSpecification + +class TestScpsUrbandatasetSchema20UrbanDatasetSpecification(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetSpecification unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetSpecification: + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecification + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetSpecification` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetSpecification() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetSpecification( + version = '', + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], ) + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetSpecification( + id = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_id.scps_urbandataset_schema_2_0_UrbanDataset_specification_id( + value = '', + scheme_id = '', ), + name = '', + uri = '', + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetSpecification(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecification""" + # 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_scps_urbandataset_schema20_urban_dataset_specification_id.py b/test/test_scps_urbandataset_schema20_urban_dataset_specification_id.py new file mode 100644 index 0000000000000000000000000000000000000000..99fc04e7324f1af52d111cec32523eb1a1a4997a --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_specification_id.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_id import ScpsUrbandatasetSchema20UrbanDatasetSpecificationId + +class TestScpsUrbandatasetSchema20UrbanDatasetSpecificationId(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetSpecificationId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetSpecificationId: + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationId + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetSpecificationId` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetSpecificationId() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationId( + value = '', + scheme_id = '' + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationId( + value = '', + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetSpecificationId(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationId""" + # 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_scps_urbandataset_schema20_urban_dataset_specification_properties.py b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties.py new file mode 100644 index 0000000000000000000000000000000000000000..977fc6c34d7f492448cded6ee72b80a97e4067c8 --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties + +class TestScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties: + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ] + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties( + property_definition = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ), ) + ], + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationProperties""" + # 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_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..cd2c7b2443563a8614179a435a7b67c36a5c6ef0 --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner + +class TestScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner: + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner( + property_name = '', + property_description = '', + data_type = '', + code_list = '', + unit_of_measure = '', + measurement_type = '', + sub_properties = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_specification_properties_property_definition_inner_sub_properties.scps_urbandataset_schema_2_0_UrbanDataset_specification_properties_propertyDefinition_inner_subProperties( + property_name = [ + '' + ], ) + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner( + property_name = '', + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInner""" + # 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_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py new file mode 100644 index 0000000000000000000000000000000000000000..2a31b92a51fa1ab49d79891a2202bf5d4258e1b5 --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_not import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot + +class TestScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot: + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot( + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot( + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerNot""" + # 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_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py new file mode 100644 index 0000000000000000000000000000000000000000..af1987026bda957ef7a47175f32ed5190d750c19 --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_specification_properties_property_definition_inner_sub_properties import ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties + +class TestScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties: + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties( + property_name = [ + '' + ] + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties( + property_name = [ + '' + ], + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetSpecificationPropertiesPropertyDefinitionInnerSubProperties""" + # 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_scps_urbandataset_schema20_urban_dataset_values.py b/test/test_scps_urbandataset_schema20_urban_dataset_values.py new file mode 100644 index 0000000000000000000000000000000000000000..183d50e127314aa3a539afbc377c440764d7ebfd --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_values.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values import ScpsUrbandatasetSchema20UrbanDatasetValues + +class TestScpsUrbandatasetSchema20UrbanDatasetValues(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetValues unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetValues: + """Test ScpsUrbandatasetSchema20UrbanDatasetValues + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetValues` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetValues() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetValues( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + id = 56, + description = '', + timestamp = '', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ] + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetValues( + line = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner( + id = 56, + description = '', + timestamp = '', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], ) + ], + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetValues(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetValues""" + # 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_scps_urbandataset_schema20_urban_dataset_values_line_inner.py b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..48acca84ba968913345c34b61dca195b7af25eff --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner + +class TestScpsUrbandatasetSchema20UrbanDatasetValuesLineInner(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner: + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner( + id = 56, + description = '', + timestamp = '', + coordinates = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_context_coordinates.scps_urbandataset_schema_2_0_UrbanDataset_context_coordinates( + format = '', + latitude = 1.337, + longitude = 1.337, + height = 1.337, ), + period = scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_period.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_period( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', ), + var_property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ] + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner( + var_property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner( + name = '', + val = '', ) + ], + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetValuesLineInner(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInner""" + # 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_scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py new file mode 100644 index 0000000000000000000000000000000000000000..f4bd586fc727d980aa558058d5580bc48752297b --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_period.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_period import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod + +class TestScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod: + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39' + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod( + start_ts = 'iR2M8880-03-31T10:01:39', + end_ts = 'iR2M8880-03-31T10:01:39', + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPeriod""" + # 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_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..f6a74195135a8e0e09798193df14647b38424913 --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner + +class TestScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner: + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner( + name = '', + val = '', + var_property = [ + scp_udg_client_rest.models.scps_urbandataset_schema_2_0_urban_dataset_values_line_inner_property_inner_property_inner.scps_urbandataset_schema_2_0_UrbanDataset_values_line_inner_property_inner_property_inner( + name = '', + val = '', ) + ] + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner( + name = '', + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInner""" + # 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_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..da2237261a10f0fc4e046ee6de201875937de96b --- /dev/null +++ b/test/test_scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.scps_urbandataset_schema20_urban_dataset_values_line_inner_property_inner_property_inner import ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner + +class TestScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner(unittest.TestCase): + """ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner: + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner` + """ + model = ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner() + if include_optional: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner( + name = '', + val = '' + ) + else: + return ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner( + name = '', + ) + """ + + def testScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner(self): + """Test ScpsUrbandatasetSchema20UrbanDatasetValuesLineInnerPropertyInnerPropertyInner""" + # 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_searching_by_property_request.py b/test/test_searching_by_property_request.py new file mode 100644 index 0000000000000000000000000000000000000000..a1eca68d0c07f4af2b65e59d0a36e48ea83db6e9 --- /dev/null +++ b/test/test_searching_by_property_request.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.searching_by_property_request import SearchingByPropertyRequest + +class TestSearchingByPropertyRequest(unittest.TestCase): + """SearchingByPropertyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchingByPropertyRequest: + """Test SearchingByPropertyRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SearchingByPropertyRequest` + """ + model = SearchingByPropertyRequest() + if include_optional: + return SearchingByPropertyRequest( + resource_id = '', + property_name = '', + property_value = '', + period_start = '', + period_end = '', + center_latitude = '', + center_longitude = '', + distance = '' + ) + else: + return SearchingByPropertyRequest( + resource_id = '', + property_name = '', + property_value = '', + ) + """ + + def testSearchingByPropertyRequest(self): + """Test SearchingByPropertyRequest""" + # 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_searching_request.py b/test/test_searching_request.py new file mode 100644 index 0000000000000000000000000000000000000000..d654fc61048c2ed5e4909958785b8966286c9583 --- /dev/null +++ b/test/test_searching_request.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.searching_request import SearchingRequest + +class TestSearchingRequest(unittest.TestCase): + """SearchingRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SearchingRequest: + """Test SearchingRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SearchingRequest` + """ + model = SearchingRequest() + if include_optional: + return SearchingRequest( + resource_id = '', + period_start = '', + period_end = '', + center_latitude = '', + center_longitude = '', + distance = '' + ) + else: + return SearchingRequest( + resource_id = '', + ) + """ + + def testSearchingRequest(self): + """Test SearchingRequest""" + # 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_specific_request.py b/test/test_specific_request.py new file mode 100644 index 0000000000000000000000000000000000000000..2ddf1ee020811d0ed38f8d723b17cb83db52a864 --- /dev/null +++ b/test/test_specific_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.specific_request import SpecificRequest + +class TestSpecificRequest(unittest.TestCase): + """SpecificRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpecificRequest: + """Test SpecificRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpecificRequest` + """ + model = SpecificRequest() + if include_optional: + return SpecificRequest( + resource_id = '', + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return SpecificRequest( + resource_id = '', + timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testSpecificRequest(self): + """Test SpecificRequest""" + # 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_test_get200_response.py b/test/test_test_get200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..54fec6428ebfb20542f8c6de63fbaac40944b3d9 --- /dev/null +++ b/test/test_test_get200_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.models.test_get200_response import TestGet200Response + +class TestTestGet200Response(unittest.TestCase): + """TestGet200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestGet200Response: + """Test TestGet200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestGet200Response` + """ + model = TestGet200Response() + if include_optional: + return TestGet200Response( + code = '', + message = '' + ) + else: + return TestGet200Response( + code = '', + message = '', + ) + """ + + def testTestGet200Response(self): + """Test TestGet200Response""" + # 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_urban_dataset_gateway_api.py b/test/test_urban_dataset_gateway_api.py new file mode 100644 index 0000000000000000000000000000000000000000..0cd923f817f407bd15b1e6a1b7dc9993223451fd --- /dev/null +++ b/test/test_urban_dataset_gateway_api.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + UrbanDatasetGateway - OpenAPI 3.0 + + **Smart City Platform Specification (SCPS) Communication 2.0** [https://smartcityplatform.enea.it/#/en/specification/communication/2.0/](https://smartcityplatform.enea.it/#/en/specification/communication/2.0/) + + The version of the OpenAPI document: 2.0.0 + Contact: tito.brasolin@kerberos.energy + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from scp_udg_client_rest.api.urban_dataset_gateway_api import UrbanDatasetGatewayApi + + +class TestUrbanDatasetGatewayApi(unittest.TestCase): + """UrbanDatasetGatewayApi unit test stubs""" + + def setUp(self) -> None: + self.api = UrbanDatasetGatewayApi() + + def tearDown(self) -> None: + pass + + def test_basic(self) -> None: + """Test case for basic + + Request an UrbanDataset, through the REQUEST / RESPONSE call, providing the identifier of the resource + """ + pass + + def test_deep_searching(self) -> None: + """Test case for deep_searching + + Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at line level (elements of specification of the dataset value records, present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + """ + pass + + def test_delete(self) -> None: + """Test case for delete + + Delete a particular UrbanDataset, providing the resource identifier and the specific generation timestamp + """ + pass + + def test_is_alive(self) -> None: + """Test case for is_alive + + Verify that the token is still valid + """ + pass + + def test_last(self) -> None: + """Test case for last + + Request the last UrbanDataset generated through a REQUEST / RESPONSE call + """ + pass + + def test_login(self) -> None: + """Test case for login + + Authenticate with the service that exposes this method through username and password, receiving in response a token that will use in subsequent calls + """ + pass + + def test_logout(self) -> None: + """Test case for logout + + Cancel authentication at the service that exposes this method making the token received in the previous login call invalid + """ + pass + + def test_push(self) -> None: + """Test case for push + + Send an UrbanDataset via the PUSH call + """ + pass + + def test_searching(self) -> None: + """Test case for searching + + Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); with all optional parameters set to null, it achieves the same result as a basic Request + """ + pass + + def test_searching_by_property(self) -> None: + """Test case for searching_by_property + + Request an UrbanDataset through a REQUEST / RESPONSE call, providing the identifier of the resource, with a spatial-temporal refinement of the search at the context level (UrbanDataset contextualization element present in the format); searching among the UD properties that one is matching with the input property + """ + pass + + def test_specific(self) -> None: + """Test case for specific + + Request a particular UrbanDataset, through a REQUEST / RESPONSE call, providing the identifier of the resource and the specific generation timestamp + """ + pass + + def test_test(self) -> None: + """Test case for test + + Test the presence of the web service + """ + pass + + def test_test_get(self) -> None: + """Test case for test_get + + Test the presence of the web service + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..e01dfd87692b140122139fbef90ea2a31fba7524 --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=scp_udg_client_rest