ocpplab 0.1.2__tar.gz → 0.2.2__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.
- {ocpplab-0.1.2 → ocpplab-0.2.2}/PKG-INFO +31 -25
- {ocpplab-0.1.2 → ocpplab-0.2.2}/README.md +30 -24
- {ocpplab-0.1.2 → ocpplab-0.2.2}/pyproject.toml +1 -1
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/__init__.py +137 -25
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/catalog/client.py +18 -22
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/catalog/raw_client.py +12 -12
- {ocpplab-0.1.2/src/ocpplab/charger_deployments → ocpplab-0.2.2/src/ocpplab/chargers}/client.py +284 -72
- {ocpplab-0.1.2/src/ocpplab/charger_deployments → ocpplab-0.2.2/src/ocpplab/chargers}/raw_client.py +504 -48
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/client.py +94 -138
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/commands/client.py +390 -128
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/commands/raw_client.py +886 -194
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/client_wrapper.py +2 -2
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/errors/__init__.py +3 -0
- ocpplab-0.2.2/src/ocpplab/errors/service_unavailable_error.py +10 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/health/client.py +70 -0
- ocpplab-0.2.2/src/ocpplab/health/raw_client.py +265 -0
- {ocpplab-0.1.2/src/ocpplab/location_charger_provisioning → ocpplab-0.2.2/src/ocpplab/location_chargers}/client.py +63 -273
- ocpplab-0.2.2/src/ocpplab/location_chargers/raw_client.py +1188 -0
- ocpplab-0.2.2/src/ocpplab/location_templates/__init__.py +37 -0
- ocpplab-0.2.2/src/ocpplab/location_templates/client.py +129 -0
- ocpplab-0.2.2/src/ocpplab/location_templates/raw_client.py +229 -0
- ocpplab-0.2.2/src/ocpplab/location_templates/types/__init__.py +38 -0
- ocpplab-0.2.2/src/ocpplab/location_templates/types/list_location_templates_request_ocpp_version.py +5 -0
- ocpplab-0.2.2/src/ocpplab/location_templates/types/list_location_templates_request_type.py +5 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/locations/client.py +38 -42
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/locations/raw_client.py +28 -50
- ocpplab-0.2.2/src/ocpplab/ocpi_cpos/client.py +618 -0
- ocpplab-0.2.2/src/ocpplab/ocpi_cpos/raw_client.py +1293 -0
- ocpplab-0.2.2/src/ocpplab/ocpi_locations/__init__.py +34 -0
- ocpplab-0.2.2/src/ocpplab/ocpi_locations/client.py +739 -0
- {ocpplab-0.1.2/src/ocpplab/location_charger_provisioning → ocpplab-0.2.2/src/ocpplab/ocpi_locations}/raw_client.py +282 -529
- ocpplab-0.2.2/src/ocpplab/ocpi_locations/types/__init__.py +36 -0
- ocpplab-0.2.2/src/ocpplab/ocpi_locations/types/create_locations_bulk_request_locations_item.py +8 -0
- ocpplab-0.2.2/src/ocpplab/ocpi_templates/__init__.py +4 -0
- ocpplab-0.2.2/src/ocpplab/ocpi_templates/client.py +104 -0
- {ocpplab-0.1.2/src/ocpplab/health → ocpplab-0.2.2/src/ocpplab/ocpi_templates}/raw_client.py +64 -25
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/__init__.py +102 -18
- ocpplab-0.2.2/src/ocpplab/types/bundle_role.py +5 -0
- ocpplab-0.2.2/src/ocpplab/types/charger_accepted_response.py +32 -0
- ocpplab-0.2.2/src/ocpplab/types/charger_lifecycle_request.py +12 -0
- ocpplab-0.2.2/src/ocpplab/types/charger_provisioning_status.py +5 -0
- ocpplab-0.2.2/src/ocpplab/types/charger_status_response.py +34 -0
- ocpplab-0.2.2/src/ocpplab/types/charger_summary.py +37 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_accepted_response.py +56 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_list_response.py +27 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_party_scope.py +25 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_provisioning_status.py +5 -0
- ocpplab-0.1.2/src/ocpplab/types/configuration_entry.py → ocpplab-0.2.2/src/ocpplab/types/cpo_report_response.py +4 -4
- ocpplab-0.2.2/src/ocpplab/types/cpo_response.py +44 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_roam_helper.py +31 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_status_response.py +43 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_topology_summary.py +26 -0
- ocpplab-0.2.2/src/ocpplab/types/evse_summary.py +40 -0
- ocpplab-0.2.2/src/ocpplab/types/location_bulk_accepted_response.py +31 -0
- ocpplab-0.2.2/src/ocpplab/types/location_bulk_provisioning_status.py +5 -0
- ocpplab-0.2.2/src/ocpplab/types/location_bulk_status_response.py +36 -0
- ocpplab-0.2.2/src/ocpplab/types/location_charger_bulk_accepted_response.py +32 -0
- ocpplab-0.2.2/src/ocpplab/types/location_charger_bulk_status_response.py +40 -0
- ocpplab-0.2.2/src/ocpplab/types/location_from_template_request.py +37 -0
- ocpplab-0.2.2/src/ocpplab/types/ocpi_charger_group.py +28 -0
- ocpplab-0.2.2/src/ocpplab/types/ocpi_charger_template.py +36 -0
- ocpplab-0.2.2/src/ocpplab/types/ocpi_coordinates.py +24 -0
- ocpplab-0.2.2/src/ocpplab/types/ocpi_create_location_request.py +42 -0
- ocpplab-0.2.2/src/ocpplab/types/ocpi_location_list_response.py +27 -0
- ocpplab-0.2.2/src/ocpplab/types/ocpi_location_response.py +40 -0
- ocpplab-0.2.2/src/ocpplab/types/parking_type.py +8 -0
- ocpplab-0.2.2/src/ocpplab/types/provisioning_error_detail.py +57 -0
- ocpplab-0.2.2/src/ocpplab/types/provisioning_progress.py +35 -0
- ocpplab-0.2.2/src/ocpplab/types/start_transaction_command_event.py +25 -0
- ocpplab-0.2.2/src/ocpplab/types/stop_transaction_command_event.py +23 -0
- ocpplab-0.2.2/src/ocpplab/types/template_list_response.py +25 -0
- ocpplab-0.2.2/src/ocpplab/types/template_summary.py +27 -0
- ocpplab-0.1.2/src/ocpplab/charger_data/client.py +0 -379
- ocpplab-0.1.2/src/ocpplab/charger_data/raw_client.py +0 -710
- ocpplab-0.1.2/src/ocpplab/raw_client.py +0 -137
- ocpplab-0.1.2/src/ocpplab/types/charger_lifecycle_request.py +0 -8
- ocpplab-0.1.2/src/ocpplab/types/configuration_response.py +0 -24
- ocpplab-0.1.2/src/ocpplab/types/create_location_chargers_response.py +0 -28
- ocpplab-0.1.2/src/ocpplab/types/local_authorization_list_response.py +0 -27
- ocpplab-0.1.2/src/ocpplab/types/location_create_charger_failure.py +0 -24
- ocpplab-0.1.2/src/ocpplab/types/location_lifecycle_request.py +0 -23
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/_default_clients.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/catalog/__init__.py +0 -0
- {ocpplab-0.1.2/src/ocpplab/charger_data → ocpplab-0.2.2/src/ocpplab/chargers}/__init__.py +0 -0
- {ocpplab-0.1.2/src/ocpplab/charger_deployments → ocpplab-0.2.2/src/ocpplab/commands}/__init__.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/__init__.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/api_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/datetime_utils.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/file.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/force_multipart.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/http_client.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/http_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/http_sse/__init__.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/http_sse/_api.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/http_sse/_decoders.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/http_sse/_exceptions.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/http_sse/_models.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/jsonable_encoder.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/logging.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/parse_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/pydantic_utilities.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/query_encoder.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/remove_none_from_dict.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/request_options.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/core/serialization.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/errors/bad_request_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/errors/forbidden_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/errors/internal_server_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/errors/not_found_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/errors/unauthorized_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/errors/unprocessable_entity_error.py +0 -0
- {ocpplab-0.1.2/src/ocpplab/commands → ocpplab-0.2.2/src/ocpplab/health}/__init__.py +0 -0
- {ocpplab-0.1.2/src/ocpplab/health → ocpplab-0.2.2/src/ocpplab/location_chargers}/__init__.py +0 -0
- {ocpplab-0.1.2/src/ocpplab/location_charger_provisioning → ocpplab-0.2.2/src/ocpplab/locations}/__init__.py +0 -0
- {ocpplab-0.1.2/src/ocpplab/locations → ocpplab-0.2.2/src/ocpplab/ocpi_cpos}/__init__.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/py.typed +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/authorize_id_tag_command_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/brand_list_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/brand_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/cache_reset_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/charger_command_target.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/charger_group.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/charger_list_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/charger_log_entry.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/charger_log_list_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/charger_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/charger_template.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/clear_fault_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/command_target.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/configuration_change_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/configuration_update_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/connector_command_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/coordinates.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/delete_location_chargers_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/empty_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/fault_operation_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/http_error_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/http_validation_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/inject_fault_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/local_auth_list_entry.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/local_auth_list_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/local_list_mutation_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_command_failure.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_command_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_delete_charger_failure.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_list_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_queued_command_result.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_response_coordinates.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/location_update_charger_failure.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/model_list_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/model_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/power_update_command_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/proxy_message_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/proxy_message_event_ocpp_version.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/queued_command_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/start_session_command_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/stop_session_command_event.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/unified_connector_request.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/update_location_charger_item.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/update_location_chargers_response.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/validation_error.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/types/validation_error_loc_item.py +0 -0
- {ocpplab-0.1.2 → ocpplab-0.2.2}/src/ocpplab/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ocpplab
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary:
|
|
5
5
|
Keywords: ev,ocpp,sdk,api,charging
|
|
6
6
|
Requires-Python: >=3.10,<4.0
|
|
@@ -75,16 +75,19 @@ client = OcpplabSDK(
|
|
|
75
75
|
base_url="https://yourhost.com/path/to/api",
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
client.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
client.ocpi_cpos.create(
|
|
79
|
+
template="small-urban-ac",
|
|
80
|
+
country_code="FR",
|
|
81
|
+
party_id="ABC",
|
|
82
|
+
name_prefix="alice",
|
|
83
|
+
role="cpo",
|
|
84
|
+
ocpi_version="2.2.1",
|
|
85
|
+
seed=42,
|
|
86
|
+
ttl_seconds=7200,
|
|
87
|
+
overrides={
|
|
88
|
+
"chargers_per_location": 3,
|
|
89
|
+
"locations": 2
|
|
90
|
+
},
|
|
88
91
|
)
|
|
89
92
|
```
|
|
90
93
|
|
|
@@ -104,16 +107,19 @@ client = AsyncOcpplabSDK(
|
|
|
104
107
|
|
|
105
108
|
|
|
106
109
|
async def main() -> None:
|
|
107
|
-
await client.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
await client.ocpi_cpos.create(
|
|
111
|
+
template="small-urban-ac",
|
|
112
|
+
country_code="FR",
|
|
113
|
+
party_id="ABC",
|
|
114
|
+
name_prefix="alice",
|
|
115
|
+
role="cpo",
|
|
116
|
+
ocpi_version="2.2.1",
|
|
117
|
+
seed=42,
|
|
118
|
+
ttl_seconds=7200,
|
|
119
|
+
overrides={
|
|
120
|
+
"chargers_per_location": 3,
|
|
121
|
+
"locations": 2
|
|
122
|
+
},
|
|
117
123
|
)
|
|
118
124
|
|
|
119
125
|
|
|
@@ -129,7 +135,7 @@ will be thrown.
|
|
|
129
135
|
from ocpplab.core.api_error import ApiError
|
|
130
136
|
|
|
131
137
|
try:
|
|
132
|
-
client.
|
|
138
|
+
client.ocpi_cpos.create(...)
|
|
133
139
|
except ApiError as e:
|
|
134
140
|
print(e.status_code)
|
|
135
141
|
print(e.body)
|
|
@@ -146,7 +152,7 @@ The `.with_raw_response` property returns a "raw" client that can be used to acc
|
|
|
146
152
|
from ocpplab import OcpplabSDK
|
|
147
153
|
|
|
148
154
|
client = OcpplabSDK(...)
|
|
149
|
-
response = client.
|
|
155
|
+
response = client.ocpi_cpos.with_raw_response.create(...)
|
|
150
156
|
print(response.headers) # access the response headers
|
|
151
157
|
print(response.status_code) # access the response status code
|
|
152
158
|
print(response.data) # access the underlying object
|
|
@@ -167,7 +173,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
167
173
|
Use the `max_retries` request option to configure this behavior.
|
|
168
174
|
|
|
169
175
|
```python
|
|
170
|
-
client.
|
|
176
|
+
client.ocpi_cpos.create(..., request_options={
|
|
171
177
|
"max_retries": 1
|
|
172
178
|
})
|
|
173
179
|
```
|
|
@@ -182,7 +188,7 @@ from ocpplab import OcpplabSDK
|
|
|
182
188
|
client = OcpplabSDK(..., timeout=20.0)
|
|
183
189
|
|
|
184
190
|
# Override timeout for a specific method
|
|
185
|
-
client.
|
|
191
|
+
client.ocpi_cpos.create(..., request_options={
|
|
186
192
|
"timeout_in_seconds": 1
|
|
187
193
|
})
|
|
188
194
|
```
|
|
@@ -41,16 +41,19 @@ client = OcpplabSDK(
|
|
|
41
41
|
base_url="https://yourhost.com/path/to/api",
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
client.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
client.ocpi_cpos.create(
|
|
45
|
+
template="small-urban-ac",
|
|
46
|
+
country_code="FR",
|
|
47
|
+
party_id="ABC",
|
|
48
|
+
name_prefix="alice",
|
|
49
|
+
role="cpo",
|
|
50
|
+
ocpi_version="2.2.1",
|
|
51
|
+
seed=42,
|
|
52
|
+
ttl_seconds=7200,
|
|
53
|
+
overrides={
|
|
54
|
+
"chargers_per_location": 3,
|
|
55
|
+
"locations": 2
|
|
56
|
+
},
|
|
54
57
|
)
|
|
55
58
|
```
|
|
56
59
|
|
|
@@ -70,16 +73,19 @@ client = AsyncOcpplabSDK(
|
|
|
70
73
|
|
|
71
74
|
|
|
72
75
|
async def main() -> None:
|
|
73
|
-
await client.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
await client.ocpi_cpos.create(
|
|
77
|
+
template="small-urban-ac",
|
|
78
|
+
country_code="FR",
|
|
79
|
+
party_id="ABC",
|
|
80
|
+
name_prefix="alice",
|
|
81
|
+
role="cpo",
|
|
82
|
+
ocpi_version="2.2.1",
|
|
83
|
+
seed=42,
|
|
84
|
+
ttl_seconds=7200,
|
|
85
|
+
overrides={
|
|
86
|
+
"chargers_per_location": 3,
|
|
87
|
+
"locations": 2
|
|
88
|
+
},
|
|
83
89
|
)
|
|
84
90
|
|
|
85
91
|
|
|
@@ -95,7 +101,7 @@ will be thrown.
|
|
|
95
101
|
from ocpplab.core.api_error import ApiError
|
|
96
102
|
|
|
97
103
|
try:
|
|
98
|
-
client.
|
|
104
|
+
client.ocpi_cpos.create(...)
|
|
99
105
|
except ApiError as e:
|
|
100
106
|
print(e.status_code)
|
|
101
107
|
print(e.body)
|
|
@@ -112,7 +118,7 @@ The `.with_raw_response` property returns a "raw" client that can be used to acc
|
|
|
112
118
|
from ocpplab import OcpplabSDK
|
|
113
119
|
|
|
114
120
|
client = OcpplabSDK(...)
|
|
115
|
-
response = client.
|
|
121
|
+
response = client.ocpi_cpos.with_raw_response.create(...)
|
|
116
122
|
print(response.headers) # access the response headers
|
|
117
123
|
print(response.status_code) # access the response status code
|
|
118
124
|
print(response.data) # access the underlying object
|
|
@@ -133,7 +139,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
133
139
|
Use the `max_retries` request option to configure this behavior.
|
|
134
140
|
|
|
135
141
|
```python
|
|
136
|
-
client.
|
|
142
|
+
client.ocpi_cpos.create(..., request_options={
|
|
137
143
|
"max_retries": 1
|
|
138
144
|
})
|
|
139
145
|
```
|
|
@@ -148,7 +154,7 @@ from ocpplab import OcpplabSDK
|
|
|
148
154
|
client = OcpplabSDK(..., timeout=20.0)
|
|
149
155
|
|
|
150
156
|
# Override timeout for a specific method
|
|
151
|
-
client.
|
|
157
|
+
client.ocpi_cpos.create(..., request_options={
|
|
152
158
|
"timeout_in_seconds": 1
|
|
153
159
|
})
|
|
154
160
|
```
|
|
@@ -10,39 +10,54 @@ if typing.TYPE_CHECKING:
|
|
|
10
10
|
AuthorizeIdTagCommandEvent,
|
|
11
11
|
BrandListResponse,
|
|
12
12
|
BrandResponse,
|
|
13
|
+
BundleRole,
|
|
13
14
|
CacheResetResponse,
|
|
15
|
+
ChargerAcceptedResponse,
|
|
14
16
|
ChargerCommandTarget,
|
|
15
17
|
ChargerGroup,
|
|
16
18
|
ChargerLifecycleRequest,
|
|
17
19
|
ChargerListResponse,
|
|
18
20
|
ChargerLogEntry,
|
|
19
21
|
ChargerLogListResponse,
|
|
22
|
+
ChargerProvisioningStatus,
|
|
20
23
|
ChargerResponse,
|
|
24
|
+
ChargerStatusResponse,
|
|
25
|
+
ChargerSummary,
|
|
21
26
|
ChargerTemplate,
|
|
22
27
|
ClearFaultEvent,
|
|
23
28
|
CommandTarget,
|
|
24
29
|
ConfigurationChangeResponse,
|
|
25
|
-
ConfigurationEntry,
|
|
26
|
-
ConfigurationResponse,
|
|
27
30
|
ConfigurationUpdateEvent,
|
|
28
31
|
ConnectorCommandEvent,
|
|
29
32
|
Coordinates,
|
|
30
|
-
|
|
33
|
+
CpoAcceptedResponse,
|
|
34
|
+
CpoListResponse,
|
|
35
|
+
CpoPartyScope,
|
|
36
|
+
CpoProvisioningStatus,
|
|
37
|
+
CpoReportResponse,
|
|
38
|
+
CpoResponse,
|
|
39
|
+
CpoRoamHelper,
|
|
40
|
+
CpoStatusResponse,
|
|
41
|
+
CpoTopologySummary,
|
|
31
42
|
DeleteLocationChargersResponse,
|
|
32
43
|
EmptyEvent,
|
|
44
|
+
EvseSummary,
|
|
33
45
|
FaultOperationResponse,
|
|
34
46
|
HttpErrorResponse,
|
|
35
47
|
HttpValidationError,
|
|
36
48
|
InjectFaultEvent,
|
|
37
49
|
LocalAuthListEntry,
|
|
38
50
|
LocalAuthListEvent,
|
|
39
|
-
LocalAuthorizationListResponse,
|
|
40
51
|
LocalListMutationResponse,
|
|
52
|
+
LocationBulkAcceptedResponse,
|
|
53
|
+
LocationBulkProvisioningStatus,
|
|
54
|
+
LocationBulkStatusResponse,
|
|
55
|
+
LocationChargerBulkAcceptedResponse,
|
|
56
|
+
LocationChargerBulkStatusResponse,
|
|
41
57
|
LocationCommandFailure,
|
|
42
58
|
LocationCommandResponse,
|
|
43
|
-
LocationCreateChargerFailure,
|
|
44
59
|
LocationDeleteChargerFailure,
|
|
45
|
-
|
|
60
|
+
LocationFromTemplateRequest,
|
|
46
61
|
LocationListResponse,
|
|
47
62
|
LocationQueuedCommandResult,
|
|
48
63
|
LocationResponse,
|
|
@@ -50,12 +65,25 @@ if typing.TYPE_CHECKING:
|
|
|
50
65
|
LocationUpdateChargerFailure,
|
|
51
66
|
ModelListResponse,
|
|
52
67
|
ModelResponse,
|
|
68
|
+
OcpiChargerGroup,
|
|
69
|
+
OcpiChargerTemplate,
|
|
70
|
+
OcpiCoordinates,
|
|
71
|
+
OcpiCreateLocationRequest,
|
|
72
|
+
OcpiLocationListResponse,
|
|
73
|
+
OcpiLocationResponse,
|
|
74
|
+
ParkingType,
|
|
53
75
|
PowerUpdateCommandEvent,
|
|
76
|
+
ProvisioningErrorDetail,
|
|
77
|
+
ProvisioningProgress,
|
|
54
78
|
ProxyMessageEvent,
|
|
55
79
|
ProxyMessageEventOcppVersion,
|
|
56
80
|
QueuedCommandResponse,
|
|
57
81
|
StartSessionCommandEvent,
|
|
82
|
+
StartTransactionCommandEvent,
|
|
58
83
|
StopSessionCommandEvent,
|
|
84
|
+
StopTransactionCommandEvent,
|
|
85
|
+
TemplateListResponse,
|
|
86
|
+
TemplateSummary,
|
|
59
87
|
UnifiedConnectorRequest,
|
|
60
88
|
UpdateLocationChargerItem,
|
|
61
89
|
UpdateLocationChargersResponse,
|
|
@@ -67,12 +95,26 @@ if typing.TYPE_CHECKING:
|
|
|
67
95
|
ForbiddenError,
|
|
68
96
|
InternalServerError,
|
|
69
97
|
NotFoundError,
|
|
98
|
+
ServiceUnavailableError,
|
|
70
99
|
UnauthorizedError,
|
|
71
100
|
UnprocessableEntityError,
|
|
72
101
|
)
|
|
73
|
-
from . import
|
|
102
|
+
from . import (
|
|
103
|
+
catalog,
|
|
104
|
+
chargers,
|
|
105
|
+
commands,
|
|
106
|
+
health,
|
|
107
|
+
location_chargers,
|
|
108
|
+
location_templates,
|
|
109
|
+
locations,
|
|
110
|
+
ocpi_cpos,
|
|
111
|
+
ocpi_locations,
|
|
112
|
+
ocpi_templates,
|
|
113
|
+
)
|
|
74
114
|
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
75
115
|
from .client import AsyncOcpplabSDK, OcpplabSDK
|
|
116
|
+
from .location_templates import ListLocationTemplatesRequestOcppVersion, ListLocationTemplatesRequestType
|
|
117
|
+
from .ocpi_locations import CreateLocationsBulkRequestLocationsItem
|
|
76
118
|
from .version import __version__
|
|
77
119
|
_dynamic_imports: typing.Dict[str, str] = {
|
|
78
120
|
"AsyncOcpplabSDK": ".client",
|
|
@@ -80,43 +122,61 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
80
122
|
"BadRequestError": ".errors",
|
|
81
123
|
"BrandListResponse": ".types",
|
|
82
124
|
"BrandResponse": ".types",
|
|
125
|
+
"BundleRole": ".types",
|
|
83
126
|
"CacheResetResponse": ".types",
|
|
127
|
+
"ChargerAcceptedResponse": ".types",
|
|
84
128
|
"ChargerCommandTarget": ".types",
|
|
85
129
|
"ChargerGroup": ".types",
|
|
86
130
|
"ChargerLifecycleRequest": ".types",
|
|
87
131
|
"ChargerListResponse": ".types",
|
|
88
132
|
"ChargerLogEntry": ".types",
|
|
89
133
|
"ChargerLogListResponse": ".types",
|
|
134
|
+
"ChargerProvisioningStatus": ".types",
|
|
90
135
|
"ChargerResponse": ".types",
|
|
136
|
+
"ChargerStatusResponse": ".types",
|
|
137
|
+
"ChargerSummary": ".types",
|
|
91
138
|
"ChargerTemplate": ".types",
|
|
92
139
|
"ClearFaultEvent": ".types",
|
|
93
140
|
"CommandTarget": ".types",
|
|
94
141
|
"ConfigurationChangeResponse": ".types",
|
|
95
|
-
"ConfigurationEntry": ".types",
|
|
96
|
-
"ConfigurationResponse": ".types",
|
|
97
142
|
"ConfigurationUpdateEvent": ".types",
|
|
98
143
|
"ConnectorCommandEvent": ".types",
|
|
99
144
|
"Coordinates": ".types",
|
|
100
|
-
"
|
|
145
|
+
"CpoAcceptedResponse": ".types",
|
|
146
|
+
"CpoListResponse": ".types",
|
|
147
|
+
"CpoPartyScope": ".types",
|
|
148
|
+
"CpoProvisioningStatus": ".types",
|
|
149
|
+
"CpoReportResponse": ".types",
|
|
150
|
+
"CpoResponse": ".types",
|
|
151
|
+
"CpoRoamHelper": ".types",
|
|
152
|
+
"CpoStatusResponse": ".types",
|
|
153
|
+
"CpoTopologySummary": ".types",
|
|
154
|
+
"CreateLocationsBulkRequestLocationsItem": ".ocpi_locations",
|
|
101
155
|
"DefaultAioHttpClient": "._default_clients",
|
|
102
156
|
"DefaultAsyncHttpxClient": "._default_clients",
|
|
103
157
|
"DeleteLocationChargersResponse": ".types",
|
|
104
158
|
"EmptyEvent": ".types",
|
|
159
|
+
"EvseSummary": ".types",
|
|
105
160
|
"FaultOperationResponse": ".types",
|
|
106
161
|
"ForbiddenError": ".errors",
|
|
107
162
|
"HttpErrorResponse": ".types",
|
|
108
163
|
"HttpValidationError": ".types",
|
|
109
164
|
"InjectFaultEvent": ".types",
|
|
110
165
|
"InternalServerError": ".errors",
|
|
166
|
+
"ListLocationTemplatesRequestOcppVersion": ".location_templates",
|
|
167
|
+
"ListLocationTemplatesRequestType": ".location_templates",
|
|
111
168
|
"LocalAuthListEntry": ".types",
|
|
112
169
|
"LocalAuthListEvent": ".types",
|
|
113
|
-
"LocalAuthorizationListResponse": ".types",
|
|
114
170
|
"LocalListMutationResponse": ".types",
|
|
171
|
+
"LocationBulkAcceptedResponse": ".types",
|
|
172
|
+
"LocationBulkProvisioningStatus": ".types",
|
|
173
|
+
"LocationBulkStatusResponse": ".types",
|
|
174
|
+
"LocationChargerBulkAcceptedResponse": ".types",
|
|
175
|
+
"LocationChargerBulkStatusResponse": ".types",
|
|
115
176
|
"LocationCommandFailure": ".types",
|
|
116
177
|
"LocationCommandResponse": ".types",
|
|
117
|
-
"LocationCreateChargerFailure": ".types",
|
|
118
178
|
"LocationDeleteChargerFailure": ".types",
|
|
119
|
-
"
|
|
179
|
+
"LocationFromTemplateRequest": ".types",
|
|
120
180
|
"LocationListResponse": ".types",
|
|
121
181
|
"LocationQueuedCommandResult": ".types",
|
|
122
182
|
"LocationResponse": ".types",
|
|
@@ -125,13 +185,27 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
125
185
|
"ModelListResponse": ".types",
|
|
126
186
|
"ModelResponse": ".types",
|
|
127
187
|
"NotFoundError": ".errors",
|
|
188
|
+
"OcpiChargerGroup": ".types",
|
|
189
|
+
"OcpiChargerTemplate": ".types",
|
|
190
|
+
"OcpiCoordinates": ".types",
|
|
191
|
+
"OcpiCreateLocationRequest": ".types",
|
|
192
|
+
"OcpiLocationListResponse": ".types",
|
|
193
|
+
"OcpiLocationResponse": ".types",
|
|
128
194
|
"OcpplabSDK": ".client",
|
|
195
|
+
"ParkingType": ".types",
|
|
129
196
|
"PowerUpdateCommandEvent": ".types",
|
|
197
|
+
"ProvisioningErrorDetail": ".types",
|
|
198
|
+
"ProvisioningProgress": ".types",
|
|
130
199
|
"ProxyMessageEvent": ".types",
|
|
131
200
|
"ProxyMessageEventOcppVersion": ".types",
|
|
132
201
|
"QueuedCommandResponse": ".types",
|
|
202
|
+
"ServiceUnavailableError": ".errors",
|
|
133
203
|
"StartSessionCommandEvent": ".types",
|
|
204
|
+
"StartTransactionCommandEvent": ".types",
|
|
134
205
|
"StopSessionCommandEvent": ".types",
|
|
206
|
+
"StopTransactionCommandEvent": ".types",
|
|
207
|
+
"TemplateListResponse": ".types",
|
|
208
|
+
"TemplateSummary": ".types",
|
|
135
209
|
"UnauthorizedError": ".errors",
|
|
136
210
|
"UnifiedConnectorRequest": ".types",
|
|
137
211
|
"UnprocessableEntityError": ".errors",
|
|
@@ -141,12 +215,15 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
141
215
|
"ValidationErrorLocItem": ".types",
|
|
142
216
|
"__version__": ".version",
|
|
143
217
|
"catalog": ".catalog",
|
|
144
|
-
"
|
|
145
|
-
"charger_deployments": ".charger_deployments",
|
|
218
|
+
"chargers": ".chargers",
|
|
146
219
|
"commands": ".commands",
|
|
147
220
|
"health": ".health",
|
|
148
|
-
"
|
|
221
|
+
"location_chargers": ".location_chargers",
|
|
222
|
+
"location_templates": ".location_templates",
|
|
149
223
|
"locations": ".locations",
|
|
224
|
+
"ocpi_cpos": ".ocpi_cpos",
|
|
225
|
+
"ocpi_locations": ".ocpi_locations",
|
|
226
|
+
"ocpi_templates": ".ocpi_templates",
|
|
150
227
|
}
|
|
151
228
|
|
|
152
229
|
|
|
@@ -177,43 +254,61 @@ __all__ = [
|
|
|
177
254
|
"BadRequestError",
|
|
178
255
|
"BrandListResponse",
|
|
179
256
|
"BrandResponse",
|
|
257
|
+
"BundleRole",
|
|
180
258
|
"CacheResetResponse",
|
|
259
|
+
"ChargerAcceptedResponse",
|
|
181
260
|
"ChargerCommandTarget",
|
|
182
261
|
"ChargerGroup",
|
|
183
262
|
"ChargerLifecycleRequest",
|
|
184
263
|
"ChargerListResponse",
|
|
185
264
|
"ChargerLogEntry",
|
|
186
265
|
"ChargerLogListResponse",
|
|
266
|
+
"ChargerProvisioningStatus",
|
|
187
267
|
"ChargerResponse",
|
|
268
|
+
"ChargerStatusResponse",
|
|
269
|
+
"ChargerSummary",
|
|
188
270
|
"ChargerTemplate",
|
|
189
271
|
"ClearFaultEvent",
|
|
190
272
|
"CommandTarget",
|
|
191
273
|
"ConfigurationChangeResponse",
|
|
192
|
-
"ConfigurationEntry",
|
|
193
|
-
"ConfigurationResponse",
|
|
194
274
|
"ConfigurationUpdateEvent",
|
|
195
275
|
"ConnectorCommandEvent",
|
|
196
276
|
"Coordinates",
|
|
197
|
-
"
|
|
277
|
+
"CpoAcceptedResponse",
|
|
278
|
+
"CpoListResponse",
|
|
279
|
+
"CpoPartyScope",
|
|
280
|
+
"CpoProvisioningStatus",
|
|
281
|
+
"CpoReportResponse",
|
|
282
|
+
"CpoResponse",
|
|
283
|
+
"CpoRoamHelper",
|
|
284
|
+
"CpoStatusResponse",
|
|
285
|
+
"CpoTopologySummary",
|
|
286
|
+
"CreateLocationsBulkRequestLocationsItem",
|
|
198
287
|
"DefaultAioHttpClient",
|
|
199
288
|
"DefaultAsyncHttpxClient",
|
|
200
289
|
"DeleteLocationChargersResponse",
|
|
201
290
|
"EmptyEvent",
|
|
291
|
+
"EvseSummary",
|
|
202
292
|
"FaultOperationResponse",
|
|
203
293
|
"ForbiddenError",
|
|
204
294
|
"HttpErrorResponse",
|
|
205
295
|
"HttpValidationError",
|
|
206
296
|
"InjectFaultEvent",
|
|
207
297
|
"InternalServerError",
|
|
298
|
+
"ListLocationTemplatesRequestOcppVersion",
|
|
299
|
+
"ListLocationTemplatesRequestType",
|
|
208
300
|
"LocalAuthListEntry",
|
|
209
301
|
"LocalAuthListEvent",
|
|
210
|
-
"LocalAuthorizationListResponse",
|
|
211
302
|
"LocalListMutationResponse",
|
|
303
|
+
"LocationBulkAcceptedResponse",
|
|
304
|
+
"LocationBulkProvisioningStatus",
|
|
305
|
+
"LocationBulkStatusResponse",
|
|
306
|
+
"LocationChargerBulkAcceptedResponse",
|
|
307
|
+
"LocationChargerBulkStatusResponse",
|
|
212
308
|
"LocationCommandFailure",
|
|
213
309
|
"LocationCommandResponse",
|
|
214
|
-
"LocationCreateChargerFailure",
|
|
215
310
|
"LocationDeleteChargerFailure",
|
|
216
|
-
"
|
|
311
|
+
"LocationFromTemplateRequest",
|
|
217
312
|
"LocationListResponse",
|
|
218
313
|
"LocationQueuedCommandResult",
|
|
219
314
|
"LocationResponse",
|
|
@@ -222,13 +317,27 @@ __all__ = [
|
|
|
222
317
|
"ModelListResponse",
|
|
223
318
|
"ModelResponse",
|
|
224
319
|
"NotFoundError",
|
|
320
|
+
"OcpiChargerGroup",
|
|
321
|
+
"OcpiChargerTemplate",
|
|
322
|
+
"OcpiCoordinates",
|
|
323
|
+
"OcpiCreateLocationRequest",
|
|
324
|
+
"OcpiLocationListResponse",
|
|
325
|
+
"OcpiLocationResponse",
|
|
225
326
|
"OcpplabSDK",
|
|
327
|
+
"ParkingType",
|
|
226
328
|
"PowerUpdateCommandEvent",
|
|
329
|
+
"ProvisioningErrorDetail",
|
|
330
|
+
"ProvisioningProgress",
|
|
227
331
|
"ProxyMessageEvent",
|
|
228
332
|
"ProxyMessageEventOcppVersion",
|
|
229
333
|
"QueuedCommandResponse",
|
|
334
|
+
"ServiceUnavailableError",
|
|
230
335
|
"StartSessionCommandEvent",
|
|
336
|
+
"StartTransactionCommandEvent",
|
|
231
337
|
"StopSessionCommandEvent",
|
|
338
|
+
"StopTransactionCommandEvent",
|
|
339
|
+
"TemplateListResponse",
|
|
340
|
+
"TemplateSummary",
|
|
232
341
|
"UnauthorizedError",
|
|
233
342
|
"UnifiedConnectorRequest",
|
|
234
343
|
"UnprocessableEntityError",
|
|
@@ -238,10 +347,13 @@ __all__ = [
|
|
|
238
347
|
"ValidationErrorLocItem",
|
|
239
348
|
"__version__",
|
|
240
349
|
"catalog",
|
|
241
|
-
"
|
|
242
|
-
"charger_deployments",
|
|
350
|
+
"chargers",
|
|
243
351
|
"commands",
|
|
244
352
|
"health",
|
|
245
|
-
"
|
|
353
|
+
"location_chargers",
|
|
354
|
+
"location_templates",
|
|
246
355
|
"locations",
|
|
356
|
+
"ocpi_cpos",
|
|
357
|
+
"ocpi_locations",
|
|
358
|
+
"ocpi_templates",
|
|
247
359
|
]
|
|
@@ -25,7 +25,7 @@ class CatalogClient:
|
|
|
25
25
|
"""
|
|
26
26
|
return self._raw_client
|
|
27
27
|
|
|
28
|
-
def
|
|
28
|
+
def list_brands(
|
|
29
29
|
self,
|
|
30
30
|
*,
|
|
31
31
|
page: typing.Optional[int] = None,
|
|
@@ -60,15 +60,15 @@ class CatalogClient:
|
|
|
60
60
|
token="YOUR_TOKEN",
|
|
61
61
|
base_url="https://yourhost.com/path/to/api",
|
|
62
62
|
)
|
|
63
|
-
client.catalog.
|
|
63
|
+
client.catalog.list_brands(
|
|
64
64
|
page=1,
|
|
65
65
|
limit=20,
|
|
66
66
|
)
|
|
67
67
|
"""
|
|
68
|
-
_response = self._raw_client.
|
|
68
|
+
_response = self._raw_client.list_brands(page=page, limit=limit, request_options=request_options)
|
|
69
69
|
return _response.data
|
|
70
70
|
|
|
71
|
-
def
|
|
71
|
+
def list_models(
|
|
72
72
|
self,
|
|
73
73
|
brand_slug: str,
|
|
74
74
|
*,
|
|
@@ -107,18 +107,16 @@ class CatalogClient:
|
|
|
107
107
|
token="YOUR_TOKEN",
|
|
108
108
|
base_url="https://yourhost.com/path/to/api",
|
|
109
109
|
)
|
|
110
|
-
client.catalog.
|
|
110
|
+
client.catalog.list_models(
|
|
111
111
|
brand_slug="wallbox",
|
|
112
112
|
page=1,
|
|
113
113
|
limit=50,
|
|
114
114
|
)
|
|
115
115
|
"""
|
|
116
|
-
_response = self._raw_client.
|
|
117
|
-
brand_slug, page=page, limit=limit, request_options=request_options
|
|
118
|
-
)
|
|
116
|
+
_response = self._raw_client.list_models(brand_slug, page=page, limit=limit, request_options=request_options)
|
|
119
117
|
return _response.data
|
|
120
118
|
|
|
121
|
-
def
|
|
119
|
+
def get_model(
|
|
122
120
|
self, brand_slug: str, model_slug: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
123
121
|
) -> ModelResponse:
|
|
124
122
|
"""
|
|
@@ -149,12 +147,12 @@ class CatalogClient:
|
|
|
149
147
|
token="YOUR_TOKEN",
|
|
150
148
|
base_url="https://yourhost.com/path/to/api",
|
|
151
149
|
)
|
|
152
|
-
client.catalog.
|
|
150
|
+
client.catalog.get_model(
|
|
153
151
|
brand_slug="wallbox",
|
|
154
152
|
model_slug="wallbox-pulsar-plus",
|
|
155
153
|
)
|
|
156
154
|
"""
|
|
157
|
-
_response = self._raw_client.
|
|
155
|
+
_response = self._raw_client.get_model(brand_slug, model_slug, request_options=request_options)
|
|
158
156
|
return _response.data
|
|
159
157
|
|
|
160
158
|
|
|
@@ -173,7 +171,7 @@ class AsyncCatalogClient:
|
|
|
173
171
|
"""
|
|
174
172
|
return self._raw_client
|
|
175
173
|
|
|
176
|
-
async def
|
|
174
|
+
async def list_brands(
|
|
177
175
|
self,
|
|
178
176
|
*,
|
|
179
177
|
page: typing.Optional[int] = None,
|
|
@@ -213,7 +211,7 @@ class AsyncCatalogClient:
|
|
|
213
211
|
|
|
214
212
|
|
|
215
213
|
async def main() -> None:
|
|
216
|
-
await client.catalog.
|
|
214
|
+
await client.catalog.list_brands(
|
|
217
215
|
page=1,
|
|
218
216
|
limit=20,
|
|
219
217
|
)
|
|
@@ -221,10 +219,10 @@ class AsyncCatalogClient:
|
|
|
221
219
|
|
|
222
220
|
asyncio.run(main())
|
|
223
221
|
"""
|
|
224
|
-
_response = await self._raw_client.
|
|
222
|
+
_response = await self._raw_client.list_brands(page=page, limit=limit, request_options=request_options)
|
|
225
223
|
return _response.data
|
|
226
224
|
|
|
227
|
-
async def
|
|
225
|
+
async def list_models(
|
|
228
226
|
self,
|
|
229
227
|
brand_slug: str,
|
|
230
228
|
*,
|
|
@@ -268,7 +266,7 @@ class AsyncCatalogClient:
|
|
|
268
266
|
|
|
269
267
|
|
|
270
268
|
async def main() -> None:
|
|
271
|
-
await client.catalog.
|
|
269
|
+
await client.catalog.list_models(
|
|
272
270
|
brand_slug="wallbox",
|
|
273
271
|
page=1,
|
|
274
272
|
limit=50,
|
|
@@ -277,12 +275,12 @@ class AsyncCatalogClient:
|
|
|
277
275
|
|
|
278
276
|
asyncio.run(main())
|
|
279
277
|
"""
|
|
280
|
-
_response = await self._raw_client.
|
|
278
|
+
_response = await self._raw_client.list_models(
|
|
281
279
|
brand_slug, page=page, limit=limit, request_options=request_options
|
|
282
280
|
)
|
|
283
281
|
return _response.data
|
|
284
282
|
|
|
285
|
-
async def
|
|
283
|
+
async def get_model(
|
|
286
284
|
self, brand_slug: str, model_slug: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
287
285
|
) -> ModelResponse:
|
|
288
286
|
"""
|
|
@@ -318,7 +316,7 @@ class AsyncCatalogClient:
|
|
|
318
316
|
|
|
319
317
|
|
|
320
318
|
async def main() -> None:
|
|
321
|
-
await client.catalog.
|
|
319
|
+
await client.catalog.get_model(
|
|
322
320
|
brand_slug="wallbox",
|
|
323
321
|
model_slug="wallbox-pulsar-plus",
|
|
324
322
|
)
|
|
@@ -326,7 +324,5 @@ class AsyncCatalogClient:
|
|
|
326
324
|
|
|
327
325
|
asyncio.run(main())
|
|
328
326
|
"""
|
|
329
|
-
_response = await self._raw_client.
|
|
330
|
-
brand_slug, model_slug, request_options=request_options
|
|
331
|
-
)
|
|
327
|
+
_response = await self._raw_client.get_model(brand_slug, model_slug, request_options=request_options)
|
|
332
328
|
return _response.data
|