evcloud 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- evcloud/__init__.py +802 -0
- evcloud/_default_clients.py +30 -0
- evcloud/client.py +200 -0
- evcloud/core/__init__.py +67 -0
- evcloud/core/api_error.py +23 -0
- evcloud/core/client_wrapper.py +108 -0
- evcloud/core/datetime_utils.py +70 -0
- evcloud/core/file.py +67 -0
- evcloud/core/force_multipart.py +18 -0
- evcloud/core/http_client.py +840 -0
- evcloud/core/http_response.py +59 -0
- evcloud/core/http_sse/__init__.py +9 -0
- evcloud/core/http_sse/_api.py +112 -0
- evcloud/core/http_sse/_decoders.py +61 -0
- evcloud/core/http_sse/_exceptions.py +7 -0
- evcloud/core/http_sse/_models.py +17 -0
- evcloud/core/jsonable_encoder.py +120 -0
- evcloud/core/logging.py +107 -0
- evcloud/core/pagination.py +82 -0
- evcloud/core/parse_error.py +36 -0
- evcloud/core/pydantic_utilities.py +634 -0
- evcloud/core/query_encoder.py +58 -0
- evcloud/core/remove_none_from_dict.py +11 -0
- evcloud/core/request_options.py +35 -0
- evcloud/core/serialization.py +276 -0
- evcloud/cpo/__init__.py +31 -0
- evcloud/cpo/cdrs/__init__.py +4 -0
- evcloud/cpo/cdrs/client.py +311 -0
- evcloud/cpo/cdrs/raw_client.py +592 -0
- evcloud/cpo/charge_points/__init__.py +7 -0
- evcloud/cpo/charge_points/client.py +1436 -0
- evcloud/cpo/charge_points/raw_client.py +2809 -0
- evcloud/cpo/charge_points/types/__init__.py +7 -0
- evcloud/cpo/charge_points/types/list_charge_points_request_ocpp_version.py +5 -0
- evcloud/cpo/client.py +62 -0
- evcloud/cpo/connectors/__init__.py +4 -0
- evcloud/cpo/connectors/client.py +698 -0
- evcloud/cpo/connectors/raw_client.py +1457 -0
- evcloud/cpo/evses/__init__.py +4 -0
- evcloud/cpo/evses/client.py +691 -0
- evcloud/cpo/evses/raw_client.py +1457 -0
- evcloud/cpo/health/__init__.py +4 -0
- evcloud/cpo/health/client.py +100 -0
- evcloud/cpo/health/raw_client.py +192 -0
- evcloud/cpo/locations/__init__.py +4 -0
- evcloud/cpo/locations/client.py +1021 -0
- evcloud/cpo/locations/raw_client.py +1887 -0
- evcloud/cpo/raw_client.py +13 -0
- evcloud/cpo/sessions/__init__.py +7 -0
- evcloud/cpo/sessions/client.py +430 -0
- evcloud/cpo/sessions/raw_client.py +889 -0
- evcloud/cpo/sessions/types/__init__.py +8 -0
- evcloud/cpo/sessions/types/list_sessions_request_billing_state.py +5 -0
- evcloud/cpo/sessions/types/list_sessions_request_status.py +7 -0
- evcloud/cpo/tariffs/__init__.py +17 -0
- evcloud/cpo/tariffs/client.py +1232 -0
- evcloud/cpo/tariffs/raw_client.py +2526 -0
- evcloud/cpo/tariffs/types/__init__.py +15 -0
- evcloud/cpo/tariffs/types/list_tariffs_request_type.py +7 -0
- evcloud/cpo/tariffs/types/tariff_create_ocpi_version.py +5 -0
- evcloud/cpo/tariffs/types/tariff_create_preauthorize_amount.py +5 -0
- evcloud/cpo/tariffs/types/tariff_patch_preauthorize_amount.py +5 -0
- evcloud/emsp/__init__.py +55 -0
- evcloud/emsp/cdrs/__init__.py +4 -0
- evcloud/emsp/cdrs/client.py +300 -0
- evcloud/emsp/cdrs/raw_client.py +610 -0
- evcloud/emsp/chargers/__init__.py +7 -0
- evcloud/emsp/chargers/client.py +167 -0
- evcloud/emsp/chargers/raw_client.py +331 -0
- evcloud/emsp/chargers/types/__init__.py +11 -0
- evcloud/emsp/chargers/types/resolve_chargers_response.py +53 -0
- evcloud/emsp/client.py +77 -0
- evcloud/emsp/commands/__init__.py +7 -0
- evcloud/emsp/commands/client.py +516 -0
- evcloud/emsp/commands/raw_client.py +979 -0
- evcloud/emsp/commands/types/__init__.py +7 -0
- evcloud/emsp/commands/types/send_commands_request_command.py +7 -0
- evcloud/emsp/emp_identities/__init__.py +4 -0
- evcloud/emsp/emp_identities/client.py +548 -0
- evcloud/emsp/emp_identities/raw_client.py +1277 -0
- evcloud/emsp/evses/__init__.py +4 -0
- evcloud/emsp/evses/client.py +154 -0
- evcloud/emsp/evses/raw_client.py +288 -0
- evcloud/emsp/health/__init__.py +4 -0
- evcloud/emsp/health/client.py +100 -0
- evcloud/emsp/health/raw_client.py +192 -0
- evcloud/emsp/locations/__init__.py +4 -0
- evcloud/emsp/locations/client.py +1386 -0
- evcloud/emsp/locations/raw_client.py +2903 -0
- evcloud/emsp/networks/__init__.py +7 -0
- evcloud/emsp/networks/client.py +1615 -0
- evcloud/emsp/networks/raw_client.py +3725 -0
- evcloud/emsp/networks/types/__init__.py +9 -0
- evcloud/emsp/networks/types/list_networks_request_network_type.py +5 -0
- evcloud/emsp/networks/types/list_rules_networks_request_validity.py +5 -0
- evcloud/emsp/networks/types/network_rule_create_request_rule_type.py +5 -0
- evcloud/emsp/raw_client.py +13 -0
- evcloud/emsp/sessions/__init__.py +4 -0
- evcloud/emsp/sessions/client.py +300 -0
- evcloud/emsp/sessions/raw_client.py +610 -0
- evcloud/emsp/tariffs/__init__.py +7 -0
- evcloud/emsp/tariffs/client.py +421 -0
- evcloud/emsp/tariffs/raw_client.py +883 -0
- evcloud/emsp/tariffs/types/__init__.py +8 -0
- evcloud/emsp/tariffs/types/estimate_request_kwh.py +5 -0
- evcloud/emsp/tariffs/types/estimate_request_minutes.py +5 -0
- evcloud/emsp/tenant/__init__.py +4 -0
- evcloud/emsp/tenant/client.py +328 -0
- evcloud/emsp/tenant/raw_client.py +869 -0
- evcloud/emsp/token_groups/__init__.py +7 -0
- evcloud/emsp/token_groups/client.py +1256 -0
- evcloud/emsp/token_groups/raw_client.py +3288 -0
- evcloud/emsp/token_groups/types/__init__.py +7 -0
- evcloud/emsp/token_groups/types/remove_token_token_groups_request_type.py +5 -0
- evcloud/emsp/tokens/__init__.py +7 -0
- evcloud/emsp/tokens/client.py +1298 -0
- evcloud/emsp/tokens/raw_client.py +2947 -0
- evcloud/emsp/tokens/types/__init__.py +10 -0
- evcloud/emsp/tokens/types/list_tokens_request_status.py +7 -0
- evcloud/emsp/tokens/types/list_tokens_request_type.py +5 -0
- evcloud/emsp/tokens/types/token_update_default_profile_type.py +5 -0
- evcloud/emsp/tokens/types/token_update_whitelist.py +5 -0
- evcloud/energy/__init__.py +8 -0
- evcloud/energy/client.py +47 -0
- evcloud/energy/control_requests/__init__.py +7 -0
- evcloud/energy/control_requests/client.py +399 -0
- evcloud/energy/control_requests/raw_client.py +835 -0
- evcloud/energy/control_requests/types/__init__.py +7 -0
- evcloud/energy/control_requests/types/list_control_requests_request_result.py +15 -0
- evcloud/energy/health/__init__.py +4 -0
- evcloud/energy/health/client.py +100 -0
- evcloud/energy/health/raw_client.py +192 -0
- evcloud/energy/power_measurements/__init__.py +4 -0
- evcloud/energy/power_measurements/client.py +254 -0
- evcloud/energy/power_measurements/raw_client.py +527 -0
- evcloud/energy/raw_client.py +13 -0
- evcloud/environment.py +7 -0
- evcloud/errors/__init__.py +25 -0
- evcloud/errors/bad_gateway_error.py +11 -0
- evcloud/errors/bad_request_error.py +11 -0
- evcloud/errors/conflict_error.py +11 -0
- evcloud/errors/forbidden_error.py +11 -0
- evcloud/errors/gateway_timeout_error.py +11 -0
- evcloud/errors/not_found_error.py +11 -0
- evcloud/errors/too_many_requests_error.py +11 -0
- evcloud/errors/unauthorized_error.py +11 -0
- evcloud/errors/unprocessable_entity_error.py +11 -0
- evcloud/health/__init__.py +4 -0
- evcloud/health/client.py +99 -0
- evcloud/health/raw_client.py +100 -0
- evcloud/ocpi/__init__.py +123 -0
- evcloud/ocpi/client.py +56 -0
- evcloud/ocpi/cpo_data/__init__.py +31 -0
- evcloud/ocpi/cpo_data/client.py +1553 -0
- evcloud/ocpi/cpo_data/raw_client.py +3119 -0
- evcloud/ocpi/cpo_data/types/__init__.py +29 -0
- evcloud/ocpi/cpo_data/types/cancel_reservation_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/create_cdr_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/delete_tariff_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/send_active_charging_profile_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/update_connector_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/update_evse_status_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/update_location_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/update_session_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/upsert_location_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/upsert_session_cpo_data_request_version.py +5 -0
- evcloud/ocpi/cpo_data/types/upsert_tariff_cpo_data_request_version.py +5 -0
- evcloud/ocpi/credentials/__init__.py +31 -0
- evcloud/ocpi/credentials/client.py +750 -0
- evcloud/ocpi/credentials/raw_client.py +1537 -0
- evcloud/ocpi/credentials/types/__init__.py +29 -0
- evcloud/ocpi/credentials/types/partner_versions_pull_request_partner_token_encoding.py +5 -0
- evcloud/ocpi/credentials/types/pull_versions_credentials_request_role.py +5 -0
- evcloud/ocpi/credentials/types/pull_versions_credentials_request_version.py +5 -0
- evcloud/ocpi/credentials/types/rotate_credentials_request_role.py +5 -0
- evcloud/ocpi/credentials/types/rotate_credentials_request_version.py +5 -0
- evcloud/ocpi/credentials/types/start_handshake_credentials_request_role.py +5 -0
- evcloud/ocpi/credentials/types/start_handshake_credentials_request_version.py +5 -0
- evcloud/ocpi/credentials/types/status_credentials_request_role.py +5 -0
- evcloud/ocpi/credentials/types/status_credentials_request_version.py +5 -0
- evcloud/ocpi/credentials/types/unregister_credentials_request_role.py +5 -0
- evcloud/ocpi/credentials/types/unregister_credentials_request_version.py +5 -0
- evcloud/ocpi/emsp/__init__.py +27 -0
- evcloud/ocpi/emsp/client.py +1142 -0
- evcloud/ocpi/emsp/raw_client.py +2209 -0
- evcloud/ocpi/emsp/types/__init__.py +25 -0
- evcloud/ocpi/emsp/types/charging_preferences_request_profile_type.py +5 -0
- evcloud/ocpi/emsp/types/clear_charging_profile_emsp_request_version.py +5 -0
- evcloud/ocpi/emsp/types/get_active_charging_profile_emsp_request_version.py +5 -0
- evcloud/ocpi/emsp/types/send_command_emsp_request_command.py +7 -0
- evcloud/ocpi/emsp/types/send_command_emsp_request_version.py +5 -0
- evcloud/ocpi/emsp/types/set_charging_preferences_emsp_request_version.py +5 -0
- evcloud/ocpi/emsp/types/set_charging_profile_emsp_request_version.py +5 -0
- evcloud/ocpi/emsp/types/update_token_emsp_request_version.py +5 -0
- evcloud/ocpi/emsp/types/upsert_token_emsp_request_version.py +5 -0
- evcloud/ocpi/invites/__init__.py +19 -0
- evcloud/ocpi/invites/client.py +385 -0
- evcloud/ocpi/invites/raw_client.py +887 -0
- evcloud/ocpi/invites/types/__init__.py +17 -0
- evcloud/ocpi/invites/types/partner_invite_create_request_gateway_role.py +5 -0
- evcloud/ocpi/invites/types/partner_invite_create_request_role.py +5 -0
- evcloud/ocpi/invites/types/partner_invite_create_request_version.py +5 -0
- evcloud/ocpi/invites/types/partner_invite_update_request_gateway_role.py +5 -0
- evcloud/ocpi/invites/types/partner_invite_update_request_version.py +5 -0
- evcloud/ocpi/partners/__init__.py +7 -0
- evcloud/ocpi/partners/client.py +581 -0
- evcloud/ocpi/partners/raw_client.py +1340 -0
- evcloud/ocpi/partners/types/__init__.py +8 -0
- evcloud/ocpi/partners/types/partner_register_request_ocpi_version.py +5 -0
- evcloud/ocpi/partners/types/partner_update_request_ocpi_version.py +5 -0
- evcloud/ocpi/raw_client.py +13 -0
- evcloud/ocpi/sync/__init__.py +33 -0
- evcloud/ocpi/sync/client.py +1701 -0
- evcloud/ocpi/sync/raw_client.py +3685 -0
- evcloud/ocpi/sync/types/__init__.py +31 -0
- evcloud/ocpi/sync/types/pull_cdrs_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/pull_hub_client_info_as_cpo_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/pull_hub_client_info_as_emsp_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/pull_locations_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/pull_sessions_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/pull_tariffs_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/pull_tokens_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/push_cdr_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/push_location_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/push_session_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/push_tariff_sync_request_version.py +5 -0
- evcloud/ocpi/sync/types/push_token_sync_request_version.py +5 -0
- evcloud/py.typed +0 -0
- evcloud/types/__init__.py +759 -0
- evcloud/types/access_mode.py +5 -0
- evcloud/types/asset_connector.py +26 -0
- evcloud/types/asset_updated_event.py +29 -0
- evcloud/types/availability_page.py +26 -0
- evcloud/types/batch_response.py +26 -0
- evcloud/types/batch_response_missing_item.py +7 -0
- evcloud/types/cdr_event.py +41 -0
- evcloud/types/cdr_out.py +75 -0
- evcloud/types/cdr_out_auth_method.py +7 -0
- evcloud/types/cdr_out_auth_method_zero.py +5 -0
- evcloud/types/cdr_out_origin.py +7 -0
- evcloud/types/cdr_out_origin_zero.py +5 -0
- evcloud/types/cdr_page.py +27 -0
- evcloud/types/cdr_write_response.py +26 -0
- evcloud/types/charge_point_created_out.py +74 -0
- evcloud/types/charge_point_created_out_access_mode.py +7 -0
- evcloud/types/charge_point_created_out_access_mode_zero.py +5 -0
- evcloud/types/charge_point_created_out_pricing.py +7 -0
- evcloud/types/charge_point_created_out_pricing_zero.py +5 -0
- evcloud/types/charge_point_created_out_site_type.py +7 -0
- evcloud/types/charge_point_created_out_site_type_zero.py +5 -0
- evcloud/types/charge_point_out.py +73 -0
- evcloud/types/charge_point_out_access_mode.py +7 -0
- evcloud/types/charge_point_out_access_mode_zero.py +5 -0
- evcloud/types/charge_point_out_pricing.py +7 -0
- evcloud/types/charge_point_out_pricing_zero.py +5 -0
- evcloud/types/charge_point_out_site_type.py +7 -0
- evcloud/types/charge_point_out_site_type_zero.py +5 -0
- evcloud/types/charge_point_page.py +27 -0
- evcloud/types/charging_preferences_response.py +28 -0
- evcloud/types/charging_preferences_response_result.py +10 -0
- evcloud/types/charging_profile.py +30 -0
- evcloud/types/charging_profile_charging_rate_unit.py +5 -0
- evcloud/types/charging_profile_period.py +31 -0
- evcloud/types/charging_profile_response.py +32 -0
- evcloud/types/cluster_page.py +26 -0
- evcloud/types/command_accepted.py +30 -0
- evcloud/types/command_accepted_route.py +53 -0
- evcloud/types/command_accepted_route_own.py +28 -0
- evcloud/types/command_accepted_route_own_ocpi_version.py +7 -0
- evcloud/types/command_accepted_route_own_ocpi_version_zero.py +5 -0
- evcloud/types/command_accepted_route_roaming.py +30 -0
- evcloud/types/command_accepted_route_roaming_ocpi_version.py +7 -0
- evcloud/types/command_accepted_route_roaming_ocpi_version_zero.py +5 -0
- evcloud/types/command_accepted_status.py +7 -0
- evcloud/types/command_accepted_status_zero.py +20 -0
- evcloud/types/command_page.py +26 -0
- evcloud/types/command_record.py +40 -0
- evcloud/types/command_record_command.py +7 -0
- evcloud/types/command_record_command_zero.py +7 -0
- evcloud/types/command_record_route.py +53 -0
- evcloud/types/command_record_route_own.py +28 -0
- evcloud/types/command_record_route_own_ocpi_version.py +7 -0
- evcloud/types/command_record_route_own_ocpi_version_zero.py +5 -0
- evcloud/types/command_record_route_roaming.py +30 -0
- evcloud/types/command_record_route_roaming_ocpi_version.py +7 -0
- evcloud/types/command_record_route_roaming_ocpi_version_zero.py +5 -0
- evcloud/types/command_record_status.py +7 -0
- evcloud/types/command_record_status_zero.py +20 -0
- evcloud/types/command_response_out.py +26 -0
- evcloud/types/command_response_out_result.py +7 -0
- evcloud/types/command_response_out_result_zero.py +7 -0
- evcloud/types/command_result_event.py +39 -0
- evcloud/types/command_result_event_module.py +5 -0
- evcloud/types/command_result_event_protocol.py +5 -0
- evcloud/types/command_result_event_status.py +5 -0
- evcloud/types/command_send_response.py +31 -0
- evcloud/types/command_token.py +36 -0
- evcloud/types/connector_format.py +5 -0
- evcloud/types/connector_page.py +27 -0
- evcloud/types/connector_status_event.py +29 -0
- evcloud/types/connector_write_response.py +27 -0
- evcloud/types/control_action.py +5 -0
- evcloud/types/control_request_page.py +27 -0
- evcloud/types/control_request_response.py +38 -0
- evcloud/types/control_request_response_action.py +7 -0
- evcloud/types/control_request_response_action_zero.py +7 -0
- evcloud/types/control_request_response_result.py +7 -0
- evcloud/types/control_request_response_result_zero.py +15 -0
- evcloud/types/control_request_response_unit.py +7 -0
- evcloud/types/control_request_response_unit_zero.py +5 -0
- evcloud/types/control_response_event.py +38 -0
- evcloud/types/control_response_event_action.py +5 -0
- evcloud/types/control_response_event_result.py +15 -0
- evcloud/types/control_response_event_unit.py +5 -0
- evcloud/types/cpo_connector_out.py +58 -0
- evcloud/types/cpo_connector_out_format.py +7 -0
- evcloud/types/cpo_connector_out_format_zero.py +5 -0
- evcloud/types/cpo_connector_out_ocpi_status.py +7 -0
- evcloud/types/cpo_connector_out_ocpi_status_zero.py +10 -0
- evcloud/types/cpo_connector_out_power_type.py +7 -0
- evcloud/types/cpo_connector_out_power_type_zero.py +7 -0
- evcloud/types/cpo_evse_out.py +61 -0
- evcloud/types/cpo_evse_out_origin.py +7 -0
- evcloud/types/cpo_evse_out_origin_zero.py +5 -0
- evcloud/types/cpo_evse_out_status.py +7 -0
- evcloud/types/cpo_evse_out_status_zero.py +10 -0
- evcloud/types/credentials_handshake_request.py +44 -0
- evcloud/types/credentials_handshake_request_partner_token_encoding.py +5 -0
- evcloud/types/credentials_handshake_response.py +32 -0
- evcloud/types/credentials_handshake_response_action.py +7 -0
- evcloud/types/credentials_handshake_response_version.py +5 -0
- evcloud/types/deliver_event_response.py +23 -0
- evcloud/types/delivery_drift_event.py +30 -0
- evcloud/types/display_text.py +24 -0
- evcloud/types/effective_cpo.py +27 -0
- evcloud/types/effective_cpo_source.py +7 -0
- evcloud/types/effective_cpo_source_zero.py +5 -0
- evcloud/types/effective_view_response.py +29 -0
- evcloud/types/emp_identity_out.py +35 -0
- evcloud/types/emp_identity_out_status.py +7 -0
- evcloud/types/emp_identity_out_status_zero.py +5 -0
- evcloud/types/emp_identity_page.py +26 -0
- evcloud/types/emsp_cdr_out.py +41 -0
- evcloud/types/emsp_cdr_out_source.py +7 -0
- evcloud/types/emsp_cdr_out_source_zero.py +5 -0
- evcloud/types/emsp_cdr_page.py +26 -0
- evcloud/types/emsp_connector_out.py +30 -0
- evcloud/types/emsp_evse_out.py +32 -0
- evcloud/types/emsp_gateway_schema_commands_location_key.py +25 -0
- evcloud/types/emsp_gateway_schema_location_lookup_location_key.py +25 -0
- evcloud/types/emsp_gateway_schema_locations_location_out.py +47 -0
- evcloud/types/emsp_gateway_schema_locations_location_page.py +26 -0
- evcloud/types/emsp_gateway_schema_networks_location_out.py +37 -0
- evcloud/types/emsp_gateway_schema_networks_location_page.py +26 -0
- evcloud/types/emsp_session_out.py +41 -0
- evcloud/types/emsp_session_out_source.py +7 -0
- evcloud/types/emsp_session_out_source_zero.py +5 -0
- evcloud/types/emsp_session_page.py +26 -0
- evcloud/types/emsp_tariff_page.py +26 -0
- evcloud/types/energy_contract.py +24 -0
- evcloud/types/estimate_line.py +27 -0
- evcloud/types/estimate_line_type.py +7 -0
- evcloud/types/estimate_line_type_zero.py +5 -0
- evcloud/types/estimate_response.py +30 -0
- evcloud/types/event_type_list.py +24 -0
- evcloud/types/event_type_response.py +27 -0
- evcloud/types/event_type_response_type.py +7 -0
- evcloud/types/event_type_response_type_zero.py +27 -0
- evcloud/types/event_type_version.py +24 -0
- evcloud/types/evse_connector_status.py +26 -0
- evcloud/types/evse_page.py +27 -0
- evcloud/types/evse_parking.py +25 -0
- evcloud/types/evse_parking_evse_position.py +7 -0
- evcloud/types/evse_parking_evse_position_zero.py +5 -0
- evcloud/types/evse_status_event.py +31 -0
- evcloud/types/evse_status_out.py +32 -0
- evcloud/types/evse_status_write_response.py +28 -0
- evcloud/types/facility_count.py +24 -0
- evcloud/types/facility_page.py +26 -0
- evcloud/types/health_ok.py +24 -0
- evcloud/types/health_ok_status.py +7 -0
- evcloud/types/health_ok_status_zero.py +5 -0
- evcloud/types/http_error_response.py +29 -0
- evcloud/types/http_validation_error.py +24 -0
- evcloud/types/limit_unit.py +5 -0
- evcloud/types/location_availability.py +28 -0
- evcloud/types/location_availability_status.py +7 -0
- evcloud/types/location_availability_status_zero.py +7 -0
- evcloud/types/location_base.py +53 -0
- evcloud/types/location_base_parking_type.py +7 -0
- evcloud/types/location_base_parking_type_zero.py +8 -0
- evcloud/types/location_cluster.py +26 -0
- evcloud/types/location_detail.py +51 -0
- evcloud/types/location_key_input.py +25 -0
- evcloud/types/location_list.py +24 -0
- evcloud/types/location_out.py +79 -0
- evcloud/types/location_out_access_mode.py +7 -0
- evcloud/types/location_out_access_mode_zero.py +5 -0
- evcloud/types/location_out_ocpi_version.py +7 -0
- evcloud/types/location_out_ocpi_version_zero.py +5 -0
- evcloud/types/location_out_origin.py +7 -0
- evcloud/types/location_out_origin_zero.py +5 -0
- evcloud/types/location_out_parking_type.py +7 -0
- evcloud/types/location_out_parking_type_zero.py +8 -0
- evcloud/types/location_out_role.py +7 -0
- evcloud/types/location_out_role_zero.py +5 -0
- evcloud/types/location_out_site_type.py +7 -0
- evcloud/types/location_out_site_type_zero.py +5 -0
- evcloud/types/location_page.py +27 -0
- evcloud/types/location_summary.py +43 -0
- evcloud/types/location_updated_event.py +30 -0
- evcloud/types/location_write_response.py +26 -0
- evcloud/types/map_cluster.py +28 -0
- evcloud/types/map_page.py +29 -0
- evcloud/types/network_consumer.py +25 -0
- evcloud/types/network_consumer_page.py +26 -0
- evcloud/types/network_detail_response.py +49 -0
- evcloud/types/network_detail_response_network_type.py +7 -0
- evcloud/types/network_detail_response_network_type_zero.py +5 -0
- evcloud/types/network_detail_response_publish_state.py +7 -0
- evcloud/types/network_detail_response_publish_state_zero.py +7 -0
- evcloud/types/network_page.py +26 -0
- evcloud/types/network_priority_order.py +23 -0
- evcloud/types/network_response.py +46 -0
- evcloud/types/network_response_network_type.py +7 -0
- evcloud/types/network_response_network_type_zero.py +5 -0
- evcloud/types/network_response_publish_state.py +7 -0
- evcloud/types/network_response_publish_state_zero.py +5 -0
- evcloud/types/network_rule_page.py +26 -0
- evcloud/types/network_rule_response.py +33 -0
- evcloud/types/network_rule_response_rule_type.py +7 -0
- evcloud/types/network_rule_response_rule_type_zero.py +5 -0
- evcloud/types/ocpi_business_details.py +26 -0
- evcloud/types/ocpi_business_details_input.py +26 -0
- evcloud/types/ocpi_cdr_dimension.py +24 -0
- evcloud/types/ocpi_cdr_location.py +30 -0
- evcloud/types/ocpi_cdr_token.py +30 -0
- evcloud/types/ocpi_charging_period.py +27 -0
- evcloud/types/ocpi_display_text.py +24 -0
- evcloud/types/ocpi_energy_mix.py +29 -0
- evcloud/types/ocpi_energy_mix_input.py +29 -0
- evcloud/types/ocpi_energy_source.py +24 -0
- evcloud/types/ocpi_energy_source_input.py +24 -0
- evcloud/types/ocpi_environmental_impact.py +24 -0
- evcloud/types/ocpi_evse_parking.py +24 -0
- evcloud/types/ocpi_exceptional_period.py +25 -0
- evcloud/types/ocpi_geo_location.py +24 -0
- evcloud/types/ocpi_geo_location_in.py +24 -0
- evcloud/types/ocpi_image.py +28 -0
- evcloud/types/ocpi_image_input.py +28 -0
- evcloud/types/ocpi_opening_times.py +28 -0
- evcloud/types/ocpi_opening_times_input.py +28 -0
- evcloud/types/ocpi_parking_place.py +44 -0
- evcloud/types/ocpi_parking_place_input.py +44 -0
- evcloud/types/ocpi_price_component_input.py +28 -0
- evcloud/types/ocpi_price_component_input_price.py +5 -0
- evcloud/types/ocpi_price_component_input_vat.py +5 -0
- evcloud/types/ocpi_price_component_output.py +26 -0
- evcloud/types/ocpi_price_input.py +26 -0
- evcloud/types/ocpi_price_input_excl_vat.py +5 -0
- evcloud/types/ocpi_price_input_incl_vat.py +5 -0
- evcloud/types/ocpi_price_output.py +24 -0
- evcloud/types/ocpi_publish_token.py +27 -0
- evcloud/types/ocpi_regular_hours.py +25 -0
- evcloud/types/ocpi_regular_hours_input.py +25 -0
- evcloud/types/ocpi_related_location.py +26 -0
- evcloud/types/ocpi_signed_data.py +28 -0
- evcloud/types/ocpi_signed_value.py +25 -0
- evcloud/types/ocpi_status_schedule.py +26 -0
- evcloud/types/ocpi_tariff_element_input.py +26 -0
- evcloud/types/ocpi_tariff_element_output.py +26 -0
- evcloud/types/ocpi_tariff_restrictions_input.py +33 -0
- evcloud/types/ocpi_tariff_restrictions_input_max_kwh.py +5 -0
- evcloud/types/ocpi_tariff_restrictions_input_min_kwh.py +5 -0
- evcloud/types/ocpi_tariff_restrictions_output.py +31 -0
- evcloud/types/ocpi_tariff_snapshot.py +26 -0
- evcloud/types/ocpp_version.py +5 -0
- evcloud/types/page_info.py +24 -0
- evcloud/types/parking.py +45 -0
- evcloud/types/parking_direction.py +7 -0
- evcloud/types/parking_direction_zero.py +5 -0
- evcloud/types/parking_type.py +8 -0
- evcloud/types/parking_vehicle_types_item.py +7 -0
- evcloud/types/parking_vehicle_types_item_zero.py +18 -0
- evcloud/types/partner_invite_response.py +47 -0
- evcloud/types/partner_invite_response_action.py +5 -0
- evcloud/types/partner_invite_response_role.py +5 -0
- evcloud/types/partner_invite_response_version.py +5 -0
- evcloud/types/partner_invite_revoke_response.py +31 -0
- evcloud/types/partner_invite_revoke_response_role.py +5 -0
- evcloud/types/partner_response.py +41 -0
- evcloud/types/partner_response_ocpi_version.py +5 -0
- evcloud/types/partner_token_updated_event.py +35 -0
- evcloud/types/partner_versions_pull_response.py +29 -0
- evcloud/types/partner_versions_pull_response_code.py +8 -0
- evcloud/types/partner_versions_pull_response_version.py +5 -0
- evcloud/types/power_measurement.py +30 -0
- evcloud/types/power_measurement_event.py +30 -0
- evcloud/types/power_measurement_list.py +24 -0
- evcloud/types/power_type.py +5 -0
- evcloud/types/price_component.py +26 -0
- evcloud/types/price_limit.py +24 -0
- evcloud/types/pricing_mode.py +5 -0
- evcloud/types/queue_health.py +34 -0
- evcloud/types/reservation_cancel_response.py +25 -0
- evcloud/types/resolve_chargers_response_own.py +28 -0
- evcloud/types/resolve_chargers_response_own_ocpi_version.py +7 -0
- evcloud/types/resolve_chargers_response_own_ocpi_version_zero.py +5 -0
- evcloud/types/resolve_chargers_response_roaming.py +30 -0
- evcloud/types/resolve_chargers_response_roaming_ocpi_version.py +7 -0
- evcloud/types/resolve_chargers_response_roaming_ocpi_version_zero.py +5 -0
- evcloud/types/session_event.py +39 -0
- evcloud/types/session_out.py +60 -0
- evcloud/types/session_out_auth_method.py +7 -0
- evcloud/types/session_out_auth_method_zero.py +5 -0
- evcloud/types/session_out_billing_state.py +7 -0
- evcloud/types/session_out_billing_state_zero.py +5 -0
- evcloud/types/session_out_origin.py +7 -0
- evcloud/types/session_out_origin_zero.py +5 -0
- evcloud/types/session_out_status.py +7 -0
- evcloud/types/session_out_status_zero.py +7 -0
- evcloud/types/session_page.py +27 -0
- evcloud/types/session_write_response.py +27 -0
- evcloud/types/sharing_slot.py +25 -0
- evcloud/types/sharing_slot_input.py +25 -0
- evcloud/types/site_type.py +5 -0
- evcloud/types/sync_patch_request.py +26 -0
- evcloud/types/sync_pull_response.py +31 -0
- evcloud/types/sync_push_response.py +31 -0
- evcloud/types/sync_push_response_status.py +5 -0
- evcloud/types/tariff.py +42 -0
- evcloud/types/tariff_assignment_out.py +32 -0
- evcloud/types/tariff_assignment_page.py +27 -0
- evcloud/types/tariff_delete_response.py +26 -0
- evcloud/types/tariff_display.py +27 -0
- evcloud/types/tariff_element.py +26 -0
- evcloud/types/tariff_out.py +57 -0
- evcloud/types/tariff_out_origin.py +7 -0
- evcloud/types/tariff_out_origin_zero.py +5 -0
- evcloud/types/tariff_out_tax_included.py +7 -0
- evcloud/types/tariff_out_tax_included_zero.py +5 -0
- evcloud/types/tariff_out_type.py +7 -0
- evcloud/types/tariff_out_type_zero.py +7 -0
- evcloud/types/tariff_page.py +27 -0
- evcloud/types/tariff_restrictions.py +36 -0
- evcloud/types/tariff_summary.py +29 -0
- evcloud/types/tariff_tax_included.py +7 -0
- evcloud/types/tariff_tax_included_zero.py +5 -0
- evcloud/types/tariff_type.py +7 -0
- evcloud/types/tariff_updated_event.py +29 -0
- evcloud/types/tariff_write_response.py +26 -0
- evcloud/types/tax_included.py +5 -0
- evcloud/types/tenant_profile_out.py +31 -0
- evcloud/types/token_bulk_out.py +26 -0
- evcloud/types/token_create.py +46 -0
- evcloud/types/token_create_default_profile_type.py +5 -0
- evcloud/types/token_create_ocpi_version.py +5 -0
- evcloud/types/token_create_type.py +5 -0
- evcloud/types/token_create_whitelist.py +5 -0
- evcloud/types/token_event_data.py +47 -0
- evcloud/types/token_event_data_status.py +7 -0
- evcloud/types/token_event_data_type.py +5 -0
- evcloud/types/token_event_data_whitelist.py +5 -0
- evcloud/types/token_event_out.py +32 -0
- evcloud/types/token_event_out_event.py +7 -0
- evcloud/types/token_event_out_event_zero.py +7 -0
- evcloud/types/token_event_page.py +26 -0
- evcloud/types/token_failure_item.py +24 -0
- evcloud/types/token_group_action_out.py +27 -0
- evcloud/types/token_group_failure.py +24 -0
- evcloud/types/token_group_member_out.py +26 -0
- evcloud/types/token_group_network_out.py +35 -0
- evcloud/types/token_group_network_page.py +26 -0
- evcloud/types/token_group_out.py +31 -0
- evcloud/types/token_group_page.py +26 -0
- evcloud/types/token_out.py +55 -0
- evcloud/types/token_out_status.py +7 -0
- evcloud/types/token_out_status_zero.py +7 -0
- evcloud/types/token_out_type.py +7 -0
- evcloud/types/token_out_type_zero.py +5 -0
- evcloud/types/token_out_whitelist.py +7 -0
- evcloud/types/token_out_whitelist_zero.py +5 -0
- evcloud/types/token_page.py +26 -0
- evcloud/types/token_reason.py +23 -0
- evcloud/types/token_ref.py +26 -0
- evcloud/types/token_ref_ocpi_version.py +5 -0
- evcloud/types/token_write_response.py +28 -0
- evcloud/types/validation_error.py +28 -0
- evcloud/types/validation_error_loc_item.py +5 -0
- evcloud/types/webhook_delivery_page.py +27 -0
- evcloud/types/webhook_delivery_response.py +35 -0
- evcloud/types/webhook_page.py +27 -0
- evcloud/types/webhook_response.py +42 -0
- evcloud/types/webhook_response_event.py +7 -0
- evcloud/types/webhook_response_event_zero.py +27 -0
- evcloud/types/webhook_response_status.py +7 -0
- evcloud/types/webhook_response_status_zero.py +5 -0
- evcloud/types/webhook_test_result.py +25 -0
- evcloud/types/webhook_with_secret_response.py +43 -0
- evcloud/types/webhook_with_secret_response_event.py +7 -0
- evcloud/types/webhook_with_secret_response_event_zero.py +27 -0
- evcloud/types/webhook_with_secret_response_status.py +7 -0
- evcloud/types/webhook_with_secret_response_status_zero.py +5 -0
- evcloud/version.py +3 -0
- evcloud/webhooks/__init__.py +28 -0
- evcloud/webhooks/client.py +53 -0
- evcloud/webhooks/deliveries/__init__.py +4 -0
- evcloud/webhooks/deliveries/client.py +141 -0
- evcloud/webhooks/deliveries/raw_client.py +268 -0
- evcloud/webhooks/endpoints/__init__.py +17 -0
- evcloud/webhooks/endpoints/client.py +642 -0
- evcloud/webhooks/endpoints/raw_client.py +1521 -0
- evcloud/webhooks/endpoints/types/__init__.py +15 -0
- evcloud/webhooks/endpoints/types/list_endpoints_request_event_types_item.py +27 -0
- evcloud/webhooks/endpoints/types/webhook_create_request_api_version.py +5 -0
- evcloud/webhooks/endpoints/types/webhook_create_request_event.py +27 -0
- evcloud/webhooks/endpoints/types/webhook_update_request_status.py +5 -0
- evcloud/webhooks/event_types/__init__.py +7 -0
- evcloud/webhooks/event_types/client.py +176 -0
- evcloud/webhooks/event_types/raw_client.py +418 -0
- evcloud/webhooks/event_types/types/__init__.py +7 -0
- evcloud/webhooks/event_types/types/get_event_types_request_type.py +27 -0
- evcloud/webhooks/events/__init__.py +7 -0
- evcloud/webhooks/events/client.py +207 -0
- evcloud/webhooks/events/raw_client.py +355 -0
- evcloud/webhooks/events/types/__init__.py +8 -0
- evcloud/webhooks/events/types/deliver_event_request_data.py +33 -0
- evcloud/webhooks/events/types/deliver_event_request_event.py +27 -0
- evcloud/webhooks/health/__init__.py +4 -0
- evcloud/webhooks/health/client.py +161 -0
- evcloud/webhooks/health/raw_client.py +380 -0
- evcloud/webhooks/raw_client.py +13 -0
- evcloud-0.1.0.dist-info/METADATA +257 -0
- evcloud-0.1.0.dist-info/RECORD +635 -0
- evcloud-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,2903 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ...core.api_error import ApiError
|
|
7
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ...core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ...core.jsonable_encoder import encode_path_param
|
|
10
|
+
from ...core.pagination import AsyncPager, SyncPager
|
|
11
|
+
from ...core.parse_error import ParsingError
|
|
12
|
+
from ...core.pydantic_utilities import parse_obj_as
|
|
13
|
+
from ...core.request_options import RequestOptions
|
|
14
|
+
from ...core.serialization import convert_and_respect_annotation_metadata
|
|
15
|
+
from ...errors.bad_gateway_error import BadGatewayError
|
|
16
|
+
from ...errors.bad_request_error import BadRequestError
|
|
17
|
+
from ...errors.conflict_error import ConflictError
|
|
18
|
+
from ...errors.gateway_timeout_error import GatewayTimeoutError
|
|
19
|
+
from ...errors.not_found_error import NotFoundError
|
|
20
|
+
from ...errors.too_many_requests_error import TooManyRequestsError
|
|
21
|
+
from ...errors.unauthorized_error import UnauthorizedError
|
|
22
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
23
|
+
from ...types.availability_page import AvailabilityPage
|
|
24
|
+
from ...types.batch_response import BatchResponse
|
|
25
|
+
from ...types.cluster_page import ClusterPage
|
|
26
|
+
from ...types.emsp_gateway_schema_locations_location_out import EmspGatewaySchemaLocationsLocationOut
|
|
27
|
+
from ...types.emsp_gateway_schema_locations_location_page import EmspGatewaySchemaLocationsLocationPage
|
|
28
|
+
from ...types.facility_page import FacilityPage
|
|
29
|
+
from ...types.http_error_response import HttpErrorResponse
|
|
30
|
+
from ...types.http_validation_error import HttpValidationError
|
|
31
|
+
from ...types.location_detail import LocationDetail
|
|
32
|
+
from ...types.location_key_input import LocationKeyInput
|
|
33
|
+
from ...types.location_list import LocationList
|
|
34
|
+
from ...types.map_page import MapPage
|
|
35
|
+
from pydantic import ValidationError
|
|
36
|
+
|
|
37
|
+
# this is used as the default value for optional parameters
|
|
38
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class RawLocationsClient:
|
|
42
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
43
|
+
self._client_wrapper = client_wrapper
|
|
44
|
+
|
|
45
|
+
def list(
|
|
46
|
+
self,
|
|
47
|
+
*,
|
|
48
|
+
cpo_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
49
|
+
countries: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
50
|
+
connector_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
51
|
+
facilities: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
52
|
+
parking_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
53
|
+
network_id: typing.Optional[int] = None,
|
|
54
|
+
token_group_id: typing.Optional[int] = None,
|
|
55
|
+
bounding_box: typing.Optional[str] = None,
|
|
56
|
+
after: typing.Optional[str] = None,
|
|
57
|
+
limit: typing.Optional[int] = None,
|
|
58
|
+
q: typing.Optional[str] = None,
|
|
59
|
+
lat: typing.Optional[float] = None,
|
|
60
|
+
lon: typing.Optional[float] = None,
|
|
61
|
+
radius_km: typing.Optional[float] = None,
|
|
62
|
+
availability: typing.Optional[bool] = None,
|
|
63
|
+
min_power: typing.Optional[float] = None,
|
|
64
|
+
own: typing.Optional[bool] = None,
|
|
65
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
66
|
+
) -> SyncPager[EmspGatewaySchemaLocationsLocationOut, EmspGatewaySchemaLocationsLocationPage]:
|
|
67
|
+
"""
|
|
68
|
+
Your own OCPP chargers and roaming CPOs' locations, filtered by area, text, CPO, connector, power, facilities and parking type, optionally scoped to a network or a token group's networks. Each row carries a stable ``uid`` and its ``source`` (``OWN_OCPP`` or ``PARTNER_OCPI``).
|
|
69
|
+
|
|
70
|
+
Parameters
|
|
71
|
+
----------
|
|
72
|
+
cpo_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
73
|
+
Only these CPOs, as ``CC*PID``. Repeat for more than one.
|
|
74
|
+
|
|
75
|
+
countries : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
76
|
+
ISO 3166-1 alpha-3 countries, e.g. ``NLD``. Repeat for more than one.
|
|
77
|
+
|
|
78
|
+
connector_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
79
|
+
Only these OCPI connector standards, e.g. ``IEC_62196_T2``. Repeat for more than one.
|
|
80
|
+
|
|
81
|
+
facilities : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
82
|
+
OCPI facilities, e.g. ``CAFE``. A location must list every one. Repeat for more than one.
|
|
83
|
+
|
|
84
|
+
parking_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
85
|
+
OCPI parking types, e.g. ``PARKING_GARAGE``. Any one matches. Repeat for more than one.
|
|
86
|
+
|
|
87
|
+
network_id : typing.Optional[int]
|
|
88
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
89
|
+
|
|
90
|
+
token_group_id : typing.Optional[int]
|
|
91
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
92
|
+
|
|
93
|
+
bounding_box : typing.Optional[str]
|
|
94
|
+
Only locations inside ``min_lon,min_lat,max_lon,max_lat`` (WGS84).
|
|
95
|
+
|
|
96
|
+
after : typing.Optional[str]
|
|
97
|
+
Cursor: the previous page's ``pagination.end_cursor`` (``country_code:party_id:location_id``). Omit it for the first page.
|
|
98
|
+
|
|
99
|
+
limit : typing.Optional[int]
|
|
100
|
+
Maximum rows per page (default 50, max 200).
|
|
101
|
+
|
|
102
|
+
q : typing.Optional[str]
|
|
103
|
+
Text in name, address or city.
|
|
104
|
+
|
|
105
|
+
lat : typing.Optional[float]
|
|
106
|
+
Search centre latitude (WGS84); send with lon.
|
|
107
|
+
|
|
108
|
+
lon : typing.Optional[float]
|
|
109
|
+
Search centre longitude (WGS84); send with lat.
|
|
110
|
+
|
|
111
|
+
radius_km : typing.Optional[float]
|
|
112
|
+
Search radius around lat/lon in km (default 10).
|
|
113
|
+
|
|
114
|
+
availability : typing.Optional[bool]
|
|
115
|
+
Only locations with an EVSE free right now.
|
|
116
|
+
|
|
117
|
+
min_power : typing.Optional[float]
|
|
118
|
+
Minimum connector power in kW.
|
|
119
|
+
|
|
120
|
+
own : typing.Optional[bool]
|
|
121
|
+
true: only your own OCPP chargers. false: only partner (roaming) locations.
|
|
122
|
+
|
|
123
|
+
request_options : typing.Optional[RequestOptions]
|
|
124
|
+
Request-specific configuration.
|
|
125
|
+
|
|
126
|
+
Returns
|
|
127
|
+
-------
|
|
128
|
+
SyncPager[EmspGatewaySchemaLocationsLocationOut, EmspGatewaySchemaLocationsLocationPage]
|
|
129
|
+
One page of own and partner locations.
|
|
130
|
+
"""
|
|
131
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
132
|
+
"emsp/locations",
|
|
133
|
+
method="GET",
|
|
134
|
+
params={
|
|
135
|
+
"cpo_ids": cpo_ids,
|
|
136
|
+
"countries": countries,
|
|
137
|
+
"connector_types": connector_types,
|
|
138
|
+
"facilities": facilities,
|
|
139
|
+
"parking_types": parking_types,
|
|
140
|
+
"network_id": network_id,
|
|
141
|
+
"token_group_id": token_group_id,
|
|
142
|
+
"bounding_box": bounding_box,
|
|
143
|
+
"after": after,
|
|
144
|
+
"limit": limit,
|
|
145
|
+
"q": q,
|
|
146
|
+
"lat": lat,
|
|
147
|
+
"lon": lon,
|
|
148
|
+
"radius_km": radius_km,
|
|
149
|
+
"availability": availability,
|
|
150
|
+
"min_power": min_power,
|
|
151
|
+
"own": own,
|
|
152
|
+
},
|
|
153
|
+
request_options=request_options,
|
|
154
|
+
)
|
|
155
|
+
try:
|
|
156
|
+
if 200 <= _response.status_code < 300:
|
|
157
|
+
_parsed_response = typing.cast(
|
|
158
|
+
EmspGatewaySchemaLocationsLocationPage,
|
|
159
|
+
parse_obj_as(
|
|
160
|
+
type_=EmspGatewaySchemaLocationsLocationPage, # type: ignore
|
|
161
|
+
object_=_response.json(),
|
|
162
|
+
),
|
|
163
|
+
)
|
|
164
|
+
_items = _parsed_response.data
|
|
165
|
+
_has_next = False
|
|
166
|
+
_get_next = None
|
|
167
|
+
if _parsed_response.pagination is not None:
|
|
168
|
+
_parsed_next = _parsed_response.pagination.end_cursor
|
|
169
|
+
_has_next = _parsed_next is not None and _parsed_next != ""
|
|
170
|
+
_get_next = lambda: self.list(
|
|
171
|
+
cpo_ids=cpo_ids,
|
|
172
|
+
countries=countries,
|
|
173
|
+
connector_types=connector_types,
|
|
174
|
+
facilities=facilities,
|
|
175
|
+
parking_types=parking_types,
|
|
176
|
+
network_id=network_id,
|
|
177
|
+
token_group_id=token_group_id,
|
|
178
|
+
bounding_box=bounding_box,
|
|
179
|
+
after=_parsed_next,
|
|
180
|
+
limit=limit,
|
|
181
|
+
q=q,
|
|
182
|
+
lat=lat,
|
|
183
|
+
lon=lon,
|
|
184
|
+
radius_km=radius_km,
|
|
185
|
+
availability=availability,
|
|
186
|
+
min_power=min_power,
|
|
187
|
+
own=own,
|
|
188
|
+
request_options=request_options,
|
|
189
|
+
)
|
|
190
|
+
return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
|
|
191
|
+
if _response.status_code == 400:
|
|
192
|
+
raise BadRequestError(
|
|
193
|
+
headers=dict(_response.headers),
|
|
194
|
+
body=typing.cast(
|
|
195
|
+
HttpErrorResponse,
|
|
196
|
+
parse_obj_as(
|
|
197
|
+
type_=HttpErrorResponse, # type: ignore
|
|
198
|
+
object_=_response.json(),
|
|
199
|
+
),
|
|
200
|
+
),
|
|
201
|
+
)
|
|
202
|
+
if _response.status_code == 401:
|
|
203
|
+
raise UnauthorizedError(
|
|
204
|
+
headers=dict(_response.headers),
|
|
205
|
+
body=typing.cast(
|
|
206
|
+
HttpErrorResponse,
|
|
207
|
+
parse_obj_as(
|
|
208
|
+
type_=HttpErrorResponse, # type: ignore
|
|
209
|
+
object_=_response.json(),
|
|
210
|
+
),
|
|
211
|
+
),
|
|
212
|
+
)
|
|
213
|
+
if _response.status_code == 422:
|
|
214
|
+
raise UnprocessableEntityError(
|
|
215
|
+
headers=dict(_response.headers),
|
|
216
|
+
body=typing.cast(
|
|
217
|
+
HttpValidationError,
|
|
218
|
+
parse_obj_as(
|
|
219
|
+
type_=HttpValidationError, # type: ignore
|
|
220
|
+
object_=_response.json(),
|
|
221
|
+
),
|
|
222
|
+
),
|
|
223
|
+
)
|
|
224
|
+
if _response.status_code == 429:
|
|
225
|
+
raise TooManyRequestsError(
|
|
226
|
+
headers=dict(_response.headers),
|
|
227
|
+
body=typing.cast(
|
|
228
|
+
HttpErrorResponse,
|
|
229
|
+
parse_obj_as(
|
|
230
|
+
type_=HttpErrorResponse, # type: ignore
|
|
231
|
+
object_=_response.json(),
|
|
232
|
+
),
|
|
233
|
+
),
|
|
234
|
+
)
|
|
235
|
+
if _response.status_code == 502:
|
|
236
|
+
raise BadGatewayError(
|
|
237
|
+
headers=dict(_response.headers),
|
|
238
|
+
body=typing.cast(
|
|
239
|
+
HttpErrorResponse,
|
|
240
|
+
parse_obj_as(
|
|
241
|
+
type_=HttpErrorResponse, # type: ignore
|
|
242
|
+
object_=_response.json(),
|
|
243
|
+
),
|
|
244
|
+
),
|
|
245
|
+
)
|
|
246
|
+
if _response.status_code == 504:
|
|
247
|
+
raise GatewayTimeoutError(
|
|
248
|
+
headers=dict(_response.headers),
|
|
249
|
+
body=typing.cast(
|
|
250
|
+
HttpErrorResponse,
|
|
251
|
+
parse_obj_as(
|
|
252
|
+
type_=HttpErrorResponse, # type: ignore
|
|
253
|
+
object_=_response.json(),
|
|
254
|
+
),
|
|
255
|
+
),
|
|
256
|
+
)
|
|
257
|
+
_response_json = _response.json()
|
|
258
|
+
except JSONDecodeError:
|
|
259
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
260
|
+
except ValidationError as e:
|
|
261
|
+
raise ParsingError(
|
|
262
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
263
|
+
)
|
|
264
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
265
|
+
|
|
266
|
+
def check_availability(
|
|
267
|
+
self,
|
|
268
|
+
*,
|
|
269
|
+
location_ids: typing.Sequence[str],
|
|
270
|
+
network_id: typing.Optional[int] = OMIT,
|
|
271
|
+
token_group_id: typing.Optional[int] = OMIT,
|
|
272
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
273
|
+
) -> HttpResponse[AvailabilityPage]:
|
|
274
|
+
"""
|
|
275
|
+
Free and total EVSEs per location. Unknown or out-of-scope ids are left out.
|
|
276
|
+
|
|
277
|
+
Parameters
|
|
278
|
+
----------
|
|
279
|
+
location_ids : typing.Sequence[str]
|
|
280
|
+
|
|
281
|
+
network_id : typing.Optional[int]
|
|
282
|
+
|
|
283
|
+
token_group_id : typing.Optional[int]
|
|
284
|
+
|
|
285
|
+
request_options : typing.Optional[RequestOptions]
|
|
286
|
+
Request-specific configuration.
|
|
287
|
+
|
|
288
|
+
Returns
|
|
289
|
+
-------
|
|
290
|
+
HttpResponse[AvailabilityPage]
|
|
291
|
+
Availability of each location found.
|
|
292
|
+
"""
|
|
293
|
+
_request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
|
|
294
|
+
{**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
|
|
295
|
+
)
|
|
296
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
297
|
+
"emsp/locations/availability",
|
|
298
|
+
method="POST",
|
|
299
|
+
json={
|
|
300
|
+
"network_id": network_id,
|
|
301
|
+
"token_group_id": token_group_id,
|
|
302
|
+
"location_ids": location_ids,
|
|
303
|
+
},
|
|
304
|
+
headers={
|
|
305
|
+
"content-type": "application/json",
|
|
306
|
+
},
|
|
307
|
+
request_options=_request_options_with_retries_disabled,
|
|
308
|
+
omit=OMIT,
|
|
309
|
+
)
|
|
310
|
+
try:
|
|
311
|
+
if 200 <= _response.status_code < 300:
|
|
312
|
+
_data = typing.cast(
|
|
313
|
+
AvailabilityPage,
|
|
314
|
+
parse_obj_as(
|
|
315
|
+
type_=AvailabilityPage, # type: ignore
|
|
316
|
+
object_=_response.json(),
|
|
317
|
+
),
|
|
318
|
+
)
|
|
319
|
+
return HttpResponse(response=_response, data=_data)
|
|
320
|
+
if _response.status_code == 400:
|
|
321
|
+
raise BadRequestError(
|
|
322
|
+
headers=dict(_response.headers),
|
|
323
|
+
body=typing.cast(
|
|
324
|
+
HttpErrorResponse,
|
|
325
|
+
parse_obj_as(
|
|
326
|
+
type_=HttpErrorResponse, # type: ignore
|
|
327
|
+
object_=_response.json(),
|
|
328
|
+
),
|
|
329
|
+
),
|
|
330
|
+
)
|
|
331
|
+
if _response.status_code == 401:
|
|
332
|
+
raise UnauthorizedError(
|
|
333
|
+
headers=dict(_response.headers),
|
|
334
|
+
body=typing.cast(
|
|
335
|
+
HttpErrorResponse,
|
|
336
|
+
parse_obj_as(
|
|
337
|
+
type_=HttpErrorResponse, # type: ignore
|
|
338
|
+
object_=_response.json(),
|
|
339
|
+
),
|
|
340
|
+
),
|
|
341
|
+
)
|
|
342
|
+
if _response.status_code == 422:
|
|
343
|
+
raise UnprocessableEntityError(
|
|
344
|
+
headers=dict(_response.headers),
|
|
345
|
+
body=typing.cast(
|
|
346
|
+
HttpValidationError,
|
|
347
|
+
parse_obj_as(
|
|
348
|
+
type_=HttpValidationError, # type: ignore
|
|
349
|
+
object_=_response.json(),
|
|
350
|
+
),
|
|
351
|
+
),
|
|
352
|
+
)
|
|
353
|
+
if _response.status_code == 429:
|
|
354
|
+
raise TooManyRequestsError(
|
|
355
|
+
headers=dict(_response.headers),
|
|
356
|
+
body=typing.cast(
|
|
357
|
+
HttpErrorResponse,
|
|
358
|
+
parse_obj_as(
|
|
359
|
+
type_=HttpErrorResponse, # type: ignore
|
|
360
|
+
object_=_response.json(),
|
|
361
|
+
),
|
|
362
|
+
),
|
|
363
|
+
)
|
|
364
|
+
if _response.status_code == 502:
|
|
365
|
+
raise BadGatewayError(
|
|
366
|
+
headers=dict(_response.headers),
|
|
367
|
+
body=typing.cast(
|
|
368
|
+
HttpErrorResponse,
|
|
369
|
+
parse_obj_as(
|
|
370
|
+
type_=HttpErrorResponse, # type: ignore
|
|
371
|
+
object_=_response.json(),
|
|
372
|
+
),
|
|
373
|
+
),
|
|
374
|
+
)
|
|
375
|
+
if _response.status_code == 504:
|
|
376
|
+
raise GatewayTimeoutError(
|
|
377
|
+
headers=dict(_response.headers),
|
|
378
|
+
body=typing.cast(
|
|
379
|
+
HttpErrorResponse,
|
|
380
|
+
parse_obj_as(
|
|
381
|
+
type_=HttpErrorResponse, # type: ignore
|
|
382
|
+
object_=_response.json(),
|
|
383
|
+
),
|
|
384
|
+
),
|
|
385
|
+
)
|
|
386
|
+
_response_json = _response.json()
|
|
387
|
+
except JSONDecodeError:
|
|
388
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
389
|
+
except ValidationError as e:
|
|
390
|
+
raise ParsingError(
|
|
391
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
392
|
+
)
|
|
393
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
394
|
+
|
|
395
|
+
def cluster(
|
|
396
|
+
self,
|
|
397
|
+
*,
|
|
398
|
+
zoom_level: int,
|
|
399
|
+
network_id: typing.Optional[int] = None,
|
|
400
|
+
token_group_id: typing.Optional[int] = None,
|
|
401
|
+
bounding_box: typing.Optional[str] = None,
|
|
402
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
403
|
+
) -> HttpResponse[ClusterPage]:
|
|
404
|
+
"""
|
|
405
|
+
Deprecated: use ``GET /emsp/locations/map``. Kept for one minor version. Groups locations into grid cells sized for the zoom level. A cell lists its location ids when it holds 20 or fewer.
|
|
406
|
+
|
|
407
|
+
Parameters
|
|
408
|
+
----------
|
|
409
|
+
zoom_level : int
|
|
410
|
+
Map zoom level (0 = whole world, 22 = street).
|
|
411
|
+
|
|
412
|
+
network_id : typing.Optional[int]
|
|
413
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
414
|
+
|
|
415
|
+
token_group_id : typing.Optional[int]
|
|
416
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
417
|
+
|
|
418
|
+
bounding_box : typing.Optional[str]
|
|
419
|
+
Only locations inside ``min_lon,min_lat,max_lon,max_lat`` (WGS84).
|
|
420
|
+
|
|
421
|
+
request_options : typing.Optional[RequestOptions]
|
|
422
|
+
Request-specific configuration.
|
|
423
|
+
|
|
424
|
+
Returns
|
|
425
|
+
-------
|
|
426
|
+
HttpResponse[ClusterPage]
|
|
427
|
+
The map cells that hold locations.
|
|
428
|
+
"""
|
|
429
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
430
|
+
"emsp/locations/clusters",
|
|
431
|
+
method="GET",
|
|
432
|
+
params={
|
|
433
|
+
"zoom_level": zoom_level,
|
|
434
|
+
"network_id": network_id,
|
|
435
|
+
"token_group_id": token_group_id,
|
|
436
|
+
"bounding_box": bounding_box,
|
|
437
|
+
},
|
|
438
|
+
request_options=request_options,
|
|
439
|
+
)
|
|
440
|
+
try:
|
|
441
|
+
if 200 <= _response.status_code < 300:
|
|
442
|
+
_data = typing.cast(
|
|
443
|
+
ClusterPage,
|
|
444
|
+
parse_obj_as(
|
|
445
|
+
type_=ClusterPage, # type: ignore
|
|
446
|
+
object_=_response.json(),
|
|
447
|
+
),
|
|
448
|
+
)
|
|
449
|
+
return HttpResponse(response=_response, data=_data)
|
|
450
|
+
if _response.status_code == 400:
|
|
451
|
+
raise BadRequestError(
|
|
452
|
+
headers=dict(_response.headers),
|
|
453
|
+
body=typing.cast(
|
|
454
|
+
HttpErrorResponse,
|
|
455
|
+
parse_obj_as(
|
|
456
|
+
type_=HttpErrorResponse, # type: ignore
|
|
457
|
+
object_=_response.json(),
|
|
458
|
+
),
|
|
459
|
+
),
|
|
460
|
+
)
|
|
461
|
+
if _response.status_code == 401:
|
|
462
|
+
raise UnauthorizedError(
|
|
463
|
+
headers=dict(_response.headers),
|
|
464
|
+
body=typing.cast(
|
|
465
|
+
HttpErrorResponse,
|
|
466
|
+
parse_obj_as(
|
|
467
|
+
type_=HttpErrorResponse, # type: ignore
|
|
468
|
+
object_=_response.json(),
|
|
469
|
+
),
|
|
470
|
+
),
|
|
471
|
+
)
|
|
472
|
+
if _response.status_code == 422:
|
|
473
|
+
raise UnprocessableEntityError(
|
|
474
|
+
headers=dict(_response.headers),
|
|
475
|
+
body=typing.cast(
|
|
476
|
+
HttpValidationError,
|
|
477
|
+
parse_obj_as(
|
|
478
|
+
type_=HttpValidationError, # type: ignore
|
|
479
|
+
object_=_response.json(),
|
|
480
|
+
),
|
|
481
|
+
),
|
|
482
|
+
)
|
|
483
|
+
if _response.status_code == 429:
|
|
484
|
+
raise TooManyRequestsError(
|
|
485
|
+
headers=dict(_response.headers),
|
|
486
|
+
body=typing.cast(
|
|
487
|
+
HttpErrorResponse,
|
|
488
|
+
parse_obj_as(
|
|
489
|
+
type_=HttpErrorResponse, # type: ignore
|
|
490
|
+
object_=_response.json(),
|
|
491
|
+
),
|
|
492
|
+
),
|
|
493
|
+
)
|
|
494
|
+
if _response.status_code == 502:
|
|
495
|
+
raise BadGatewayError(
|
|
496
|
+
headers=dict(_response.headers),
|
|
497
|
+
body=typing.cast(
|
|
498
|
+
HttpErrorResponse,
|
|
499
|
+
parse_obj_as(
|
|
500
|
+
type_=HttpErrorResponse, # type: ignore
|
|
501
|
+
object_=_response.json(),
|
|
502
|
+
),
|
|
503
|
+
),
|
|
504
|
+
)
|
|
505
|
+
if _response.status_code == 504:
|
|
506
|
+
raise GatewayTimeoutError(
|
|
507
|
+
headers=dict(_response.headers),
|
|
508
|
+
body=typing.cast(
|
|
509
|
+
HttpErrorResponse,
|
|
510
|
+
parse_obj_as(
|
|
511
|
+
type_=HttpErrorResponse, # type: ignore
|
|
512
|
+
object_=_response.json(),
|
|
513
|
+
),
|
|
514
|
+
),
|
|
515
|
+
)
|
|
516
|
+
_response_json = _response.json()
|
|
517
|
+
except JSONDecodeError:
|
|
518
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
519
|
+
except ValidationError as e:
|
|
520
|
+
raise ParsingError(
|
|
521
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
522
|
+
)
|
|
523
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
524
|
+
|
|
525
|
+
def list_facilities(
|
|
526
|
+
self,
|
|
527
|
+
*,
|
|
528
|
+
countries: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
529
|
+
network_id: typing.Optional[int] = None,
|
|
530
|
+
token_group_id: typing.Optional[int] = None,
|
|
531
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
532
|
+
) -> HttpResponse[FacilityPage]:
|
|
533
|
+
"""
|
|
534
|
+
Each OCPI facility present, with how many locations have it, most common first.
|
|
535
|
+
|
|
536
|
+
Parameters
|
|
537
|
+
----------
|
|
538
|
+
countries : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
539
|
+
ISO 3166-1 alpha-3 countries, e.g. ``NLD``. Repeat for more than one.
|
|
540
|
+
|
|
541
|
+
network_id : typing.Optional[int]
|
|
542
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
543
|
+
|
|
544
|
+
token_group_id : typing.Optional[int]
|
|
545
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
546
|
+
|
|
547
|
+
request_options : typing.Optional[RequestOptions]
|
|
548
|
+
Request-specific configuration.
|
|
549
|
+
|
|
550
|
+
Returns
|
|
551
|
+
-------
|
|
552
|
+
HttpResponse[FacilityPage]
|
|
553
|
+
Facility counts, most common first.
|
|
554
|
+
"""
|
|
555
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
556
|
+
"emsp/locations/facilities",
|
|
557
|
+
method="GET",
|
|
558
|
+
params={
|
|
559
|
+
"countries": countries,
|
|
560
|
+
"network_id": network_id,
|
|
561
|
+
"token_group_id": token_group_id,
|
|
562
|
+
},
|
|
563
|
+
request_options=request_options,
|
|
564
|
+
)
|
|
565
|
+
try:
|
|
566
|
+
if 200 <= _response.status_code < 300:
|
|
567
|
+
_data = typing.cast(
|
|
568
|
+
FacilityPage,
|
|
569
|
+
parse_obj_as(
|
|
570
|
+
type_=FacilityPage, # type: ignore
|
|
571
|
+
object_=_response.json(),
|
|
572
|
+
),
|
|
573
|
+
)
|
|
574
|
+
return HttpResponse(response=_response, data=_data)
|
|
575
|
+
if _response.status_code == 400:
|
|
576
|
+
raise BadRequestError(
|
|
577
|
+
headers=dict(_response.headers),
|
|
578
|
+
body=typing.cast(
|
|
579
|
+
HttpErrorResponse,
|
|
580
|
+
parse_obj_as(
|
|
581
|
+
type_=HttpErrorResponse, # type: ignore
|
|
582
|
+
object_=_response.json(),
|
|
583
|
+
),
|
|
584
|
+
),
|
|
585
|
+
)
|
|
586
|
+
if _response.status_code == 401:
|
|
587
|
+
raise UnauthorizedError(
|
|
588
|
+
headers=dict(_response.headers),
|
|
589
|
+
body=typing.cast(
|
|
590
|
+
HttpErrorResponse,
|
|
591
|
+
parse_obj_as(
|
|
592
|
+
type_=HttpErrorResponse, # type: ignore
|
|
593
|
+
object_=_response.json(),
|
|
594
|
+
),
|
|
595
|
+
),
|
|
596
|
+
)
|
|
597
|
+
if _response.status_code == 422:
|
|
598
|
+
raise UnprocessableEntityError(
|
|
599
|
+
headers=dict(_response.headers),
|
|
600
|
+
body=typing.cast(
|
|
601
|
+
HttpValidationError,
|
|
602
|
+
parse_obj_as(
|
|
603
|
+
type_=HttpValidationError, # type: ignore
|
|
604
|
+
object_=_response.json(),
|
|
605
|
+
),
|
|
606
|
+
),
|
|
607
|
+
)
|
|
608
|
+
if _response.status_code == 429:
|
|
609
|
+
raise TooManyRequestsError(
|
|
610
|
+
headers=dict(_response.headers),
|
|
611
|
+
body=typing.cast(
|
|
612
|
+
HttpErrorResponse,
|
|
613
|
+
parse_obj_as(
|
|
614
|
+
type_=HttpErrorResponse, # type: ignore
|
|
615
|
+
object_=_response.json(),
|
|
616
|
+
),
|
|
617
|
+
),
|
|
618
|
+
)
|
|
619
|
+
if _response.status_code == 502:
|
|
620
|
+
raise BadGatewayError(
|
|
621
|
+
headers=dict(_response.headers),
|
|
622
|
+
body=typing.cast(
|
|
623
|
+
HttpErrorResponse,
|
|
624
|
+
parse_obj_as(
|
|
625
|
+
type_=HttpErrorResponse, # type: ignore
|
|
626
|
+
object_=_response.json(),
|
|
627
|
+
),
|
|
628
|
+
),
|
|
629
|
+
)
|
|
630
|
+
if _response.status_code == 504:
|
|
631
|
+
raise GatewayTimeoutError(
|
|
632
|
+
headers=dict(_response.headers),
|
|
633
|
+
body=typing.cast(
|
|
634
|
+
HttpErrorResponse,
|
|
635
|
+
parse_obj_as(
|
|
636
|
+
type_=HttpErrorResponse, # type: ignore
|
|
637
|
+
object_=_response.json(),
|
|
638
|
+
),
|
|
639
|
+
),
|
|
640
|
+
)
|
|
641
|
+
_response_json = _response.json()
|
|
642
|
+
except JSONDecodeError:
|
|
643
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
644
|
+
except ValidationError as e:
|
|
645
|
+
raise ParsingError(
|
|
646
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
647
|
+
)
|
|
648
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
649
|
+
|
|
650
|
+
def map_(
|
|
651
|
+
self,
|
|
652
|
+
*,
|
|
653
|
+
bbox: str,
|
|
654
|
+
zoom: int,
|
|
655
|
+
connector_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
656
|
+
cpo_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
657
|
+
network_id: typing.Optional[int] = None,
|
|
658
|
+
token_group_id: typing.Optional[int] = None,
|
|
659
|
+
min_power: typing.Optional[float] = None,
|
|
660
|
+
available_only: typing.Optional[bool] = None,
|
|
661
|
+
own: typing.Optional[bool] = None,
|
|
662
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
663
|
+
) -> HttpResponse[MapPage]:
|
|
664
|
+
"""
|
|
665
|
+
Pins (up to 500 location summaries) when ``zoom`` >= 13 or the box holds 500 locations or fewer; otherwise clusters on web-mercator tiles. ``tile_versions`` change when a tile's content changes. Answers are cached for a few seconds per workspace and query.
|
|
666
|
+
|
|
667
|
+
Parameters
|
|
668
|
+
----------
|
|
669
|
+
bbox : str
|
|
670
|
+
The viewport as ``min_lon,min_lat,max_lon,max_lat`` (WGS84).
|
|
671
|
+
|
|
672
|
+
zoom : int
|
|
673
|
+
Map zoom level (0 = whole world, 22 = street).
|
|
674
|
+
|
|
675
|
+
connector_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
676
|
+
Only these OCPI connector standards, e.g. ``IEC_62196_T2``. Repeat for more than one.
|
|
677
|
+
|
|
678
|
+
cpo_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
679
|
+
Only these CPOs, as ``CC*PID``. Repeat for more than one.
|
|
680
|
+
|
|
681
|
+
network_id : typing.Optional[int]
|
|
682
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
683
|
+
|
|
684
|
+
token_group_id : typing.Optional[int]
|
|
685
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
686
|
+
|
|
687
|
+
min_power : typing.Optional[float]
|
|
688
|
+
Minimum connector power in kW.
|
|
689
|
+
|
|
690
|
+
available_only : typing.Optional[bool]
|
|
691
|
+
Only locations with an EVSE free right now.
|
|
692
|
+
|
|
693
|
+
own : typing.Optional[bool]
|
|
694
|
+
true: only your own OCPP chargers. false: only partner (roaming) locations.
|
|
695
|
+
|
|
696
|
+
request_options : typing.Optional[RequestOptions]
|
|
697
|
+
Request-specific configuration.
|
|
698
|
+
|
|
699
|
+
Returns
|
|
700
|
+
-------
|
|
701
|
+
HttpResponse[MapPage]
|
|
702
|
+
Clusters (zoomed out) or pins (zoomed in) for the viewport.
|
|
703
|
+
"""
|
|
704
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
705
|
+
"emsp/locations/map",
|
|
706
|
+
method="GET",
|
|
707
|
+
params={
|
|
708
|
+
"connector_types": connector_types,
|
|
709
|
+
"cpo_ids": cpo_ids,
|
|
710
|
+
"bbox": bbox,
|
|
711
|
+
"zoom": zoom,
|
|
712
|
+
"network_id": network_id,
|
|
713
|
+
"token_group_id": token_group_id,
|
|
714
|
+
"min_power": min_power,
|
|
715
|
+
"available_only": available_only,
|
|
716
|
+
"own": own,
|
|
717
|
+
},
|
|
718
|
+
request_options=request_options,
|
|
719
|
+
)
|
|
720
|
+
try:
|
|
721
|
+
if 200 <= _response.status_code < 300:
|
|
722
|
+
_data = typing.cast(
|
|
723
|
+
MapPage,
|
|
724
|
+
parse_obj_as(
|
|
725
|
+
type_=MapPage, # type: ignore
|
|
726
|
+
object_=_response.json(),
|
|
727
|
+
),
|
|
728
|
+
)
|
|
729
|
+
return HttpResponse(response=_response, data=_data)
|
|
730
|
+
if _response.status_code == 400:
|
|
731
|
+
raise BadRequestError(
|
|
732
|
+
headers=dict(_response.headers),
|
|
733
|
+
body=typing.cast(
|
|
734
|
+
HttpErrorResponse,
|
|
735
|
+
parse_obj_as(
|
|
736
|
+
type_=HttpErrorResponse, # type: ignore
|
|
737
|
+
object_=_response.json(),
|
|
738
|
+
),
|
|
739
|
+
),
|
|
740
|
+
)
|
|
741
|
+
if _response.status_code == 401:
|
|
742
|
+
raise UnauthorizedError(
|
|
743
|
+
headers=dict(_response.headers),
|
|
744
|
+
body=typing.cast(
|
|
745
|
+
HttpErrorResponse,
|
|
746
|
+
parse_obj_as(
|
|
747
|
+
type_=HttpErrorResponse, # type: ignore
|
|
748
|
+
object_=_response.json(),
|
|
749
|
+
),
|
|
750
|
+
),
|
|
751
|
+
)
|
|
752
|
+
if _response.status_code == 422:
|
|
753
|
+
raise UnprocessableEntityError(
|
|
754
|
+
headers=dict(_response.headers),
|
|
755
|
+
body=typing.cast(
|
|
756
|
+
HttpValidationError,
|
|
757
|
+
parse_obj_as(
|
|
758
|
+
type_=HttpValidationError, # type: ignore
|
|
759
|
+
object_=_response.json(),
|
|
760
|
+
),
|
|
761
|
+
),
|
|
762
|
+
)
|
|
763
|
+
if _response.status_code == 429:
|
|
764
|
+
raise TooManyRequestsError(
|
|
765
|
+
headers=dict(_response.headers),
|
|
766
|
+
body=typing.cast(
|
|
767
|
+
HttpErrorResponse,
|
|
768
|
+
parse_obj_as(
|
|
769
|
+
type_=HttpErrorResponse, # type: ignore
|
|
770
|
+
object_=_response.json(),
|
|
771
|
+
),
|
|
772
|
+
),
|
|
773
|
+
)
|
|
774
|
+
if _response.status_code == 502:
|
|
775
|
+
raise BadGatewayError(
|
|
776
|
+
headers=dict(_response.headers),
|
|
777
|
+
body=typing.cast(
|
|
778
|
+
HttpErrorResponse,
|
|
779
|
+
parse_obj_as(
|
|
780
|
+
type_=HttpErrorResponse, # type: ignore
|
|
781
|
+
object_=_response.json(),
|
|
782
|
+
),
|
|
783
|
+
),
|
|
784
|
+
)
|
|
785
|
+
if _response.status_code == 504:
|
|
786
|
+
raise GatewayTimeoutError(
|
|
787
|
+
headers=dict(_response.headers),
|
|
788
|
+
body=typing.cast(
|
|
789
|
+
HttpErrorResponse,
|
|
790
|
+
parse_obj_as(
|
|
791
|
+
type_=HttpErrorResponse, # type: ignore
|
|
792
|
+
object_=_response.json(),
|
|
793
|
+
),
|
|
794
|
+
),
|
|
795
|
+
)
|
|
796
|
+
_response_json = _response.json()
|
|
797
|
+
except JSONDecodeError:
|
|
798
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
799
|
+
except ValidationError as e:
|
|
800
|
+
raise ParsingError(
|
|
801
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
802
|
+
)
|
|
803
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
804
|
+
|
|
805
|
+
def search(
|
|
806
|
+
self,
|
|
807
|
+
*,
|
|
808
|
+
q: typing.Optional[str] = None,
|
|
809
|
+
evse_id: typing.Optional[str] = None,
|
|
810
|
+
lat: typing.Optional[float] = None,
|
|
811
|
+
lon: typing.Optional[float] = None,
|
|
812
|
+
limit: typing.Optional[int] = None,
|
|
813
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
814
|
+
) -> HttpResponse[LocationList]:
|
|
815
|
+
"""
|
|
816
|
+
Text search on name, address and city (``q``), EVSE id lookup (``evse_id``, as printed on the QR code; ``*`` and case are ignored), or both. Nearest first when ``lat`` and ``lon`` are given. Returns at most ``limit`` matches with no next page: refine the query to narrow it.
|
|
817
|
+
|
|
818
|
+
Parameters
|
|
819
|
+
----------
|
|
820
|
+
q : typing.Optional[str]
|
|
821
|
+
Text in name, address or city.
|
|
822
|
+
|
|
823
|
+
evse_id : typing.Optional[str]
|
|
824
|
+
eMI3 EVSE id as printed on the QR code, e.g. ``NL*ABC*E1001*1``.
|
|
825
|
+
|
|
826
|
+
lat : typing.Optional[float]
|
|
827
|
+
Your latitude (WGS84); send with lon.
|
|
828
|
+
|
|
829
|
+
lon : typing.Optional[float]
|
|
830
|
+
Your longitude (WGS84); send with lat.
|
|
831
|
+
|
|
832
|
+
limit : typing.Optional[int]
|
|
833
|
+
Maximum results (default 10, max 50).
|
|
834
|
+
|
|
835
|
+
request_options : typing.Optional[RequestOptions]
|
|
836
|
+
Request-specific configuration.
|
|
837
|
+
|
|
838
|
+
Returns
|
|
839
|
+
-------
|
|
840
|
+
HttpResponse[LocationList]
|
|
841
|
+
Matching locations, nearest first when lat/lon are given.
|
|
842
|
+
"""
|
|
843
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
844
|
+
"emsp/locations/search",
|
|
845
|
+
method="GET",
|
|
846
|
+
params={
|
|
847
|
+
"q": q,
|
|
848
|
+
"evse_id": evse_id,
|
|
849
|
+
"lat": lat,
|
|
850
|
+
"lon": lon,
|
|
851
|
+
"limit": limit,
|
|
852
|
+
},
|
|
853
|
+
request_options=request_options,
|
|
854
|
+
)
|
|
855
|
+
try:
|
|
856
|
+
if 200 <= _response.status_code < 300:
|
|
857
|
+
_data = typing.cast(
|
|
858
|
+
LocationList,
|
|
859
|
+
parse_obj_as(
|
|
860
|
+
type_=LocationList, # type: ignore
|
|
861
|
+
object_=_response.json(),
|
|
862
|
+
),
|
|
863
|
+
)
|
|
864
|
+
return HttpResponse(response=_response, data=_data)
|
|
865
|
+
if _response.status_code == 400:
|
|
866
|
+
raise BadRequestError(
|
|
867
|
+
headers=dict(_response.headers),
|
|
868
|
+
body=typing.cast(
|
|
869
|
+
HttpErrorResponse,
|
|
870
|
+
parse_obj_as(
|
|
871
|
+
type_=HttpErrorResponse, # type: ignore
|
|
872
|
+
object_=_response.json(),
|
|
873
|
+
),
|
|
874
|
+
),
|
|
875
|
+
)
|
|
876
|
+
if _response.status_code == 401:
|
|
877
|
+
raise UnauthorizedError(
|
|
878
|
+
headers=dict(_response.headers),
|
|
879
|
+
body=typing.cast(
|
|
880
|
+
HttpErrorResponse,
|
|
881
|
+
parse_obj_as(
|
|
882
|
+
type_=HttpErrorResponse, # type: ignore
|
|
883
|
+
object_=_response.json(),
|
|
884
|
+
),
|
|
885
|
+
),
|
|
886
|
+
)
|
|
887
|
+
if _response.status_code == 422:
|
|
888
|
+
raise UnprocessableEntityError(
|
|
889
|
+
headers=dict(_response.headers),
|
|
890
|
+
body=typing.cast(
|
|
891
|
+
HttpValidationError,
|
|
892
|
+
parse_obj_as(
|
|
893
|
+
type_=HttpValidationError, # type: ignore
|
|
894
|
+
object_=_response.json(),
|
|
895
|
+
),
|
|
896
|
+
),
|
|
897
|
+
)
|
|
898
|
+
if _response.status_code == 429:
|
|
899
|
+
raise TooManyRequestsError(
|
|
900
|
+
headers=dict(_response.headers),
|
|
901
|
+
body=typing.cast(
|
|
902
|
+
HttpErrorResponse,
|
|
903
|
+
parse_obj_as(
|
|
904
|
+
type_=HttpErrorResponse, # type: ignore
|
|
905
|
+
object_=_response.json(),
|
|
906
|
+
),
|
|
907
|
+
),
|
|
908
|
+
)
|
|
909
|
+
if _response.status_code == 502:
|
|
910
|
+
raise BadGatewayError(
|
|
911
|
+
headers=dict(_response.headers),
|
|
912
|
+
body=typing.cast(
|
|
913
|
+
HttpErrorResponse,
|
|
914
|
+
parse_obj_as(
|
|
915
|
+
type_=HttpErrorResponse, # type: ignore
|
|
916
|
+
object_=_response.json(),
|
|
917
|
+
),
|
|
918
|
+
),
|
|
919
|
+
)
|
|
920
|
+
if _response.status_code == 504:
|
|
921
|
+
raise GatewayTimeoutError(
|
|
922
|
+
headers=dict(_response.headers),
|
|
923
|
+
body=typing.cast(
|
|
924
|
+
HttpErrorResponse,
|
|
925
|
+
parse_obj_as(
|
|
926
|
+
type_=HttpErrorResponse, # type: ignore
|
|
927
|
+
object_=_response.json(),
|
|
928
|
+
),
|
|
929
|
+
),
|
|
930
|
+
)
|
|
931
|
+
_response_json = _response.json()
|
|
932
|
+
except JSONDecodeError:
|
|
933
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
934
|
+
except ValidationError as e:
|
|
935
|
+
raise ParsingError(
|
|
936
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
937
|
+
)
|
|
938
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
939
|
+
|
|
940
|
+
def route(
|
|
941
|
+
self,
|
|
942
|
+
*,
|
|
943
|
+
polyline: str,
|
|
944
|
+
connector_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
945
|
+
cpo_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
946
|
+
buffer_km: typing.Optional[float] = None,
|
|
947
|
+
limit: typing.Optional[int] = None,
|
|
948
|
+
network_id: typing.Optional[int] = None,
|
|
949
|
+
token_group_id: typing.Optional[int] = None,
|
|
950
|
+
min_power: typing.Optional[float] = None,
|
|
951
|
+
available_only: typing.Optional[bool] = None,
|
|
952
|
+
own: typing.Optional[bool] = None,
|
|
953
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
954
|
+
) -> HttpResponse[LocationList]:
|
|
955
|
+
"""
|
|
956
|
+
Locations within ``buffer_km`` of an encoded polyline (Google format, precision 5), in order along the route. Same filters as the map. Returns at most ``limit`` locations with no next page: shorten the route or ``buffer_km`` to narrow it.
|
|
957
|
+
|
|
958
|
+
Parameters
|
|
959
|
+
----------
|
|
960
|
+
polyline : str
|
|
961
|
+
The route as a Google encoded polyline, precision 5.
|
|
962
|
+
|
|
963
|
+
connector_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
964
|
+
Only these OCPI connector standards, e.g. ``IEC_62196_T2``. Repeat for more than one.
|
|
965
|
+
|
|
966
|
+
cpo_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
967
|
+
Only these CPOs, as ``CC*PID``. Repeat for more than one.
|
|
968
|
+
|
|
969
|
+
buffer_km : typing.Optional[float]
|
|
970
|
+
Distance from the route in km (default 2, max 20).
|
|
971
|
+
|
|
972
|
+
limit : typing.Optional[int]
|
|
973
|
+
Maximum results (default 50, max 200).
|
|
974
|
+
|
|
975
|
+
network_id : typing.Optional[int]
|
|
976
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
977
|
+
|
|
978
|
+
token_group_id : typing.Optional[int]
|
|
979
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
980
|
+
|
|
981
|
+
min_power : typing.Optional[float]
|
|
982
|
+
Minimum connector power in kW.
|
|
983
|
+
|
|
984
|
+
available_only : typing.Optional[bool]
|
|
985
|
+
Only locations with an EVSE free right now.
|
|
986
|
+
|
|
987
|
+
own : typing.Optional[bool]
|
|
988
|
+
true: only your own OCPP chargers. false: only partner (roaming) locations.
|
|
989
|
+
|
|
990
|
+
request_options : typing.Optional[RequestOptions]
|
|
991
|
+
Request-specific configuration.
|
|
992
|
+
|
|
993
|
+
Returns
|
|
994
|
+
-------
|
|
995
|
+
HttpResponse[LocationList]
|
|
996
|
+
Locations near the route, in order along it.
|
|
997
|
+
"""
|
|
998
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
999
|
+
"emsp/locations/route",
|
|
1000
|
+
method="GET",
|
|
1001
|
+
params={
|
|
1002
|
+
"connector_types": connector_types,
|
|
1003
|
+
"cpo_ids": cpo_ids,
|
|
1004
|
+
"polyline": polyline,
|
|
1005
|
+
"buffer_km": buffer_km,
|
|
1006
|
+
"limit": limit,
|
|
1007
|
+
"network_id": network_id,
|
|
1008
|
+
"token_group_id": token_group_id,
|
|
1009
|
+
"min_power": min_power,
|
|
1010
|
+
"available_only": available_only,
|
|
1011
|
+
"own": own,
|
|
1012
|
+
},
|
|
1013
|
+
request_options=request_options,
|
|
1014
|
+
)
|
|
1015
|
+
try:
|
|
1016
|
+
if 200 <= _response.status_code < 300:
|
|
1017
|
+
_data = typing.cast(
|
|
1018
|
+
LocationList,
|
|
1019
|
+
parse_obj_as(
|
|
1020
|
+
type_=LocationList, # type: ignore
|
|
1021
|
+
object_=_response.json(),
|
|
1022
|
+
),
|
|
1023
|
+
)
|
|
1024
|
+
return HttpResponse(response=_response, data=_data)
|
|
1025
|
+
if _response.status_code == 400:
|
|
1026
|
+
raise BadRequestError(
|
|
1027
|
+
headers=dict(_response.headers),
|
|
1028
|
+
body=typing.cast(
|
|
1029
|
+
HttpErrorResponse,
|
|
1030
|
+
parse_obj_as(
|
|
1031
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1032
|
+
object_=_response.json(),
|
|
1033
|
+
),
|
|
1034
|
+
),
|
|
1035
|
+
)
|
|
1036
|
+
if _response.status_code == 401:
|
|
1037
|
+
raise UnauthorizedError(
|
|
1038
|
+
headers=dict(_response.headers),
|
|
1039
|
+
body=typing.cast(
|
|
1040
|
+
HttpErrorResponse,
|
|
1041
|
+
parse_obj_as(
|
|
1042
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1043
|
+
object_=_response.json(),
|
|
1044
|
+
),
|
|
1045
|
+
),
|
|
1046
|
+
)
|
|
1047
|
+
if _response.status_code == 422:
|
|
1048
|
+
raise UnprocessableEntityError(
|
|
1049
|
+
headers=dict(_response.headers),
|
|
1050
|
+
body=typing.cast(
|
|
1051
|
+
HttpValidationError,
|
|
1052
|
+
parse_obj_as(
|
|
1053
|
+
type_=HttpValidationError, # type: ignore
|
|
1054
|
+
object_=_response.json(),
|
|
1055
|
+
),
|
|
1056
|
+
),
|
|
1057
|
+
)
|
|
1058
|
+
if _response.status_code == 429:
|
|
1059
|
+
raise TooManyRequestsError(
|
|
1060
|
+
headers=dict(_response.headers),
|
|
1061
|
+
body=typing.cast(
|
|
1062
|
+
HttpErrorResponse,
|
|
1063
|
+
parse_obj_as(
|
|
1064
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1065
|
+
object_=_response.json(),
|
|
1066
|
+
),
|
|
1067
|
+
),
|
|
1068
|
+
)
|
|
1069
|
+
if _response.status_code == 502:
|
|
1070
|
+
raise BadGatewayError(
|
|
1071
|
+
headers=dict(_response.headers),
|
|
1072
|
+
body=typing.cast(
|
|
1073
|
+
HttpErrorResponse,
|
|
1074
|
+
parse_obj_as(
|
|
1075
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1076
|
+
object_=_response.json(),
|
|
1077
|
+
),
|
|
1078
|
+
),
|
|
1079
|
+
)
|
|
1080
|
+
if _response.status_code == 504:
|
|
1081
|
+
raise GatewayTimeoutError(
|
|
1082
|
+
headers=dict(_response.headers),
|
|
1083
|
+
body=typing.cast(
|
|
1084
|
+
HttpErrorResponse,
|
|
1085
|
+
parse_obj_as(
|
|
1086
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1087
|
+
object_=_response.json(),
|
|
1088
|
+
),
|
|
1089
|
+
),
|
|
1090
|
+
)
|
|
1091
|
+
_response_json = _response.json()
|
|
1092
|
+
except JSONDecodeError:
|
|
1093
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1094
|
+
except ValidationError as e:
|
|
1095
|
+
raise ParsingError(
|
|
1096
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
1097
|
+
)
|
|
1098
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1099
|
+
|
|
1100
|
+
def batch(
|
|
1101
|
+
self,
|
|
1102
|
+
*,
|
|
1103
|
+
keys: typing.Optional[typing.Sequence[LocationKeyInput]] = OMIT,
|
|
1104
|
+
uids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
1105
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1106
|
+
) -> HttpResponse[BatchResponse]:
|
|
1107
|
+
"""
|
|
1108
|
+
Up to 500 locations by OCPI key or by ``uid`` (one of the two). Keys or uids that are unknown or out of scope come back in ``missing``.
|
|
1109
|
+
|
|
1110
|
+
Parameters
|
|
1111
|
+
----------
|
|
1112
|
+
keys : typing.Optional[typing.Sequence[LocationKeyInput]]
|
|
1113
|
+
|
|
1114
|
+
uids : typing.Optional[typing.Sequence[str]]
|
|
1115
|
+
|
|
1116
|
+
request_options : typing.Optional[RequestOptions]
|
|
1117
|
+
Request-specific configuration.
|
|
1118
|
+
|
|
1119
|
+
Returns
|
|
1120
|
+
-------
|
|
1121
|
+
HttpResponse[BatchResponse]
|
|
1122
|
+
The locations found, and the keys or uids that were not.
|
|
1123
|
+
"""
|
|
1124
|
+
_request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
|
|
1125
|
+
{**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
|
|
1126
|
+
)
|
|
1127
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1128
|
+
"emsp/locations/batch",
|
|
1129
|
+
method="POST",
|
|
1130
|
+
json={
|
|
1131
|
+
"keys": convert_and_respect_annotation_metadata(
|
|
1132
|
+
object_=keys, annotation=typing.Optional[typing.Sequence[LocationKeyInput]], direction="write"
|
|
1133
|
+
),
|
|
1134
|
+
"uids": uids,
|
|
1135
|
+
},
|
|
1136
|
+
headers={
|
|
1137
|
+
"content-type": "application/json",
|
|
1138
|
+
},
|
|
1139
|
+
request_options=_request_options_with_retries_disabled,
|
|
1140
|
+
omit=OMIT,
|
|
1141
|
+
)
|
|
1142
|
+
try:
|
|
1143
|
+
if 200 <= _response.status_code < 300:
|
|
1144
|
+
_data = typing.cast(
|
|
1145
|
+
BatchResponse,
|
|
1146
|
+
parse_obj_as(
|
|
1147
|
+
type_=BatchResponse, # type: ignore
|
|
1148
|
+
object_=_response.json(),
|
|
1149
|
+
),
|
|
1150
|
+
)
|
|
1151
|
+
return HttpResponse(response=_response, data=_data)
|
|
1152
|
+
if _response.status_code == 400:
|
|
1153
|
+
raise BadRequestError(
|
|
1154
|
+
headers=dict(_response.headers),
|
|
1155
|
+
body=typing.cast(
|
|
1156
|
+
HttpErrorResponse,
|
|
1157
|
+
parse_obj_as(
|
|
1158
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1159
|
+
object_=_response.json(),
|
|
1160
|
+
),
|
|
1161
|
+
),
|
|
1162
|
+
)
|
|
1163
|
+
if _response.status_code == 401:
|
|
1164
|
+
raise UnauthorizedError(
|
|
1165
|
+
headers=dict(_response.headers),
|
|
1166
|
+
body=typing.cast(
|
|
1167
|
+
HttpErrorResponse,
|
|
1168
|
+
parse_obj_as(
|
|
1169
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1170
|
+
object_=_response.json(),
|
|
1171
|
+
),
|
|
1172
|
+
),
|
|
1173
|
+
)
|
|
1174
|
+
if _response.status_code == 422:
|
|
1175
|
+
raise UnprocessableEntityError(
|
|
1176
|
+
headers=dict(_response.headers),
|
|
1177
|
+
body=typing.cast(
|
|
1178
|
+
HttpValidationError,
|
|
1179
|
+
parse_obj_as(
|
|
1180
|
+
type_=HttpValidationError, # type: ignore
|
|
1181
|
+
object_=_response.json(),
|
|
1182
|
+
),
|
|
1183
|
+
),
|
|
1184
|
+
)
|
|
1185
|
+
if _response.status_code == 429:
|
|
1186
|
+
raise TooManyRequestsError(
|
|
1187
|
+
headers=dict(_response.headers),
|
|
1188
|
+
body=typing.cast(
|
|
1189
|
+
HttpErrorResponse,
|
|
1190
|
+
parse_obj_as(
|
|
1191
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1192
|
+
object_=_response.json(),
|
|
1193
|
+
),
|
|
1194
|
+
),
|
|
1195
|
+
)
|
|
1196
|
+
if _response.status_code == 502:
|
|
1197
|
+
raise BadGatewayError(
|
|
1198
|
+
headers=dict(_response.headers),
|
|
1199
|
+
body=typing.cast(
|
|
1200
|
+
HttpErrorResponse,
|
|
1201
|
+
parse_obj_as(
|
|
1202
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1203
|
+
object_=_response.json(),
|
|
1204
|
+
),
|
|
1205
|
+
),
|
|
1206
|
+
)
|
|
1207
|
+
if _response.status_code == 504:
|
|
1208
|
+
raise GatewayTimeoutError(
|
|
1209
|
+
headers=dict(_response.headers),
|
|
1210
|
+
body=typing.cast(
|
|
1211
|
+
HttpErrorResponse,
|
|
1212
|
+
parse_obj_as(
|
|
1213
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1214
|
+
object_=_response.json(),
|
|
1215
|
+
),
|
|
1216
|
+
),
|
|
1217
|
+
)
|
|
1218
|
+
_response_json = _response.json()
|
|
1219
|
+
except JSONDecodeError:
|
|
1220
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1221
|
+
except ValidationError as e:
|
|
1222
|
+
raise ParsingError(
|
|
1223
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
1224
|
+
)
|
|
1225
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1226
|
+
|
|
1227
|
+
def get_by_uid(
|
|
1228
|
+
self, uid: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1229
|
+
) -> HttpResponse[LocationDetail]:
|
|
1230
|
+
"""
|
|
1231
|
+
One location with its EVSEs, connectors and tariff summary, by its stable ``uid``.
|
|
1232
|
+
|
|
1233
|
+
Parameters
|
|
1234
|
+
----------
|
|
1235
|
+
uid : str
|
|
1236
|
+
The location's stable ``uid``.
|
|
1237
|
+
|
|
1238
|
+
request_options : typing.Optional[RequestOptions]
|
|
1239
|
+
Request-specific configuration.
|
|
1240
|
+
|
|
1241
|
+
Returns
|
|
1242
|
+
-------
|
|
1243
|
+
HttpResponse[LocationDetail]
|
|
1244
|
+
The location with its EVSEs, connectors and tariff summary.
|
|
1245
|
+
"""
|
|
1246
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1247
|
+
f"emsp/locations/by-uid/{encode_path_param(uid)}",
|
|
1248
|
+
method="GET",
|
|
1249
|
+
request_options=request_options,
|
|
1250
|
+
)
|
|
1251
|
+
try:
|
|
1252
|
+
if 200 <= _response.status_code < 300:
|
|
1253
|
+
_data = typing.cast(
|
|
1254
|
+
LocationDetail,
|
|
1255
|
+
parse_obj_as(
|
|
1256
|
+
type_=LocationDetail, # type: ignore
|
|
1257
|
+
object_=_response.json(),
|
|
1258
|
+
),
|
|
1259
|
+
)
|
|
1260
|
+
return HttpResponse(response=_response, data=_data)
|
|
1261
|
+
if _response.status_code == 401:
|
|
1262
|
+
raise UnauthorizedError(
|
|
1263
|
+
headers=dict(_response.headers),
|
|
1264
|
+
body=typing.cast(
|
|
1265
|
+
HttpErrorResponse,
|
|
1266
|
+
parse_obj_as(
|
|
1267
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1268
|
+
object_=_response.json(),
|
|
1269
|
+
),
|
|
1270
|
+
),
|
|
1271
|
+
)
|
|
1272
|
+
if _response.status_code == 404:
|
|
1273
|
+
raise NotFoundError(
|
|
1274
|
+
headers=dict(_response.headers),
|
|
1275
|
+
body=typing.cast(
|
|
1276
|
+
HttpErrorResponse,
|
|
1277
|
+
parse_obj_as(
|
|
1278
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1279
|
+
object_=_response.json(),
|
|
1280
|
+
),
|
|
1281
|
+
),
|
|
1282
|
+
)
|
|
1283
|
+
if _response.status_code == 422:
|
|
1284
|
+
raise UnprocessableEntityError(
|
|
1285
|
+
headers=dict(_response.headers),
|
|
1286
|
+
body=typing.cast(
|
|
1287
|
+
HttpValidationError,
|
|
1288
|
+
parse_obj_as(
|
|
1289
|
+
type_=HttpValidationError, # type: ignore
|
|
1290
|
+
object_=_response.json(),
|
|
1291
|
+
),
|
|
1292
|
+
),
|
|
1293
|
+
)
|
|
1294
|
+
if _response.status_code == 429:
|
|
1295
|
+
raise TooManyRequestsError(
|
|
1296
|
+
headers=dict(_response.headers),
|
|
1297
|
+
body=typing.cast(
|
|
1298
|
+
HttpErrorResponse,
|
|
1299
|
+
parse_obj_as(
|
|
1300
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1301
|
+
object_=_response.json(),
|
|
1302
|
+
),
|
|
1303
|
+
),
|
|
1304
|
+
)
|
|
1305
|
+
if _response.status_code == 502:
|
|
1306
|
+
raise BadGatewayError(
|
|
1307
|
+
headers=dict(_response.headers),
|
|
1308
|
+
body=typing.cast(
|
|
1309
|
+
HttpErrorResponse,
|
|
1310
|
+
parse_obj_as(
|
|
1311
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1312
|
+
object_=_response.json(),
|
|
1313
|
+
),
|
|
1314
|
+
),
|
|
1315
|
+
)
|
|
1316
|
+
if _response.status_code == 504:
|
|
1317
|
+
raise GatewayTimeoutError(
|
|
1318
|
+
headers=dict(_response.headers),
|
|
1319
|
+
body=typing.cast(
|
|
1320
|
+
HttpErrorResponse,
|
|
1321
|
+
parse_obj_as(
|
|
1322
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1323
|
+
object_=_response.json(),
|
|
1324
|
+
),
|
|
1325
|
+
),
|
|
1326
|
+
)
|
|
1327
|
+
_response_json = _response.json()
|
|
1328
|
+
except JSONDecodeError:
|
|
1329
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1330
|
+
except ValidationError as e:
|
|
1331
|
+
raise ParsingError(
|
|
1332
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
1333
|
+
)
|
|
1334
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1335
|
+
|
|
1336
|
+
def get(
|
|
1337
|
+
self,
|
|
1338
|
+
location_id: str,
|
|
1339
|
+
*,
|
|
1340
|
+
country_code: str,
|
|
1341
|
+
party_id: str,
|
|
1342
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1343
|
+
) -> HttpResponse[LocationDetail]:
|
|
1344
|
+
"""
|
|
1345
|
+
One own or partner location with its EVSEs, connectors and tariff summary, addressed by the CPO's country code and party id.
|
|
1346
|
+
|
|
1347
|
+
Parameters
|
|
1348
|
+
----------
|
|
1349
|
+
location_id : str
|
|
1350
|
+
OCPI location id.
|
|
1351
|
+
|
|
1352
|
+
country_code : str
|
|
1353
|
+
The CPO's OCPI country code, e.g. NL.
|
|
1354
|
+
|
|
1355
|
+
party_id : str
|
|
1356
|
+
The CPO's OCPI party id, e.g. ABC.
|
|
1357
|
+
|
|
1358
|
+
request_options : typing.Optional[RequestOptions]
|
|
1359
|
+
Request-specific configuration.
|
|
1360
|
+
|
|
1361
|
+
Returns
|
|
1362
|
+
-------
|
|
1363
|
+
HttpResponse[LocationDetail]
|
|
1364
|
+
The location with its EVSEs, connectors and tariff summary.
|
|
1365
|
+
"""
|
|
1366
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1367
|
+
f"emsp/locations/by-id/{encode_path_param(location_id)}",
|
|
1368
|
+
method="GET",
|
|
1369
|
+
params={
|
|
1370
|
+
"country_code": country_code,
|
|
1371
|
+
"party_id": party_id,
|
|
1372
|
+
},
|
|
1373
|
+
request_options=request_options,
|
|
1374
|
+
)
|
|
1375
|
+
try:
|
|
1376
|
+
if 200 <= _response.status_code < 300:
|
|
1377
|
+
_data = typing.cast(
|
|
1378
|
+
LocationDetail,
|
|
1379
|
+
parse_obj_as(
|
|
1380
|
+
type_=LocationDetail, # type: ignore
|
|
1381
|
+
object_=_response.json(),
|
|
1382
|
+
),
|
|
1383
|
+
)
|
|
1384
|
+
return HttpResponse(response=_response, data=_data)
|
|
1385
|
+
if _response.status_code == 401:
|
|
1386
|
+
raise UnauthorizedError(
|
|
1387
|
+
headers=dict(_response.headers),
|
|
1388
|
+
body=typing.cast(
|
|
1389
|
+
HttpErrorResponse,
|
|
1390
|
+
parse_obj_as(
|
|
1391
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1392
|
+
object_=_response.json(),
|
|
1393
|
+
),
|
|
1394
|
+
),
|
|
1395
|
+
)
|
|
1396
|
+
if _response.status_code == 404:
|
|
1397
|
+
raise NotFoundError(
|
|
1398
|
+
headers=dict(_response.headers),
|
|
1399
|
+
body=typing.cast(
|
|
1400
|
+
HttpErrorResponse,
|
|
1401
|
+
parse_obj_as(
|
|
1402
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1403
|
+
object_=_response.json(),
|
|
1404
|
+
),
|
|
1405
|
+
),
|
|
1406
|
+
)
|
|
1407
|
+
if _response.status_code == 409:
|
|
1408
|
+
raise ConflictError(
|
|
1409
|
+
headers=dict(_response.headers),
|
|
1410
|
+
body=typing.cast(
|
|
1411
|
+
HttpErrorResponse,
|
|
1412
|
+
parse_obj_as(
|
|
1413
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1414
|
+
object_=_response.json(),
|
|
1415
|
+
),
|
|
1416
|
+
),
|
|
1417
|
+
)
|
|
1418
|
+
if _response.status_code == 422:
|
|
1419
|
+
raise UnprocessableEntityError(
|
|
1420
|
+
headers=dict(_response.headers),
|
|
1421
|
+
body=typing.cast(
|
|
1422
|
+
HttpValidationError,
|
|
1423
|
+
parse_obj_as(
|
|
1424
|
+
type_=HttpValidationError, # type: ignore
|
|
1425
|
+
object_=_response.json(),
|
|
1426
|
+
),
|
|
1427
|
+
),
|
|
1428
|
+
)
|
|
1429
|
+
if _response.status_code == 429:
|
|
1430
|
+
raise TooManyRequestsError(
|
|
1431
|
+
headers=dict(_response.headers),
|
|
1432
|
+
body=typing.cast(
|
|
1433
|
+
HttpErrorResponse,
|
|
1434
|
+
parse_obj_as(
|
|
1435
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1436
|
+
object_=_response.json(),
|
|
1437
|
+
),
|
|
1438
|
+
),
|
|
1439
|
+
)
|
|
1440
|
+
if _response.status_code == 502:
|
|
1441
|
+
raise BadGatewayError(
|
|
1442
|
+
headers=dict(_response.headers),
|
|
1443
|
+
body=typing.cast(
|
|
1444
|
+
HttpErrorResponse,
|
|
1445
|
+
parse_obj_as(
|
|
1446
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1447
|
+
object_=_response.json(),
|
|
1448
|
+
),
|
|
1449
|
+
),
|
|
1450
|
+
)
|
|
1451
|
+
if _response.status_code == 504:
|
|
1452
|
+
raise GatewayTimeoutError(
|
|
1453
|
+
headers=dict(_response.headers),
|
|
1454
|
+
body=typing.cast(
|
|
1455
|
+
HttpErrorResponse,
|
|
1456
|
+
parse_obj_as(
|
|
1457
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1458
|
+
object_=_response.json(),
|
|
1459
|
+
),
|
|
1460
|
+
),
|
|
1461
|
+
)
|
|
1462
|
+
_response_json = _response.json()
|
|
1463
|
+
except JSONDecodeError:
|
|
1464
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1465
|
+
except ValidationError as e:
|
|
1466
|
+
raise ParsingError(
|
|
1467
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
1468
|
+
)
|
|
1469
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
class AsyncRawLocationsClient:
|
|
1473
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
1474
|
+
self._client_wrapper = client_wrapper
|
|
1475
|
+
|
|
1476
|
+
async def list(
|
|
1477
|
+
self,
|
|
1478
|
+
*,
|
|
1479
|
+
cpo_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1480
|
+
countries: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1481
|
+
connector_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1482
|
+
facilities: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1483
|
+
parking_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1484
|
+
network_id: typing.Optional[int] = None,
|
|
1485
|
+
token_group_id: typing.Optional[int] = None,
|
|
1486
|
+
bounding_box: typing.Optional[str] = None,
|
|
1487
|
+
after: typing.Optional[str] = None,
|
|
1488
|
+
limit: typing.Optional[int] = None,
|
|
1489
|
+
q: typing.Optional[str] = None,
|
|
1490
|
+
lat: typing.Optional[float] = None,
|
|
1491
|
+
lon: typing.Optional[float] = None,
|
|
1492
|
+
radius_km: typing.Optional[float] = None,
|
|
1493
|
+
availability: typing.Optional[bool] = None,
|
|
1494
|
+
min_power: typing.Optional[float] = None,
|
|
1495
|
+
own: typing.Optional[bool] = None,
|
|
1496
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1497
|
+
) -> AsyncPager[EmspGatewaySchemaLocationsLocationOut, EmspGatewaySchemaLocationsLocationPage]:
|
|
1498
|
+
"""
|
|
1499
|
+
Your own OCPP chargers and roaming CPOs' locations, filtered by area, text, CPO, connector, power, facilities and parking type, optionally scoped to a network or a token group's networks. Each row carries a stable ``uid`` and its ``source`` (``OWN_OCPP`` or ``PARTNER_OCPI``).
|
|
1500
|
+
|
|
1501
|
+
Parameters
|
|
1502
|
+
----------
|
|
1503
|
+
cpo_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1504
|
+
Only these CPOs, as ``CC*PID``. Repeat for more than one.
|
|
1505
|
+
|
|
1506
|
+
countries : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1507
|
+
ISO 3166-1 alpha-3 countries, e.g. ``NLD``. Repeat for more than one.
|
|
1508
|
+
|
|
1509
|
+
connector_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1510
|
+
Only these OCPI connector standards, e.g. ``IEC_62196_T2``. Repeat for more than one.
|
|
1511
|
+
|
|
1512
|
+
facilities : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1513
|
+
OCPI facilities, e.g. ``CAFE``. A location must list every one. Repeat for more than one.
|
|
1514
|
+
|
|
1515
|
+
parking_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1516
|
+
OCPI parking types, e.g. ``PARKING_GARAGE``. Any one matches. Repeat for more than one.
|
|
1517
|
+
|
|
1518
|
+
network_id : typing.Optional[int]
|
|
1519
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
1520
|
+
|
|
1521
|
+
token_group_id : typing.Optional[int]
|
|
1522
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
1523
|
+
|
|
1524
|
+
bounding_box : typing.Optional[str]
|
|
1525
|
+
Only locations inside ``min_lon,min_lat,max_lon,max_lat`` (WGS84).
|
|
1526
|
+
|
|
1527
|
+
after : typing.Optional[str]
|
|
1528
|
+
Cursor: the previous page's ``pagination.end_cursor`` (``country_code:party_id:location_id``). Omit it for the first page.
|
|
1529
|
+
|
|
1530
|
+
limit : typing.Optional[int]
|
|
1531
|
+
Maximum rows per page (default 50, max 200).
|
|
1532
|
+
|
|
1533
|
+
q : typing.Optional[str]
|
|
1534
|
+
Text in name, address or city.
|
|
1535
|
+
|
|
1536
|
+
lat : typing.Optional[float]
|
|
1537
|
+
Search centre latitude (WGS84); send with lon.
|
|
1538
|
+
|
|
1539
|
+
lon : typing.Optional[float]
|
|
1540
|
+
Search centre longitude (WGS84); send with lat.
|
|
1541
|
+
|
|
1542
|
+
radius_km : typing.Optional[float]
|
|
1543
|
+
Search radius around lat/lon in km (default 10).
|
|
1544
|
+
|
|
1545
|
+
availability : typing.Optional[bool]
|
|
1546
|
+
Only locations with an EVSE free right now.
|
|
1547
|
+
|
|
1548
|
+
min_power : typing.Optional[float]
|
|
1549
|
+
Minimum connector power in kW.
|
|
1550
|
+
|
|
1551
|
+
own : typing.Optional[bool]
|
|
1552
|
+
true: only your own OCPP chargers. false: only partner (roaming) locations.
|
|
1553
|
+
|
|
1554
|
+
request_options : typing.Optional[RequestOptions]
|
|
1555
|
+
Request-specific configuration.
|
|
1556
|
+
|
|
1557
|
+
Returns
|
|
1558
|
+
-------
|
|
1559
|
+
AsyncPager[EmspGatewaySchemaLocationsLocationOut, EmspGatewaySchemaLocationsLocationPage]
|
|
1560
|
+
One page of own and partner locations.
|
|
1561
|
+
"""
|
|
1562
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1563
|
+
"emsp/locations",
|
|
1564
|
+
method="GET",
|
|
1565
|
+
params={
|
|
1566
|
+
"cpo_ids": cpo_ids,
|
|
1567
|
+
"countries": countries,
|
|
1568
|
+
"connector_types": connector_types,
|
|
1569
|
+
"facilities": facilities,
|
|
1570
|
+
"parking_types": parking_types,
|
|
1571
|
+
"network_id": network_id,
|
|
1572
|
+
"token_group_id": token_group_id,
|
|
1573
|
+
"bounding_box": bounding_box,
|
|
1574
|
+
"after": after,
|
|
1575
|
+
"limit": limit,
|
|
1576
|
+
"q": q,
|
|
1577
|
+
"lat": lat,
|
|
1578
|
+
"lon": lon,
|
|
1579
|
+
"radius_km": radius_km,
|
|
1580
|
+
"availability": availability,
|
|
1581
|
+
"min_power": min_power,
|
|
1582
|
+
"own": own,
|
|
1583
|
+
},
|
|
1584
|
+
request_options=request_options,
|
|
1585
|
+
)
|
|
1586
|
+
try:
|
|
1587
|
+
if 200 <= _response.status_code < 300:
|
|
1588
|
+
_parsed_response = typing.cast(
|
|
1589
|
+
EmspGatewaySchemaLocationsLocationPage,
|
|
1590
|
+
parse_obj_as(
|
|
1591
|
+
type_=EmspGatewaySchemaLocationsLocationPage, # type: ignore
|
|
1592
|
+
object_=_response.json(),
|
|
1593
|
+
),
|
|
1594
|
+
)
|
|
1595
|
+
_items = _parsed_response.data
|
|
1596
|
+
_has_next = False
|
|
1597
|
+
_get_next = None
|
|
1598
|
+
if _parsed_response.pagination is not None:
|
|
1599
|
+
_parsed_next = _parsed_response.pagination.end_cursor
|
|
1600
|
+
_has_next = _parsed_next is not None and _parsed_next != ""
|
|
1601
|
+
|
|
1602
|
+
async def _get_next():
|
|
1603
|
+
return await self.list(
|
|
1604
|
+
cpo_ids=cpo_ids,
|
|
1605
|
+
countries=countries,
|
|
1606
|
+
connector_types=connector_types,
|
|
1607
|
+
facilities=facilities,
|
|
1608
|
+
parking_types=parking_types,
|
|
1609
|
+
network_id=network_id,
|
|
1610
|
+
token_group_id=token_group_id,
|
|
1611
|
+
bounding_box=bounding_box,
|
|
1612
|
+
after=_parsed_next,
|
|
1613
|
+
limit=limit,
|
|
1614
|
+
q=q,
|
|
1615
|
+
lat=lat,
|
|
1616
|
+
lon=lon,
|
|
1617
|
+
radius_km=radius_km,
|
|
1618
|
+
availability=availability,
|
|
1619
|
+
min_power=min_power,
|
|
1620
|
+
own=own,
|
|
1621
|
+
request_options=request_options,
|
|
1622
|
+
)
|
|
1623
|
+
|
|
1624
|
+
return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
|
|
1625
|
+
if _response.status_code == 400:
|
|
1626
|
+
raise BadRequestError(
|
|
1627
|
+
headers=dict(_response.headers),
|
|
1628
|
+
body=typing.cast(
|
|
1629
|
+
HttpErrorResponse,
|
|
1630
|
+
parse_obj_as(
|
|
1631
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1632
|
+
object_=_response.json(),
|
|
1633
|
+
),
|
|
1634
|
+
),
|
|
1635
|
+
)
|
|
1636
|
+
if _response.status_code == 401:
|
|
1637
|
+
raise UnauthorizedError(
|
|
1638
|
+
headers=dict(_response.headers),
|
|
1639
|
+
body=typing.cast(
|
|
1640
|
+
HttpErrorResponse,
|
|
1641
|
+
parse_obj_as(
|
|
1642
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1643
|
+
object_=_response.json(),
|
|
1644
|
+
),
|
|
1645
|
+
),
|
|
1646
|
+
)
|
|
1647
|
+
if _response.status_code == 422:
|
|
1648
|
+
raise UnprocessableEntityError(
|
|
1649
|
+
headers=dict(_response.headers),
|
|
1650
|
+
body=typing.cast(
|
|
1651
|
+
HttpValidationError,
|
|
1652
|
+
parse_obj_as(
|
|
1653
|
+
type_=HttpValidationError, # type: ignore
|
|
1654
|
+
object_=_response.json(),
|
|
1655
|
+
),
|
|
1656
|
+
),
|
|
1657
|
+
)
|
|
1658
|
+
if _response.status_code == 429:
|
|
1659
|
+
raise TooManyRequestsError(
|
|
1660
|
+
headers=dict(_response.headers),
|
|
1661
|
+
body=typing.cast(
|
|
1662
|
+
HttpErrorResponse,
|
|
1663
|
+
parse_obj_as(
|
|
1664
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1665
|
+
object_=_response.json(),
|
|
1666
|
+
),
|
|
1667
|
+
),
|
|
1668
|
+
)
|
|
1669
|
+
if _response.status_code == 502:
|
|
1670
|
+
raise BadGatewayError(
|
|
1671
|
+
headers=dict(_response.headers),
|
|
1672
|
+
body=typing.cast(
|
|
1673
|
+
HttpErrorResponse,
|
|
1674
|
+
parse_obj_as(
|
|
1675
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1676
|
+
object_=_response.json(),
|
|
1677
|
+
),
|
|
1678
|
+
),
|
|
1679
|
+
)
|
|
1680
|
+
if _response.status_code == 504:
|
|
1681
|
+
raise GatewayTimeoutError(
|
|
1682
|
+
headers=dict(_response.headers),
|
|
1683
|
+
body=typing.cast(
|
|
1684
|
+
HttpErrorResponse,
|
|
1685
|
+
parse_obj_as(
|
|
1686
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1687
|
+
object_=_response.json(),
|
|
1688
|
+
),
|
|
1689
|
+
),
|
|
1690
|
+
)
|
|
1691
|
+
_response_json = _response.json()
|
|
1692
|
+
except JSONDecodeError:
|
|
1693
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1694
|
+
except ValidationError as e:
|
|
1695
|
+
raise ParsingError(
|
|
1696
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
1697
|
+
)
|
|
1698
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1699
|
+
|
|
1700
|
+
async def check_availability(
|
|
1701
|
+
self,
|
|
1702
|
+
*,
|
|
1703
|
+
location_ids: typing.Sequence[str],
|
|
1704
|
+
network_id: typing.Optional[int] = OMIT,
|
|
1705
|
+
token_group_id: typing.Optional[int] = OMIT,
|
|
1706
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1707
|
+
) -> AsyncHttpResponse[AvailabilityPage]:
|
|
1708
|
+
"""
|
|
1709
|
+
Free and total EVSEs per location. Unknown or out-of-scope ids are left out.
|
|
1710
|
+
|
|
1711
|
+
Parameters
|
|
1712
|
+
----------
|
|
1713
|
+
location_ids : typing.Sequence[str]
|
|
1714
|
+
|
|
1715
|
+
network_id : typing.Optional[int]
|
|
1716
|
+
|
|
1717
|
+
token_group_id : typing.Optional[int]
|
|
1718
|
+
|
|
1719
|
+
request_options : typing.Optional[RequestOptions]
|
|
1720
|
+
Request-specific configuration.
|
|
1721
|
+
|
|
1722
|
+
Returns
|
|
1723
|
+
-------
|
|
1724
|
+
AsyncHttpResponse[AvailabilityPage]
|
|
1725
|
+
Availability of each location found.
|
|
1726
|
+
"""
|
|
1727
|
+
_request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
|
|
1728
|
+
{**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
|
|
1729
|
+
)
|
|
1730
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1731
|
+
"emsp/locations/availability",
|
|
1732
|
+
method="POST",
|
|
1733
|
+
json={
|
|
1734
|
+
"network_id": network_id,
|
|
1735
|
+
"token_group_id": token_group_id,
|
|
1736
|
+
"location_ids": location_ids,
|
|
1737
|
+
},
|
|
1738
|
+
headers={
|
|
1739
|
+
"content-type": "application/json",
|
|
1740
|
+
},
|
|
1741
|
+
request_options=_request_options_with_retries_disabled,
|
|
1742
|
+
omit=OMIT,
|
|
1743
|
+
)
|
|
1744
|
+
try:
|
|
1745
|
+
if 200 <= _response.status_code < 300:
|
|
1746
|
+
_data = typing.cast(
|
|
1747
|
+
AvailabilityPage,
|
|
1748
|
+
parse_obj_as(
|
|
1749
|
+
type_=AvailabilityPage, # type: ignore
|
|
1750
|
+
object_=_response.json(),
|
|
1751
|
+
),
|
|
1752
|
+
)
|
|
1753
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1754
|
+
if _response.status_code == 400:
|
|
1755
|
+
raise BadRequestError(
|
|
1756
|
+
headers=dict(_response.headers),
|
|
1757
|
+
body=typing.cast(
|
|
1758
|
+
HttpErrorResponse,
|
|
1759
|
+
parse_obj_as(
|
|
1760
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1761
|
+
object_=_response.json(),
|
|
1762
|
+
),
|
|
1763
|
+
),
|
|
1764
|
+
)
|
|
1765
|
+
if _response.status_code == 401:
|
|
1766
|
+
raise UnauthorizedError(
|
|
1767
|
+
headers=dict(_response.headers),
|
|
1768
|
+
body=typing.cast(
|
|
1769
|
+
HttpErrorResponse,
|
|
1770
|
+
parse_obj_as(
|
|
1771
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1772
|
+
object_=_response.json(),
|
|
1773
|
+
),
|
|
1774
|
+
),
|
|
1775
|
+
)
|
|
1776
|
+
if _response.status_code == 422:
|
|
1777
|
+
raise UnprocessableEntityError(
|
|
1778
|
+
headers=dict(_response.headers),
|
|
1779
|
+
body=typing.cast(
|
|
1780
|
+
HttpValidationError,
|
|
1781
|
+
parse_obj_as(
|
|
1782
|
+
type_=HttpValidationError, # type: ignore
|
|
1783
|
+
object_=_response.json(),
|
|
1784
|
+
),
|
|
1785
|
+
),
|
|
1786
|
+
)
|
|
1787
|
+
if _response.status_code == 429:
|
|
1788
|
+
raise TooManyRequestsError(
|
|
1789
|
+
headers=dict(_response.headers),
|
|
1790
|
+
body=typing.cast(
|
|
1791
|
+
HttpErrorResponse,
|
|
1792
|
+
parse_obj_as(
|
|
1793
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1794
|
+
object_=_response.json(),
|
|
1795
|
+
),
|
|
1796
|
+
),
|
|
1797
|
+
)
|
|
1798
|
+
if _response.status_code == 502:
|
|
1799
|
+
raise BadGatewayError(
|
|
1800
|
+
headers=dict(_response.headers),
|
|
1801
|
+
body=typing.cast(
|
|
1802
|
+
HttpErrorResponse,
|
|
1803
|
+
parse_obj_as(
|
|
1804
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1805
|
+
object_=_response.json(),
|
|
1806
|
+
),
|
|
1807
|
+
),
|
|
1808
|
+
)
|
|
1809
|
+
if _response.status_code == 504:
|
|
1810
|
+
raise GatewayTimeoutError(
|
|
1811
|
+
headers=dict(_response.headers),
|
|
1812
|
+
body=typing.cast(
|
|
1813
|
+
HttpErrorResponse,
|
|
1814
|
+
parse_obj_as(
|
|
1815
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1816
|
+
object_=_response.json(),
|
|
1817
|
+
),
|
|
1818
|
+
),
|
|
1819
|
+
)
|
|
1820
|
+
_response_json = _response.json()
|
|
1821
|
+
except JSONDecodeError:
|
|
1822
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1823
|
+
except ValidationError as e:
|
|
1824
|
+
raise ParsingError(
|
|
1825
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
1826
|
+
)
|
|
1827
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1828
|
+
|
|
1829
|
+
async def cluster(
|
|
1830
|
+
self,
|
|
1831
|
+
*,
|
|
1832
|
+
zoom_level: int,
|
|
1833
|
+
network_id: typing.Optional[int] = None,
|
|
1834
|
+
token_group_id: typing.Optional[int] = None,
|
|
1835
|
+
bounding_box: typing.Optional[str] = None,
|
|
1836
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1837
|
+
) -> AsyncHttpResponse[ClusterPage]:
|
|
1838
|
+
"""
|
|
1839
|
+
Deprecated: use ``GET /emsp/locations/map``. Kept for one minor version. Groups locations into grid cells sized for the zoom level. A cell lists its location ids when it holds 20 or fewer.
|
|
1840
|
+
|
|
1841
|
+
Parameters
|
|
1842
|
+
----------
|
|
1843
|
+
zoom_level : int
|
|
1844
|
+
Map zoom level (0 = whole world, 22 = street).
|
|
1845
|
+
|
|
1846
|
+
network_id : typing.Optional[int]
|
|
1847
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
1848
|
+
|
|
1849
|
+
token_group_id : typing.Optional[int]
|
|
1850
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
1851
|
+
|
|
1852
|
+
bounding_box : typing.Optional[str]
|
|
1853
|
+
Only locations inside ``min_lon,min_lat,max_lon,max_lat`` (WGS84).
|
|
1854
|
+
|
|
1855
|
+
request_options : typing.Optional[RequestOptions]
|
|
1856
|
+
Request-specific configuration.
|
|
1857
|
+
|
|
1858
|
+
Returns
|
|
1859
|
+
-------
|
|
1860
|
+
AsyncHttpResponse[ClusterPage]
|
|
1861
|
+
The map cells that hold locations.
|
|
1862
|
+
"""
|
|
1863
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1864
|
+
"emsp/locations/clusters",
|
|
1865
|
+
method="GET",
|
|
1866
|
+
params={
|
|
1867
|
+
"zoom_level": zoom_level,
|
|
1868
|
+
"network_id": network_id,
|
|
1869
|
+
"token_group_id": token_group_id,
|
|
1870
|
+
"bounding_box": bounding_box,
|
|
1871
|
+
},
|
|
1872
|
+
request_options=request_options,
|
|
1873
|
+
)
|
|
1874
|
+
try:
|
|
1875
|
+
if 200 <= _response.status_code < 300:
|
|
1876
|
+
_data = typing.cast(
|
|
1877
|
+
ClusterPage,
|
|
1878
|
+
parse_obj_as(
|
|
1879
|
+
type_=ClusterPage, # type: ignore
|
|
1880
|
+
object_=_response.json(),
|
|
1881
|
+
),
|
|
1882
|
+
)
|
|
1883
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1884
|
+
if _response.status_code == 400:
|
|
1885
|
+
raise BadRequestError(
|
|
1886
|
+
headers=dict(_response.headers),
|
|
1887
|
+
body=typing.cast(
|
|
1888
|
+
HttpErrorResponse,
|
|
1889
|
+
parse_obj_as(
|
|
1890
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1891
|
+
object_=_response.json(),
|
|
1892
|
+
),
|
|
1893
|
+
),
|
|
1894
|
+
)
|
|
1895
|
+
if _response.status_code == 401:
|
|
1896
|
+
raise UnauthorizedError(
|
|
1897
|
+
headers=dict(_response.headers),
|
|
1898
|
+
body=typing.cast(
|
|
1899
|
+
HttpErrorResponse,
|
|
1900
|
+
parse_obj_as(
|
|
1901
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1902
|
+
object_=_response.json(),
|
|
1903
|
+
),
|
|
1904
|
+
),
|
|
1905
|
+
)
|
|
1906
|
+
if _response.status_code == 422:
|
|
1907
|
+
raise UnprocessableEntityError(
|
|
1908
|
+
headers=dict(_response.headers),
|
|
1909
|
+
body=typing.cast(
|
|
1910
|
+
HttpValidationError,
|
|
1911
|
+
parse_obj_as(
|
|
1912
|
+
type_=HttpValidationError, # type: ignore
|
|
1913
|
+
object_=_response.json(),
|
|
1914
|
+
),
|
|
1915
|
+
),
|
|
1916
|
+
)
|
|
1917
|
+
if _response.status_code == 429:
|
|
1918
|
+
raise TooManyRequestsError(
|
|
1919
|
+
headers=dict(_response.headers),
|
|
1920
|
+
body=typing.cast(
|
|
1921
|
+
HttpErrorResponse,
|
|
1922
|
+
parse_obj_as(
|
|
1923
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1924
|
+
object_=_response.json(),
|
|
1925
|
+
),
|
|
1926
|
+
),
|
|
1927
|
+
)
|
|
1928
|
+
if _response.status_code == 502:
|
|
1929
|
+
raise BadGatewayError(
|
|
1930
|
+
headers=dict(_response.headers),
|
|
1931
|
+
body=typing.cast(
|
|
1932
|
+
HttpErrorResponse,
|
|
1933
|
+
parse_obj_as(
|
|
1934
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1935
|
+
object_=_response.json(),
|
|
1936
|
+
),
|
|
1937
|
+
),
|
|
1938
|
+
)
|
|
1939
|
+
if _response.status_code == 504:
|
|
1940
|
+
raise GatewayTimeoutError(
|
|
1941
|
+
headers=dict(_response.headers),
|
|
1942
|
+
body=typing.cast(
|
|
1943
|
+
HttpErrorResponse,
|
|
1944
|
+
parse_obj_as(
|
|
1945
|
+
type_=HttpErrorResponse, # type: ignore
|
|
1946
|
+
object_=_response.json(),
|
|
1947
|
+
),
|
|
1948
|
+
),
|
|
1949
|
+
)
|
|
1950
|
+
_response_json = _response.json()
|
|
1951
|
+
except JSONDecodeError:
|
|
1952
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1953
|
+
except ValidationError as e:
|
|
1954
|
+
raise ParsingError(
|
|
1955
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
1956
|
+
)
|
|
1957
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1958
|
+
|
|
1959
|
+
async def list_facilities(
|
|
1960
|
+
self,
|
|
1961
|
+
*,
|
|
1962
|
+
countries: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1963
|
+
network_id: typing.Optional[int] = None,
|
|
1964
|
+
token_group_id: typing.Optional[int] = None,
|
|
1965
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1966
|
+
) -> AsyncHttpResponse[FacilityPage]:
|
|
1967
|
+
"""
|
|
1968
|
+
Each OCPI facility present, with how many locations have it, most common first.
|
|
1969
|
+
|
|
1970
|
+
Parameters
|
|
1971
|
+
----------
|
|
1972
|
+
countries : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1973
|
+
ISO 3166-1 alpha-3 countries, e.g. ``NLD``. Repeat for more than one.
|
|
1974
|
+
|
|
1975
|
+
network_id : typing.Optional[int]
|
|
1976
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
1977
|
+
|
|
1978
|
+
token_group_id : typing.Optional[int]
|
|
1979
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
1980
|
+
|
|
1981
|
+
request_options : typing.Optional[RequestOptions]
|
|
1982
|
+
Request-specific configuration.
|
|
1983
|
+
|
|
1984
|
+
Returns
|
|
1985
|
+
-------
|
|
1986
|
+
AsyncHttpResponse[FacilityPage]
|
|
1987
|
+
Facility counts, most common first.
|
|
1988
|
+
"""
|
|
1989
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1990
|
+
"emsp/locations/facilities",
|
|
1991
|
+
method="GET",
|
|
1992
|
+
params={
|
|
1993
|
+
"countries": countries,
|
|
1994
|
+
"network_id": network_id,
|
|
1995
|
+
"token_group_id": token_group_id,
|
|
1996
|
+
},
|
|
1997
|
+
request_options=request_options,
|
|
1998
|
+
)
|
|
1999
|
+
try:
|
|
2000
|
+
if 200 <= _response.status_code < 300:
|
|
2001
|
+
_data = typing.cast(
|
|
2002
|
+
FacilityPage,
|
|
2003
|
+
parse_obj_as(
|
|
2004
|
+
type_=FacilityPage, # type: ignore
|
|
2005
|
+
object_=_response.json(),
|
|
2006
|
+
),
|
|
2007
|
+
)
|
|
2008
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2009
|
+
if _response.status_code == 400:
|
|
2010
|
+
raise BadRequestError(
|
|
2011
|
+
headers=dict(_response.headers),
|
|
2012
|
+
body=typing.cast(
|
|
2013
|
+
HttpErrorResponse,
|
|
2014
|
+
parse_obj_as(
|
|
2015
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2016
|
+
object_=_response.json(),
|
|
2017
|
+
),
|
|
2018
|
+
),
|
|
2019
|
+
)
|
|
2020
|
+
if _response.status_code == 401:
|
|
2021
|
+
raise UnauthorizedError(
|
|
2022
|
+
headers=dict(_response.headers),
|
|
2023
|
+
body=typing.cast(
|
|
2024
|
+
HttpErrorResponse,
|
|
2025
|
+
parse_obj_as(
|
|
2026
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2027
|
+
object_=_response.json(),
|
|
2028
|
+
),
|
|
2029
|
+
),
|
|
2030
|
+
)
|
|
2031
|
+
if _response.status_code == 422:
|
|
2032
|
+
raise UnprocessableEntityError(
|
|
2033
|
+
headers=dict(_response.headers),
|
|
2034
|
+
body=typing.cast(
|
|
2035
|
+
HttpValidationError,
|
|
2036
|
+
parse_obj_as(
|
|
2037
|
+
type_=HttpValidationError, # type: ignore
|
|
2038
|
+
object_=_response.json(),
|
|
2039
|
+
),
|
|
2040
|
+
),
|
|
2041
|
+
)
|
|
2042
|
+
if _response.status_code == 429:
|
|
2043
|
+
raise TooManyRequestsError(
|
|
2044
|
+
headers=dict(_response.headers),
|
|
2045
|
+
body=typing.cast(
|
|
2046
|
+
HttpErrorResponse,
|
|
2047
|
+
parse_obj_as(
|
|
2048
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2049
|
+
object_=_response.json(),
|
|
2050
|
+
),
|
|
2051
|
+
),
|
|
2052
|
+
)
|
|
2053
|
+
if _response.status_code == 502:
|
|
2054
|
+
raise BadGatewayError(
|
|
2055
|
+
headers=dict(_response.headers),
|
|
2056
|
+
body=typing.cast(
|
|
2057
|
+
HttpErrorResponse,
|
|
2058
|
+
parse_obj_as(
|
|
2059
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2060
|
+
object_=_response.json(),
|
|
2061
|
+
),
|
|
2062
|
+
),
|
|
2063
|
+
)
|
|
2064
|
+
if _response.status_code == 504:
|
|
2065
|
+
raise GatewayTimeoutError(
|
|
2066
|
+
headers=dict(_response.headers),
|
|
2067
|
+
body=typing.cast(
|
|
2068
|
+
HttpErrorResponse,
|
|
2069
|
+
parse_obj_as(
|
|
2070
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2071
|
+
object_=_response.json(),
|
|
2072
|
+
),
|
|
2073
|
+
),
|
|
2074
|
+
)
|
|
2075
|
+
_response_json = _response.json()
|
|
2076
|
+
except JSONDecodeError:
|
|
2077
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2078
|
+
except ValidationError as e:
|
|
2079
|
+
raise ParsingError(
|
|
2080
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
2081
|
+
)
|
|
2082
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2083
|
+
|
|
2084
|
+
async def map_(
|
|
2085
|
+
self,
|
|
2086
|
+
*,
|
|
2087
|
+
bbox: str,
|
|
2088
|
+
zoom: int,
|
|
2089
|
+
connector_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
2090
|
+
cpo_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
2091
|
+
network_id: typing.Optional[int] = None,
|
|
2092
|
+
token_group_id: typing.Optional[int] = None,
|
|
2093
|
+
min_power: typing.Optional[float] = None,
|
|
2094
|
+
available_only: typing.Optional[bool] = None,
|
|
2095
|
+
own: typing.Optional[bool] = None,
|
|
2096
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2097
|
+
) -> AsyncHttpResponse[MapPage]:
|
|
2098
|
+
"""
|
|
2099
|
+
Pins (up to 500 location summaries) when ``zoom`` >= 13 or the box holds 500 locations or fewer; otherwise clusters on web-mercator tiles. ``tile_versions`` change when a tile's content changes. Answers are cached for a few seconds per workspace and query.
|
|
2100
|
+
|
|
2101
|
+
Parameters
|
|
2102
|
+
----------
|
|
2103
|
+
bbox : str
|
|
2104
|
+
The viewport as ``min_lon,min_lat,max_lon,max_lat`` (WGS84).
|
|
2105
|
+
|
|
2106
|
+
zoom : int
|
|
2107
|
+
Map zoom level (0 = whole world, 22 = street).
|
|
2108
|
+
|
|
2109
|
+
connector_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
2110
|
+
Only these OCPI connector standards, e.g. ``IEC_62196_T2``. Repeat for more than one.
|
|
2111
|
+
|
|
2112
|
+
cpo_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
2113
|
+
Only these CPOs, as ``CC*PID``. Repeat for more than one.
|
|
2114
|
+
|
|
2115
|
+
network_id : typing.Optional[int]
|
|
2116
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
2117
|
+
|
|
2118
|
+
token_group_id : typing.Optional[int]
|
|
2119
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
2120
|
+
|
|
2121
|
+
min_power : typing.Optional[float]
|
|
2122
|
+
Minimum connector power in kW.
|
|
2123
|
+
|
|
2124
|
+
available_only : typing.Optional[bool]
|
|
2125
|
+
Only locations with an EVSE free right now.
|
|
2126
|
+
|
|
2127
|
+
own : typing.Optional[bool]
|
|
2128
|
+
true: only your own OCPP chargers. false: only partner (roaming) locations.
|
|
2129
|
+
|
|
2130
|
+
request_options : typing.Optional[RequestOptions]
|
|
2131
|
+
Request-specific configuration.
|
|
2132
|
+
|
|
2133
|
+
Returns
|
|
2134
|
+
-------
|
|
2135
|
+
AsyncHttpResponse[MapPage]
|
|
2136
|
+
Clusters (zoomed out) or pins (zoomed in) for the viewport.
|
|
2137
|
+
"""
|
|
2138
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2139
|
+
"emsp/locations/map",
|
|
2140
|
+
method="GET",
|
|
2141
|
+
params={
|
|
2142
|
+
"connector_types": connector_types,
|
|
2143
|
+
"cpo_ids": cpo_ids,
|
|
2144
|
+
"bbox": bbox,
|
|
2145
|
+
"zoom": zoom,
|
|
2146
|
+
"network_id": network_id,
|
|
2147
|
+
"token_group_id": token_group_id,
|
|
2148
|
+
"min_power": min_power,
|
|
2149
|
+
"available_only": available_only,
|
|
2150
|
+
"own": own,
|
|
2151
|
+
},
|
|
2152
|
+
request_options=request_options,
|
|
2153
|
+
)
|
|
2154
|
+
try:
|
|
2155
|
+
if 200 <= _response.status_code < 300:
|
|
2156
|
+
_data = typing.cast(
|
|
2157
|
+
MapPage,
|
|
2158
|
+
parse_obj_as(
|
|
2159
|
+
type_=MapPage, # type: ignore
|
|
2160
|
+
object_=_response.json(),
|
|
2161
|
+
),
|
|
2162
|
+
)
|
|
2163
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2164
|
+
if _response.status_code == 400:
|
|
2165
|
+
raise BadRequestError(
|
|
2166
|
+
headers=dict(_response.headers),
|
|
2167
|
+
body=typing.cast(
|
|
2168
|
+
HttpErrorResponse,
|
|
2169
|
+
parse_obj_as(
|
|
2170
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2171
|
+
object_=_response.json(),
|
|
2172
|
+
),
|
|
2173
|
+
),
|
|
2174
|
+
)
|
|
2175
|
+
if _response.status_code == 401:
|
|
2176
|
+
raise UnauthorizedError(
|
|
2177
|
+
headers=dict(_response.headers),
|
|
2178
|
+
body=typing.cast(
|
|
2179
|
+
HttpErrorResponse,
|
|
2180
|
+
parse_obj_as(
|
|
2181
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2182
|
+
object_=_response.json(),
|
|
2183
|
+
),
|
|
2184
|
+
),
|
|
2185
|
+
)
|
|
2186
|
+
if _response.status_code == 422:
|
|
2187
|
+
raise UnprocessableEntityError(
|
|
2188
|
+
headers=dict(_response.headers),
|
|
2189
|
+
body=typing.cast(
|
|
2190
|
+
HttpValidationError,
|
|
2191
|
+
parse_obj_as(
|
|
2192
|
+
type_=HttpValidationError, # type: ignore
|
|
2193
|
+
object_=_response.json(),
|
|
2194
|
+
),
|
|
2195
|
+
),
|
|
2196
|
+
)
|
|
2197
|
+
if _response.status_code == 429:
|
|
2198
|
+
raise TooManyRequestsError(
|
|
2199
|
+
headers=dict(_response.headers),
|
|
2200
|
+
body=typing.cast(
|
|
2201
|
+
HttpErrorResponse,
|
|
2202
|
+
parse_obj_as(
|
|
2203
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2204
|
+
object_=_response.json(),
|
|
2205
|
+
),
|
|
2206
|
+
),
|
|
2207
|
+
)
|
|
2208
|
+
if _response.status_code == 502:
|
|
2209
|
+
raise BadGatewayError(
|
|
2210
|
+
headers=dict(_response.headers),
|
|
2211
|
+
body=typing.cast(
|
|
2212
|
+
HttpErrorResponse,
|
|
2213
|
+
parse_obj_as(
|
|
2214
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2215
|
+
object_=_response.json(),
|
|
2216
|
+
),
|
|
2217
|
+
),
|
|
2218
|
+
)
|
|
2219
|
+
if _response.status_code == 504:
|
|
2220
|
+
raise GatewayTimeoutError(
|
|
2221
|
+
headers=dict(_response.headers),
|
|
2222
|
+
body=typing.cast(
|
|
2223
|
+
HttpErrorResponse,
|
|
2224
|
+
parse_obj_as(
|
|
2225
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2226
|
+
object_=_response.json(),
|
|
2227
|
+
),
|
|
2228
|
+
),
|
|
2229
|
+
)
|
|
2230
|
+
_response_json = _response.json()
|
|
2231
|
+
except JSONDecodeError:
|
|
2232
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2233
|
+
except ValidationError as e:
|
|
2234
|
+
raise ParsingError(
|
|
2235
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
2236
|
+
)
|
|
2237
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2238
|
+
|
|
2239
|
+
async def search(
|
|
2240
|
+
self,
|
|
2241
|
+
*,
|
|
2242
|
+
q: typing.Optional[str] = None,
|
|
2243
|
+
evse_id: typing.Optional[str] = None,
|
|
2244
|
+
lat: typing.Optional[float] = None,
|
|
2245
|
+
lon: typing.Optional[float] = None,
|
|
2246
|
+
limit: typing.Optional[int] = None,
|
|
2247
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2248
|
+
) -> AsyncHttpResponse[LocationList]:
|
|
2249
|
+
"""
|
|
2250
|
+
Text search on name, address and city (``q``), EVSE id lookup (``evse_id``, as printed on the QR code; ``*`` and case are ignored), or both. Nearest first when ``lat`` and ``lon`` are given. Returns at most ``limit`` matches with no next page: refine the query to narrow it.
|
|
2251
|
+
|
|
2252
|
+
Parameters
|
|
2253
|
+
----------
|
|
2254
|
+
q : typing.Optional[str]
|
|
2255
|
+
Text in name, address or city.
|
|
2256
|
+
|
|
2257
|
+
evse_id : typing.Optional[str]
|
|
2258
|
+
eMI3 EVSE id as printed on the QR code, e.g. ``NL*ABC*E1001*1``.
|
|
2259
|
+
|
|
2260
|
+
lat : typing.Optional[float]
|
|
2261
|
+
Your latitude (WGS84); send with lon.
|
|
2262
|
+
|
|
2263
|
+
lon : typing.Optional[float]
|
|
2264
|
+
Your longitude (WGS84); send with lat.
|
|
2265
|
+
|
|
2266
|
+
limit : typing.Optional[int]
|
|
2267
|
+
Maximum results (default 10, max 50).
|
|
2268
|
+
|
|
2269
|
+
request_options : typing.Optional[RequestOptions]
|
|
2270
|
+
Request-specific configuration.
|
|
2271
|
+
|
|
2272
|
+
Returns
|
|
2273
|
+
-------
|
|
2274
|
+
AsyncHttpResponse[LocationList]
|
|
2275
|
+
Matching locations, nearest first when lat/lon are given.
|
|
2276
|
+
"""
|
|
2277
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2278
|
+
"emsp/locations/search",
|
|
2279
|
+
method="GET",
|
|
2280
|
+
params={
|
|
2281
|
+
"q": q,
|
|
2282
|
+
"evse_id": evse_id,
|
|
2283
|
+
"lat": lat,
|
|
2284
|
+
"lon": lon,
|
|
2285
|
+
"limit": limit,
|
|
2286
|
+
},
|
|
2287
|
+
request_options=request_options,
|
|
2288
|
+
)
|
|
2289
|
+
try:
|
|
2290
|
+
if 200 <= _response.status_code < 300:
|
|
2291
|
+
_data = typing.cast(
|
|
2292
|
+
LocationList,
|
|
2293
|
+
parse_obj_as(
|
|
2294
|
+
type_=LocationList, # type: ignore
|
|
2295
|
+
object_=_response.json(),
|
|
2296
|
+
),
|
|
2297
|
+
)
|
|
2298
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2299
|
+
if _response.status_code == 400:
|
|
2300
|
+
raise BadRequestError(
|
|
2301
|
+
headers=dict(_response.headers),
|
|
2302
|
+
body=typing.cast(
|
|
2303
|
+
HttpErrorResponse,
|
|
2304
|
+
parse_obj_as(
|
|
2305
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2306
|
+
object_=_response.json(),
|
|
2307
|
+
),
|
|
2308
|
+
),
|
|
2309
|
+
)
|
|
2310
|
+
if _response.status_code == 401:
|
|
2311
|
+
raise UnauthorizedError(
|
|
2312
|
+
headers=dict(_response.headers),
|
|
2313
|
+
body=typing.cast(
|
|
2314
|
+
HttpErrorResponse,
|
|
2315
|
+
parse_obj_as(
|
|
2316
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2317
|
+
object_=_response.json(),
|
|
2318
|
+
),
|
|
2319
|
+
),
|
|
2320
|
+
)
|
|
2321
|
+
if _response.status_code == 422:
|
|
2322
|
+
raise UnprocessableEntityError(
|
|
2323
|
+
headers=dict(_response.headers),
|
|
2324
|
+
body=typing.cast(
|
|
2325
|
+
HttpValidationError,
|
|
2326
|
+
parse_obj_as(
|
|
2327
|
+
type_=HttpValidationError, # type: ignore
|
|
2328
|
+
object_=_response.json(),
|
|
2329
|
+
),
|
|
2330
|
+
),
|
|
2331
|
+
)
|
|
2332
|
+
if _response.status_code == 429:
|
|
2333
|
+
raise TooManyRequestsError(
|
|
2334
|
+
headers=dict(_response.headers),
|
|
2335
|
+
body=typing.cast(
|
|
2336
|
+
HttpErrorResponse,
|
|
2337
|
+
parse_obj_as(
|
|
2338
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2339
|
+
object_=_response.json(),
|
|
2340
|
+
),
|
|
2341
|
+
),
|
|
2342
|
+
)
|
|
2343
|
+
if _response.status_code == 502:
|
|
2344
|
+
raise BadGatewayError(
|
|
2345
|
+
headers=dict(_response.headers),
|
|
2346
|
+
body=typing.cast(
|
|
2347
|
+
HttpErrorResponse,
|
|
2348
|
+
parse_obj_as(
|
|
2349
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2350
|
+
object_=_response.json(),
|
|
2351
|
+
),
|
|
2352
|
+
),
|
|
2353
|
+
)
|
|
2354
|
+
if _response.status_code == 504:
|
|
2355
|
+
raise GatewayTimeoutError(
|
|
2356
|
+
headers=dict(_response.headers),
|
|
2357
|
+
body=typing.cast(
|
|
2358
|
+
HttpErrorResponse,
|
|
2359
|
+
parse_obj_as(
|
|
2360
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2361
|
+
object_=_response.json(),
|
|
2362
|
+
),
|
|
2363
|
+
),
|
|
2364
|
+
)
|
|
2365
|
+
_response_json = _response.json()
|
|
2366
|
+
except JSONDecodeError:
|
|
2367
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2368
|
+
except ValidationError as e:
|
|
2369
|
+
raise ParsingError(
|
|
2370
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
2371
|
+
)
|
|
2372
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2373
|
+
|
|
2374
|
+
async def route(
|
|
2375
|
+
self,
|
|
2376
|
+
*,
|
|
2377
|
+
polyline: str,
|
|
2378
|
+
connector_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
2379
|
+
cpo_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
2380
|
+
buffer_km: typing.Optional[float] = None,
|
|
2381
|
+
limit: typing.Optional[int] = None,
|
|
2382
|
+
network_id: typing.Optional[int] = None,
|
|
2383
|
+
token_group_id: typing.Optional[int] = None,
|
|
2384
|
+
min_power: typing.Optional[float] = None,
|
|
2385
|
+
available_only: typing.Optional[bool] = None,
|
|
2386
|
+
own: typing.Optional[bool] = None,
|
|
2387
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2388
|
+
) -> AsyncHttpResponse[LocationList]:
|
|
2389
|
+
"""
|
|
2390
|
+
Locations within ``buffer_km`` of an encoded polyline (Google format, precision 5), in order along the route. Same filters as the map. Returns at most ``limit`` locations with no next page: shorten the route or ``buffer_km`` to narrow it.
|
|
2391
|
+
|
|
2392
|
+
Parameters
|
|
2393
|
+
----------
|
|
2394
|
+
polyline : str
|
|
2395
|
+
The route as a Google encoded polyline, precision 5.
|
|
2396
|
+
|
|
2397
|
+
connector_types : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
2398
|
+
Only these OCPI connector standards, e.g. ``IEC_62196_T2``. Repeat for more than one.
|
|
2399
|
+
|
|
2400
|
+
cpo_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
2401
|
+
Only these CPOs, as ``CC*PID``. Repeat for more than one.
|
|
2402
|
+
|
|
2403
|
+
buffer_km : typing.Optional[float]
|
|
2404
|
+
Distance from the route in km (default 2, max 20).
|
|
2405
|
+
|
|
2406
|
+
limit : typing.Optional[int]
|
|
2407
|
+
Maximum results (default 50, max 200).
|
|
2408
|
+
|
|
2409
|
+
network_id : typing.Optional[int]
|
|
2410
|
+
Only locations this network reaches. Not together with token_group_id.
|
|
2411
|
+
|
|
2412
|
+
token_group_id : typing.Optional[int]
|
|
2413
|
+
Only locations the group's networks reach. Not together with network_id.
|
|
2414
|
+
|
|
2415
|
+
min_power : typing.Optional[float]
|
|
2416
|
+
Minimum connector power in kW.
|
|
2417
|
+
|
|
2418
|
+
available_only : typing.Optional[bool]
|
|
2419
|
+
Only locations with an EVSE free right now.
|
|
2420
|
+
|
|
2421
|
+
own : typing.Optional[bool]
|
|
2422
|
+
true: only your own OCPP chargers. false: only partner (roaming) locations.
|
|
2423
|
+
|
|
2424
|
+
request_options : typing.Optional[RequestOptions]
|
|
2425
|
+
Request-specific configuration.
|
|
2426
|
+
|
|
2427
|
+
Returns
|
|
2428
|
+
-------
|
|
2429
|
+
AsyncHttpResponse[LocationList]
|
|
2430
|
+
Locations near the route, in order along it.
|
|
2431
|
+
"""
|
|
2432
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2433
|
+
"emsp/locations/route",
|
|
2434
|
+
method="GET",
|
|
2435
|
+
params={
|
|
2436
|
+
"connector_types": connector_types,
|
|
2437
|
+
"cpo_ids": cpo_ids,
|
|
2438
|
+
"polyline": polyline,
|
|
2439
|
+
"buffer_km": buffer_km,
|
|
2440
|
+
"limit": limit,
|
|
2441
|
+
"network_id": network_id,
|
|
2442
|
+
"token_group_id": token_group_id,
|
|
2443
|
+
"min_power": min_power,
|
|
2444
|
+
"available_only": available_only,
|
|
2445
|
+
"own": own,
|
|
2446
|
+
},
|
|
2447
|
+
request_options=request_options,
|
|
2448
|
+
)
|
|
2449
|
+
try:
|
|
2450
|
+
if 200 <= _response.status_code < 300:
|
|
2451
|
+
_data = typing.cast(
|
|
2452
|
+
LocationList,
|
|
2453
|
+
parse_obj_as(
|
|
2454
|
+
type_=LocationList, # type: ignore
|
|
2455
|
+
object_=_response.json(),
|
|
2456
|
+
),
|
|
2457
|
+
)
|
|
2458
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2459
|
+
if _response.status_code == 400:
|
|
2460
|
+
raise BadRequestError(
|
|
2461
|
+
headers=dict(_response.headers),
|
|
2462
|
+
body=typing.cast(
|
|
2463
|
+
HttpErrorResponse,
|
|
2464
|
+
parse_obj_as(
|
|
2465
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2466
|
+
object_=_response.json(),
|
|
2467
|
+
),
|
|
2468
|
+
),
|
|
2469
|
+
)
|
|
2470
|
+
if _response.status_code == 401:
|
|
2471
|
+
raise UnauthorizedError(
|
|
2472
|
+
headers=dict(_response.headers),
|
|
2473
|
+
body=typing.cast(
|
|
2474
|
+
HttpErrorResponse,
|
|
2475
|
+
parse_obj_as(
|
|
2476
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2477
|
+
object_=_response.json(),
|
|
2478
|
+
),
|
|
2479
|
+
),
|
|
2480
|
+
)
|
|
2481
|
+
if _response.status_code == 422:
|
|
2482
|
+
raise UnprocessableEntityError(
|
|
2483
|
+
headers=dict(_response.headers),
|
|
2484
|
+
body=typing.cast(
|
|
2485
|
+
HttpValidationError,
|
|
2486
|
+
parse_obj_as(
|
|
2487
|
+
type_=HttpValidationError, # type: ignore
|
|
2488
|
+
object_=_response.json(),
|
|
2489
|
+
),
|
|
2490
|
+
),
|
|
2491
|
+
)
|
|
2492
|
+
if _response.status_code == 429:
|
|
2493
|
+
raise TooManyRequestsError(
|
|
2494
|
+
headers=dict(_response.headers),
|
|
2495
|
+
body=typing.cast(
|
|
2496
|
+
HttpErrorResponse,
|
|
2497
|
+
parse_obj_as(
|
|
2498
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2499
|
+
object_=_response.json(),
|
|
2500
|
+
),
|
|
2501
|
+
),
|
|
2502
|
+
)
|
|
2503
|
+
if _response.status_code == 502:
|
|
2504
|
+
raise BadGatewayError(
|
|
2505
|
+
headers=dict(_response.headers),
|
|
2506
|
+
body=typing.cast(
|
|
2507
|
+
HttpErrorResponse,
|
|
2508
|
+
parse_obj_as(
|
|
2509
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2510
|
+
object_=_response.json(),
|
|
2511
|
+
),
|
|
2512
|
+
),
|
|
2513
|
+
)
|
|
2514
|
+
if _response.status_code == 504:
|
|
2515
|
+
raise GatewayTimeoutError(
|
|
2516
|
+
headers=dict(_response.headers),
|
|
2517
|
+
body=typing.cast(
|
|
2518
|
+
HttpErrorResponse,
|
|
2519
|
+
parse_obj_as(
|
|
2520
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2521
|
+
object_=_response.json(),
|
|
2522
|
+
),
|
|
2523
|
+
),
|
|
2524
|
+
)
|
|
2525
|
+
_response_json = _response.json()
|
|
2526
|
+
except JSONDecodeError:
|
|
2527
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2528
|
+
except ValidationError as e:
|
|
2529
|
+
raise ParsingError(
|
|
2530
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
2531
|
+
)
|
|
2532
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2533
|
+
|
|
2534
|
+
async def batch(
|
|
2535
|
+
self,
|
|
2536
|
+
*,
|
|
2537
|
+
keys: typing.Optional[typing.Sequence[LocationKeyInput]] = OMIT,
|
|
2538
|
+
uids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
2539
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2540
|
+
) -> AsyncHttpResponse[BatchResponse]:
|
|
2541
|
+
"""
|
|
2542
|
+
Up to 500 locations by OCPI key or by ``uid`` (one of the two). Keys or uids that are unknown or out of scope come back in ``missing``.
|
|
2543
|
+
|
|
2544
|
+
Parameters
|
|
2545
|
+
----------
|
|
2546
|
+
keys : typing.Optional[typing.Sequence[LocationKeyInput]]
|
|
2547
|
+
|
|
2548
|
+
uids : typing.Optional[typing.Sequence[str]]
|
|
2549
|
+
|
|
2550
|
+
request_options : typing.Optional[RequestOptions]
|
|
2551
|
+
Request-specific configuration.
|
|
2552
|
+
|
|
2553
|
+
Returns
|
|
2554
|
+
-------
|
|
2555
|
+
AsyncHttpResponse[BatchResponse]
|
|
2556
|
+
The locations found, and the keys or uids that were not.
|
|
2557
|
+
"""
|
|
2558
|
+
_request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
|
|
2559
|
+
{**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
|
|
2560
|
+
)
|
|
2561
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2562
|
+
"emsp/locations/batch",
|
|
2563
|
+
method="POST",
|
|
2564
|
+
json={
|
|
2565
|
+
"keys": convert_and_respect_annotation_metadata(
|
|
2566
|
+
object_=keys, annotation=typing.Optional[typing.Sequence[LocationKeyInput]], direction="write"
|
|
2567
|
+
),
|
|
2568
|
+
"uids": uids,
|
|
2569
|
+
},
|
|
2570
|
+
headers={
|
|
2571
|
+
"content-type": "application/json",
|
|
2572
|
+
},
|
|
2573
|
+
request_options=_request_options_with_retries_disabled,
|
|
2574
|
+
omit=OMIT,
|
|
2575
|
+
)
|
|
2576
|
+
try:
|
|
2577
|
+
if 200 <= _response.status_code < 300:
|
|
2578
|
+
_data = typing.cast(
|
|
2579
|
+
BatchResponse,
|
|
2580
|
+
parse_obj_as(
|
|
2581
|
+
type_=BatchResponse, # type: ignore
|
|
2582
|
+
object_=_response.json(),
|
|
2583
|
+
),
|
|
2584
|
+
)
|
|
2585
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2586
|
+
if _response.status_code == 400:
|
|
2587
|
+
raise BadRequestError(
|
|
2588
|
+
headers=dict(_response.headers),
|
|
2589
|
+
body=typing.cast(
|
|
2590
|
+
HttpErrorResponse,
|
|
2591
|
+
parse_obj_as(
|
|
2592
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2593
|
+
object_=_response.json(),
|
|
2594
|
+
),
|
|
2595
|
+
),
|
|
2596
|
+
)
|
|
2597
|
+
if _response.status_code == 401:
|
|
2598
|
+
raise UnauthorizedError(
|
|
2599
|
+
headers=dict(_response.headers),
|
|
2600
|
+
body=typing.cast(
|
|
2601
|
+
HttpErrorResponse,
|
|
2602
|
+
parse_obj_as(
|
|
2603
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2604
|
+
object_=_response.json(),
|
|
2605
|
+
),
|
|
2606
|
+
),
|
|
2607
|
+
)
|
|
2608
|
+
if _response.status_code == 422:
|
|
2609
|
+
raise UnprocessableEntityError(
|
|
2610
|
+
headers=dict(_response.headers),
|
|
2611
|
+
body=typing.cast(
|
|
2612
|
+
HttpValidationError,
|
|
2613
|
+
parse_obj_as(
|
|
2614
|
+
type_=HttpValidationError, # type: ignore
|
|
2615
|
+
object_=_response.json(),
|
|
2616
|
+
),
|
|
2617
|
+
),
|
|
2618
|
+
)
|
|
2619
|
+
if _response.status_code == 429:
|
|
2620
|
+
raise TooManyRequestsError(
|
|
2621
|
+
headers=dict(_response.headers),
|
|
2622
|
+
body=typing.cast(
|
|
2623
|
+
HttpErrorResponse,
|
|
2624
|
+
parse_obj_as(
|
|
2625
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2626
|
+
object_=_response.json(),
|
|
2627
|
+
),
|
|
2628
|
+
),
|
|
2629
|
+
)
|
|
2630
|
+
if _response.status_code == 502:
|
|
2631
|
+
raise BadGatewayError(
|
|
2632
|
+
headers=dict(_response.headers),
|
|
2633
|
+
body=typing.cast(
|
|
2634
|
+
HttpErrorResponse,
|
|
2635
|
+
parse_obj_as(
|
|
2636
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2637
|
+
object_=_response.json(),
|
|
2638
|
+
),
|
|
2639
|
+
),
|
|
2640
|
+
)
|
|
2641
|
+
if _response.status_code == 504:
|
|
2642
|
+
raise GatewayTimeoutError(
|
|
2643
|
+
headers=dict(_response.headers),
|
|
2644
|
+
body=typing.cast(
|
|
2645
|
+
HttpErrorResponse,
|
|
2646
|
+
parse_obj_as(
|
|
2647
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2648
|
+
object_=_response.json(),
|
|
2649
|
+
),
|
|
2650
|
+
),
|
|
2651
|
+
)
|
|
2652
|
+
_response_json = _response.json()
|
|
2653
|
+
except JSONDecodeError:
|
|
2654
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2655
|
+
except ValidationError as e:
|
|
2656
|
+
raise ParsingError(
|
|
2657
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
2658
|
+
)
|
|
2659
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2660
|
+
|
|
2661
|
+
async def get_by_uid(
|
|
2662
|
+
self, uid: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
2663
|
+
) -> AsyncHttpResponse[LocationDetail]:
|
|
2664
|
+
"""
|
|
2665
|
+
One location with its EVSEs, connectors and tariff summary, by its stable ``uid``.
|
|
2666
|
+
|
|
2667
|
+
Parameters
|
|
2668
|
+
----------
|
|
2669
|
+
uid : str
|
|
2670
|
+
The location's stable ``uid``.
|
|
2671
|
+
|
|
2672
|
+
request_options : typing.Optional[RequestOptions]
|
|
2673
|
+
Request-specific configuration.
|
|
2674
|
+
|
|
2675
|
+
Returns
|
|
2676
|
+
-------
|
|
2677
|
+
AsyncHttpResponse[LocationDetail]
|
|
2678
|
+
The location with its EVSEs, connectors and tariff summary.
|
|
2679
|
+
"""
|
|
2680
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2681
|
+
f"emsp/locations/by-uid/{encode_path_param(uid)}",
|
|
2682
|
+
method="GET",
|
|
2683
|
+
request_options=request_options,
|
|
2684
|
+
)
|
|
2685
|
+
try:
|
|
2686
|
+
if 200 <= _response.status_code < 300:
|
|
2687
|
+
_data = typing.cast(
|
|
2688
|
+
LocationDetail,
|
|
2689
|
+
parse_obj_as(
|
|
2690
|
+
type_=LocationDetail, # type: ignore
|
|
2691
|
+
object_=_response.json(),
|
|
2692
|
+
),
|
|
2693
|
+
)
|
|
2694
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2695
|
+
if _response.status_code == 401:
|
|
2696
|
+
raise UnauthorizedError(
|
|
2697
|
+
headers=dict(_response.headers),
|
|
2698
|
+
body=typing.cast(
|
|
2699
|
+
HttpErrorResponse,
|
|
2700
|
+
parse_obj_as(
|
|
2701
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2702
|
+
object_=_response.json(),
|
|
2703
|
+
),
|
|
2704
|
+
),
|
|
2705
|
+
)
|
|
2706
|
+
if _response.status_code == 404:
|
|
2707
|
+
raise NotFoundError(
|
|
2708
|
+
headers=dict(_response.headers),
|
|
2709
|
+
body=typing.cast(
|
|
2710
|
+
HttpErrorResponse,
|
|
2711
|
+
parse_obj_as(
|
|
2712
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2713
|
+
object_=_response.json(),
|
|
2714
|
+
),
|
|
2715
|
+
),
|
|
2716
|
+
)
|
|
2717
|
+
if _response.status_code == 422:
|
|
2718
|
+
raise UnprocessableEntityError(
|
|
2719
|
+
headers=dict(_response.headers),
|
|
2720
|
+
body=typing.cast(
|
|
2721
|
+
HttpValidationError,
|
|
2722
|
+
parse_obj_as(
|
|
2723
|
+
type_=HttpValidationError, # type: ignore
|
|
2724
|
+
object_=_response.json(),
|
|
2725
|
+
),
|
|
2726
|
+
),
|
|
2727
|
+
)
|
|
2728
|
+
if _response.status_code == 429:
|
|
2729
|
+
raise TooManyRequestsError(
|
|
2730
|
+
headers=dict(_response.headers),
|
|
2731
|
+
body=typing.cast(
|
|
2732
|
+
HttpErrorResponse,
|
|
2733
|
+
parse_obj_as(
|
|
2734
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2735
|
+
object_=_response.json(),
|
|
2736
|
+
),
|
|
2737
|
+
),
|
|
2738
|
+
)
|
|
2739
|
+
if _response.status_code == 502:
|
|
2740
|
+
raise BadGatewayError(
|
|
2741
|
+
headers=dict(_response.headers),
|
|
2742
|
+
body=typing.cast(
|
|
2743
|
+
HttpErrorResponse,
|
|
2744
|
+
parse_obj_as(
|
|
2745
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2746
|
+
object_=_response.json(),
|
|
2747
|
+
),
|
|
2748
|
+
),
|
|
2749
|
+
)
|
|
2750
|
+
if _response.status_code == 504:
|
|
2751
|
+
raise GatewayTimeoutError(
|
|
2752
|
+
headers=dict(_response.headers),
|
|
2753
|
+
body=typing.cast(
|
|
2754
|
+
HttpErrorResponse,
|
|
2755
|
+
parse_obj_as(
|
|
2756
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2757
|
+
object_=_response.json(),
|
|
2758
|
+
),
|
|
2759
|
+
),
|
|
2760
|
+
)
|
|
2761
|
+
_response_json = _response.json()
|
|
2762
|
+
except JSONDecodeError:
|
|
2763
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2764
|
+
except ValidationError as e:
|
|
2765
|
+
raise ParsingError(
|
|
2766
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
2767
|
+
)
|
|
2768
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2769
|
+
|
|
2770
|
+
async def get(
|
|
2771
|
+
self,
|
|
2772
|
+
location_id: str,
|
|
2773
|
+
*,
|
|
2774
|
+
country_code: str,
|
|
2775
|
+
party_id: str,
|
|
2776
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2777
|
+
) -> AsyncHttpResponse[LocationDetail]:
|
|
2778
|
+
"""
|
|
2779
|
+
One own or partner location with its EVSEs, connectors and tariff summary, addressed by the CPO's country code and party id.
|
|
2780
|
+
|
|
2781
|
+
Parameters
|
|
2782
|
+
----------
|
|
2783
|
+
location_id : str
|
|
2784
|
+
OCPI location id.
|
|
2785
|
+
|
|
2786
|
+
country_code : str
|
|
2787
|
+
The CPO's OCPI country code, e.g. NL.
|
|
2788
|
+
|
|
2789
|
+
party_id : str
|
|
2790
|
+
The CPO's OCPI party id, e.g. ABC.
|
|
2791
|
+
|
|
2792
|
+
request_options : typing.Optional[RequestOptions]
|
|
2793
|
+
Request-specific configuration.
|
|
2794
|
+
|
|
2795
|
+
Returns
|
|
2796
|
+
-------
|
|
2797
|
+
AsyncHttpResponse[LocationDetail]
|
|
2798
|
+
The location with its EVSEs, connectors and tariff summary.
|
|
2799
|
+
"""
|
|
2800
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2801
|
+
f"emsp/locations/by-id/{encode_path_param(location_id)}",
|
|
2802
|
+
method="GET",
|
|
2803
|
+
params={
|
|
2804
|
+
"country_code": country_code,
|
|
2805
|
+
"party_id": party_id,
|
|
2806
|
+
},
|
|
2807
|
+
request_options=request_options,
|
|
2808
|
+
)
|
|
2809
|
+
try:
|
|
2810
|
+
if 200 <= _response.status_code < 300:
|
|
2811
|
+
_data = typing.cast(
|
|
2812
|
+
LocationDetail,
|
|
2813
|
+
parse_obj_as(
|
|
2814
|
+
type_=LocationDetail, # type: ignore
|
|
2815
|
+
object_=_response.json(),
|
|
2816
|
+
),
|
|
2817
|
+
)
|
|
2818
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2819
|
+
if _response.status_code == 401:
|
|
2820
|
+
raise UnauthorizedError(
|
|
2821
|
+
headers=dict(_response.headers),
|
|
2822
|
+
body=typing.cast(
|
|
2823
|
+
HttpErrorResponse,
|
|
2824
|
+
parse_obj_as(
|
|
2825
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2826
|
+
object_=_response.json(),
|
|
2827
|
+
),
|
|
2828
|
+
),
|
|
2829
|
+
)
|
|
2830
|
+
if _response.status_code == 404:
|
|
2831
|
+
raise NotFoundError(
|
|
2832
|
+
headers=dict(_response.headers),
|
|
2833
|
+
body=typing.cast(
|
|
2834
|
+
HttpErrorResponse,
|
|
2835
|
+
parse_obj_as(
|
|
2836
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2837
|
+
object_=_response.json(),
|
|
2838
|
+
),
|
|
2839
|
+
),
|
|
2840
|
+
)
|
|
2841
|
+
if _response.status_code == 409:
|
|
2842
|
+
raise ConflictError(
|
|
2843
|
+
headers=dict(_response.headers),
|
|
2844
|
+
body=typing.cast(
|
|
2845
|
+
HttpErrorResponse,
|
|
2846
|
+
parse_obj_as(
|
|
2847
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2848
|
+
object_=_response.json(),
|
|
2849
|
+
),
|
|
2850
|
+
),
|
|
2851
|
+
)
|
|
2852
|
+
if _response.status_code == 422:
|
|
2853
|
+
raise UnprocessableEntityError(
|
|
2854
|
+
headers=dict(_response.headers),
|
|
2855
|
+
body=typing.cast(
|
|
2856
|
+
HttpValidationError,
|
|
2857
|
+
parse_obj_as(
|
|
2858
|
+
type_=HttpValidationError, # type: ignore
|
|
2859
|
+
object_=_response.json(),
|
|
2860
|
+
),
|
|
2861
|
+
),
|
|
2862
|
+
)
|
|
2863
|
+
if _response.status_code == 429:
|
|
2864
|
+
raise TooManyRequestsError(
|
|
2865
|
+
headers=dict(_response.headers),
|
|
2866
|
+
body=typing.cast(
|
|
2867
|
+
HttpErrorResponse,
|
|
2868
|
+
parse_obj_as(
|
|
2869
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2870
|
+
object_=_response.json(),
|
|
2871
|
+
),
|
|
2872
|
+
),
|
|
2873
|
+
)
|
|
2874
|
+
if _response.status_code == 502:
|
|
2875
|
+
raise BadGatewayError(
|
|
2876
|
+
headers=dict(_response.headers),
|
|
2877
|
+
body=typing.cast(
|
|
2878
|
+
HttpErrorResponse,
|
|
2879
|
+
parse_obj_as(
|
|
2880
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2881
|
+
object_=_response.json(),
|
|
2882
|
+
),
|
|
2883
|
+
),
|
|
2884
|
+
)
|
|
2885
|
+
if _response.status_code == 504:
|
|
2886
|
+
raise GatewayTimeoutError(
|
|
2887
|
+
headers=dict(_response.headers),
|
|
2888
|
+
body=typing.cast(
|
|
2889
|
+
HttpErrorResponse,
|
|
2890
|
+
parse_obj_as(
|
|
2891
|
+
type_=HttpErrorResponse, # type: ignore
|
|
2892
|
+
object_=_response.json(),
|
|
2893
|
+
),
|
|
2894
|
+
),
|
|
2895
|
+
)
|
|
2896
|
+
_response_json = _response.json()
|
|
2897
|
+
except JSONDecodeError:
|
|
2898
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2899
|
+
except ValidationError as e:
|
|
2900
|
+
raise ParsingError(
|
|
2901
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
2902
|
+
)
|
|
2903
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|