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,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, Mapping, Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]:
|
|
7
|
+
new: Dict[str, Any] = {}
|
|
8
|
+
for key, value in original.items():
|
|
9
|
+
if value is not None:
|
|
10
|
+
new[key] = value
|
|
11
|
+
return new
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
from typing import NotRequired # type: ignore
|
|
7
|
+
except ImportError:
|
|
8
|
+
from typing_extensions import NotRequired
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RequestOptions(typing.TypedDict, total=False):
|
|
12
|
+
"""
|
|
13
|
+
Additional options for request-specific configuration when calling APIs via the SDK.
|
|
14
|
+
This is used primarily as an optional final parameter for service functions.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
- timeout_in_seconds: int. The number of seconds to await an API call before timing out.
|
|
18
|
+
|
|
19
|
+
- max_retries: int. The max number of retries to attempt if the API call fails.
|
|
20
|
+
|
|
21
|
+
- additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict
|
|
22
|
+
|
|
23
|
+
- additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict
|
|
24
|
+
|
|
25
|
+
- additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict
|
|
26
|
+
|
|
27
|
+
- chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
timeout_in_seconds: NotRequired[int]
|
|
31
|
+
max_retries: NotRequired[int]
|
|
32
|
+
additional_headers: NotRequired[typing.Dict[str, typing.Any]]
|
|
33
|
+
additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
|
34
|
+
additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
|
35
|
+
chunk_size: NotRequired[int]
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import collections
|
|
4
|
+
import inspect
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
import pydantic
|
|
8
|
+
import typing_extensions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FieldMetadata:
|
|
12
|
+
"""
|
|
13
|
+
Metadata class used to annotate fields to provide additional information.
|
|
14
|
+
|
|
15
|
+
Example:
|
|
16
|
+
class MyDict(TypedDict):
|
|
17
|
+
field: typing.Annotated[str, FieldMetadata(alias="field_name")]
|
|
18
|
+
|
|
19
|
+
Will serialize: `{"field": "value"}`
|
|
20
|
+
To: `{"field_name": "value"}`
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
alias: str
|
|
24
|
+
|
|
25
|
+
def __init__(self, *, alias: str) -> None:
|
|
26
|
+
self.alias = alias
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def convert_and_respect_annotation_metadata(
|
|
30
|
+
*,
|
|
31
|
+
object_: typing.Any,
|
|
32
|
+
annotation: typing.Any,
|
|
33
|
+
inner_type: typing.Optional[typing.Any] = None,
|
|
34
|
+
direction: typing.Literal["read", "write"],
|
|
35
|
+
) -> typing.Any:
|
|
36
|
+
"""
|
|
37
|
+
Respect the metadata annotations on a field, such as aliasing. This function effectively
|
|
38
|
+
manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for
|
|
39
|
+
TypedDicts, which cannot support aliasing out of the box, and can be extended for additional
|
|
40
|
+
utilities, such as defaults.
|
|
41
|
+
|
|
42
|
+
Parameters
|
|
43
|
+
----------
|
|
44
|
+
object_ : typing.Any
|
|
45
|
+
|
|
46
|
+
annotation : type
|
|
47
|
+
The type we're looking to apply typing annotations from
|
|
48
|
+
|
|
49
|
+
inner_type : typing.Optional[type]
|
|
50
|
+
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
typing.Any
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
if object_ is None:
|
|
57
|
+
return None
|
|
58
|
+
if inner_type is None:
|
|
59
|
+
inner_type = annotation
|
|
60
|
+
|
|
61
|
+
clean_type = _remove_annotations(inner_type)
|
|
62
|
+
# Pydantic models
|
|
63
|
+
if (
|
|
64
|
+
inspect.isclass(clean_type)
|
|
65
|
+
and issubclass(clean_type, pydantic.BaseModel)
|
|
66
|
+
and isinstance(object_, typing.Mapping)
|
|
67
|
+
):
|
|
68
|
+
return _convert_mapping(object_, clean_type, direction)
|
|
69
|
+
# TypedDicts
|
|
70
|
+
if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping):
|
|
71
|
+
return _convert_mapping(object_, clean_type, direction)
|
|
72
|
+
|
|
73
|
+
if (
|
|
74
|
+
typing_extensions.get_origin(clean_type) == typing.Dict
|
|
75
|
+
or typing_extensions.get_origin(clean_type) == dict
|
|
76
|
+
or clean_type == typing.Dict
|
|
77
|
+
) and isinstance(object_, typing.Dict):
|
|
78
|
+
key_type = typing_extensions.get_args(clean_type)[0]
|
|
79
|
+
value_type = typing_extensions.get_args(clean_type)[1]
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
key: convert_and_respect_annotation_metadata(
|
|
83
|
+
object_=value,
|
|
84
|
+
annotation=annotation,
|
|
85
|
+
inner_type=value_type,
|
|
86
|
+
direction=direction,
|
|
87
|
+
)
|
|
88
|
+
for key, value in object_.items()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
# If you're iterating on a string, do not bother to coerce it to a sequence.
|
|
92
|
+
if not isinstance(object_, str):
|
|
93
|
+
if (
|
|
94
|
+
typing_extensions.get_origin(clean_type) == typing.Set
|
|
95
|
+
or typing_extensions.get_origin(clean_type) == set
|
|
96
|
+
or clean_type == typing.Set
|
|
97
|
+
) and isinstance(object_, typing.Set):
|
|
98
|
+
inner_type = typing_extensions.get_args(clean_type)[0]
|
|
99
|
+
return {
|
|
100
|
+
convert_and_respect_annotation_metadata(
|
|
101
|
+
object_=item,
|
|
102
|
+
annotation=annotation,
|
|
103
|
+
inner_type=inner_type,
|
|
104
|
+
direction=direction,
|
|
105
|
+
)
|
|
106
|
+
for item in object_
|
|
107
|
+
}
|
|
108
|
+
elif (
|
|
109
|
+
(
|
|
110
|
+
typing_extensions.get_origin(clean_type) == typing.List
|
|
111
|
+
or typing_extensions.get_origin(clean_type) == list
|
|
112
|
+
or clean_type == typing.List
|
|
113
|
+
)
|
|
114
|
+
and isinstance(object_, typing.List)
|
|
115
|
+
) or (
|
|
116
|
+
(
|
|
117
|
+
typing_extensions.get_origin(clean_type) == typing.Sequence
|
|
118
|
+
or typing_extensions.get_origin(clean_type) == collections.abc.Sequence
|
|
119
|
+
or clean_type == typing.Sequence
|
|
120
|
+
)
|
|
121
|
+
and isinstance(object_, typing.Sequence)
|
|
122
|
+
):
|
|
123
|
+
inner_type = typing_extensions.get_args(clean_type)[0]
|
|
124
|
+
return [
|
|
125
|
+
convert_and_respect_annotation_metadata(
|
|
126
|
+
object_=item,
|
|
127
|
+
annotation=annotation,
|
|
128
|
+
inner_type=inner_type,
|
|
129
|
+
direction=direction,
|
|
130
|
+
)
|
|
131
|
+
for item in object_
|
|
132
|
+
]
|
|
133
|
+
|
|
134
|
+
if typing_extensions.get_origin(clean_type) == typing.Union:
|
|
135
|
+
# We should be able to ~relatively~ safely try to convert keys against all
|
|
136
|
+
# member types in the union, the edge case here is if one member aliases a field
|
|
137
|
+
# of the same name to a different name from another member
|
|
138
|
+
# Or if another member aliases a field of the same name that another member does not.
|
|
139
|
+
for member in typing_extensions.get_args(clean_type):
|
|
140
|
+
object_ = convert_and_respect_annotation_metadata(
|
|
141
|
+
object_=object_,
|
|
142
|
+
annotation=annotation,
|
|
143
|
+
inner_type=member,
|
|
144
|
+
direction=direction,
|
|
145
|
+
)
|
|
146
|
+
return object_
|
|
147
|
+
|
|
148
|
+
annotated_type = _get_annotation(annotation)
|
|
149
|
+
if annotated_type is None:
|
|
150
|
+
return object_
|
|
151
|
+
|
|
152
|
+
# If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.)
|
|
153
|
+
# Then we can safely call it on the recursive conversion.
|
|
154
|
+
return object_
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def _convert_mapping(
|
|
158
|
+
object_: typing.Mapping[str, object],
|
|
159
|
+
expected_type: typing.Any,
|
|
160
|
+
direction: typing.Literal["read", "write"],
|
|
161
|
+
) -> typing.Mapping[str, object]:
|
|
162
|
+
converted_object: typing.Dict[str, object] = {}
|
|
163
|
+
try:
|
|
164
|
+
annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
|
|
165
|
+
except NameError:
|
|
166
|
+
# The TypedDict contains a circular reference, so
|
|
167
|
+
# we use the __annotations__ attribute directly.
|
|
168
|
+
annotations = getattr(expected_type, "__annotations__", {})
|
|
169
|
+
aliases_to_field_names = _get_alias_to_field_name(annotations)
|
|
170
|
+
for key, value in object_.items():
|
|
171
|
+
if direction == "read" and key in aliases_to_field_names:
|
|
172
|
+
dealiased_key = aliases_to_field_names.get(key)
|
|
173
|
+
if dealiased_key is not None:
|
|
174
|
+
type_ = annotations.get(dealiased_key)
|
|
175
|
+
else:
|
|
176
|
+
type_ = annotations.get(key)
|
|
177
|
+
# Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map
|
|
178
|
+
#
|
|
179
|
+
# So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias
|
|
180
|
+
# then we can just pass the value through as is
|
|
181
|
+
if type_ is None:
|
|
182
|
+
converted_object[key] = value
|
|
183
|
+
elif direction == "read" and key not in aliases_to_field_names:
|
|
184
|
+
converted_object[key] = convert_and_respect_annotation_metadata(
|
|
185
|
+
object_=value, annotation=type_, direction=direction
|
|
186
|
+
)
|
|
187
|
+
else:
|
|
188
|
+
converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = (
|
|
189
|
+
convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction)
|
|
190
|
+
)
|
|
191
|
+
return converted_object
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]:
|
|
195
|
+
maybe_annotated_type = typing_extensions.get_origin(type_)
|
|
196
|
+
if maybe_annotated_type is None:
|
|
197
|
+
return None
|
|
198
|
+
|
|
199
|
+
if maybe_annotated_type == typing_extensions.NotRequired:
|
|
200
|
+
type_ = typing_extensions.get_args(type_)[0]
|
|
201
|
+
maybe_annotated_type = typing_extensions.get_origin(type_)
|
|
202
|
+
|
|
203
|
+
if maybe_annotated_type == typing_extensions.Annotated:
|
|
204
|
+
return type_
|
|
205
|
+
|
|
206
|
+
return None
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def _remove_annotations(type_: typing.Any) -> typing.Any:
|
|
210
|
+
maybe_annotated_type = typing_extensions.get_origin(type_)
|
|
211
|
+
if maybe_annotated_type is None:
|
|
212
|
+
return type_
|
|
213
|
+
|
|
214
|
+
if maybe_annotated_type == typing_extensions.NotRequired:
|
|
215
|
+
return _remove_annotations(typing_extensions.get_args(type_)[0])
|
|
216
|
+
|
|
217
|
+
if maybe_annotated_type == typing_extensions.Annotated:
|
|
218
|
+
return _remove_annotations(typing_extensions.get_args(type_)[0])
|
|
219
|
+
|
|
220
|
+
return type_
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]:
|
|
224
|
+
annotations = typing_extensions.get_type_hints(type_, include_extras=True)
|
|
225
|
+
return _get_alias_to_field_name(annotations)
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]:
|
|
229
|
+
annotations = typing_extensions.get_type_hints(type_, include_extras=True)
|
|
230
|
+
return _get_field_to_alias_name(annotations)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def _get_alias_to_field_name(
|
|
234
|
+
field_to_hint: typing.Dict[str, typing.Any],
|
|
235
|
+
) -> typing.Dict[str, str]:
|
|
236
|
+
aliases = {}
|
|
237
|
+
for field, hint in field_to_hint.items():
|
|
238
|
+
maybe_alias = _get_alias_from_type(hint)
|
|
239
|
+
if maybe_alias is not None:
|
|
240
|
+
aliases[maybe_alias] = field
|
|
241
|
+
return aliases
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def _get_field_to_alias_name(
|
|
245
|
+
field_to_hint: typing.Dict[str, typing.Any],
|
|
246
|
+
) -> typing.Dict[str, str]:
|
|
247
|
+
aliases = {}
|
|
248
|
+
for field, hint in field_to_hint.items():
|
|
249
|
+
maybe_alias = _get_alias_from_type(hint)
|
|
250
|
+
if maybe_alias is not None:
|
|
251
|
+
aliases[field] = maybe_alias
|
|
252
|
+
return aliases
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]:
|
|
256
|
+
maybe_annotated_type = _get_annotation(type_)
|
|
257
|
+
|
|
258
|
+
if maybe_annotated_type is not None:
|
|
259
|
+
# The actual annotations are 1 onward, the first is the annotated type
|
|
260
|
+
annotations = typing_extensions.get_args(maybe_annotated_type)[1:]
|
|
261
|
+
|
|
262
|
+
for annotation in annotations:
|
|
263
|
+
if isinstance(annotation, FieldMetadata) and annotation.alias is not None:
|
|
264
|
+
return annotation.alias
|
|
265
|
+
return None
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def _alias_key(
|
|
269
|
+
key: str,
|
|
270
|
+
type_: typing.Any,
|
|
271
|
+
direction: typing.Literal["read", "write"],
|
|
272
|
+
aliases_to_field_names: typing.Dict[str, str],
|
|
273
|
+
) -> str:
|
|
274
|
+
if direction == "read":
|
|
275
|
+
return aliases_to_field_names.get(key, key)
|
|
276
|
+
return _get_alias_from_type(type_=type_) or key
|
evcloud/cpo/__init__.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from . import cdrs, charge_points, connectors, evses, health, locations, sessions, tariffs
|
|
6
|
+
from .charge_points import ListChargePointsRequestOcppVersion
|
|
7
|
+
from .sessions import ListSessionsRequestBillingState, ListSessionsRequestStatus
|
|
8
|
+
from .tariffs import (
|
|
9
|
+
ListTariffsRequestType,
|
|
10
|
+
TariffCreateOcpiVersion,
|
|
11
|
+
TariffCreatePreauthorizeAmount,
|
|
12
|
+
TariffPatchPreauthorizeAmount,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"ListChargePointsRequestOcppVersion",
|
|
17
|
+
"ListSessionsRequestBillingState",
|
|
18
|
+
"ListSessionsRequestStatus",
|
|
19
|
+
"ListTariffsRequestType",
|
|
20
|
+
"TariffCreateOcpiVersion",
|
|
21
|
+
"TariffCreatePreauthorizeAmount",
|
|
22
|
+
"TariffPatchPreauthorizeAmount",
|
|
23
|
+
"cdrs",
|
|
24
|
+
"charge_points",
|
|
25
|
+
"connectors",
|
|
26
|
+
"evses",
|
|
27
|
+
"health",
|
|
28
|
+
"locations",
|
|
29
|
+
"sessions",
|
|
30
|
+
"tariffs",
|
|
31
|
+
]
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
+
from ...core.pagination import AsyncPager, SyncPager
|
|
8
|
+
from ...core.request_options import RequestOptions
|
|
9
|
+
from ...types.cdr_out import CdrOut
|
|
10
|
+
from ...types.cdr_page import CdrPage
|
|
11
|
+
from .raw_client import AsyncRawCdrsClient, RawCdrsClient
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class CdrsClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._raw_client = RawCdrsClient(client_wrapper=client_wrapper)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def with_raw_response(self) -> RawCdrsClient:
|
|
20
|
+
"""
|
|
21
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
22
|
+
|
|
23
|
+
Returns
|
|
24
|
+
-------
|
|
25
|
+
RawCdrsClient
|
|
26
|
+
"""
|
|
27
|
+
return self._raw_client
|
|
28
|
+
|
|
29
|
+
def list(
|
|
30
|
+
self,
|
|
31
|
+
*,
|
|
32
|
+
charge_point_id: typing.Optional[str] = None,
|
|
33
|
+
location_id: typing.Optional[str] = None,
|
|
34
|
+
date_from: typing.Optional[dt.datetime] = None,
|
|
35
|
+
date_to: typing.Optional[dt.datetime] = None,
|
|
36
|
+
offset: typing.Optional[int] = None,
|
|
37
|
+
limit: typing.Optional[int] = None,
|
|
38
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
39
|
+
) -> SyncPager[CdrOut, CdrPage]:
|
|
40
|
+
"""
|
|
41
|
+
Charge detail records produced from charger traffic, newest start first, optionally within a time window.
|
|
42
|
+
|
|
43
|
+
Parameters
|
|
44
|
+
----------
|
|
45
|
+
charge_point_id : typing.Optional[str]
|
|
46
|
+
Only this charger (its OCPP identity).
|
|
47
|
+
|
|
48
|
+
location_id : typing.Optional[str]
|
|
49
|
+
Only this OCPI location id.
|
|
50
|
+
|
|
51
|
+
date_from : typing.Optional[dt.datetime]
|
|
52
|
+
Only rows starting at or after this time (inclusive).
|
|
53
|
+
|
|
54
|
+
date_to : typing.Optional[dt.datetime]
|
|
55
|
+
Only rows starting before this time (exclusive).
|
|
56
|
+
|
|
57
|
+
offset : typing.Optional[int]
|
|
58
|
+
Rows to skip. Pass the previous page's ``next_offset`` to continue.
|
|
59
|
+
|
|
60
|
+
limit : typing.Optional[int]
|
|
61
|
+
Maximum rows per page (default 50, max 200).
|
|
62
|
+
|
|
63
|
+
request_options : typing.Optional[RequestOptions]
|
|
64
|
+
Request-specific configuration.
|
|
65
|
+
|
|
66
|
+
Returns
|
|
67
|
+
-------
|
|
68
|
+
SyncPager[CdrOut, CdrPage]
|
|
69
|
+
One page of results; ``next_offset`` is null on the last page.
|
|
70
|
+
|
|
71
|
+
Examples
|
|
72
|
+
--------
|
|
73
|
+
import datetime
|
|
74
|
+
|
|
75
|
+
from evcloud import EvcloudClient
|
|
76
|
+
|
|
77
|
+
client = EvcloudClient(
|
|
78
|
+
token="YOUR_TOKEN",
|
|
79
|
+
)
|
|
80
|
+
response = client.cpo.cdrs.list(
|
|
81
|
+
charge_point_id="CP-AMS-001",
|
|
82
|
+
date_from=datetime.datetime.fromisoformat(
|
|
83
|
+
"2026-09-30 00:00:00+00:00",
|
|
84
|
+
),
|
|
85
|
+
date_to=datetime.datetime.fromisoformat(
|
|
86
|
+
"2026-10-01 00:00:00+00:00",
|
|
87
|
+
),
|
|
88
|
+
limit=50,
|
|
89
|
+
offset=0,
|
|
90
|
+
)
|
|
91
|
+
for item in response:
|
|
92
|
+
yield item
|
|
93
|
+
# alternatively, you can paginate page-by-page
|
|
94
|
+
for page in response.iter_pages():
|
|
95
|
+
yield page
|
|
96
|
+
"""
|
|
97
|
+
return self._raw_client.list(
|
|
98
|
+
charge_point_id=charge_point_id,
|
|
99
|
+
location_id=location_id,
|
|
100
|
+
date_from=date_from,
|
|
101
|
+
date_to=date_to,
|
|
102
|
+
offset=offset,
|
|
103
|
+
limit=limit,
|
|
104
|
+
request_options=request_options,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
def get(
|
|
108
|
+
self,
|
|
109
|
+
cdr_id: str,
|
|
110
|
+
*,
|
|
111
|
+
country_code: typing.Optional[str] = None,
|
|
112
|
+
party_id: typing.Optional[str] = None,
|
|
113
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
114
|
+
) -> CdrOut:
|
|
115
|
+
"""
|
|
116
|
+
One CDR by OCPI id. If two parties use the same id, pass ``country_code`` and ``party_id`` (409 otherwise).
|
|
117
|
+
|
|
118
|
+
Parameters
|
|
119
|
+
----------
|
|
120
|
+
cdr_id : str
|
|
121
|
+
OCPI CDR id.
|
|
122
|
+
|
|
123
|
+
country_code : typing.Optional[str]
|
|
124
|
+
Only this OCPI party country code, e.g. NL.
|
|
125
|
+
|
|
126
|
+
party_id : typing.Optional[str]
|
|
127
|
+
Only this OCPI party id, e.g. OCP.
|
|
128
|
+
|
|
129
|
+
request_options : typing.Optional[RequestOptions]
|
|
130
|
+
Request-specific configuration.
|
|
131
|
+
|
|
132
|
+
Returns
|
|
133
|
+
-------
|
|
134
|
+
CdrOut
|
|
135
|
+
The requested object.
|
|
136
|
+
|
|
137
|
+
Examples
|
|
138
|
+
--------
|
|
139
|
+
from evcloud import EvcloudClient
|
|
140
|
+
|
|
141
|
+
client = EvcloudClient(
|
|
142
|
+
token="YOUR_TOKEN",
|
|
143
|
+
)
|
|
144
|
+
client.cpo.cdrs.get(
|
|
145
|
+
cdr_id="CDR-2026-09-30-0001",
|
|
146
|
+
country_code="NL",
|
|
147
|
+
party_id="OCP",
|
|
148
|
+
)
|
|
149
|
+
"""
|
|
150
|
+
_response = self._raw_client.get(
|
|
151
|
+
cdr_id, country_code=country_code, party_id=party_id, request_options=request_options
|
|
152
|
+
)
|
|
153
|
+
return _response.data
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class AsyncCdrsClient:
|
|
157
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
158
|
+
self._raw_client = AsyncRawCdrsClient(client_wrapper=client_wrapper)
|
|
159
|
+
|
|
160
|
+
@property
|
|
161
|
+
def with_raw_response(self) -> AsyncRawCdrsClient:
|
|
162
|
+
"""
|
|
163
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
164
|
+
|
|
165
|
+
Returns
|
|
166
|
+
-------
|
|
167
|
+
AsyncRawCdrsClient
|
|
168
|
+
"""
|
|
169
|
+
return self._raw_client
|
|
170
|
+
|
|
171
|
+
async def list(
|
|
172
|
+
self,
|
|
173
|
+
*,
|
|
174
|
+
charge_point_id: typing.Optional[str] = None,
|
|
175
|
+
location_id: typing.Optional[str] = None,
|
|
176
|
+
date_from: typing.Optional[dt.datetime] = None,
|
|
177
|
+
date_to: typing.Optional[dt.datetime] = None,
|
|
178
|
+
offset: typing.Optional[int] = None,
|
|
179
|
+
limit: typing.Optional[int] = None,
|
|
180
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
181
|
+
) -> AsyncPager[CdrOut, CdrPage]:
|
|
182
|
+
"""
|
|
183
|
+
Charge detail records produced from charger traffic, newest start first, optionally within a time window.
|
|
184
|
+
|
|
185
|
+
Parameters
|
|
186
|
+
----------
|
|
187
|
+
charge_point_id : typing.Optional[str]
|
|
188
|
+
Only this charger (its OCPP identity).
|
|
189
|
+
|
|
190
|
+
location_id : typing.Optional[str]
|
|
191
|
+
Only this OCPI location id.
|
|
192
|
+
|
|
193
|
+
date_from : typing.Optional[dt.datetime]
|
|
194
|
+
Only rows starting at or after this time (inclusive).
|
|
195
|
+
|
|
196
|
+
date_to : typing.Optional[dt.datetime]
|
|
197
|
+
Only rows starting before this time (exclusive).
|
|
198
|
+
|
|
199
|
+
offset : typing.Optional[int]
|
|
200
|
+
Rows to skip. Pass the previous page's ``next_offset`` to continue.
|
|
201
|
+
|
|
202
|
+
limit : typing.Optional[int]
|
|
203
|
+
Maximum rows per page (default 50, max 200).
|
|
204
|
+
|
|
205
|
+
request_options : typing.Optional[RequestOptions]
|
|
206
|
+
Request-specific configuration.
|
|
207
|
+
|
|
208
|
+
Returns
|
|
209
|
+
-------
|
|
210
|
+
AsyncPager[CdrOut, CdrPage]
|
|
211
|
+
One page of results; ``next_offset`` is null on the last page.
|
|
212
|
+
|
|
213
|
+
Examples
|
|
214
|
+
--------
|
|
215
|
+
import asyncio
|
|
216
|
+
import datetime
|
|
217
|
+
|
|
218
|
+
from evcloud import AsyncEvcloudClient
|
|
219
|
+
|
|
220
|
+
client = AsyncEvcloudClient(
|
|
221
|
+
token="YOUR_TOKEN",
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
async def main() -> None:
|
|
226
|
+
response = await client.cpo.cdrs.list(
|
|
227
|
+
charge_point_id="CP-AMS-001",
|
|
228
|
+
date_from=datetime.datetime.fromisoformat(
|
|
229
|
+
"2026-09-30 00:00:00+00:00",
|
|
230
|
+
),
|
|
231
|
+
date_to=datetime.datetime.fromisoformat(
|
|
232
|
+
"2026-10-01 00:00:00+00:00",
|
|
233
|
+
),
|
|
234
|
+
limit=50,
|
|
235
|
+
offset=0,
|
|
236
|
+
)
|
|
237
|
+
async for item in response:
|
|
238
|
+
yield item
|
|
239
|
+
|
|
240
|
+
# alternatively, you can paginate page-by-page
|
|
241
|
+
async for page in response.iter_pages():
|
|
242
|
+
yield page
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
asyncio.run(main())
|
|
246
|
+
"""
|
|
247
|
+
return await self._raw_client.list(
|
|
248
|
+
charge_point_id=charge_point_id,
|
|
249
|
+
location_id=location_id,
|
|
250
|
+
date_from=date_from,
|
|
251
|
+
date_to=date_to,
|
|
252
|
+
offset=offset,
|
|
253
|
+
limit=limit,
|
|
254
|
+
request_options=request_options,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
async def get(
|
|
258
|
+
self,
|
|
259
|
+
cdr_id: str,
|
|
260
|
+
*,
|
|
261
|
+
country_code: typing.Optional[str] = None,
|
|
262
|
+
party_id: typing.Optional[str] = None,
|
|
263
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
264
|
+
) -> CdrOut:
|
|
265
|
+
"""
|
|
266
|
+
One CDR by OCPI id. If two parties use the same id, pass ``country_code`` and ``party_id`` (409 otherwise).
|
|
267
|
+
|
|
268
|
+
Parameters
|
|
269
|
+
----------
|
|
270
|
+
cdr_id : str
|
|
271
|
+
OCPI CDR id.
|
|
272
|
+
|
|
273
|
+
country_code : typing.Optional[str]
|
|
274
|
+
Only this OCPI party country code, e.g. NL.
|
|
275
|
+
|
|
276
|
+
party_id : typing.Optional[str]
|
|
277
|
+
Only this OCPI party id, e.g. OCP.
|
|
278
|
+
|
|
279
|
+
request_options : typing.Optional[RequestOptions]
|
|
280
|
+
Request-specific configuration.
|
|
281
|
+
|
|
282
|
+
Returns
|
|
283
|
+
-------
|
|
284
|
+
CdrOut
|
|
285
|
+
The requested object.
|
|
286
|
+
|
|
287
|
+
Examples
|
|
288
|
+
--------
|
|
289
|
+
import asyncio
|
|
290
|
+
|
|
291
|
+
from evcloud import AsyncEvcloudClient
|
|
292
|
+
|
|
293
|
+
client = AsyncEvcloudClient(
|
|
294
|
+
token="YOUR_TOKEN",
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
async def main() -> None:
|
|
299
|
+
await client.cpo.cdrs.get(
|
|
300
|
+
cdr_id="CDR-2026-09-30-0001",
|
|
301
|
+
country_code="NL",
|
|
302
|
+
party_id="OCP",
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
asyncio.run(main())
|
|
307
|
+
"""
|
|
308
|
+
_response = await self._raw_client.get(
|
|
309
|
+
cdr_id, country_code=country_code, party_id=party_id, request_options=request_options
|
|
310
|
+
)
|
|
311
|
+
return _response.data
|