ocpplab 0.2.2__tar.gz → 0.2.3__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.2.2 → ocpplab-0.2.3}/PKG-INFO +36 -30
- {ocpplab-0.2.2 → ocpplab-0.2.3}/README.md +35 -29
- {ocpplab-0.2.2 → ocpplab-0.2.3}/pyproject.toml +1 -1
- ocpplab-0.2.3/src/ocpplab/__init__.py +237 -0
- ocpplab-0.2.3/src/ocpplab/client.py +215 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/client_wrapper.py +4 -24
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/errors/__init__.py +1 -15
- ocpplab-0.2.2/src/ocpplab/errors/unauthorized_error.py → ocpplab-0.2.3/src/ocpplab/errors/internal_server_error.py +2 -2
- ocpplab-0.2.2/src/ocpplab/errors/forbidden_error.py → ocpplab-0.2.3/src/ocpplab/errors/not_found_error.py +2 -2
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/errors/unprocessable_entity_error.py +2 -1
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/health/client.py +0 -4
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/health/raw_client.py +0 -91
- ocpplab-0.2.3/src/ocpplab/ocpi/__init__.py +58 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/client.py +101 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/cpo/client.py +236 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/cpo/raw_client.py +292 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/location/__init__.py +46 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/location/client.py +377 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/location/raw_client.py +351 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/location/types/__init__.py +44 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/location/types/create_ocpi_cpo_location_request_ocpi_version.py +5 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/location/types/create_ocpi_cpo_location_request_ocpp_version.py +5 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/location/types/delete_location_request_ocpi_version.py +5 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/raw_client.py +13 -0
- {ocpplab-0.2.2/src/ocpplab/location_templates → ocpplab-0.2.3/src/ocpplab/ocpi/templates}/__init__.py +4 -4
- ocpplab-0.2.3/src/ocpplab/ocpi/templates/client.py +160 -0
- {ocpplab-0.2.2/src/ocpplab/ocpi_templates → ocpplab-0.2.3/src/ocpplab/ocpi/templates}/raw_client.py +93 -63
- {ocpplab-0.2.2/src/ocpplab/location_templates → ocpplab-0.2.3/src/ocpplab/ocpi/templates}/types/__init__.py +5 -5
- ocpplab-0.2.3/src/ocpplab/ocpi/templates/types/list_templates_request_ocpi_version.py +5 -0
- ocpplab-0.2.3/src/ocpplab/ocpi/templates/types/list_templates_request_ocpp_version.py +5 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/__init__.py +63 -0
- {ocpplab-0.2.2/src/ocpplab → ocpplab-0.2.3/src/ocpplab/ocpp}/catalog/client.py +23 -29
- {ocpplab-0.2.2/src/ocpplab → ocpplab-0.2.3/src/ocpplab/ocpp}/catalog/raw_client.py +77 -210
- ocpplab-0.2.3/src/ocpplab/ocpp/client.py +177 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/commands/client.py +1413 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/commands/raw_client.py +2111 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/deployment/client.py +293 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/deployment/raw_client.py +360 -0
- {ocpplab-0.2.2/src/ocpplab/ocpi_locations → ocpplab-0.2.3/src/ocpplab/ocpp/deployment_runtime_ops}/__init__.py +3 -3
- ocpplab-0.2.3/src/ocpplab/ocpp/deployment_runtime_ops/client.py +148 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/deployment_runtime_ops/raw_client.py +177 -0
- {ocpplab-0.2.2/src/ocpplab/ocpi_locations → ocpplab-0.2.3/src/ocpplab/ocpp/deployment_runtime_ops}/types/__init__.py +3 -3
- ocpplab-0.2.3/src/ocpplab/ocpp/deployment_runtime_ops/types/operate_deployment_runtime_ops_response.py +8 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/location/client.py +313 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/location/raw_client.py +355 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/logs/__init__.py +37 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/logs/client.py +309 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/logs/raw_client.py +444 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/logs/types/__init__.py +38 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/logs/types/delete_logs_request_action_item.py +7 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/logs/types/list_logs_request_action_item.py +7 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/raw_client.py +13 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/templates/__init__.py +37 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/templates/client.py +160 -0
- {ocpplab-0.2.2/src/ocpplab/location_templates → ocpplab-0.2.3/src/ocpplab/ocpp/templates}/raw_client.py +74 -79
- ocpplab-0.2.3/src/ocpplab/ocpp/templates/types/__init__.py +38 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/templates/types/list_templates_request_ocpi_version.py +5 -0
- ocpplab-0.2.3/src/ocpplab/ocpp/templates/types/list_templates_request_ocpp_version.py +5 -0
- ocpplab-0.2.3/src/ocpplab/types/__init__.py +206 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_roam_helper.py → ocpplab-0.2.3/src/ocpplab/types/accepted_response.py +9 -6
- ocpplab-0.2.2/src/ocpplab/types/authorize_id_tag_command_event.py → ocpplab-0.2.3/src/ocpplab/types/authorize_id_tag_payload.py +2 -2
- ocpplab-0.2.2/src/ocpplab/types/ocpi_charger_template.py → ocpplab-0.2.3/src/ocpplab/types/charger_input.py +11 -10
- ocpplab-0.2.3/src/ocpplab/types/charger_input_ocpp_version.py +5 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/command_target.py +9 -13
- ocpplab-0.2.2/src/ocpplab/types/empty_event.py → ocpplab-0.2.3/src/ocpplab/types/configuration_change_payload.py +5 -2
- ocpplab-0.2.2/src/ocpplab/types/charger_command_target.py → ocpplab-0.2.3/src/ocpplab/types/connector_input.py +13 -4
- ocpplab-0.2.3/src/ocpplab/types/connector_input_format.py +5 -0
- ocpplab-0.2.3/src/ocpplab/types/connector_input_power_type.py +7 -0
- ocpplab-0.2.2/src/ocpplab/types/connector_command_event.py → ocpplab-0.2.3/src/ocpplab/types/connector_payload.py +2 -2
- ocpplab-0.2.3/src/ocpplab/types/cpo_location_details_input.py +54 -0
- ocpplab-0.2.3/src/ocpplab/types/deployment_runtime_action.py +5 -0
- ocpplab-0.2.2/src/ocpplab/types/template_list_response.py → ocpplab-0.2.3/src/ocpplab/types/deployment_runtime_ops_result.py +11 -5
- ocpplab-0.2.3/src/ocpplab/types/deployment_runtime_ops_result_status.py +5 -0
- ocpplab-0.2.2/src/ocpplab/types/cpo_report_response.py → ocpplab-0.2.3/src/ocpplab/types/empty_command_payload.py +2 -5
- ocpplab-0.2.2/src/ocpplab/types/fault_operation_response.py → ocpplab-0.2.3/src/ocpplab/types/evse_input.py +7 -6
- ocpplab-0.2.2/src/ocpplab/types/clear_fault_event.py → ocpplab-0.2.3/src/ocpplab/types/fault_clear_payload.py +2 -2
- ocpplab-0.2.2/src/ocpplab/types/inject_fault_event.py → ocpplab-0.2.3/src/ocpplab/types/fault_injection_payload.py +3 -3
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/http_error_response.py +3 -0
- ocpplab-0.2.2/src/ocpplab/types/local_auth_list_event.py → ocpplab-0.2.3/src/ocpplab/types/local_auth_list_payload.py +5 -3
- ocpplab-0.2.3/src/ocpplab/types/local_auth_list_payload_update_type.py +5 -0
- ocpplab-0.2.2/src/ocpplab/types/coordinates.py → ocpplab-0.2.3/src/ocpplab/types/ocpi_business_details.py +11 -6
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/ocpi_coordinates.py +1 -1
- ocpplab-0.2.3/src/ocpplab/types/ocpi_location_template_list_response.py +27 -0
- ocpplab-0.2.2/src/ocpplab/types/template_summary.py → ocpplab-0.2.3/src/ocpplab/types/ocpi_location_template_response.py +13 -5
- ocpplab-0.2.3/src/ocpplab/types/ocpi_partner_input.py +50 -0
- ocpplab-0.2.2/src/ocpplab/types/bundle_role.py → ocpplab-0.2.3/src/ocpplab/types/ocpi_partner_input_role.py +1 -1
- ocpplab-0.2.2/src/ocpplab/types/local_list_mutation_response.py → ocpplab-0.2.3/src/ocpplab/types/ocpi_partner_response.py +8 -6
- ocpplab-0.2.3/src/ocpplab/types/ocpi_template_filters_response.py +26 -0
- ocpplab-0.2.2/src/ocpplab/types/brand_list_response.py → ocpplab-0.2.3/src/ocpplab/types/ocpp_brand_list_response.py +1 -1
- ocpplab-0.2.2/src/ocpplab/types/unified_connector_request.py → ocpplab-0.2.3/src/ocpplab/types/ocpp_connector_command_request.py +3 -7
- ocpplab-0.2.3/src/ocpplab/types/ocpp_deployment_runtime_ops_response.py +32 -0
- ocpplab-0.2.3/src/ocpplab/types/ocpp_deployment_runtime_ops_response_target_type.py +5 -0
- ocpplab-0.2.2/src/ocpplab/types/cache_reset_response.py → ocpplab-0.2.3/src/ocpplab/types/ocpp_empty_command_request.py +5 -7
- ocpplab-0.2.2/src/ocpplab/types/location_command_response.py → ocpplab-0.2.3/src/ocpplab/types/ocpp_location_command_response.py +1 -1
- ocpplab-0.2.3/src/ocpplab/types/ocpp_location_template_list_response.py +27 -0
- ocpplab-0.2.3/src/ocpplab/types/ocpp_location_template_response.py +35 -0
- ocpplab-0.2.2/src/ocpplab/types/charger_log_list_response.py → ocpplab-0.2.3/src/ocpplab/types/ocpp_log_list_response.py +1 -1
- ocpplab-0.2.2/src/ocpplab/types/model_list_response.py → ocpplab-0.2.3/src/ocpplab/types/ocpp_model_list_response.py +3 -3
- ocpplab-0.2.2/src/ocpplab/types/model_response.py → ocpplab-0.2.3/src/ocpplab/types/ocpp_model_response.py +1 -1
- ocpplab-0.2.3/src/ocpplab/types/ocpp_template_filters_response.py +26 -0
- ocpplab-0.2.3/src/ocpplab/types/ocpp_virtual_deployment_response.py +31 -0
- ocpplab-0.2.2/src/ocpplab/types/power_update_command_event.py → ocpplab-0.2.3/src/ocpplab/types/power_update_payload.py +3 -3
- ocpplab-0.2.2/src/ocpplab/types/cpo_party_scope.py → ocpplab-0.2.3/src/ocpplab/types/proxy_message_payload.py +4 -5
- ocpplab-0.2.2/src/ocpplab/types/start_session_command_event.py → ocpplab-0.2.3/src/ocpplab/types/start_session_payload.py +2 -2
- ocpplab-0.2.2/src/ocpplab/types/stop_session_command_event.py → ocpplab-0.2.3/src/ocpplab/types/stop_session_payload.py +2 -2
- ocpplab-0.2.2/src/ocpplab/types/update_location_charger_item.py → ocpplab-0.2.3/src/ocpplab/types/virtual_location_charger_item.py +14 -9
- ocpplab-0.2.3/src/ocpplab/types/virtual_location_coordinates.py +24 -0
- ocpplab-0.2.2/src/ocpplab/__init__.py +0 -359
- ocpplab-0.2.2/src/ocpplab/chargers/client.py +0 -1116
- ocpplab-0.2.2/src/ocpplab/chargers/raw_client.py +0 -2305
- ocpplab-0.2.2/src/ocpplab/client.py +0 -356
- ocpplab-0.2.2/src/ocpplab/commands/client.py +0 -1910
- ocpplab-0.2.2/src/ocpplab/commands/raw_client.py +0 -4260
- ocpplab-0.2.2/src/ocpplab/errors/internal_server_error.py +0 -10
- ocpplab-0.2.2/src/ocpplab/errors/not_found_error.py +0 -10
- ocpplab-0.2.2/src/ocpplab/errors/service_unavailable_error.py +0 -10
- ocpplab-0.2.2/src/ocpplab/location_chargers/client.py +0 -571
- ocpplab-0.2.2/src/ocpplab/location_chargers/raw_client.py +0 -1188
- ocpplab-0.2.2/src/ocpplab/location_templates/client.py +0 -129
- ocpplab-0.2.2/src/ocpplab/location_templates/types/list_location_templates_request_ocpp_version.py +0 -5
- ocpplab-0.2.2/src/ocpplab/location_templates/types/list_location_templates_request_type.py +0 -5
- ocpplab-0.2.2/src/ocpplab/locations/client.py +0 -629
- ocpplab-0.2.2/src/ocpplab/locations/raw_client.py +0 -1189
- ocpplab-0.2.2/src/ocpplab/ocpi_cpos/__init__.py +0 -4
- ocpplab-0.2.2/src/ocpplab/ocpi_cpos/client.py +0 -618
- ocpplab-0.2.2/src/ocpplab/ocpi_cpos/raw_client.py +0 -1293
- ocpplab-0.2.2/src/ocpplab/ocpi_locations/client.py +0 -739
- ocpplab-0.2.2/src/ocpplab/ocpi_locations/raw_client.py +0 -1450
- ocpplab-0.2.2/src/ocpplab/ocpi_locations/types/create_locations_bulk_request_locations_item.py +0 -8
- ocpplab-0.2.2/src/ocpplab/ocpi_templates/__init__.py +0 -4
- ocpplab-0.2.2/src/ocpplab/ocpi_templates/client.py +0 -104
- ocpplab-0.2.2/src/ocpplab/types/__init__.py +0 -281
- ocpplab-0.2.2/src/ocpplab/types/charger_accepted_response.py +0 -32
- ocpplab-0.2.2/src/ocpplab/types/charger_group.py +0 -40
- ocpplab-0.2.2/src/ocpplab/types/charger_lifecycle_request.py +0 -12
- ocpplab-0.2.2/src/ocpplab/types/charger_list_response.py +0 -27
- ocpplab-0.2.2/src/ocpplab/types/charger_provisioning_status.py +0 -5
- ocpplab-0.2.2/src/ocpplab/types/charger_response.py +0 -36
- ocpplab-0.2.2/src/ocpplab/types/charger_status_response.py +0 -34
- ocpplab-0.2.2/src/ocpplab/types/charger_summary.py +0 -37
- ocpplab-0.2.2/src/ocpplab/types/charger_template.py +0 -36
- ocpplab-0.2.2/src/ocpplab/types/configuration_change_response.py +0 -25
- ocpplab-0.2.2/src/ocpplab/types/configuration_update_event.py +0 -26
- ocpplab-0.2.2/src/ocpplab/types/cpo_accepted_response.py +0 -56
- ocpplab-0.2.2/src/ocpplab/types/cpo_list_response.py +0 -27
- ocpplab-0.2.2/src/ocpplab/types/cpo_provisioning_status.py +0 -5
- ocpplab-0.2.2/src/ocpplab/types/cpo_response.py +0 -44
- ocpplab-0.2.2/src/ocpplab/types/cpo_status_response.py +0 -43
- ocpplab-0.2.2/src/ocpplab/types/cpo_topology_summary.py +0 -26
- ocpplab-0.2.2/src/ocpplab/types/delete_location_chargers_response.py +0 -27
- ocpplab-0.2.2/src/ocpplab/types/evse_summary.py +0 -40
- ocpplab-0.2.2/src/ocpplab/types/location_bulk_accepted_response.py +0 -31
- ocpplab-0.2.2/src/ocpplab/types/location_bulk_provisioning_status.py +0 -5
- ocpplab-0.2.2/src/ocpplab/types/location_bulk_status_response.py +0 -36
- ocpplab-0.2.2/src/ocpplab/types/location_charger_bulk_accepted_response.py +0 -32
- ocpplab-0.2.2/src/ocpplab/types/location_charger_bulk_status_response.py +0 -40
- ocpplab-0.2.2/src/ocpplab/types/location_delete_charger_failure.py +0 -24
- ocpplab-0.2.2/src/ocpplab/types/location_from_template_request.py +0 -37
- ocpplab-0.2.2/src/ocpplab/types/location_list_response.py +0 -27
- ocpplab-0.2.2/src/ocpplab/types/location_response.py +0 -37
- ocpplab-0.2.2/src/ocpplab/types/location_response_coordinates.py +0 -7
- ocpplab-0.2.2/src/ocpplab/types/location_update_charger_failure.py +0 -24
- ocpplab-0.2.2/src/ocpplab/types/ocpi_charger_group.py +0 -28
- ocpplab-0.2.2/src/ocpplab/types/ocpi_create_location_request.py +0 -42
- ocpplab-0.2.2/src/ocpplab/types/ocpi_location_list_response.py +0 -27
- ocpplab-0.2.2/src/ocpplab/types/ocpi_location_response.py +0 -40
- ocpplab-0.2.2/src/ocpplab/types/parking_type.py +0 -8
- ocpplab-0.2.2/src/ocpplab/types/provisioning_error_detail.py +0 -57
- ocpplab-0.2.2/src/ocpplab/types/provisioning_progress.py +0 -35
- ocpplab-0.2.2/src/ocpplab/types/proxy_message_event.py +0 -29
- ocpplab-0.2.2/src/ocpplab/types/proxy_message_event_ocpp_version.py +0 -5
- ocpplab-0.2.2/src/ocpplab/types/start_transaction_command_event.py +0 -25
- ocpplab-0.2.2/src/ocpplab/types/stop_transaction_command_event.py +0 -23
- ocpplab-0.2.2/src/ocpplab/types/update_location_chargers_response.py +0 -28
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/_default_clients.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/__init__.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/api_error.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/datetime_utils.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/file.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/force_multipart.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/http_client.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/http_response.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/http_sse/__init__.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/http_sse/_api.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/http_sse/_decoders.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/http_sse/_exceptions.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/http_sse/_models.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/jsonable_encoder.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/logging.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/parse_error.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/pydantic_utilities.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/query_encoder.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/remove_none_from_dict.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/request_options.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/core/serialization.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/errors/bad_request_error.py +0 -0
- {ocpplab-0.2.2/src/ocpplab/catalog → ocpplab-0.2.3/src/ocpplab/health}/__init__.py +0 -0
- {ocpplab-0.2.2/src/ocpplab/chargers → ocpplab-0.2.3/src/ocpplab/ocpi/cpo}/__init__.py +0 -0
- {ocpplab-0.2.2/src/ocpplab/commands → ocpplab-0.2.3/src/ocpplab/ocpp/catalog}/__init__.py +0 -0
- {ocpplab-0.2.2/src/ocpplab/health → ocpplab-0.2.3/src/ocpplab/ocpp/commands}/__init__.py +0 -0
- {ocpplab-0.2.2/src/ocpplab/location_chargers → ocpplab-0.2.3/src/ocpplab/ocpp/deployment}/__init__.py +0 -0
- {ocpplab-0.2.2/src/ocpplab/locations → ocpplab-0.2.3/src/ocpplab/ocpp/location}/__init__.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/py.typed +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/brand_response.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/charger_log_entry.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/http_validation_error.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/local_auth_list_entry.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/location_command_failure.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/location_queued_command_result.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/queued_command_response.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/validation_error.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/types/validation_error_loc_item.py +0 -0
- {ocpplab-0.2.2 → ocpplab-0.2.3}/src/ocpplab/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ocpplab
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary:
|
|
5
5
|
Keywords: ev,ocpp,sdk,api,charging
|
|
6
6
|
Requires-Python: >=3.10,<4.0
|
|
@@ -68,26 +68,29 @@ A full reference for this library is available [here](https://github.com/ev-clou
|
|
|
68
68
|
Instantiate and use the client with the following:
|
|
69
69
|
|
|
70
70
|
```python
|
|
71
|
-
from ocpplab import OcpplabSDK
|
|
71
|
+
from ocpplab import OcpplabSDK, OcpiPartnerInput, OcpiBusinessDetails
|
|
72
72
|
|
|
73
73
|
client = OcpplabSDK(
|
|
74
74
|
token="<token>",
|
|
75
75
|
base_url="https://yourhost.com/path/to/api",
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
client.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
client.ocpi.cpo.create(
|
|
79
|
+
partner=OcpiPartnerInput(
|
|
80
|
+
country_code="NL",
|
|
81
|
+
party_id="ABC",
|
|
82
|
+
name="ABC Charging",
|
|
83
|
+
role="CPO",
|
|
84
|
+
ocpi_versions=[
|
|
85
|
+
"2.2.1"
|
|
86
|
+
],
|
|
87
|
+
business_details=OcpiBusinessDetails(
|
|
88
|
+
name="ABC Charging B.V.",
|
|
89
|
+
website="https://abc-charging.example.com",
|
|
90
|
+
logo_url="https://abc-charging.example.com/logo.png",
|
|
91
|
+
),
|
|
92
|
+
),
|
|
84
93
|
ocpi_version="2.2.1",
|
|
85
|
-
seed=42,
|
|
86
|
-
ttl_seconds=7200,
|
|
87
|
-
overrides={
|
|
88
|
-
"chargers_per_location": 3,
|
|
89
|
-
"locations": 2
|
|
90
|
-
},
|
|
91
94
|
)
|
|
92
95
|
```
|
|
93
96
|
|
|
@@ -107,19 +110,22 @@ client = AsyncOcpplabSDK(
|
|
|
107
110
|
|
|
108
111
|
|
|
109
112
|
async def main() -> None:
|
|
110
|
-
await client.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
await client.ocpi.cpo.create(
|
|
114
|
+
partner=OcpiPartnerInput(
|
|
115
|
+
country_code="NL",
|
|
116
|
+
party_id="ABC",
|
|
117
|
+
name="ABC Charging",
|
|
118
|
+
role="CPO",
|
|
119
|
+
ocpi_versions=[
|
|
120
|
+
"2.2.1"
|
|
121
|
+
],
|
|
122
|
+
business_details=OcpiBusinessDetails(
|
|
123
|
+
name="ABC Charging B.V.",
|
|
124
|
+
website="https://abc-charging.example.com",
|
|
125
|
+
logo_url="https://abc-charging.example.com/logo.png",
|
|
126
|
+
),
|
|
127
|
+
),
|
|
116
128
|
ocpi_version="2.2.1",
|
|
117
|
-
seed=42,
|
|
118
|
-
ttl_seconds=7200,
|
|
119
|
-
overrides={
|
|
120
|
-
"chargers_per_location": 3,
|
|
121
|
-
"locations": 2
|
|
122
|
-
},
|
|
123
129
|
)
|
|
124
130
|
|
|
125
131
|
|
|
@@ -135,7 +141,7 @@ will be thrown.
|
|
|
135
141
|
from ocpplab.core.api_error import ApiError
|
|
136
142
|
|
|
137
143
|
try:
|
|
138
|
-
client.
|
|
144
|
+
client.ocpi.cpo.create(...)
|
|
139
145
|
except ApiError as e:
|
|
140
146
|
print(e.status_code)
|
|
141
147
|
print(e.body)
|
|
@@ -152,7 +158,7 @@ The `.with_raw_response` property returns a "raw" client that can be used to acc
|
|
|
152
158
|
from ocpplab import OcpplabSDK
|
|
153
159
|
|
|
154
160
|
client = OcpplabSDK(...)
|
|
155
|
-
response = client.
|
|
161
|
+
response = client.ocpi.cpo.with_raw_response.create(...)
|
|
156
162
|
print(response.headers) # access the response headers
|
|
157
163
|
print(response.status_code) # access the response status code
|
|
158
164
|
print(response.data) # access the underlying object
|
|
@@ -173,7 +179,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
173
179
|
Use the `max_retries` request option to configure this behavior.
|
|
174
180
|
|
|
175
181
|
```python
|
|
176
|
-
client.
|
|
182
|
+
client.ocpi.cpo.create(..., request_options={
|
|
177
183
|
"max_retries": 1
|
|
178
184
|
})
|
|
179
185
|
```
|
|
@@ -188,7 +194,7 @@ from ocpplab import OcpplabSDK
|
|
|
188
194
|
client = OcpplabSDK(..., timeout=20.0)
|
|
189
195
|
|
|
190
196
|
# Override timeout for a specific method
|
|
191
|
-
client.
|
|
197
|
+
client.ocpi.cpo.create(..., request_options={
|
|
192
198
|
"timeout_in_seconds": 1
|
|
193
199
|
})
|
|
194
200
|
```
|
|
@@ -34,26 +34,29 @@ A full reference for this library is available [here](https://github.com/ev-clou
|
|
|
34
34
|
Instantiate and use the client with the following:
|
|
35
35
|
|
|
36
36
|
```python
|
|
37
|
-
from ocpplab import OcpplabSDK
|
|
37
|
+
from ocpplab import OcpplabSDK, OcpiPartnerInput, OcpiBusinessDetails
|
|
38
38
|
|
|
39
39
|
client = OcpplabSDK(
|
|
40
40
|
token="<token>",
|
|
41
41
|
base_url="https://yourhost.com/path/to/api",
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
client.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
client.ocpi.cpo.create(
|
|
45
|
+
partner=OcpiPartnerInput(
|
|
46
|
+
country_code="NL",
|
|
47
|
+
party_id="ABC",
|
|
48
|
+
name="ABC Charging",
|
|
49
|
+
role="CPO",
|
|
50
|
+
ocpi_versions=[
|
|
51
|
+
"2.2.1"
|
|
52
|
+
],
|
|
53
|
+
business_details=OcpiBusinessDetails(
|
|
54
|
+
name="ABC Charging B.V.",
|
|
55
|
+
website="https://abc-charging.example.com",
|
|
56
|
+
logo_url="https://abc-charging.example.com/logo.png",
|
|
57
|
+
),
|
|
58
|
+
),
|
|
50
59
|
ocpi_version="2.2.1",
|
|
51
|
-
seed=42,
|
|
52
|
-
ttl_seconds=7200,
|
|
53
|
-
overrides={
|
|
54
|
-
"chargers_per_location": 3,
|
|
55
|
-
"locations": 2
|
|
56
|
-
},
|
|
57
60
|
)
|
|
58
61
|
```
|
|
59
62
|
|
|
@@ -73,19 +76,22 @@ client = AsyncOcpplabSDK(
|
|
|
73
76
|
|
|
74
77
|
|
|
75
78
|
async def main() -> None:
|
|
76
|
-
await client.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
await client.ocpi.cpo.create(
|
|
80
|
+
partner=OcpiPartnerInput(
|
|
81
|
+
country_code="NL",
|
|
82
|
+
party_id="ABC",
|
|
83
|
+
name="ABC Charging",
|
|
84
|
+
role="CPO",
|
|
85
|
+
ocpi_versions=[
|
|
86
|
+
"2.2.1"
|
|
87
|
+
],
|
|
88
|
+
business_details=OcpiBusinessDetails(
|
|
89
|
+
name="ABC Charging B.V.",
|
|
90
|
+
website="https://abc-charging.example.com",
|
|
91
|
+
logo_url="https://abc-charging.example.com/logo.png",
|
|
92
|
+
),
|
|
93
|
+
),
|
|
82
94
|
ocpi_version="2.2.1",
|
|
83
|
-
seed=42,
|
|
84
|
-
ttl_seconds=7200,
|
|
85
|
-
overrides={
|
|
86
|
-
"chargers_per_location": 3,
|
|
87
|
-
"locations": 2
|
|
88
|
-
},
|
|
89
95
|
)
|
|
90
96
|
|
|
91
97
|
|
|
@@ -101,7 +107,7 @@ will be thrown.
|
|
|
101
107
|
from ocpplab.core.api_error import ApiError
|
|
102
108
|
|
|
103
109
|
try:
|
|
104
|
-
client.
|
|
110
|
+
client.ocpi.cpo.create(...)
|
|
105
111
|
except ApiError as e:
|
|
106
112
|
print(e.status_code)
|
|
107
113
|
print(e.body)
|
|
@@ -118,7 +124,7 @@ The `.with_raw_response` property returns a "raw" client that can be used to acc
|
|
|
118
124
|
from ocpplab import OcpplabSDK
|
|
119
125
|
|
|
120
126
|
client = OcpplabSDK(...)
|
|
121
|
-
response = client.
|
|
127
|
+
response = client.ocpi.cpo.with_raw_response.create(...)
|
|
122
128
|
print(response.headers) # access the response headers
|
|
123
129
|
print(response.status_code) # access the response status code
|
|
124
130
|
print(response.data) # access the underlying object
|
|
@@ -139,7 +145,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
139
145
|
Use the `max_retries` request option to configure this behavior.
|
|
140
146
|
|
|
141
147
|
```python
|
|
142
|
-
client.
|
|
148
|
+
client.ocpi.cpo.create(..., request_options={
|
|
143
149
|
"max_retries": 1
|
|
144
150
|
})
|
|
145
151
|
```
|
|
@@ -154,7 +160,7 @@ from ocpplab import OcpplabSDK
|
|
|
154
160
|
client = OcpplabSDK(..., timeout=20.0)
|
|
155
161
|
|
|
156
162
|
# Override timeout for a specific method
|
|
157
|
-
client.
|
|
163
|
+
client.ocpi.cpo.create(..., request_options={
|
|
158
164
|
"timeout_in_seconds": 1
|
|
159
165
|
})
|
|
160
166
|
```
|
|
@@ -0,0 +1,237 @@
|
|
|
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
|
+
AcceptedResponse,
|
|
11
|
+
AuthorizeIdTagPayload,
|
|
12
|
+
BrandResponse,
|
|
13
|
+
ChargerInput,
|
|
14
|
+
ChargerInputOcppVersion,
|
|
15
|
+
ChargerLogEntry,
|
|
16
|
+
CommandTarget,
|
|
17
|
+
ConfigurationChangePayload,
|
|
18
|
+
ConnectorInput,
|
|
19
|
+
ConnectorInputFormat,
|
|
20
|
+
ConnectorInputPowerType,
|
|
21
|
+
ConnectorPayload,
|
|
22
|
+
CpoLocationDetailsInput,
|
|
23
|
+
DeploymentRuntimeAction,
|
|
24
|
+
DeploymentRuntimeOpsResult,
|
|
25
|
+
DeploymentRuntimeOpsResultStatus,
|
|
26
|
+
EmptyCommandPayload,
|
|
27
|
+
EvseInput,
|
|
28
|
+
FaultClearPayload,
|
|
29
|
+
FaultInjectionPayload,
|
|
30
|
+
HttpErrorResponse,
|
|
31
|
+
HttpValidationError,
|
|
32
|
+
LocalAuthListEntry,
|
|
33
|
+
LocalAuthListPayload,
|
|
34
|
+
LocalAuthListPayloadUpdateType,
|
|
35
|
+
LocationCommandFailure,
|
|
36
|
+
LocationQueuedCommandResult,
|
|
37
|
+
OcpiBusinessDetails,
|
|
38
|
+
OcpiCoordinates,
|
|
39
|
+
OcpiLocationTemplateListResponse,
|
|
40
|
+
OcpiLocationTemplateResponse,
|
|
41
|
+
OcpiPartnerInput,
|
|
42
|
+
OcpiPartnerInputRole,
|
|
43
|
+
OcpiPartnerResponse,
|
|
44
|
+
OcpiTemplateFiltersResponse,
|
|
45
|
+
OcppBrandListResponse,
|
|
46
|
+
OcppConnectorCommandRequest,
|
|
47
|
+
OcppDeploymentRuntimeOpsResponse,
|
|
48
|
+
OcppDeploymentRuntimeOpsResponseTargetType,
|
|
49
|
+
OcppEmptyCommandRequest,
|
|
50
|
+
OcppLocationCommandResponse,
|
|
51
|
+
OcppLocationTemplateListResponse,
|
|
52
|
+
OcppLocationTemplateResponse,
|
|
53
|
+
OcppLogListResponse,
|
|
54
|
+
OcppModelListResponse,
|
|
55
|
+
OcppModelResponse,
|
|
56
|
+
OcppTemplateFiltersResponse,
|
|
57
|
+
OcppVirtualDeploymentResponse,
|
|
58
|
+
PowerUpdatePayload,
|
|
59
|
+
ProxyMessagePayload,
|
|
60
|
+
QueuedCommandResponse,
|
|
61
|
+
StartSessionPayload,
|
|
62
|
+
StopSessionPayload,
|
|
63
|
+
ValidationError,
|
|
64
|
+
ValidationErrorLocItem,
|
|
65
|
+
VirtualLocationChargerItem,
|
|
66
|
+
VirtualLocationCoordinates,
|
|
67
|
+
)
|
|
68
|
+
from .errors import BadRequestError, InternalServerError, NotFoundError, UnprocessableEntityError
|
|
69
|
+
from . import health, ocpi, ocpp
|
|
70
|
+
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
71
|
+
from .client import AsyncOcpplabSDK, OcpplabSDK
|
|
72
|
+
from .version import __version__
|
|
73
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
74
|
+
"AcceptedResponse": ".types",
|
|
75
|
+
"AsyncOcpplabSDK": ".client",
|
|
76
|
+
"AuthorizeIdTagPayload": ".types",
|
|
77
|
+
"BadRequestError": ".errors",
|
|
78
|
+
"BrandResponse": ".types",
|
|
79
|
+
"ChargerInput": ".types",
|
|
80
|
+
"ChargerInputOcppVersion": ".types",
|
|
81
|
+
"ChargerLogEntry": ".types",
|
|
82
|
+
"CommandTarget": ".types",
|
|
83
|
+
"ConfigurationChangePayload": ".types",
|
|
84
|
+
"ConnectorInput": ".types",
|
|
85
|
+
"ConnectorInputFormat": ".types",
|
|
86
|
+
"ConnectorInputPowerType": ".types",
|
|
87
|
+
"ConnectorPayload": ".types",
|
|
88
|
+
"CpoLocationDetailsInput": ".types",
|
|
89
|
+
"DefaultAioHttpClient": "._default_clients",
|
|
90
|
+
"DefaultAsyncHttpxClient": "._default_clients",
|
|
91
|
+
"DeploymentRuntimeAction": ".types",
|
|
92
|
+
"DeploymentRuntimeOpsResult": ".types",
|
|
93
|
+
"DeploymentRuntimeOpsResultStatus": ".types",
|
|
94
|
+
"EmptyCommandPayload": ".types",
|
|
95
|
+
"EvseInput": ".types",
|
|
96
|
+
"FaultClearPayload": ".types",
|
|
97
|
+
"FaultInjectionPayload": ".types",
|
|
98
|
+
"HttpErrorResponse": ".types",
|
|
99
|
+
"HttpValidationError": ".types",
|
|
100
|
+
"InternalServerError": ".errors",
|
|
101
|
+
"LocalAuthListEntry": ".types",
|
|
102
|
+
"LocalAuthListPayload": ".types",
|
|
103
|
+
"LocalAuthListPayloadUpdateType": ".types",
|
|
104
|
+
"LocationCommandFailure": ".types",
|
|
105
|
+
"LocationQueuedCommandResult": ".types",
|
|
106
|
+
"NotFoundError": ".errors",
|
|
107
|
+
"OcpiBusinessDetails": ".types",
|
|
108
|
+
"OcpiCoordinates": ".types",
|
|
109
|
+
"OcpiLocationTemplateListResponse": ".types",
|
|
110
|
+
"OcpiLocationTemplateResponse": ".types",
|
|
111
|
+
"OcpiPartnerInput": ".types",
|
|
112
|
+
"OcpiPartnerInputRole": ".types",
|
|
113
|
+
"OcpiPartnerResponse": ".types",
|
|
114
|
+
"OcpiTemplateFiltersResponse": ".types",
|
|
115
|
+
"OcppBrandListResponse": ".types",
|
|
116
|
+
"OcppConnectorCommandRequest": ".types",
|
|
117
|
+
"OcppDeploymentRuntimeOpsResponse": ".types",
|
|
118
|
+
"OcppDeploymentRuntimeOpsResponseTargetType": ".types",
|
|
119
|
+
"OcppEmptyCommandRequest": ".types",
|
|
120
|
+
"OcppLocationCommandResponse": ".types",
|
|
121
|
+
"OcppLocationTemplateListResponse": ".types",
|
|
122
|
+
"OcppLocationTemplateResponse": ".types",
|
|
123
|
+
"OcppLogListResponse": ".types",
|
|
124
|
+
"OcppModelListResponse": ".types",
|
|
125
|
+
"OcppModelResponse": ".types",
|
|
126
|
+
"OcppTemplateFiltersResponse": ".types",
|
|
127
|
+
"OcppVirtualDeploymentResponse": ".types",
|
|
128
|
+
"OcpplabSDK": ".client",
|
|
129
|
+
"PowerUpdatePayload": ".types",
|
|
130
|
+
"ProxyMessagePayload": ".types",
|
|
131
|
+
"QueuedCommandResponse": ".types",
|
|
132
|
+
"StartSessionPayload": ".types",
|
|
133
|
+
"StopSessionPayload": ".types",
|
|
134
|
+
"UnprocessableEntityError": ".errors",
|
|
135
|
+
"ValidationError": ".types",
|
|
136
|
+
"ValidationErrorLocItem": ".types",
|
|
137
|
+
"VirtualLocationChargerItem": ".types",
|
|
138
|
+
"VirtualLocationCoordinates": ".types",
|
|
139
|
+
"__version__": ".version",
|
|
140
|
+
"health": ".health",
|
|
141
|
+
"ocpi": ".ocpi",
|
|
142
|
+
"ocpp": ".ocpp",
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
147
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
148
|
+
if module_name is None:
|
|
149
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
150
|
+
try:
|
|
151
|
+
module = import_module(module_name, __package__)
|
|
152
|
+
if module_name == f".{attr_name}":
|
|
153
|
+
return module
|
|
154
|
+
else:
|
|
155
|
+
return getattr(module, attr_name)
|
|
156
|
+
except ImportError as e:
|
|
157
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
158
|
+
except AttributeError as e:
|
|
159
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def __dir__():
|
|
163
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
164
|
+
return sorted(lazy_attrs)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
__all__ = [
|
|
168
|
+
"AcceptedResponse",
|
|
169
|
+
"AsyncOcpplabSDK",
|
|
170
|
+
"AuthorizeIdTagPayload",
|
|
171
|
+
"BadRequestError",
|
|
172
|
+
"BrandResponse",
|
|
173
|
+
"ChargerInput",
|
|
174
|
+
"ChargerInputOcppVersion",
|
|
175
|
+
"ChargerLogEntry",
|
|
176
|
+
"CommandTarget",
|
|
177
|
+
"ConfigurationChangePayload",
|
|
178
|
+
"ConnectorInput",
|
|
179
|
+
"ConnectorInputFormat",
|
|
180
|
+
"ConnectorInputPowerType",
|
|
181
|
+
"ConnectorPayload",
|
|
182
|
+
"CpoLocationDetailsInput",
|
|
183
|
+
"DefaultAioHttpClient",
|
|
184
|
+
"DefaultAsyncHttpxClient",
|
|
185
|
+
"DeploymentRuntimeAction",
|
|
186
|
+
"DeploymentRuntimeOpsResult",
|
|
187
|
+
"DeploymentRuntimeOpsResultStatus",
|
|
188
|
+
"EmptyCommandPayload",
|
|
189
|
+
"EvseInput",
|
|
190
|
+
"FaultClearPayload",
|
|
191
|
+
"FaultInjectionPayload",
|
|
192
|
+
"HttpErrorResponse",
|
|
193
|
+
"HttpValidationError",
|
|
194
|
+
"InternalServerError",
|
|
195
|
+
"LocalAuthListEntry",
|
|
196
|
+
"LocalAuthListPayload",
|
|
197
|
+
"LocalAuthListPayloadUpdateType",
|
|
198
|
+
"LocationCommandFailure",
|
|
199
|
+
"LocationQueuedCommandResult",
|
|
200
|
+
"NotFoundError",
|
|
201
|
+
"OcpiBusinessDetails",
|
|
202
|
+
"OcpiCoordinates",
|
|
203
|
+
"OcpiLocationTemplateListResponse",
|
|
204
|
+
"OcpiLocationTemplateResponse",
|
|
205
|
+
"OcpiPartnerInput",
|
|
206
|
+
"OcpiPartnerInputRole",
|
|
207
|
+
"OcpiPartnerResponse",
|
|
208
|
+
"OcpiTemplateFiltersResponse",
|
|
209
|
+
"OcppBrandListResponse",
|
|
210
|
+
"OcppConnectorCommandRequest",
|
|
211
|
+
"OcppDeploymentRuntimeOpsResponse",
|
|
212
|
+
"OcppDeploymentRuntimeOpsResponseTargetType",
|
|
213
|
+
"OcppEmptyCommandRequest",
|
|
214
|
+
"OcppLocationCommandResponse",
|
|
215
|
+
"OcppLocationTemplateListResponse",
|
|
216
|
+
"OcppLocationTemplateResponse",
|
|
217
|
+
"OcppLogListResponse",
|
|
218
|
+
"OcppModelListResponse",
|
|
219
|
+
"OcppModelResponse",
|
|
220
|
+
"OcppTemplateFiltersResponse",
|
|
221
|
+
"OcppVirtualDeploymentResponse",
|
|
222
|
+
"OcpplabSDK",
|
|
223
|
+
"PowerUpdatePayload",
|
|
224
|
+
"ProxyMessagePayload",
|
|
225
|
+
"QueuedCommandResponse",
|
|
226
|
+
"StartSessionPayload",
|
|
227
|
+
"StopSessionPayload",
|
|
228
|
+
"UnprocessableEntityError",
|
|
229
|
+
"ValidationError",
|
|
230
|
+
"ValidationErrorLocItem",
|
|
231
|
+
"VirtualLocationChargerItem",
|
|
232
|
+
"VirtualLocationCoordinates",
|
|
233
|
+
"__version__",
|
|
234
|
+
"health",
|
|
235
|
+
"ocpi",
|
|
236
|
+
"ocpp",
|
|
237
|
+
]
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .core.logging import LogConfig, Logger
|
|
10
|
+
|
|
11
|
+
if typing.TYPE_CHECKING:
|
|
12
|
+
from .health.client import AsyncHealthClient, HealthClient
|
|
13
|
+
from .ocpi.client import AsyncOcpiClient, OcpiClient
|
|
14
|
+
from .ocpp.client import AsyncOcppClient, OcppClient
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class OcpplabSDK:
|
|
18
|
+
"""
|
|
19
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
20
|
+
|
|
21
|
+
Parameters
|
|
22
|
+
----------
|
|
23
|
+
base_url : str
|
|
24
|
+
The base url to use for requests from the client.
|
|
25
|
+
|
|
26
|
+
token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
|
|
27
|
+
headers : typing.Optional[typing.Dict[str, str]]
|
|
28
|
+
Additional headers to send with every request.
|
|
29
|
+
|
|
30
|
+
timeout : typing.Optional[float]
|
|
31
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
32
|
+
|
|
33
|
+
follow_redirects : typing.Optional[bool]
|
|
34
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
35
|
+
|
|
36
|
+
httpx_client : typing.Optional[httpx.Client]
|
|
37
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
38
|
+
|
|
39
|
+
logging : typing.Optional[typing.Union[LogConfig, Logger]]
|
|
40
|
+
Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance.
|
|
41
|
+
|
|
42
|
+
Examples
|
|
43
|
+
--------
|
|
44
|
+
from ocpplab import OcpplabSDK
|
|
45
|
+
|
|
46
|
+
client = OcpplabSDK(
|
|
47
|
+
token="YOUR_TOKEN",
|
|
48
|
+
base_url="https://yourhost.com/path/to/api",
|
|
49
|
+
)
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def __init__(
|
|
53
|
+
self,
|
|
54
|
+
*,
|
|
55
|
+
base_url: str,
|
|
56
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
57
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
58
|
+
timeout: typing.Optional[float] = None,
|
|
59
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
60
|
+
httpx_client: typing.Optional[httpx.Client] = None,
|
|
61
|
+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
|
|
62
|
+
):
|
|
63
|
+
_defaulted_timeout = (
|
|
64
|
+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
|
|
65
|
+
)
|
|
66
|
+
self._client_wrapper = SyncClientWrapper(
|
|
67
|
+
base_url=base_url,
|
|
68
|
+
token=token,
|
|
69
|
+
headers=headers,
|
|
70
|
+
httpx_client=httpx_client
|
|
71
|
+
if httpx_client is not None
|
|
72
|
+
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
|
|
73
|
+
if follow_redirects is not None
|
|
74
|
+
else httpx.Client(timeout=_defaulted_timeout),
|
|
75
|
+
timeout=_defaulted_timeout,
|
|
76
|
+
logging=logging,
|
|
77
|
+
)
|
|
78
|
+
self._health: typing.Optional[HealthClient] = None
|
|
79
|
+
self._ocpi: typing.Optional[OcpiClient] = None
|
|
80
|
+
self._ocpp: typing.Optional[OcppClient] = None
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def health(self):
|
|
84
|
+
if self._health is None:
|
|
85
|
+
from .health.client import HealthClient # noqa: E402
|
|
86
|
+
|
|
87
|
+
self._health = HealthClient(client_wrapper=self._client_wrapper)
|
|
88
|
+
return self._health
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def ocpi(self):
|
|
92
|
+
if self._ocpi is None:
|
|
93
|
+
from .ocpi.client import OcpiClient # noqa: E402
|
|
94
|
+
|
|
95
|
+
self._ocpi = OcpiClient(client_wrapper=self._client_wrapper)
|
|
96
|
+
return self._ocpi
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def ocpp(self):
|
|
100
|
+
if self._ocpp is None:
|
|
101
|
+
from .ocpp.client import OcppClient # noqa: E402
|
|
102
|
+
|
|
103
|
+
self._ocpp = OcppClient(client_wrapper=self._client_wrapper)
|
|
104
|
+
return self._ocpp
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _make_default_async_client(
|
|
108
|
+
timeout: typing.Optional[float],
|
|
109
|
+
follow_redirects: typing.Optional[bool],
|
|
110
|
+
) -> httpx.AsyncClient:
|
|
111
|
+
try:
|
|
112
|
+
import httpx_aiohttp # type: ignore[import-not-found]
|
|
113
|
+
except ImportError:
|
|
114
|
+
pass
|
|
115
|
+
else:
|
|
116
|
+
if follow_redirects is not None:
|
|
117
|
+
return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout, follow_redirects=follow_redirects)
|
|
118
|
+
return httpx_aiohttp.HttpxAiohttpClient(timeout=timeout)
|
|
119
|
+
|
|
120
|
+
if follow_redirects is not None:
|
|
121
|
+
return httpx.AsyncClient(timeout=timeout, follow_redirects=follow_redirects)
|
|
122
|
+
return httpx.AsyncClient(timeout=timeout)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class AsyncOcpplabSDK:
|
|
126
|
+
"""
|
|
127
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
128
|
+
|
|
129
|
+
Parameters
|
|
130
|
+
----------
|
|
131
|
+
base_url : str
|
|
132
|
+
The base url to use for requests from the client.
|
|
133
|
+
|
|
134
|
+
token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
|
|
135
|
+
headers : typing.Optional[typing.Dict[str, str]]
|
|
136
|
+
Additional headers to send with every request.
|
|
137
|
+
|
|
138
|
+
async_token : typing.Optional[typing.Callable[[], typing.Awaitable[str]]]
|
|
139
|
+
An async callable that returns a bearer token. Use this when token acquisition involves async I/O (e.g., refreshing tokens via an async HTTP client). When provided, this is used instead of the synchronous token for async requests.
|
|
140
|
+
|
|
141
|
+
timeout : typing.Optional[float]
|
|
142
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
143
|
+
|
|
144
|
+
follow_redirects : typing.Optional[bool]
|
|
145
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
146
|
+
|
|
147
|
+
httpx_client : typing.Optional[httpx.AsyncClient]
|
|
148
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
149
|
+
|
|
150
|
+
logging : typing.Optional[typing.Union[LogConfig, Logger]]
|
|
151
|
+
Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance.
|
|
152
|
+
|
|
153
|
+
Examples
|
|
154
|
+
--------
|
|
155
|
+
from ocpplab import AsyncOcpplabSDK
|
|
156
|
+
|
|
157
|
+
client = AsyncOcpplabSDK(
|
|
158
|
+
token="YOUR_TOKEN",
|
|
159
|
+
base_url="https://yourhost.com/path/to/api",
|
|
160
|
+
)
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
def __init__(
|
|
164
|
+
self,
|
|
165
|
+
*,
|
|
166
|
+
base_url: str,
|
|
167
|
+
token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
|
|
168
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
169
|
+
async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None,
|
|
170
|
+
timeout: typing.Optional[float] = None,
|
|
171
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
172
|
+
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
173
|
+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
|
|
174
|
+
):
|
|
175
|
+
_defaulted_timeout = (
|
|
176
|
+
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
|
|
177
|
+
)
|
|
178
|
+
self._client_wrapper = AsyncClientWrapper(
|
|
179
|
+
base_url=base_url,
|
|
180
|
+
token=token,
|
|
181
|
+
headers=headers,
|
|
182
|
+
async_token=async_token,
|
|
183
|
+
httpx_client=httpx_client
|
|
184
|
+
if httpx_client is not None
|
|
185
|
+
else _make_default_async_client(timeout=_defaulted_timeout, follow_redirects=follow_redirects),
|
|
186
|
+
timeout=_defaulted_timeout,
|
|
187
|
+
logging=logging,
|
|
188
|
+
)
|
|
189
|
+
self._health: typing.Optional[AsyncHealthClient] = None
|
|
190
|
+
self._ocpi: typing.Optional[AsyncOcpiClient] = None
|
|
191
|
+
self._ocpp: typing.Optional[AsyncOcppClient] = None
|
|
192
|
+
|
|
193
|
+
@property
|
|
194
|
+
def health(self):
|
|
195
|
+
if self._health is None:
|
|
196
|
+
from .health.client import AsyncHealthClient # noqa: E402
|
|
197
|
+
|
|
198
|
+
self._health = AsyncHealthClient(client_wrapper=self._client_wrapper)
|
|
199
|
+
return self._health
|
|
200
|
+
|
|
201
|
+
@property
|
|
202
|
+
def ocpi(self):
|
|
203
|
+
if self._ocpi is None:
|
|
204
|
+
from .ocpi.client import AsyncOcpiClient # noqa: E402
|
|
205
|
+
|
|
206
|
+
self._ocpi = AsyncOcpiClient(client_wrapper=self._client_wrapper)
|
|
207
|
+
return self._ocpi
|
|
208
|
+
|
|
209
|
+
@property
|
|
210
|
+
def ocpp(self):
|
|
211
|
+
if self._ocpp is None:
|
|
212
|
+
from .ocpp.client import AsyncOcppClient # noqa: E402
|
|
213
|
+
|
|
214
|
+
self._ocpp = AsyncOcppClient(client_wrapper=self._client_wrapper)
|
|
215
|
+
return self._ocpp
|