ocpplab 0.1.1__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.
- ocpplab/__init__.py +240 -0
- ocpplab/_default_clients.py +30 -0
- ocpplab/catalog/__init__.py +4 -0
- ocpplab/catalog/client.py +332 -0
- ocpplab/catalog/raw_client.py +657 -0
- ocpplab/charger_commands/__init__.py +4 -0
- ocpplab/charger_commands/client.py +1291 -0
- ocpplab/charger_commands/raw_client.py +2821 -0
- ocpplab/charger_configuration/__init__.py +4 -0
- ocpplab/charger_configuration/client.py +310 -0
- ocpplab/charger_configuration/raw_client.py +690 -0
- ocpplab/charger_deployments/__init__.py +4 -0
- ocpplab/charger_deployments/client.py +904 -0
- ocpplab/charger_deployments/raw_client.py +1850 -0
- ocpplab/charger_faults/__init__.py +4 -0
- ocpplab/charger_faults/client.py +266 -0
- ocpplab/charger_faults/raw_client.py +493 -0
- ocpplab/charger_local_authorization/__init__.py +4 -0
- ocpplab/charger_local_authorization/client.py +360 -0
- ocpplab/charger_local_authorization/raw_client.py +716 -0
- ocpplab/charger_logs/__init__.py +4 -0
- ocpplab/charger_logs/client.py +181 -0
- ocpplab/charger_logs/raw_client.py +266 -0
- ocpplab/client.py +500 -0
- ocpplab/core/__init__.py +127 -0
- ocpplab/core/api_error.py +23 -0
- ocpplab/core/client_wrapper.py +128 -0
- ocpplab/core/datetime_utils.py +70 -0
- ocpplab/core/file.py +67 -0
- ocpplab/core/force_multipart.py +18 -0
- ocpplab/core/http_client.py +840 -0
- ocpplab/core/http_response.py +59 -0
- ocpplab/core/http_sse/__init__.py +42 -0
- ocpplab/core/http_sse/_api.py +112 -0
- ocpplab/core/http_sse/_decoders.py +61 -0
- ocpplab/core/http_sse/_exceptions.py +7 -0
- ocpplab/core/http_sse/_models.py +17 -0
- ocpplab/core/jsonable_encoder.py +120 -0
- ocpplab/core/logging.py +107 -0
- ocpplab/core/parse_error.py +36 -0
- ocpplab/core/pydantic_utilities.py +634 -0
- ocpplab/core/query_encoder.py +58 -0
- ocpplab/core/remove_none_from_dict.py +11 -0
- ocpplab/core/request_options.py +35 -0
- ocpplab/core/serialization.py +276 -0
- ocpplab/errors/__init__.py +53 -0
- ocpplab/errors/bad_request_error.py +11 -0
- ocpplab/errors/forbidden_error.py +11 -0
- ocpplab/errors/internal_server_error.py +11 -0
- ocpplab/errors/not_found_error.py +11 -0
- ocpplab/errors/unauthorized_error.py +11 -0
- ocpplab/errors/unprocessable_entity_error.py +11 -0
- ocpplab/health/__init__.py +4 -0
- ocpplab/health/client.py +109 -0
- ocpplab/health/raw_client.py +155 -0
- ocpplab/location_charger_commands/__init__.py +4 -0
- ocpplab/location_charger_commands/client.py +1311 -0
- ocpplab/location_charger_commands/raw_client.py +2887 -0
- ocpplab/location_charger_faults/__init__.py +4 -0
- ocpplab/location_charger_faults/client.py +289 -0
- ocpplab/location_charger_faults/raw_client.py +563 -0
- ocpplab/location_charger_provisioning/__init__.py +4 -0
- ocpplab/location_charger_provisioning/client.py +797 -0
- ocpplab/location_charger_provisioning/raw_client.py +1712 -0
- ocpplab/locations/__init__.py +4 -0
- ocpplab/locations/client.py +633 -0
- ocpplab/locations/raw_client.py +1212 -0
- ocpplab/py.typed +0 -0
- ocpplab/raw_client.py +137 -0
- ocpplab/types/__init__.py +167 -0
- ocpplab/types/brand_list_response.py +27 -0
- ocpplab/types/brand_response.py +28 -0
- ocpplab/types/cache_reset_response.py +24 -0
- ocpplab/types/charger_lifecycle_request.py +8 -0
- ocpplab/types/charger_list_response.py +27 -0
- ocpplab/types/charger_log_entry.py +27 -0
- ocpplab/types/charger_log_list_response.py +27 -0
- ocpplab/types/charger_response.py +36 -0
- ocpplab/types/configuration_change_response.py +25 -0
- ocpplab/types/configuration_entry.py +24 -0
- ocpplab/types/configuration_response.py +24 -0
- ocpplab/types/configuration_update_request.py +8 -0
- ocpplab/types/connector_selection_request.py +24 -0
- ocpplab/types/coordinates.py +31 -0
- ocpplab/types/create_charger_request.py +42 -0
- ocpplab/types/create_location_chargers_response.py +28 -0
- ocpplab/types/delete_location_chargers_response.py +27 -0
- ocpplab/types/fault_operation_response.py +27 -0
- ocpplab/types/http_error_response.py +26 -0
- ocpplab/types/http_validation_error.py +20 -0
- ocpplab/types/local_auth_list_entry.py +26 -0
- ocpplab/types/local_authorization_list_response.py +27 -0
- ocpplab/types/local_list_mutation_response.py +27 -0
- ocpplab/types/location_command_failure.py +24 -0
- ocpplab/types/location_command_response.py +29 -0
- ocpplab/types/location_create_charger_failure.py +24 -0
- ocpplab/types/location_delete_charger_failure.py +24 -0
- ocpplab/types/location_fault_response.py +29 -0
- ocpplab/types/location_fault_result.py +26 -0
- ocpplab/types/location_lifecycle_request.py +23 -0
- ocpplab/types/location_list_response.py +27 -0
- ocpplab/types/location_queued_command_result.py +26 -0
- ocpplab/types/location_response.py +37 -0
- ocpplab/types/location_response_coordinates.py +7 -0
- ocpplab/types/location_update_charger_failure.py +24 -0
- ocpplab/types/model_list_response.py +27 -0
- ocpplab/types/model_response.py +34 -0
- ocpplab/types/proxy_action.py +27 -0
- ocpplab/types/proxy_ocpp_version.py +5 -0
- ocpplab/types/queued_command_response.py +29 -0
- ocpplab/types/update_location_charger_item.py +30 -0
- ocpplab/types/update_location_chargers_response.py +28 -0
- ocpplab/types/validation_error.py +24 -0
- ocpplab/types/validation_error_loc_item.py +5 -0
- ocpplab/version.py +3 -0
- ocpplab-0.1.1.dist-info/METADATA +262 -0
- ocpplab-0.1.1.dist-info/RECORD +118 -0
- ocpplab-0.1.1.dist-info/WHEEL +4 -0
ocpplab/__init__.py
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
BrandListResponse,
|
|
11
|
+
BrandResponse,
|
|
12
|
+
CacheResetResponse,
|
|
13
|
+
ChargerLifecycleRequest,
|
|
14
|
+
ChargerListResponse,
|
|
15
|
+
ChargerLogEntry,
|
|
16
|
+
ChargerLogListResponse,
|
|
17
|
+
ChargerResponse,
|
|
18
|
+
ConfigurationChangeResponse,
|
|
19
|
+
ConfigurationEntry,
|
|
20
|
+
ConfigurationResponse,
|
|
21
|
+
ConfigurationUpdateRequest,
|
|
22
|
+
ConnectorSelectionRequest,
|
|
23
|
+
Coordinates,
|
|
24
|
+
CreateChargerRequest,
|
|
25
|
+
CreateLocationChargersResponse,
|
|
26
|
+
DeleteLocationChargersResponse,
|
|
27
|
+
FaultOperationResponse,
|
|
28
|
+
HttpErrorResponse,
|
|
29
|
+
HttpValidationError,
|
|
30
|
+
LocalAuthListEntry,
|
|
31
|
+
LocalAuthorizationListResponse,
|
|
32
|
+
LocalListMutationResponse,
|
|
33
|
+
LocationCommandFailure,
|
|
34
|
+
LocationCommandResponse,
|
|
35
|
+
LocationCreateChargerFailure,
|
|
36
|
+
LocationDeleteChargerFailure,
|
|
37
|
+
LocationFaultResponse,
|
|
38
|
+
LocationFaultResult,
|
|
39
|
+
LocationLifecycleRequest,
|
|
40
|
+
LocationListResponse,
|
|
41
|
+
LocationQueuedCommandResult,
|
|
42
|
+
LocationResponse,
|
|
43
|
+
LocationResponseCoordinates,
|
|
44
|
+
LocationUpdateChargerFailure,
|
|
45
|
+
ModelListResponse,
|
|
46
|
+
ModelResponse,
|
|
47
|
+
ProxyAction,
|
|
48
|
+
ProxyOcppVersion,
|
|
49
|
+
QueuedCommandResponse,
|
|
50
|
+
UpdateLocationChargerItem,
|
|
51
|
+
UpdateLocationChargersResponse,
|
|
52
|
+
ValidationError,
|
|
53
|
+
ValidationErrorLocItem,
|
|
54
|
+
)
|
|
55
|
+
from .errors import (
|
|
56
|
+
BadRequestError,
|
|
57
|
+
ForbiddenError,
|
|
58
|
+
InternalServerError,
|
|
59
|
+
NotFoundError,
|
|
60
|
+
UnauthorizedError,
|
|
61
|
+
UnprocessableEntityError,
|
|
62
|
+
)
|
|
63
|
+
from . import (
|
|
64
|
+
catalog,
|
|
65
|
+
charger_commands,
|
|
66
|
+
charger_configuration,
|
|
67
|
+
charger_deployments,
|
|
68
|
+
charger_faults,
|
|
69
|
+
charger_local_authorization,
|
|
70
|
+
charger_logs,
|
|
71
|
+
health,
|
|
72
|
+
location_charger_commands,
|
|
73
|
+
location_charger_faults,
|
|
74
|
+
location_charger_provisioning,
|
|
75
|
+
locations,
|
|
76
|
+
)
|
|
77
|
+
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
78
|
+
from .client import AsyncOcpplabApi, OcpplabApi
|
|
79
|
+
from .version import __version__
|
|
80
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
81
|
+
"AsyncOcpplabApi": ".client",
|
|
82
|
+
"BadRequestError": ".errors",
|
|
83
|
+
"BrandListResponse": ".types",
|
|
84
|
+
"BrandResponse": ".types",
|
|
85
|
+
"CacheResetResponse": ".types",
|
|
86
|
+
"ChargerLifecycleRequest": ".types",
|
|
87
|
+
"ChargerListResponse": ".types",
|
|
88
|
+
"ChargerLogEntry": ".types",
|
|
89
|
+
"ChargerLogListResponse": ".types",
|
|
90
|
+
"ChargerResponse": ".types",
|
|
91
|
+
"ConfigurationChangeResponse": ".types",
|
|
92
|
+
"ConfigurationEntry": ".types",
|
|
93
|
+
"ConfigurationResponse": ".types",
|
|
94
|
+
"ConfigurationUpdateRequest": ".types",
|
|
95
|
+
"ConnectorSelectionRequest": ".types",
|
|
96
|
+
"Coordinates": ".types",
|
|
97
|
+
"CreateChargerRequest": ".types",
|
|
98
|
+
"CreateLocationChargersResponse": ".types",
|
|
99
|
+
"DefaultAioHttpClient": "._default_clients",
|
|
100
|
+
"DefaultAsyncHttpxClient": "._default_clients",
|
|
101
|
+
"DeleteLocationChargersResponse": ".types",
|
|
102
|
+
"FaultOperationResponse": ".types",
|
|
103
|
+
"ForbiddenError": ".errors",
|
|
104
|
+
"HttpErrorResponse": ".types",
|
|
105
|
+
"HttpValidationError": ".types",
|
|
106
|
+
"InternalServerError": ".errors",
|
|
107
|
+
"LocalAuthListEntry": ".types",
|
|
108
|
+
"LocalAuthorizationListResponse": ".types",
|
|
109
|
+
"LocalListMutationResponse": ".types",
|
|
110
|
+
"LocationCommandFailure": ".types",
|
|
111
|
+
"LocationCommandResponse": ".types",
|
|
112
|
+
"LocationCreateChargerFailure": ".types",
|
|
113
|
+
"LocationDeleteChargerFailure": ".types",
|
|
114
|
+
"LocationFaultResponse": ".types",
|
|
115
|
+
"LocationFaultResult": ".types",
|
|
116
|
+
"LocationLifecycleRequest": ".types",
|
|
117
|
+
"LocationListResponse": ".types",
|
|
118
|
+
"LocationQueuedCommandResult": ".types",
|
|
119
|
+
"LocationResponse": ".types",
|
|
120
|
+
"LocationResponseCoordinates": ".types",
|
|
121
|
+
"LocationUpdateChargerFailure": ".types",
|
|
122
|
+
"ModelListResponse": ".types",
|
|
123
|
+
"ModelResponse": ".types",
|
|
124
|
+
"NotFoundError": ".errors",
|
|
125
|
+
"OcpplabApi": ".client",
|
|
126
|
+
"ProxyAction": ".types",
|
|
127
|
+
"ProxyOcppVersion": ".types",
|
|
128
|
+
"QueuedCommandResponse": ".types",
|
|
129
|
+
"UnauthorizedError": ".errors",
|
|
130
|
+
"UnprocessableEntityError": ".errors",
|
|
131
|
+
"UpdateLocationChargerItem": ".types",
|
|
132
|
+
"UpdateLocationChargersResponse": ".types",
|
|
133
|
+
"ValidationError": ".types",
|
|
134
|
+
"ValidationErrorLocItem": ".types",
|
|
135
|
+
"__version__": ".version",
|
|
136
|
+
"catalog": ".catalog",
|
|
137
|
+
"charger_commands": ".charger_commands",
|
|
138
|
+
"charger_configuration": ".charger_configuration",
|
|
139
|
+
"charger_deployments": ".charger_deployments",
|
|
140
|
+
"charger_faults": ".charger_faults",
|
|
141
|
+
"charger_local_authorization": ".charger_local_authorization",
|
|
142
|
+
"charger_logs": ".charger_logs",
|
|
143
|
+
"health": ".health",
|
|
144
|
+
"location_charger_commands": ".location_charger_commands",
|
|
145
|
+
"location_charger_faults": ".location_charger_faults",
|
|
146
|
+
"location_charger_provisioning": ".location_charger_provisioning",
|
|
147
|
+
"locations": ".locations",
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
152
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
153
|
+
if module_name is None:
|
|
154
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
155
|
+
try:
|
|
156
|
+
module = import_module(module_name, __package__)
|
|
157
|
+
if module_name == f".{attr_name}":
|
|
158
|
+
return module
|
|
159
|
+
else:
|
|
160
|
+
return getattr(module, attr_name)
|
|
161
|
+
except ImportError as e:
|
|
162
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
163
|
+
except AttributeError as e:
|
|
164
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def __dir__():
|
|
168
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
169
|
+
return sorted(lazy_attrs)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
__all__ = [
|
|
173
|
+
"AsyncOcpplabApi",
|
|
174
|
+
"BadRequestError",
|
|
175
|
+
"BrandListResponse",
|
|
176
|
+
"BrandResponse",
|
|
177
|
+
"CacheResetResponse",
|
|
178
|
+
"ChargerLifecycleRequest",
|
|
179
|
+
"ChargerListResponse",
|
|
180
|
+
"ChargerLogEntry",
|
|
181
|
+
"ChargerLogListResponse",
|
|
182
|
+
"ChargerResponse",
|
|
183
|
+
"ConfigurationChangeResponse",
|
|
184
|
+
"ConfigurationEntry",
|
|
185
|
+
"ConfigurationResponse",
|
|
186
|
+
"ConfigurationUpdateRequest",
|
|
187
|
+
"ConnectorSelectionRequest",
|
|
188
|
+
"Coordinates",
|
|
189
|
+
"CreateChargerRequest",
|
|
190
|
+
"CreateLocationChargersResponse",
|
|
191
|
+
"DefaultAioHttpClient",
|
|
192
|
+
"DefaultAsyncHttpxClient",
|
|
193
|
+
"DeleteLocationChargersResponse",
|
|
194
|
+
"FaultOperationResponse",
|
|
195
|
+
"ForbiddenError",
|
|
196
|
+
"HttpErrorResponse",
|
|
197
|
+
"HttpValidationError",
|
|
198
|
+
"InternalServerError",
|
|
199
|
+
"LocalAuthListEntry",
|
|
200
|
+
"LocalAuthorizationListResponse",
|
|
201
|
+
"LocalListMutationResponse",
|
|
202
|
+
"LocationCommandFailure",
|
|
203
|
+
"LocationCommandResponse",
|
|
204
|
+
"LocationCreateChargerFailure",
|
|
205
|
+
"LocationDeleteChargerFailure",
|
|
206
|
+
"LocationFaultResponse",
|
|
207
|
+
"LocationFaultResult",
|
|
208
|
+
"LocationLifecycleRequest",
|
|
209
|
+
"LocationListResponse",
|
|
210
|
+
"LocationQueuedCommandResult",
|
|
211
|
+
"LocationResponse",
|
|
212
|
+
"LocationResponseCoordinates",
|
|
213
|
+
"LocationUpdateChargerFailure",
|
|
214
|
+
"ModelListResponse",
|
|
215
|
+
"ModelResponse",
|
|
216
|
+
"NotFoundError",
|
|
217
|
+
"OcpplabApi",
|
|
218
|
+
"ProxyAction",
|
|
219
|
+
"ProxyOcppVersion",
|
|
220
|
+
"QueuedCommandResponse",
|
|
221
|
+
"UnauthorizedError",
|
|
222
|
+
"UnprocessableEntityError",
|
|
223
|
+
"UpdateLocationChargerItem",
|
|
224
|
+
"UpdateLocationChargersResponse",
|
|
225
|
+
"ValidationError",
|
|
226
|
+
"ValidationErrorLocItem",
|
|
227
|
+
"__version__",
|
|
228
|
+
"catalog",
|
|
229
|
+
"charger_commands",
|
|
230
|
+
"charger_configuration",
|
|
231
|
+
"charger_deployments",
|
|
232
|
+
"charger_faults",
|
|
233
|
+
"charger_local_authorization",
|
|
234
|
+
"charger_logs",
|
|
235
|
+
"health",
|
|
236
|
+
"location_charger_commands",
|
|
237
|
+
"location_charger_faults",
|
|
238
|
+
"location_charger_provisioning",
|
|
239
|
+
"locations",
|
|
240
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
SDK_DEFAULT_TIMEOUT = 60
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import httpx_aiohttp # type: ignore[import-not-found]
|
|
11
|
+
except ImportError:
|
|
12
|
+
|
|
13
|
+
class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
|
|
14
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
15
|
+
raise RuntimeError("To use the aiohttp client, install the aiohttp extra: pip install ocpplab[aiohttp]")
|
|
16
|
+
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
|
|
20
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
21
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
22
|
+
kwargs.setdefault("follow_redirects", True)
|
|
23
|
+
super().__init__(**kwargs)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class DefaultAsyncHttpxClient(httpx.AsyncClient):
|
|
27
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
28
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
29
|
+
kwargs.setdefault("follow_redirects", True)
|
|
30
|
+
super().__init__(**kwargs)
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.brand_list_response import BrandListResponse
|
|
8
|
+
from ..types.model_list_response import ModelListResponse
|
|
9
|
+
from ..types.model_response import ModelResponse
|
|
10
|
+
from .raw_client import AsyncRawCatalogClient, RawCatalogClient
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CatalogClient:
|
|
14
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
15
|
+
self._raw_client = RawCatalogClient(client_wrapper=client_wrapper)
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def with_raw_response(self) -> RawCatalogClient:
|
|
19
|
+
"""
|
|
20
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
21
|
+
|
|
22
|
+
Returns
|
|
23
|
+
-------
|
|
24
|
+
RawCatalogClient
|
|
25
|
+
"""
|
|
26
|
+
return self._raw_client
|
|
27
|
+
|
|
28
|
+
def list_catalog_brands(
|
|
29
|
+
self,
|
|
30
|
+
*,
|
|
31
|
+
page: typing.Optional[int] = None,
|
|
32
|
+
limit: typing.Optional[int] = None,
|
|
33
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
34
|
+
) -> BrandListResponse:
|
|
35
|
+
"""
|
|
36
|
+
Retrieve the catalog of charger brands available to the platform.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
page : typing.Optional[int]
|
|
41
|
+
Page number for the paginated brand catalog.
|
|
42
|
+
|
|
43
|
+
limit : typing.Optional[int]
|
|
44
|
+
Maximum number of brands returned in one page.
|
|
45
|
+
|
|
46
|
+
request_options : typing.Optional[RequestOptions]
|
|
47
|
+
Request-specific configuration.
|
|
48
|
+
|
|
49
|
+
Returns
|
|
50
|
+
-------
|
|
51
|
+
BrandListResponse
|
|
52
|
+
Catalog brands retrieved successfully
|
|
53
|
+
|
|
54
|
+
Examples
|
|
55
|
+
--------
|
|
56
|
+
from ocpplab import OcpplabApi
|
|
57
|
+
|
|
58
|
+
client = OcpplabApi(
|
|
59
|
+
organization_id="YOUR_ORGANIZATION_ID",
|
|
60
|
+
token="YOUR_TOKEN",
|
|
61
|
+
base_url="https://yourhost.com/path/to/api",
|
|
62
|
+
)
|
|
63
|
+
client.catalog.list_catalog_brands(
|
|
64
|
+
page=1,
|
|
65
|
+
limit=20,
|
|
66
|
+
)
|
|
67
|
+
"""
|
|
68
|
+
_response = self._raw_client.list_catalog_brands(page=page, limit=limit, request_options=request_options)
|
|
69
|
+
return _response.data
|
|
70
|
+
|
|
71
|
+
def list_catalog_brand_models(
|
|
72
|
+
self,
|
|
73
|
+
brand_slug: str,
|
|
74
|
+
*,
|
|
75
|
+
page: typing.Optional[int] = None,
|
|
76
|
+
limit: typing.Optional[int] = None,
|
|
77
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
78
|
+
) -> ModelListResponse:
|
|
79
|
+
"""
|
|
80
|
+
Retrieve charger model details for a specific brand slug.
|
|
81
|
+
|
|
82
|
+
Parameters
|
|
83
|
+
----------
|
|
84
|
+
brand_slug : str
|
|
85
|
+
Brand slug (URL-safe identifier) used to scope model discovery.
|
|
86
|
+
|
|
87
|
+
page : typing.Optional[int]
|
|
88
|
+
Page number for the paginated brand model list.
|
|
89
|
+
|
|
90
|
+
limit : typing.Optional[int]
|
|
91
|
+
Maximum number of models returned in one page.
|
|
92
|
+
|
|
93
|
+
request_options : typing.Optional[RequestOptions]
|
|
94
|
+
Request-specific configuration.
|
|
95
|
+
|
|
96
|
+
Returns
|
|
97
|
+
-------
|
|
98
|
+
ModelListResponse
|
|
99
|
+
Models retrieved successfully
|
|
100
|
+
|
|
101
|
+
Examples
|
|
102
|
+
--------
|
|
103
|
+
from ocpplab import OcpplabApi
|
|
104
|
+
|
|
105
|
+
client = OcpplabApi(
|
|
106
|
+
organization_id="YOUR_ORGANIZATION_ID",
|
|
107
|
+
token="YOUR_TOKEN",
|
|
108
|
+
base_url="https://yourhost.com/path/to/api",
|
|
109
|
+
)
|
|
110
|
+
client.catalog.list_catalog_brand_models(
|
|
111
|
+
brand_slug="wallbox",
|
|
112
|
+
page=1,
|
|
113
|
+
limit=50,
|
|
114
|
+
)
|
|
115
|
+
"""
|
|
116
|
+
_response = self._raw_client.list_catalog_brand_models(
|
|
117
|
+
brand_slug, page=page, limit=limit, request_options=request_options
|
|
118
|
+
)
|
|
119
|
+
return _response.data
|
|
120
|
+
|
|
121
|
+
def get_catalog_brand_model(
|
|
122
|
+
self, brand_slug: str, model_slug: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
123
|
+
) -> ModelResponse:
|
|
124
|
+
"""
|
|
125
|
+
Retrieve one charger model detail record by brand slug and model slug.
|
|
126
|
+
|
|
127
|
+
Parameters
|
|
128
|
+
----------
|
|
129
|
+
brand_slug : str
|
|
130
|
+
Brand slug (URL-safe identifier) used to scope model discovery.
|
|
131
|
+
|
|
132
|
+
model_slug : str
|
|
133
|
+
Model slug (URL-safe identifier) scoped under one brand.
|
|
134
|
+
|
|
135
|
+
request_options : typing.Optional[RequestOptions]
|
|
136
|
+
Request-specific configuration.
|
|
137
|
+
|
|
138
|
+
Returns
|
|
139
|
+
-------
|
|
140
|
+
ModelResponse
|
|
141
|
+
Model retrieved successfully
|
|
142
|
+
|
|
143
|
+
Examples
|
|
144
|
+
--------
|
|
145
|
+
from ocpplab import OcpplabApi
|
|
146
|
+
|
|
147
|
+
client = OcpplabApi(
|
|
148
|
+
organization_id="YOUR_ORGANIZATION_ID",
|
|
149
|
+
token="YOUR_TOKEN",
|
|
150
|
+
base_url="https://yourhost.com/path/to/api",
|
|
151
|
+
)
|
|
152
|
+
client.catalog.get_catalog_brand_model(
|
|
153
|
+
brand_slug="wallbox",
|
|
154
|
+
model_slug="wallbox-pulsar-plus",
|
|
155
|
+
)
|
|
156
|
+
"""
|
|
157
|
+
_response = self._raw_client.get_catalog_brand_model(brand_slug, model_slug, request_options=request_options)
|
|
158
|
+
return _response.data
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class AsyncCatalogClient:
|
|
162
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
163
|
+
self._raw_client = AsyncRawCatalogClient(client_wrapper=client_wrapper)
|
|
164
|
+
|
|
165
|
+
@property
|
|
166
|
+
def with_raw_response(self) -> AsyncRawCatalogClient:
|
|
167
|
+
"""
|
|
168
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
169
|
+
|
|
170
|
+
Returns
|
|
171
|
+
-------
|
|
172
|
+
AsyncRawCatalogClient
|
|
173
|
+
"""
|
|
174
|
+
return self._raw_client
|
|
175
|
+
|
|
176
|
+
async def list_catalog_brands(
|
|
177
|
+
self,
|
|
178
|
+
*,
|
|
179
|
+
page: typing.Optional[int] = None,
|
|
180
|
+
limit: typing.Optional[int] = None,
|
|
181
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
182
|
+
) -> BrandListResponse:
|
|
183
|
+
"""
|
|
184
|
+
Retrieve the catalog of charger brands available to the platform.
|
|
185
|
+
|
|
186
|
+
Parameters
|
|
187
|
+
----------
|
|
188
|
+
page : typing.Optional[int]
|
|
189
|
+
Page number for the paginated brand catalog.
|
|
190
|
+
|
|
191
|
+
limit : typing.Optional[int]
|
|
192
|
+
Maximum number of brands returned in one page.
|
|
193
|
+
|
|
194
|
+
request_options : typing.Optional[RequestOptions]
|
|
195
|
+
Request-specific configuration.
|
|
196
|
+
|
|
197
|
+
Returns
|
|
198
|
+
-------
|
|
199
|
+
BrandListResponse
|
|
200
|
+
Catalog brands retrieved successfully
|
|
201
|
+
|
|
202
|
+
Examples
|
|
203
|
+
--------
|
|
204
|
+
import asyncio
|
|
205
|
+
|
|
206
|
+
from ocpplab import AsyncOcpplabApi
|
|
207
|
+
|
|
208
|
+
client = AsyncOcpplabApi(
|
|
209
|
+
organization_id="YOUR_ORGANIZATION_ID",
|
|
210
|
+
token="YOUR_TOKEN",
|
|
211
|
+
base_url="https://yourhost.com/path/to/api",
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
async def main() -> None:
|
|
216
|
+
await client.catalog.list_catalog_brands(
|
|
217
|
+
page=1,
|
|
218
|
+
limit=20,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
asyncio.run(main())
|
|
223
|
+
"""
|
|
224
|
+
_response = await self._raw_client.list_catalog_brands(page=page, limit=limit, request_options=request_options)
|
|
225
|
+
return _response.data
|
|
226
|
+
|
|
227
|
+
async def list_catalog_brand_models(
|
|
228
|
+
self,
|
|
229
|
+
brand_slug: str,
|
|
230
|
+
*,
|
|
231
|
+
page: typing.Optional[int] = None,
|
|
232
|
+
limit: typing.Optional[int] = None,
|
|
233
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
234
|
+
) -> ModelListResponse:
|
|
235
|
+
"""
|
|
236
|
+
Retrieve charger model details for a specific brand slug.
|
|
237
|
+
|
|
238
|
+
Parameters
|
|
239
|
+
----------
|
|
240
|
+
brand_slug : str
|
|
241
|
+
Brand slug (URL-safe identifier) used to scope model discovery.
|
|
242
|
+
|
|
243
|
+
page : typing.Optional[int]
|
|
244
|
+
Page number for the paginated brand model list.
|
|
245
|
+
|
|
246
|
+
limit : typing.Optional[int]
|
|
247
|
+
Maximum number of models returned in one page.
|
|
248
|
+
|
|
249
|
+
request_options : typing.Optional[RequestOptions]
|
|
250
|
+
Request-specific configuration.
|
|
251
|
+
|
|
252
|
+
Returns
|
|
253
|
+
-------
|
|
254
|
+
ModelListResponse
|
|
255
|
+
Models retrieved successfully
|
|
256
|
+
|
|
257
|
+
Examples
|
|
258
|
+
--------
|
|
259
|
+
import asyncio
|
|
260
|
+
|
|
261
|
+
from ocpplab import AsyncOcpplabApi
|
|
262
|
+
|
|
263
|
+
client = AsyncOcpplabApi(
|
|
264
|
+
organization_id="YOUR_ORGANIZATION_ID",
|
|
265
|
+
token="YOUR_TOKEN",
|
|
266
|
+
base_url="https://yourhost.com/path/to/api",
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
async def main() -> None:
|
|
271
|
+
await client.catalog.list_catalog_brand_models(
|
|
272
|
+
brand_slug="wallbox",
|
|
273
|
+
page=1,
|
|
274
|
+
limit=50,
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
asyncio.run(main())
|
|
279
|
+
"""
|
|
280
|
+
_response = await self._raw_client.list_catalog_brand_models(
|
|
281
|
+
brand_slug, page=page, limit=limit, request_options=request_options
|
|
282
|
+
)
|
|
283
|
+
return _response.data
|
|
284
|
+
|
|
285
|
+
async def get_catalog_brand_model(
|
|
286
|
+
self, brand_slug: str, model_slug: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
287
|
+
) -> ModelResponse:
|
|
288
|
+
"""
|
|
289
|
+
Retrieve one charger model detail record by brand slug and model slug.
|
|
290
|
+
|
|
291
|
+
Parameters
|
|
292
|
+
----------
|
|
293
|
+
brand_slug : str
|
|
294
|
+
Brand slug (URL-safe identifier) used to scope model discovery.
|
|
295
|
+
|
|
296
|
+
model_slug : str
|
|
297
|
+
Model slug (URL-safe identifier) scoped under one brand.
|
|
298
|
+
|
|
299
|
+
request_options : typing.Optional[RequestOptions]
|
|
300
|
+
Request-specific configuration.
|
|
301
|
+
|
|
302
|
+
Returns
|
|
303
|
+
-------
|
|
304
|
+
ModelResponse
|
|
305
|
+
Model retrieved successfully
|
|
306
|
+
|
|
307
|
+
Examples
|
|
308
|
+
--------
|
|
309
|
+
import asyncio
|
|
310
|
+
|
|
311
|
+
from ocpplab import AsyncOcpplabApi
|
|
312
|
+
|
|
313
|
+
client = AsyncOcpplabApi(
|
|
314
|
+
organization_id="YOUR_ORGANIZATION_ID",
|
|
315
|
+
token="YOUR_TOKEN",
|
|
316
|
+
base_url="https://yourhost.com/path/to/api",
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
async def main() -> None:
|
|
321
|
+
await client.catalog.get_catalog_brand_model(
|
|
322
|
+
brand_slug="wallbox",
|
|
323
|
+
model_slug="wallbox-pulsar-plus",
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
asyncio.run(main())
|
|
328
|
+
"""
|
|
329
|
+
_response = await self._raw_client.get_catalog_brand_model(
|
|
330
|
+
brand_slug, model_slug, request_options=request_options
|
|
331
|
+
)
|
|
332
|
+
return _response.data
|