deutschland-api-sdk 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deutschland_api_sdk-0.1.0/LICENSE +21 -0
- deutschland_api_sdk-0.1.0/PKG-INFO +33 -0
- deutschland_api_sdk-0.1.0/README.md +16 -0
- deutschland_api_sdk-0.1.0/pyproject.toml +31 -0
- deutschland_api_sdk-0.1.0/setup.cfg +4 -0
- deutschland_api_sdk-0.1.0/setup.py +3 -0
- deutschland_api_sdk-0.1.0/src/deutschland_api_sdk.egg-info/PKG-INFO +33 -0
- deutschland_api_sdk-0.1.0/src/deutschland_api_sdk.egg-info/SOURCES.txt +60 -0
- deutschland_api_sdk-0.1.0/src/deutschland_api_sdk.egg-info/dependency_links.txt +1 -0
- deutschland_api_sdk-0.1.0/src/deutschland_api_sdk.egg-info/requires.txt +1 -0
- deutschland_api_sdk-0.1.0/src/deutschland_api_sdk.egg-info/top_level.txt +1 -0
- deutschland_api_sdk-0.1.0/src/sdk/authorization_tag.py +70 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_charging_station.py +15 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_charging_station_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_charging_station_tag.py +51 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_closure.py +21 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_closure_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_closure_tag.py +51 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_collection.py +11 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_coordinate.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_parking_lorry.py +17 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_parking_lorry_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_parking_lorry_tag.py +51 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_tag.py +78 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_warning.py +21 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_warning_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/autobahn_warning_tag.py +51 -0
- deutschland_api_sdk-0.1.0/src/sdk/backend_app.py +25 -0
- deutschland_api_sdk-0.1.0/src/sdk/backend_token.py +18 -0
- deutschland_api_sdk-0.1.0/src/sdk/backend_user.py +24 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundesrat_member.py +25 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundesrat_member_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundesrat_member_tag.py +50 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundesrat_tag.py +23 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundestag_constituency.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundestag_member.py +23 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundestag_member_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundestag_member_tag.py +83 -0
- deutschland_api_sdk-0.1.0/src/sdk/bundestag_tag.py +23 -0
- deutschland_api_sdk-0.1.0/src/sdk/city.py +18 -0
- deutschland_api_sdk-0.1.0/src/sdk/city_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/city_tag.py +88 -0
- deutschland_api_sdk-0.1.0/src/sdk/client.py +84 -0
- deutschland_api_sdk-0.1.0/src/sdk/collection.py +15 -0
- deutschland_api_sdk-0.1.0/src/sdk/common_message.py +13 -0
- deutschland_api_sdk-0.1.0/src/sdk/common_message_exception.py +17 -0
- deutschland_api_sdk-0.1.0/src/sdk/common_metadata.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/district.py +16 -0
- deutschland_api_sdk-0.1.0/src/sdk/district_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/district_tag.py +86 -0
- deutschland_api_sdk-0.1.0/src/sdk/message.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/message_exception.py +17 -0
- deutschland_api_sdk-0.1.0/src/sdk/meta_tag.py +40 -0
- deutschland_api_sdk-0.1.0/src/sdk/state.py +13 -0
- deutschland_api_sdk-0.1.0/src/sdk/state_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/state_tag.py +85 -0
- deutschland_api_sdk-0.1.0/src/sdk/system_about.py +26 -0
- deutschland_api_sdk-0.1.0/src/sdk/system_about_apps.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/system_about_link.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/warning.py +18 -0
- deutschland_api_sdk-0.1.0/src/sdk/warning_collection.py +12 -0
- deutschland_api_sdk-0.1.0/src/sdk/warning_tag.py +50 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Apioo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: deutschland-api-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Client SDK to access the Deutschland API
|
|
5
|
+
Author-email: Christoph Kappestein <christoph.kappestein@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/apioo/deutschland-api-sdk-python
|
|
8
|
+
Project-URL: Issues, https://github.com/apioo/deutschland-api-sdk-python/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: sdkgen-client
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# DeutschlandAPI SDK
|
|
20
|
+
|
|
21
|
+
This SDK helps to access the [DeutschlandAPI](https://deutschland-api.dev)
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
The following example shows how you initialize the client:
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from sdk.client import Client
|
|
29
|
+
|
|
30
|
+
client = Client.build()
|
|
31
|
+
|
|
32
|
+
// @TODO use the client
|
|
33
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
# DeutschlandAPI SDK
|
|
3
|
+
|
|
4
|
+
This SDK helps to access the [DeutschlandAPI](https://deutschland-api.dev)
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
The following example shows how you initialize the client:
|
|
9
|
+
|
|
10
|
+
```python
|
|
11
|
+
from sdk.client import Client
|
|
12
|
+
|
|
13
|
+
client = Client.build()
|
|
14
|
+
|
|
15
|
+
// @TODO use the client
|
|
16
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "deutschland-api-sdk"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name="Christoph Kappestein", email="christoph.kappestein@gmail.com" },
|
|
6
|
+
]
|
|
7
|
+
description = "Client SDK to access the Deutschland API"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.8"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Programming Language :: Python :: 3",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
"Topic :: Software Development :: Code Generators",
|
|
16
|
+
]
|
|
17
|
+
dependencies = [
|
|
18
|
+
"sdkgen-client"
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://github.com/apioo/deutschland-api-sdk-python"
|
|
23
|
+
Issues = "https://github.com/apioo/deutschland-api-sdk-python/issues"
|
|
24
|
+
|
|
25
|
+
[build-system]
|
|
26
|
+
requires = ["setuptools>=61.0"]
|
|
27
|
+
build-backend = "setuptools.build_meta"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools]
|
|
30
|
+
packages = ["sdk"]
|
|
31
|
+
package-dir = {"" = "src"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: deutschland-api-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Client SDK to access the Deutschland API
|
|
5
|
+
Author-email: Christoph Kappestein <christoph.kappestein@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/apioo/deutschland-api-sdk-python
|
|
8
|
+
Project-URL: Issues, https://github.com/apioo/deutschland-api-sdk-python/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: sdkgen-client
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# DeutschlandAPI SDK
|
|
20
|
+
|
|
21
|
+
This SDK helps to access the [DeutschlandAPI](https://deutschland-api.dev)
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
The following example shows how you initialize the client:
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from sdk.client import Client
|
|
29
|
+
|
|
30
|
+
client = Client.build()
|
|
31
|
+
|
|
32
|
+
// @TODO use the client
|
|
33
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
src/deutschland_api_sdk.egg-info/PKG-INFO
|
|
6
|
+
src/deutschland_api_sdk.egg-info/SOURCES.txt
|
|
7
|
+
src/deutschland_api_sdk.egg-info/dependency_links.txt
|
|
8
|
+
src/deutschland_api_sdk.egg-info/requires.txt
|
|
9
|
+
src/deutschland_api_sdk.egg-info/top_level.txt
|
|
10
|
+
src/sdk/authorization_tag.py
|
|
11
|
+
src/sdk/autobahn_charging_station.py
|
|
12
|
+
src/sdk/autobahn_charging_station_collection.py
|
|
13
|
+
src/sdk/autobahn_charging_station_tag.py
|
|
14
|
+
src/sdk/autobahn_closure.py
|
|
15
|
+
src/sdk/autobahn_closure_collection.py
|
|
16
|
+
src/sdk/autobahn_closure_tag.py
|
|
17
|
+
src/sdk/autobahn_collection.py
|
|
18
|
+
src/sdk/autobahn_coordinate.py
|
|
19
|
+
src/sdk/autobahn_parking_lorry.py
|
|
20
|
+
src/sdk/autobahn_parking_lorry_collection.py
|
|
21
|
+
src/sdk/autobahn_parking_lorry_tag.py
|
|
22
|
+
src/sdk/autobahn_tag.py
|
|
23
|
+
src/sdk/autobahn_warning.py
|
|
24
|
+
src/sdk/autobahn_warning_collection.py
|
|
25
|
+
src/sdk/autobahn_warning_tag.py
|
|
26
|
+
src/sdk/backend_app.py
|
|
27
|
+
src/sdk/backend_token.py
|
|
28
|
+
src/sdk/backend_user.py
|
|
29
|
+
src/sdk/bundesrat_member.py
|
|
30
|
+
src/sdk/bundesrat_member_collection.py
|
|
31
|
+
src/sdk/bundesrat_member_tag.py
|
|
32
|
+
src/sdk/bundesrat_tag.py
|
|
33
|
+
src/sdk/bundestag_constituency.py
|
|
34
|
+
src/sdk/bundestag_member.py
|
|
35
|
+
src/sdk/bundestag_member_collection.py
|
|
36
|
+
src/sdk/bundestag_member_tag.py
|
|
37
|
+
src/sdk/bundestag_tag.py
|
|
38
|
+
src/sdk/city.py
|
|
39
|
+
src/sdk/city_collection.py
|
|
40
|
+
src/sdk/city_tag.py
|
|
41
|
+
src/sdk/client.py
|
|
42
|
+
src/sdk/collection.py
|
|
43
|
+
src/sdk/common_message.py
|
|
44
|
+
src/sdk/common_message_exception.py
|
|
45
|
+
src/sdk/common_metadata.py
|
|
46
|
+
src/sdk/district.py
|
|
47
|
+
src/sdk/district_collection.py
|
|
48
|
+
src/sdk/district_tag.py
|
|
49
|
+
src/sdk/message.py
|
|
50
|
+
src/sdk/message_exception.py
|
|
51
|
+
src/sdk/meta_tag.py
|
|
52
|
+
src/sdk/state.py
|
|
53
|
+
src/sdk/state_collection.py
|
|
54
|
+
src/sdk/state_tag.py
|
|
55
|
+
src/sdk/system_about.py
|
|
56
|
+
src/sdk/system_about_apps.py
|
|
57
|
+
src/sdk/system_about_link.py
|
|
58
|
+
src/sdk/warning.py
|
|
59
|
+
src/sdk/warning_collection.py
|
|
60
|
+
src/sdk/warning_tag.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sdkgen-client
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sdk
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AuthorizationTag automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
import sdkgen
|
|
8
|
+
from requests import RequestException
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from .backend_user import BackendUser
|
|
12
|
+
from .common_message import CommonMessage
|
|
13
|
+
from .common_message_exception import CommonMessageException
|
|
14
|
+
|
|
15
|
+
class AuthorizationTag(sdkgen.TagAbstract):
|
|
16
|
+
def __init__(self, http_client: requests.Session, parser: sdkgen.Parser):
|
|
17
|
+
super().__init__(http_client, parser)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_whoami(self) -> BackendUser:
|
|
21
|
+
try:
|
|
22
|
+
path_params = {}
|
|
23
|
+
|
|
24
|
+
query_params = {}
|
|
25
|
+
|
|
26
|
+
query_struct_names = []
|
|
27
|
+
|
|
28
|
+
url = self.parser.url("/authorization/whoami", path_params)
|
|
29
|
+
|
|
30
|
+
headers = {}
|
|
31
|
+
|
|
32
|
+
response = self.http_client.get(url, headers=headers, params=self.parser.query(query_params, query_struct_names))
|
|
33
|
+
|
|
34
|
+
if response.status_code >= 200 and response.status_code < 300:
|
|
35
|
+
return BackendUser.model_validate_json(json_data=response.content)
|
|
36
|
+
|
|
37
|
+
if response.status_code == 500:
|
|
38
|
+
raise CommonMessageException(response.content)
|
|
39
|
+
|
|
40
|
+
raise sdkgen.UnknownStatusCodeException("The server returned an unknown status code")
|
|
41
|
+
except RequestException as e:
|
|
42
|
+
raise sdkgen.ClientException("An unknown error occurred: " + str(e))
|
|
43
|
+
|
|
44
|
+
def revoke(self) -> CommonMessage:
|
|
45
|
+
try:
|
|
46
|
+
path_params = {}
|
|
47
|
+
|
|
48
|
+
query_params = {}
|
|
49
|
+
|
|
50
|
+
query_struct_names = []
|
|
51
|
+
|
|
52
|
+
url = self.parser.url("/authorization/revoke", path_params)
|
|
53
|
+
|
|
54
|
+
headers = {}
|
|
55
|
+
|
|
56
|
+
response = self.http_client.post(url, headers=headers, params=self.parser.query(query_params, query_struct_names))
|
|
57
|
+
|
|
58
|
+
if response.status_code >= 200 and response.status_code < 300:
|
|
59
|
+
return CommonMessage.model_validate_json(json_data=response.content)
|
|
60
|
+
|
|
61
|
+
if response.status_code == 400:
|
|
62
|
+
raise CommonMessageException(response.content)
|
|
63
|
+
if response.status_code == 500:
|
|
64
|
+
raise CommonMessageException(response.content)
|
|
65
|
+
|
|
66
|
+
raise sdkgen.UnknownStatusCodeException("The server returned an unknown status code")
|
|
67
|
+
except RequestException as e:
|
|
68
|
+
raise sdkgen.ClientException("An unknown error occurred: " + str(e))
|
|
69
|
+
|
|
70
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_charging_station automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
from .autobahn_coordinate import AutobahnCoordinate
|
|
10
|
+
class AutobahnChargingStation(BaseModel):
|
|
11
|
+
id: Optional[str] = Field(default=None, alias="id")
|
|
12
|
+
title: Optional[str] = Field(default=None, alias="title")
|
|
13
|
+
description: Optional[List[str]] = Field(default=None, alias="description")
|
|
14
|
+
coordinate: Optional[AutobahnCoordinate] = Field(default=None, alias="coordinate")
|
|
15
|
+
pass
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_charging_station_collection automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
from .autobahn_charging_station import AutobahnChargingStation
|
|
10
|
+
class AutobahnChargingStationCollection(BaseModel):
|
|
11
|
+
entries: Optional[List[AutobahnChargingStation]] = Field(default=None, alias="entries")
|
|
12
|
+
pass
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AutobahnChargingStationTag automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
import sdkgen
|
|
8
|
+
from requests import RequestException
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from .autobahn_charging_station_collection import AutobahnChargingStationCollection
|
|
12
|
+
from .message_exception import MessageException
|
|
13
|
+
|
|
14
|
+
class AutobahnChargingStationTag(sdkgen.TagAbstract):
|
|
15
|
+
def __init__(self, http_client: requests.Session, parser: sdkgen.Parser):
|
|
16
|
+
super().__init__(http_client, parser)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_all(self, autobahn_id: str) -> AutobahnChargingStationCollection:
|
|
20
|
+
"""
|
|
21
|
+
Returns available charging stations for a specific autobahn
|
|
22
|
+
"""
|
|
23
|
+
try:
|
|
24
|
+
path_params = {}
|
|
25
|
+
path_params["autobahn_id"] = autobahn_id
|
|
26
|
+
|
|
27
|
+
query_params = {}
|
|
28
|
+
|
|
29
|
+
query_struct_names = []
|
|
30
|
+
|
|
31
|
+
url = self.parser.url("/autobahn/:autobahn_id/charging_station", path_params)
|
|
32
|
+
|
|
33
|
+
headers = {}
|
|
34
|
+
|
|
35
|
+
response = self.http_client.get(url, headers=headers, params=self.parser.query(query_params, query_struct_names))
|
|
36
|
+
|
|
37
|
+
if response.status_code >= 200 and response.status_code < 300:
|
|
38
|
+
return AutobahnChargingStationCollection.model_validate_json(json_data=response.content)
|
|
39
|
+
|
|
40
|
+
if response.status_code == 400:
|
|
41
|
+
raise MessageException(response.content)
|
|
42
|
+
if response.status_code == 404:
|
|
43
|
+
raise MessageException(response.content)
|
|
44
|
+
if response.status_code == 500:
|
|
45
|
+
raise MessageException(response.content)
|
|
46
|
+
|
|
47
|
+
raise sdkgen.UnknownStatusCodeException("The server returned an unknown status code")
|
|
48
|
+
except RequestException as e:
|
|
49
|
+
raise sdkgen.ClientException("An unknown error occurred: " + str(e))
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_closure automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
import datetime
|
|
10
|
+
from .autobahn_coordinate import AutobahnCoordinate
|
|
11
|
+
class AutobahnClosure(BaseModel):
|
|
12
|
+
id: Optional[str] = Field(default=None, alias="id")
|
|
13
|
+
blocked: Optional[bool] = Field(default=None, alias="blocked")
|
|
14
|
+
future: Optional[bool] = Field(default=None, alias="future")
|
|
15
|
+
title: Optional[str] = Field(default=None, alias="title")
|
|
16
|
+
subtitle: Optional[str] = Field(default=None, alias="subtitle")
|
|
17
|
+
description: Optional[List[str]] = Field(default=None, alias="description")
|
|
18
|
+
start_date: Optional[datetime.datetime] = Field(default=None, alias="startDate")
|
|
19
|
+
coordinate: Optional[AutobahnCoordinate] = Field(default=None, alias="coordinate")
|
|
20
|
+
line_string: Optional[List[AutobahnCoordinate]] = Field(default=None, alias="lineString")
|
|
21
|
+
pass
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_closure_collection automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
from .autobahn_closure import AutobahnClosure
|
|
10
|
+
class AutobahnClosureCollection(BaseModel):
|
|
11
|
+
entries: Optional[List[AutobahnClosure]] = Field(default=None, alias="entries")
|
|
12
|
+
pass
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AutobahnClosureTag automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
import sdkgen
|
|
8
|
+
from requests import RequestException
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from .autobahn_closure_collection import AutobahnClosureCollection
|
|
12
|
+
from .message_exception import MessageException
|
|
13
|
+
|
|
14
|
+
class AutobahnClosureTag(sdkgen.TagAbstract):
|
|
15
|
+
def __init__(self, http_client: requests.Session, parser: sdkgen.Parser):
|
|
16
|
+
super().__init__(http_client, parser)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_all(self, autobahn_id: str) -> AutobahnClosureCollection:
|
|
20
|
+
"""
|
|
21
|
+
Returns available closures for a specific autobahn
|
|
22
|
+
"""
|
|
23
|
+
try:
|
|
24
|
+
path_params = {}
|
|
25
|
+
path_params["autobahn_id"] = autobahn_id
|
|
26
|
+
|
|
27
|
+
query_params = {}
|
|
28
|
+
|
|
29
|
+
query_struct_names = []
|
|
30
|
+
|
|
31
|
+
url = self.parser.url("/autobahn/:autobahn_id/closure", path_params)
|
|
32
|
+
|
|
33
|
+
headers = {}
|
|
34
|
+
|
|
35
|
+
response = self.http_client.get(url, headers=headers, params=self.parser.query(query_params, query_struct_names))
|
|
36
|
+
|
|
37
|
+
if response.status_code >= 200 and response.status_code < 300:
|
|
38
|
+
return AutobahnClosureCollection.model_validate_json(json_data=response.content)
|
|
39
|
+
|
|
40
|
+
if response.status_code == 400:
|
|
41
|
+
raise MessageException(response.content)
|
|
42
|
+
if response.status_code == 404:
|
|
43
|
+
raise MessageException(response.content)
|
|
44
|
+
if response.status_code == 500:
|
|
45
|
+
raise MessageException(response.content)
|
|
46
|
+
|
|
47
|
+
raise sdkgen.UnknownStatusCodeException("The server returned an unknown status code")
|
|
48
|
+
except RequestException as e:
|
|
49
|
+
raise sdkgen.ClientException("An unknown error occurred: " + str(e))
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_collection automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
class AutobahnCollection(BaseModel):
|
|
10
|
+
roads: Optional[List[str]] = Field(default=None, alias="roads")
|
|
11
|
+
pass
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_coordinate automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
class AutobahnCoordinate(BaseModel):
|
|
10
|
+
lat: Optional[str] = Field(default=None, alias="lat")
|
|
11
|
+
long: Optional[str] = Field(default=None, alias="long")
|
|
12
|
+
pass
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_parking_lorry automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
from .autobahn_coordinate import AutobahnCoordinate
|
|
10
|
+
class AutobahnParkingLorry(BaseModel):
|
|
11
|
+
id: Optional[str] = Field(default=None, alias="id")
|
|
12
|
+
title: Optional[str] = Field(default=None, alias="title")
|
|
13
|
+
subtitle: Optional[str] = Field(default=None, alias="subtitle")
|
|
14
|
+
description: Optional[List[str]] = Field(default=None, alias="description")
|
|
15
|
+
coordinate: Optional[AutobahnCoordinate] = Field(default=None, alias="coordinate")
|
|
16
|
+
features: Optional[List[str]] = Field(default=None, alias="features")
|
|
17
|
+
pass
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
autobahn_parking_lorry_collection automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, GetCoreSchemaHandler
|
|
7
|
+
from pydantic_core import CoreSchema, core_schema
|
|
8
|
+
from typing import Any, Dict, Generic, List, Optional, TypeVar, Union
|
|
9
|
+
from .autobahn_parking_lorry import AutobahnParkingLorry
|
|
10
|
+
class AutobahnParkingLorryCollection(BaseModel):
|
|
11
|
+
entries: Optional[List[AutobahnParkingLorry]] = Field(default=None, alias="entries")
|
|
12
|
+
pass
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AutobahnParkingLorryTag automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
import sdkgen
|
|
8
|
+
from requests import RequestException
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from .autobahn_parking_lorry_collection import AutobahnParkingLorryCollection
|
|
12
|
+
from .message_exception import MessageException
|
|
13
|
+
|
|
14
|
+
class AutobahnParkingLorryTag(sdkgen.TagAbstract):
|
|
15
|
+
def __init__(self, http_client: requests.Session, parser: sdkgen.Parser):
|
|
16
|
+
super().__init__(http_client, parser)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_all(self, autobahn_id: str) -> AutobahnParkingLorryCollection:
|
|
20
|
+
"""
|
|
21
|
+
Returns available parking lorries for a specific autobahn
|
|
22
|
+
"""
|
|
23
|
+
try:
|
|
24
|
+
path_params = {}
|
|
25
|
+
path_params["autobahn_id"] = autobahn_id
|
|
26
|
+
|
|
27
|
+
query_params = {}
|
|
28
|
+
|
|
29
|
+
query_struct_names = []
|
|
30
|
+
|
|
31
|
+
url = self.parser.url("/autobahn/:autobahn_id/parking_lorry", path_params)
|
|
32
|
+
|
|
33
|
+
headers = {}
|
|
34
|
+
|
|
35
|
+
response = self.http_client.get(url, headers=headers, params=self.parser.query(query_params, query_struct_names))
|
|
36
|
+
|
|
37
|
+
if response.status_code >= 200 and response.status_code < 300:
|
|
38
|
+
return AutobahnParkingLorryCollection.model_validate_json(json_data=response.content)
|
|
39
|
+
|
|
40
|
+
if response.status_code == 400:
|
|
41
|
+
raise MessageException(response.content)
|
|
42
|
+
if response.status_code == 404:
|
|
43
|
+
raise MessageException(response.content)
|
|
44
|
+
if response.status_code == 500:
|
|
45
|
+
raise MessageException(response.content)
|
|
46
|
+
|
|
47
|
+
raise sdkgen.UnknownStatusCodeException("The server returned an unknown status code")
|
|
48
|
+
except RequestException as e:
|
|
49
|
+
raise sdkgen.ClientException("An unknown error occurred: " + str(e))
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AutobahnTag automatically generated by SDKgen please do not edit this file manually
|
|
3
|
+
https://sdkgen.app
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
import sdkgen
|
|
8
|
+
from requests import RequestException
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from .autobahn_charging_station_tag import AutobahnChargingStationTag
|
|
12
|
+
from .autobahn_closure_tag import AutobahnClosureTag
|
|
13
|
+
from .autobahn_collection import AutobahnCollection
|
|
14
|
+
from .autobahn_parking_lorry_tag import AutobahnParkingLorryTag
|
|
15
|
+
from .autobahn_warning_tag import AutobahnWarningTag
|
|
16
|
+
from .message_exception import MessageException
|
|
17
|
+
|
|
18
|
+
class AutobahnTag(sdkgen.TagAbstract):
|
|
19
|
+
def __init__(self, http_client: requests.Session, parser: sdkgen.Parser):
|
|
20
|
+
super().__init__(http_client, parser)
|
|
21
|
+
|
|
22
|
+
def warning(self) -> AutobahnWarningTag:
|
|
23
|
+
return AutobahnWarningTag(
|
|
24
|
+
self.http_client,
|
|
25
|
+
self.parser
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def parking_lorry(self) -> AutobahnParkingLorryTag:
|
|
29
|
+
return AutobahnParkingLorryTag(
|
|
30
|
+
self.http_client,
|
|
31
|
+
self.parser
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
def closure(self) -> AutobahnClosureTag:
|
|
35
|
+
return AutobahnClosureTag(
|
|
36
|
+
self.http_client,
|
|
37
|
+
self.parser
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
def charging_station(self) -> AutobahnChargingStationTag:
|
|
41
|
+
return AutobahnChargingStationTag(
|
|
42
|
+
self.http_client,
|
|
43
|
+
self.parser
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def get_all(self) -> AutobahnCollection:
|
|
48
|
+
"""
|
|
49
|
+
Returns all available autobahns
|
|
50
|
+
"""
|
|
51
|
+
try:
|
|
52
|
+
path_params = {}
|
|
53
|
+
|
|
54
|
+
query_params = {}
|
|
55
|
+
|
|
56
|
+
query_struct_names = []
|
|
57
|
+
|
|
58
|
+
url = self.parser.url("/autobahn", path_params)
|
|
59
|
+
|
|
60
|
+
headers = {}
|
|
61
|
+
|
|
62
|
+
response = self.http_client.get(url, headers=headers, params=self.parser.query(query_params, query_struct_names))
|
|
63
|
+
|
|
64
|
+
if response.status_code >= 200 and response.status_code < 300:
|
|
65
|
+
return AutobahnCollection.model_validate_json(json_data=response.content)
|
|
66
|
+
|
|
67
|
+
if response.status_code == 400:
|
|
68
|
+
raise MessageException(response.content)
|
|
69
|
+
if response.status_code == 404:
|
|
70
|
+
raise MessageException(response.content)
|
|
71
|
+
if response.status_code == 500:
|
|
72
|
+
raise MessageException(response.content)
|
|
73
|
+
|
|
74
|
+
raise sdkgen.UnknownStatusCodeException("The server returned an unknown status code")
|
|
75
|
+
except RequestException as e:
|
|
76
|
+
raise sdkgen.ClientException("An unknown error occurred: " + str(e))
|
|
77
|
+
|
|
78
|
+
|