naurt-api 0.1.0__py3-none-any.whl

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.
Files changed (63) hide show
  1. naurt_api/__init__.py +8 -0
  2. naurt_api/api/__init__.py +1 -0
  3. naurt_api/api/feedback/__init__.py +1 -0
  4. naurt_api/api/feedback/feedback_options.py +150 -0
  5. naurt_api/api/feedback/feedback_post.py +231 -0
  6. naurt_api/api/final_destination/__init__.py +1 -0
  7. naurt_api/api/final_destination/finaldestination_options.py +150 -0
  8. naurt_api/api/final_destination/finaldestination_post.py +310 -0
  9. naurt_api/api/rendezvous/__init__.py +1 -0
  10. naurt_api/api/rendezvous/rendezvous_options.py +158 -0
  11. naurt_api/api/rendezvous/rendezvous_post.py +215 -0
  12. naurt_api/client.py +271 -0
  13. naurt_api/errors.py +14 -0
  14. naurt_api/models/__init__.py +91 -0
  15. naurt_api/models/accuracy.py +80 -0
  16. naurt_api/models/accuracy_quality.py +9 -0
  17. naurt_api/models/country.py +42 -0
  18. naurt_api/models/error_response.py +81 -0
  19. naurt_api/models/feature.py +150 -0
  20. naurt_api/models/feature_collection.py +106 -0
  21. naurt_api/models/feature_collection_type.py +7 -0
  22. naurt_api/models/feature_properties.py +114 -0
  23. naurt_api/models/feature_properties_naurt_type.py +10 -0
  24. naurt_api/models/feature_type.py +7 -0
  25. naurt_api/models/feedback_location.py +66 -0
  26. naurt_api/models/feedback_query.py +124 -0
  27. naurt_api/models/feedback_request.py +76 -0
  28. naurt_api/models/feedback_response.py +58 -0
  29. naurt_api/models/final_destination_hit.py +187 -0
  30. naurt_api/models/final_destination_hits.py +148 -0
  31. naurt_api/models/final_destination_location.py +82 -0
  32. naurt_api/models/final_destination_logging.py +94 -0
  33. naurt_api/models/final_destination_options.py +150 -0
  34. naurt_api/models/final_destination_query.py +217 -0
  35. naurt_api/models/final_destination_request.py +101 -0
  36. naurt_api/models/final_destination_response.py +121 -0
  37. naurt_api/models/final_destination_source_id_request.py +60 -0
  38. naurt_api/models/final_destination_source_id_response.py +75 -0
  39. naurt_api/models/final_destination_status.py +8 -0
  40. naurt_api/models/geojson_type.py +8 -0
  41. naurt_api/models/input_filter.py +9 -0
  42. naurt_api/models/key_value.py +156 -0
  43. naurt_api/models/language.py +22 -0
  44. naurt_api/models/multipoint.py +117 -0
  45. naurt_api/models/multipoint_type.py +7 -0
  46. naurt_api/models/options_response.py +70 -0
  47. naurt_api/models/point.py +92 -0
  48. naurt_api/models/point_type.py +7 -0
  49. naurt_api/models/polygon.py +112 -0
  50. naurt_api/models/polygon_type.py +7 -0
  51. naurt_api/models/rendezvous_hit.py +87 -0
  52. naurt_api/models/rendezvous_hit_data.py +93 -0
  53. naurt_api/models/rendezvous_options.py +66 -0
  54. naurt_api/models/rendezvous_query.py +104 -0
  55. naurt_api/models/rendezvous_request.py +100 -0
  56. naurt_api/models/rendezvous_response.py +144 -0
  57. naurt_api/models/structured_address.py +144 -0
  58. naurt_api/py.typed +1 -0
  59. naurt_api/types.py +53 -0
  60. naurt_api-0.1.0.dist-info/METADATA +151 -0
  61. naurt_api-0.1.0.dist-info/RECORD +63 -0
  62. naurt_api-0.1.0.dist-info/WHEEL +4 -0
  63. naurt_api-0.1.0.dist-info/licenses/LICENSE +21 -0
naurt_api/__init__.py ADDED
@@ -0,0 +1,8 @@
1
+
2
+ """ A client library for accessing Naurt API """
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """ Contains methods for accessing the API """
@@ -0,0 +1 @@
1
+ """ Contains endpoint functions for accessing the API """
@@ -0,0 +1,150 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response, UNSET
9
+ from ... import errors
10
+
11
+ from ...models.options_response import OptionsResponse
12
+ from typing import cast
13
+
14
+
15
+
16
+ def _get_kwargs(
17
+
18
+ ) -> dict[str, Any]:
19
+
20
+
21
+
22
+
23
+
24
+
25
+ _kwargs: dict[str, Any] = {
26
+ "method": "options",
27
+ "url": "/feedback/v2",
28
+ }
29
+
30
+
31
+ return _kwargs
32
+
33
+
34
+
35
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionsResponse | None:
36
+ if response.status_code == 200:
37
+ response_200 = OptionsResponse.from_dict(response.json())
38
+
39
+
40
+
41
+ return response_200
42
+
43
+ if client.raise_on_unexpected_status:
44
+ raise errors.UnexpectedStatus(response.status_code, response.content)
45
+ else:
46
+ return None
47
+
48
+
49
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionsResponse]:
50
+ return Response(
51
+ status_code=HTTPStatus(response.status_code),
52
+ content=response.content,
53
+ headers=response.headers,
54
+ parsed=_parse_response(client=client, response=response),
55
+ )
56
+
57
+
58
+ def sync_detailed(
59
+ *,
60
+ client: AuthenticatedClient | Client,
61
+
62
+ ) -> Response[OptionsResponse]:
63
+ """ Options
64
+
65
+ Raises:
66
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
67
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
68
+
69
+ Returns:
70
+ Response[OptionsResponse]
71
+ """
72
+
73
+
74
+ kwargs = _get_kwargs(
75
+
76
+ )
77
+
78
+ response = client.get_httpx_client().request(
79
+ **kwargs,
80
+ )
81
+
82
+ return _build_response(client=client, response=response)
83
+
84
+ def sync(
85
+ *,
86
+ client: AuthenticatedClient | Client,
87
+
88
+ ) -> OptionsResponse | None:
89
+ """ Options
90
+
91
+ Raises:
92
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
94
+
95
+ Returns:
96
+ OptionsResponse
97
+ """
98
+
99
+
100
+ return sync_detailed(
101
+ client=client,
102
+
103
+ ).parsed
104
+
105
+ async def asyncio_detailed(
106
+ *,
107
+ client: AuthenticatedClient | Client,
108
+
109
+ ) -> Response[OptionsResponse]:
110
+ """ Options
111
+
112
+ Raises:
113
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
115
+
116
+ Returns:
117
+ Response[OptionsResponse]
118
+ """
119
+
120
+
121
+ kwargs = _get_kwargs(
122
+
123
+ )
124
+
125
+ response = await client.get_async_httpx_client().request(
126
+ **kwargs
127
+ )
128
+
129
+ return _build_response(client=client, response=response)
130
+
131
+ async def asyncio(
132
+ *,
133
+ client: AuthenticatedClient | Client,
134
+
135
+ ) -> OptionsResponse | None:
136
+ """ Options
137
+
138
+ Raises:
139
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
140
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
141
+
142
+ Returns:
143
+ OptionsResponse
144
+ """
145
+
146
+
147
+ return (await asyncio_detailed(
148
+ client=client,
149
+
150
+ )).parsed
@@ -0,0 +1,231 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response, UNSET
9
+ from ... import errors
10
+
11
+ from ...models.feedback_request import FeedbackRequest
12
+ from ...models.feedback_response import FeedbackResponse
13
+ from typing import cast
14
+
15
+
16
+
17
+ def _get_kwargs(
18
+ *,
19
+ body: FeedbackRequest,
20
+
21
+ ) -> dict[str, Any]:
22
+ headers: dict[str, Any] = {}
23
+
24
+
25
+
26
+
27
+
28
+
29
+ _kwargs: dict[str, Any] = {
30
+ "method": "post",
31
+ "url": "/feedback/v2",
32
+ }
33
+
34
+ _kwargs["json"] = body.to_dict()
35
+
36
+
37
+ headers["Content-Type"] = "application/json"
38
+
39
+ _kwargs["headers"] = headers
40
+ return _kwargs
41
+
42
+
43
+
44
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | FeedbackResponse | None:
45
+ if response.status_code == 200:
46
+ response_200 = FeedbackResponse.from_dict(response.json())
47
+
48
+
49
+
50
+ return response_200
51
+
52
+ if response.status_code == 400:
53
+ response_400 = cast(Any, None)
54
+ return response_400
55
+
56
+ if response.status_code == 401:
57
+ response_401 = cast(Any, None)
58
+ return response_401
59
+
60
+ if response.status_code == 500:
61
+ response_500 = cast(Any, None)
62
+ return response_500
63
+
64
+ if client.raise_on_unexpected_status:
65
+ raise errors.UnexpectedStatus(response.status_code, response.content)
66
+ else:
67
+ return None
68
+
69
+
70
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | FeedbackResponse]:
71
+ return Response(
72
+ status_code=HTTPStatus(response.status_code),
73
+ content=response.content,
74
+ headers=response.headers,
75
+ parsed=_parse_response(client=client, response=response),
76
+ )
77
+
78
+
79
+ def sync_detailed(
80
+ *,
81
+ client: AuthenticatedClient,
82
+ body: FeedbackRequest,
83
+
84
+ ) -> Response[Any | FeedbackResponse]:
85
+ """ Post
86
+
87
+ Submit feedback to Naurt for address, parking location, or door location data.
88
+
89
+ This endpoint can be used to:
90
+ - suggest corrections to existing Naurt address data
91
+ - suggest improved parking locations
92
+ - suggest improved door locations
93
+ - provide new address records where parking or door data is not yet available
94
+
95
+ A valid API key is required. Feedback submissions do not count against API usage.
96
+
97
+ Args:
98
+ body (FeedbackRequest):
99
+
100
+ Raises:
101
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
103
+
104
+ Returns:
105
+ Response[Any | FeedbackResponse]
106
+ """
107
+
108
+
109
+ kwargs = _get_kwargs(
110
+ body=body,
111
+
112
+ )
113
+
114
+ response = client.get_httpx_client().request(
115
+ **kwargs,
116
+ )
117
+
118
+ return _build_response(client=client, response=response)
119
+
120
+ def sync(
121
+ *,
122
+ client: AuthenticatedClient,
123
+ body: FeedbackRequest,
124
+
125
+ ) -> Any | FeedbackResponse | None:
126
+ """ Post
127
+
128
+ Submit feedback to Naurt for address, parking location, or door location data.
129
+
130
+ This endpoint can be used to:
131
+ - suggest corrections to existing Naurt address data
132
+ - suggest improved parking locations
133
+ - suggest improved door locations
134
+ - provide new address records where parking or door data is not yet available
135
+
136
+ A valid API key is required. Feedback submissions do not count against API usage.
137
+
138
+ Args:
139
+ body (FeedbackRequest):
140
+
141
+ Raises:
142
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
144
+
145
+ Returns:
146
+ Any | FeedbackResponse
147
+ """
148
+
149
+
150
+ return sync_detailed(
151
+ client=client,
152
+ body=body,
153
+
154
+ ).parsed
155
+
156
+ async def asyncio_detailed(
157
+ *,
158
+ client: AuthenticatedClient,
159
+ body: FeedbackRequest,
160
+
161
+ ) -> Response[Any | FeedbackResponse]:
162
+ """ Post
163
+
164
+ Submit feedback to Naurt for address, parking location, or door location data.
165
+
166
+ This endpoint can be used to:
167
+ - suggest corrections to existing Naurt address data
168
+ - suggest improved parking locations
169
+ - suggest improved door locations
170
+ - provide new address records where parking or door data is not yet available
171
+
172
+ A valid API key is required. Feedback submissions do not count against API usage.
173
+
174
+ Args:
175
+ body (FeedbackRequest):
176
+
177
+ Raises:
178
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
179
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
180
+
181
+ Returns:
182
+ Response[Any | FeedbackResponse]
183
+ """
184
+
185
+
186
+ kwargs = _get_kwargs(
187
+ body=body,
188
+
189
+ )
190
+
191
+ response = await client.get_async_httpx_client().request(
192
+ **kwargs
193
+ )
194
+
195
+ return _build_response(client=client, response=response)
196
+
197
+ async def asyncio(
198
+ *,
199
+ client: AuthenticatedClient,
200
+ body: FeedbackRequest,
201
+
202
+ ) -> Any | FeedbackResponse | None:
203
+ """ Post
204
+
205
+ Submit feedback to Naurt for address, parking location, or door location data.
206
+
207
+ This endpoint can be used to:
208
+ - suggest corrections to existing Naurt address data
209
+ - suggest improved parking locations
210
+ - suggest improved door locations
211
+ - provide new address records where parking or door data is not yet available
212
+
213
+ A valid API key is required. Feedback submissions do not count against API usage.
214
+
215
+ Args:
216
+ body (FeedbackRequest):
217
+
218
+ Raises:
219
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
220
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
221
+
222
+ Returns:
223
+ Any | FeedbackResponse
224
+ """
225
+
226
+
227
+ return (await asyncio_detailed(
228
+ client=client,
229
+ body=body,
230
+
231
+ )).parsed
@@ -0,0 +1 @@
1
+ """ Contains endpoint functions for accessing the API """
@@ -0,0 +1,150 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response, UNSET
9
+ from ... import errors
10
+
11
+ from ...models.options_response import OptionsResponse
12
+ from typing import cast
13
+
14
+
15
+
16
+ def _get_kwargs(
17
+
18
+ ) -> dict[str, Any]:
19
+
20
+
21
+
22
+
23
+
24
+
25
+ _kwargs: dict[str, Any] = {
26
+ "method": "options",
27
+ "url": "/final-destination/v2",
28
+ }
29
+
30
+
31
+ return _kwargs
32
+
33
+
34
+
35
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> OptionsResponse | None:
36
+ if response.status_code == 200:
37
+ response_200 = OptionsResponse.from_dict(response.json())
38
+
39
+
40
+
41
+ return response_200
42
+
43
+ if client.raise_on_unexpected_status:
44
+ raise errors.UnexpectedStatus(response.status_code, response.content)
45
+ else:
46
+ return None
47
+
48
+
49
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[OptionsResponse]:
50
+ return Response(
51
+ status_code=HTTPStatus(response.status_code),
52
+ content=response.content,
53
+ headers=response.headers,
54
+ parsed=_parse_response(client=client, response=response),
55
+ )
56
+
57
+
58
+ def sync_detailed(
59
+ *,
60
+ client: AuthenticatedClient | Client,
61
+
62
+ ) -> Response[OptionsResponse]:
63
+ """ Options
64
+
65
+ Raises:
66
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
67
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
68
+
69
+ Returns:
70
+ Response[OptionsResponse]
71
+ """
72
+
73
+
74
+ kwargs = _get_kwargs(
75
+
76
+ )
77
+
78
+ response = client.get_httpx_client().request(
79
+ **kwargs,
80
+ )
81
+
82
+ return _build_response(client=client, response=response)
83
+
84
+ def sync(
85
+ *,
86
+ client: AuthenticatedClient | Client,
87
+
88
+ ) -> OptionsResponse | None:
89
+ """ Options
90
+
91
+ Raises:
92
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
94
+
95
+ Returns:
96
+ OptionsResponse
97
+ """
98
+
99
+
100
+ return sync_detailed(
101
+ client=client,
102
+
103
+ ).parsed
104
+
105
+ async def asyncio_detailed(
106
+ *,
107
+ client: AuthenticatedClient | Client,
108
+
109
+ ) -> Response[OptionsResponse]:
110
+ """ Options
111
+
112
+ Raises:
113
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
115
+
116
+ Returns:
117
+ Response[OptionsResponse]
118
+ """
119
+
120
+
121
+ kwargs = _get_kwargs(
122
+
123
+ )
124
+
125
+ response = await client.get_async_httpx_client().request(
126
+ **kwargs
127
+ )
128
+
129
+ return _build_response(client=client, response=response)
130
+
131
+ async def asyncio(
132
+ *,
133
+ client: AuthenticatedClient | Client,
134
+
135
+ ) -> OptionsResponse | None:
136
+ """ Options
137
+
138
+ Raises:
139
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
140
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
141
+
142
+ Returns:
143
+ OptionsResponse
144
+ """
145
+
146
+
147
+ return (await asyncio_detailed(
148
+ client=client,
149
+
150
+ )).parsed