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,1298 @@
|
|
|
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.energy_contract import EnergyContract
|
|
10
|
+
from ...types.token_bulk_out import TokenBulkOut
|
|
11
|
+
from ...types.token_create import TokenCreate
|
|
12
|
+
from ...types.token_create_default_profile_type import TokenCreateDefaultProfileType
|
|
13
|
+
from ...types.token_create_ocpi_version import TokenCreateOcpiVersion
|
|
14
|
+
from ...types.token_create_type import TokenCreateType
|
|
15
|
+
from ...types.token_create_whitelist import TokenCreateWhitelist
|
|
16
|
+
from ...types.token_event_out import TokenEventOut
|
|
17
|
+
from ...types.token_event_page import TokenEventPage
|
|
18
|
+
from ...types.token_out import TokenOut
|
|
19
|
+
from ...types.token_page import TokenPage
|
|
20
|
+
from ...types.token_reason import TokenReason
|
|
21
|
+
from .raw_client import AsyncRawTokensClient, RawTokensClient
|
|
22
|
+
from .types.list_tokens_request_status import ListTokensRequestStatus
|
|
23
|
+
from .types.list_tokens_request_type import ListTokensRequestType
|
|
24
|
+
from .types.token_update_default_profile_type import TokenUpdateDefaultProfileType
|
|
25
|
+
from .types.token_update_whitelist import TokenUpdateWhitelist
|
|
26
|
+
|
|
27
|
+
# this is used as the default value for optional parameters
|
|
28
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TokensClient:
|
|
32
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
33
|
+
self._raw_client = RawTokensClient(client_wrapper=client_wrapper)
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def with_raw_response(self) -> RawTokensClient:
|
|
37
|
+
"""
|
|
38
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
39
|
+
|
|
40
|
+
Returns
|
|
41
|
+
-------
|
|
42
|
+
RawTokensClient
|
|
43
|
+
"""
|
|
44
|
+
return self._raw_client
|
|
45
|
+
|
|
46
|
+
def list(
|
|
47
|
+
self,
|
|
48
|
+
*,
|
|
49
|
+
status: typing.Optional[ListTokensRequestStatus] = None,
|
|
50
|
+
type: typing.Optional[ListTokensRequestType] = None,
|
|
51
|
+
search: typing.Optional[str] = None,
|
|
52
|
+
after: typing.Optional[str] = None,
|
|
53
|
+
limit: typing.Optional[int] = None,
|
|
54
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
55
|
+
) -> SyncPager[TokenOut, TokenPage]:
|
|
56
|
+
"""
|
|
57
|
+
Tokens you issued, filtered by status, type or text in uid, contract id or printed number.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
status : typing.Optional[ListTokensRequestStatus]
|
|
62
|
+
Only this status. EXPIRED means ``valid_until`` has passed and the token is not revoked.
|
|
63
|
+
|
|
64
|
+
type : typing.Optional[ListTokensRequestType]
|
|
65
|
+
Only this OCPI token type.
|
|
66
|
+
|
|
67
|
+
search : typing.Optional[str]
|
|
68
|
+
Text in uid, contract id or printed number.
|
|
69
|
+
|
|
70
|
+
after : typing.Optional[str]
|
|
71
|
+
Cursor: the previous page's ``pagination.end_cursor``. Omit it for the first page.
|
|
72
|
+
|
|
73
|
+
limit : typing.Optional[int]
|
|
74
|
+
Maximum rows per page (default 50, max 200).
|
|
75
|
+
|
|
76
|
+
request_options : typing.Optional[RequestOptions]
|
|
77
|
+
Request-specific configuration.
|
|
78
|
+
|
|
79
|
+
Returns
|
|
80
|
+
-------
|
|
81
|
+
SyncPager[TokenOut, TokenPage]
|
|
82
|
+
One page of tokens.
|
|
83
|
+
|
|
84
|
+
Examples
|
|
85
|
+
--------
|
|
86
|
+
from evcloud import EvcloudClient
|
|
87
|
+
|
|
88
|
+
client = EvcloudClient(
|
|
89
|
+
token="YOUR_TOKEN",
|
|
90
|
+
)
|
|
91
|
+
response = client.emsp.tokens.list(
|
|
92
|
+
limit=50,
|
|
93
|
+
status="ACTIVE",
|
|
94
|
+
type="RFID",
|
|
95
|
+
)
|
|
96
|
+
for item in response:
|
|
97
|
+
yield item
|
|
98
|
+
# alternatively, you can paginate page-by-page
|
|
99
|
+
for page in response.iter_pages():
|
|
100
|
+
yield page
|
|
101
|
+
"""
|
|
102
|
+
return self._raw_client.list(
|
|
103
|
+
status=status, type=type, search=search, after=after, limit=limit, request_options=request_options
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
def provision(
|
|
107
|
+
self,
|
|
108
|
+
*,
|
|
109
|
+
idempotency_key: str,
|
|
110
|
+
uid: str,
|
|
111
|
+
type: TokenCreateType,
|
|
112
|
+
contract_id: str,
|
|
113
|
+
issuer: str,
|
|
114
|
+
visual_number: typing.Optional[str] = OMIT,
|
|
115
|
+
group_id: typing.Optional[str] = OMIT,
|
|
116
|
+
whitelist: typing.Optional[TokenCreateWhitelist] = OMIT,
|
|
117
|
+
language: typing.Optional[str] = OMIT,
|
|
118
|
+
valid_from: typing.Optional[dt.datetime] = OMIT,
|
|
119
|
+
valid_until: typing.Optional[dt.datetime] = OMIT,
|
|
120
|
+
country_code: typing.Optional[str] = OMIT,
|
|
121
|
+
party_id: typing.Optional[str] = OMIT,
|
|
122
|
+
ocpi_version: typing.Optional[TokenCreateOcpiVersion] = OMIT,
|
|
123
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
124
|
+
is_roaming: typing.Optional[bool] = OMIT,
|
|
125
|
+
default_profile_type: typing.Optional[TokenCreateDefaultProfileType] = OMIT,
|
|
126
|
+
energy_contract: typing.Optional[EnergyContract] = OMIT,
|
|
127
|
+
auto_activate: typing.Optional[bool] = OMIT,
|
|
128
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
129
|
+
) -> TokenOut:
|
|
130
|
+
"""
|
|
131
|
+
Creates the token as PROVISIONED; with ``auto_activate`` it is pushed to roaming partners and stored ACTIVE. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
132
|
+
|
|
133
|
+
Parameters
|
|
134
|
+
----------
|
|
135
|
+
idempotency_key : str
|
|
136
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
137
|
+
|
|
138
|
+
uid : str
|
|
139
|
+
|
|
140
|
+
type : TokenCreateType
|
|
141
|
+
|
|
142
|
+
contract_id : str
|
|
143
|
+
|
|
144
|
+
issuer : str
|
|
145
|
+
|
|
146
|
+
visual_number : typing.Optional[str]
|
|
147
|
+
|
|
148
|
+
group_id : typing.Optional[str]
|
|
149
|
+
|
|
150
|
+
whitelist : typing.Optional[TokenCreateWhitelist]
|
|
151
|
+
|
|
152
|
+
language : typing.Optional[str]
|
|
153
|
+
|
|
154
|
+
valid_from : typing.Optional[dt.datetime]
|
|
155
|
+
|
|
156
|
+
valid_until : typing.Optional[dt.datetime]
|
|
157
|
+
|
|
158
|
+
country_code : typing.Optional[str]
|
|
159
|
+
|
|
160
|
+
party_id : typing.Optional[str]
|
|
161
|
+
|
|
162
|
+
ocpi_version : typing.Optional[TokenCreateOcpiVersion]
|
|
163
|
+
|
|
164
|
+
metadata : typing.Optional[typing.Dict[str, typing.Any]]
|
|
165
|
+
|
|
166
|
+
is_roaming : typing.Optional[bool]
|
|
167
|
+
|
|
168
|
+
default_profile_type : typing.Optional[TokenCreateDefaultProfileType]
|
|
169
|
+
|
|
170
|
+
energy_contract : typing.Optional[EnergyContract]
|
|
171
|
+
|
|
172
|
+
auto_activate : typing.Optional[bool]
|
|
173
|
+
|
|
174
|
+
request_options : typing.Optional[RequestOptions]
|
|
175
|
+
Request-specific configuration.
|
|
176
|
+
|
|
177
|
+
Returns
|
|
178
|
+
-------
|
|
179
|
+
TokenOut
|
|
180
|
+
The token; ACTIVE when ``auto_activate`` was set, else PROVISIONED.
|
|
181
|
+
|
|
182
|
+
Examples
|
|
183
|
+
--------
|
|
184
|
+
from evcloud import EvcloudClient
|
|
185
|
+
|
|
186
|
+
client = EvcloudClient(
|
|
187
|
+
token="YOUR_TOKEN",
|
|
188
|
+
)
|
|
189
|
+
client.emsp.tokens.provision(
|
|
190
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
191
|
+
uid="04A2B3C4D5E6F7",
|
|
192
|
+
type="RFID",
|
|
193
|
+
contract_id="NL-OCP-C12345678-X",
|
|
194
|
+
issuer="ev-cloud Mobility",
|
|
195
|
+
visual_number="OCP-0001",
|
|
196
|
+
language="nl",
|
|
197
|
+
metadata={"driver_id": "drv-123"},
|
|
198
|
+
auto_activate=True,
|
|
199
|
+
)
|
|
200
|
+
"""
|
|
201
|
+
_response = self._raw_client.provision(
|
|
202
|
+
idempotency_key=idempotency_key,
|
|
203
|
+
uid=uid,
|
|
204
|
+
type=type,
|
|
205
|
+
contract_id=contract_id,
|
|
206
|
+
issuer=issuer,
|
|
207
|
+
visual_number=visual_number,
|
|
208
|
+
group_id=group_id,
|
|
209
|
+
whitelist=whitelist,
|
|
210
|
+
language=language,
|
|
211
|
+
valid_from=valid_from,
|
|
212
|
+
valid_until=valid_until,
|
|
213
|
+
country_code=country_code,
|
|
214
|
+
party_id=party_id,
|
|
215
|
+
ocpi_version=ocpi_version,
|
|
216
|
+
metadata=metadata,
|
|
217
|
+
is_roaming=is_roaming,
|
|
218
|
+
default_profile_type=default_profile_type,
|
|
219
|
+
energy_contract=energy_contract,
|
|
220
|
+
auto_activate=auto_activate,
|
|
221
|
+
request_options=request_options,
|
|
222
|
+
)
|
|
223
|
+
return _response.data
|
|
224
|
+
|
|
225
|
+
def bulk_provision(
|
|
226
|
+
self,
|
|
227
|
+
*,
|
|
228
|
+
idempotency_key: str,
|
|
229
|
+
tokens: typing.Sequence[TokenCreate],
|
|
230
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
231
|
+
) -> TokenBulkOut:
|
|
232
|
+
"""
|
|
233
|
+
The batch is validated and created as a whole. With ``auto_activate`` each token is pushed in turn; a failed push is listed and that token stays PROVISIONED.
|
|
234
|
+
|
|
235
|
+
Parameters
|
|
236
|
+
----------
|
|
237
|
+
idempotency_key : str
|
|
238
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
239
|
+
|
|
240
|
+
tokens : typing.Sequence[TokenCreate]
|
|
241
|
+
|
|
242
|
+
request_options : typing.Optional[RequestOptions]
|
|
243
|
+
Request-specific configuration.
|
|
244
|
+
|
|
245
|
+
Returns
|
|
246
|
+
-------
|
|
247
|
+
TokenBulkOut
|
|
248
|
+
How many tokens were provisioned and activated, and which pushes failed.
|
|
249
|
+
|
|
250
|
+
Examples
|
|
251
|
+
--------
|
|
252
|
+
from evcloud import EvcloudClient, TokenCreate
|
|
253
|
+
|
|
254
|
+
client = EvcloudClient(
|
|
255
|
+
token="YOUR_TOKEN",
|
|
256
|
+
)
|
|
257
|
+
client.emsp.tokens.bulk_provision(
|
|
258
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
259
|
+
tokens=[
|
|
260
|
+
TokenCreate(
|
|
261
|
+
uid="04A2B3C4D5E6F7",
|
|
262
|
+
type="RFID",
|
|
263
|
+
contract_id="NL-OCP-C12345678-X",
|
|
264
|
+
issuer="ev-cloud Mobility",
|
|
265
|
+
visual_number="OCP-0001",
|
|
266
|
+
language="nl",
|
|
267
|
+
metadata={"driver_id": "drv-123"},
|
|
268
|
+
auto_activate=True,
|
|
269
|
+
),
|
|
270
|
+
TokenCreate(
|
|
271
|
+
uid="04A2B3C4D5E6F8",
|
|
272
|
+
type="RFID",
|
|
273
|
+
contract_id="NL-OCP-C12345678-X",
|
|
274
|
+
issuer="ev-cloud Mobility",
|
|
275
|
+
visual_number="OCP-0002",
|
|
276
|
+
language="nl",
|
|
277
|
+
metadata={"driver_id": "drv-123"},
|
|
278
|
+
auto_activate=True,
|
|
279
|
+
),
|
|
280
|
+
],
|
|
281
|
+
)
|
|
282
|
+
"""
|
|
283
|
+
_response = self._raw_client.bulk_provision(
|
|
284
|
+
idempotency_key=idempotency_key, tokens=tokens, request_options=request_options
|
|
285
|
+
)
|
|
286
|
+
return _response.data
|
|
287
|
+
|
|
288
|
+
def get(self, token_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> TokenOut:
|
|
289
|
+
"""
|
|
290
|
+
One token you issued.
|
|
291
|
+
|
|
292
|
+
Parameters
|
|
293
|
+
----------
|
|
294
|
+
token_id : int
|
|
295
|
+
The token's ``id``.
|
|
296
|
+
|
|
297
|
+
request_options : typing.Optional[RequestOptions]
|
|
298
|
+
Request-specific configuration.
|
|
299
|
+
|
|
300
|
+
Returns
|
|
301
|
+
-------
|
|
302
|
+
TokenOut
|
|
303
|
+
The token.
|
|
304
|
+
|
|
305
|
+
Examples
|
|
306
|
+
--------
|
|
307
|
+
from evcloud import EvcloudClient
|
|
308
|
+
|
|
309
|
+
client = EvcloudClient(
|
|
310
|
+
token="YOUR_TOKEN",
|
|
311
|
+
)
|
|
312
|
+
client.emsp.tokens.get(
|
|
313
|
+
token_id=77,
|
|
314
|
+
)
|
|
315
|
+
"""
|
|
316
|
+
_response = self._raw_client.get(token_id, request_options=request_options)
|
|
317
|
+
return _response.data
|
|
318
|
+
|
|
319
|
+
def update(
|
|
320
|
+
self,
|
|
321
|
+
token_id: int,
|
|
322
|
+
*,
|
|
323
|
+
visual_number: typing.Optional[str] = OMIT,
|
|
324
|
+
contract_id: typing.Optional[str] = OMIT,
|
|
325
|
+
issuer: typing.Optional[str] = OMIT,
|
|
326
|
+
language: typing.Optional[str] = OMIT,
|
|
327
|
+
whitelist: typing.Optional[TokenUpdateWhitelist] = OMIT,
|
|
328
|
+
group_id: typing.Optional[str] = OMIT,
|
|
329
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
330
|
+
is_roaming: typing.Optional[bool] = OMIT,
|
|
331
|
+
default_profile_type: typing.Optional[TokenUpdateDefaultProfileType] = OMIT,
|
|
332
|
+
energy_contract: typing.Optional[EnergyContract] = OMIT,
|
|
333
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
334
|
+
) -> TokenOut:
|
|
335
|
+
"""
|
|
336
|
+
Only the fields sent change. ACTIVE and SUSPENDED tokens are pushed to partners again before the change is saved. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
337
|
+
|
|
338
|
+
Parameters
|
|
339
|
+
----------
|
|
340
|
+
token_id : int
|
|
341
|
+
The token's ``id``.
|
|
342
|
+
|
|
343
|
+
visual_number : typing.Optional[str]
|
|
344
|
+
|
|
345
|
+
contract_id : typing.Optional[str]
|
|
346
|
+
|
|
347
|
+
issuer : typing.Optional[str]
|
|
348
|
+
|
|
349
|
+
language : typing.Optional[str]
|
|
350
|
+
|
|
351
|
+
whitelist : typing.Optional[TokenUpdateWhitelist]
|
|
352
|
+
|
|
353
|
+
group_id : typing.Optional[str]
|
|
354
|
+
|
|
355
|
+
metadata : typing.Optional[typing.Dict[str, typing.Any]]
|
|
356
|
+
|
|
357
|
+
is_roaming : typing.Optional[bool]
|
|
358
|
+
|
|
359
|
+
default_profile_type : typing.Optional[TokenUpdateDefaultProfileType]
|
|
360
|
+
|
|
361
|
+
energy_contract : typing.Optional[EnergyContract]
|
|
362
|
+
|
|
363
|
+
request_options : typing.Optional[RequestOptions]
|
|
364
|
+
Request-specific configuration.
|
|
365
|
+
|
|
366
|
+
Returns
|
|
367
|
+
-------
|
|
368
|
+
TokenOut
|
|
369
|
+
The token after the update.
|
|
370
|
+
|
|
371
|
+
Examples
|
|
372
|
+
--------
|
|
373
|
+
from evcloud import EvcloudClient
|
|
374
|
+
|
|
375
|
+
client = EvcloudClient(
|
|
376
|
+
token="YOUR_TOKEN",
|
|
377
|
+
)
|
|
378
|
+
client.emsp.tokens.update(
|
|
379
|
+
token_id=77,
|
|
380
|
+
visual_number="OCP-0002",
|
|
381
|
+
)
|
|
382
|
+
"""
|
|
383
|
+
_response = self._raw_client.update(
|
|
384
|
+
token_id,
|
|
385
|
+
visual_number=visual_number,
|
|
386
|
+
contract_id=contract_id,
|
|
387
|
+
issuer=issuer,
|
|
388
|
+
language=language,
|
|
389
|
+
whitelist=whitelist,
|
|
390
|
+
group_id=group_id,
|
|
391
|
+
metadata=metadata,
|
|
392
|
+
is_roaming=is_roaming,
|
|
393
|
+
default_profile_type=default_profile_type,
|
|
394
|
+
energy_contract=energy_contract,
|
|
395
|
+
request_options=request_options,
|
|
396
|
+
)
|
|
397
|
+
return _response.data
|
|
398
|
+
|
|
399
|
+
def activate(
|
|
400
|
+
self, token_id: int, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
401
|
+
) -> TokenOut:
|
|
402
|
+
"""
|
|
403
|
+
PROVISIONED → ACTIVE: pushed to partners with ``valid: true``. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
404
|
+
|
|
405
|
+
Parameters
|
|
406
|
+
----------
|
|
407
|
+
token_id : int
|
|
408
|
+
The token's ``id``.
|
|
409
|
+
|
|
410
|
+
idempotency_key : str
|
|
411
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
412
|
+
|
|
413
|
+
request_options : typing.Optional[RequestOptions]
|
|
414
|
+
Request-specific configuration.
|
|
415
|
+
|
|
416
|
+
Returns
|
|
417
|
+
-------
|
|
418
|
+
TokenOut
|
|
419
|
+
The token after the change.
|
|
420
|
+
|
|
421
|
+
Examples
|
|
422
|
+
--------
|
|
423
|
+
from evcloud import EvcloudClient
|
|
424
|
+
|
|
425
|
+
client = EvcloudClient(
|
|
426
|
+
token="YOUR_TOKEN",
|
|
427
|
+
)
|
|
428
|
+
client.emsp.tokens.activate(
|
|
429
|
+
token_id=77,
|
|
430
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
431
|
+
)
|
|
432
|
+
"""
|
|
433
|
+
_response = self._raw_client.activate(
|
|
434
|
+
token_id, idempotency_key=idempotency_key, request_options=request_options
|
|
435
|
+
)
|
|
436
|
+
return _response.data
|
|
437
|
+
|
|
438
|
+
def history(
|
|
439
|
+
self,
|
|
440
|
+
token_id: int,
|
|
441
|
+
*,
|
|
442
|
+
after: typing.Optional[str] = None,
|
|
443
|
+
limit: typing.Optional[int] = None,
|
|
444
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
445
|
+
) -> SyncPager[TokenEventOut, TokenEventPage]:
|
|
446
|
+
"""
|
|
447
|
+
Lifecycle changes of the token, newest first.
|
|
448
|
+
|
|
449
|
+
Parameters
|
|
450
|
+
----------
|
|
451
|
+
token_id : int
|
|
452
|
+
The token's ``id``.
|
|
453
|
+
|
|
454
|
+
after : typing.Optional[str]
|
|
455
|
+
Cursor: the previous page's ``pagination.end_cursor``. Omit it for the first page.
|
|
456
|
+
|
|
457
|
+
limit : typing.Optional[int]
|
|
458
|
+
Maximum rows per page (default 50, max 200).
|
|
459
|
+
|
|
460
|
+
request_options : typing.Optional[RequestOptions]
|
|
461
|
+
Request-specific configuration.
|
|
462
|
+
|
|
463
|
+
Returns
|
|
464
|
+
-------
|
|
465
|
+
SyncPager[TokenEventOut, TokenEventPage]
|
|
466
|
+
One page of lifecycle events, newest first.
|
|
467
|
+
|
|
468
|
+
Examples
|
|
469
|
+
--------
|
|
470
|
+
from evcloud import EvcloudClient
|
|
471
|
+
|
|
472
|
+
client = EvcloudClient(
|
|
473
|
+
token="YOUR_TOKEN",
|
|
474
|
+
)
|
|
475
|
+
response = client.emsp.tokens.history(
|
|
476
|
+
token_id=77,
|
|
477
|
+
limit=50,
|
|
478
|
+
)
|
|
479
|
+
for item in response:
|
|
480
|
+
yield item
|
|
481
|
+
# alternatively, you can paginate page-by-page
|
|
482
|
+
for page in response.iter_pages():
|
|
483
|
+
yield page
|
|
484
|
+
"""
|
|
485
|
+
return self._raw_client.history(token_id, after=after, limit=limit, request_options=request_options)
|
|
486
|
+
|
|
487
|
+
def reactivate(
|
|
488
|
+
self, token_id: int, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
489
|
+
) -> TokenOut:
|
|
490
|
+
"""
|
|
491
|
+
SUSPENDED → ACTIVE: pushed to partners with ``valid: true``. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
492
|
+
|
|
493
|
+
Parameters
|
|
494
|
+
----------
|
|
495
|
+
token_id : int
|
|
496
|
+
The token's ``id``.
|
|
497
|
+
|
|
498
|
+
idempotency_key : str
|
|
499
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
500
|
+
|
|
501
|
+
request_options : typing.Optional[RequestOptions]
|
|
502
|
+
Request-specific configuration.
|
|
503
|
+
|
|
504
|
+
Returns
|
|
505
|
+
-------
|
|
506
|
+
TokenOut
|
|
507
|
+
The token after the change.
|
|
508
|
+
|
|
509
|
+
Examples
|
|
510
|
+
--------
|
|
511
|
+
from evcloud import EvcloudClient
|
|
512
|
+
|
|
513
|
+
client = EvcloudClient(
|
|
514
|
+
token="YOUR_TOKEN",
|
|
515
|
+
)
|
|
516
|
+
client.emsp.tokens.reactivate(
|
|
517
|
+
token_id=77,
|
|
518
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
519
|
+
)
|
|
520
|
+
"""
|
|
521
|
+
_response = self._raw_client.reactivate(
|
|
522
|
+
token_id, idempotency_key=idempotency_key, request_options=request_options
|
|
523
|
+
)
|
|
524
|
+
return _response.data
|
|
525
|
+
|
|
526
|
+
def revoke(
|
|
527
|
+
self,
|
|
528
|
+
token_id: int,
|
|
529
|
+
*,
|
|
530
|
+
idempotency_key: str,
|
|
531
|
+
request: typing.Optional[TokenReason] = None,
|
|
532
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
533
|
+
) -> TokenOut:
|
|
534
|
+
"""
|
|
535
|
+
Final: any status except REVOKED. A token partners already have is pushed with ``valid: false`` first. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
536
|
+
|
|
537
|
+
Parameters
|
|
538
|
+
----------
|
|
539
|
+
token_id : int
|
|
540
|
+
The token's ``id``.
|
|
541
|
+
|
|
542
|
+
idempotency_key : str
|
|
543
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
544
|
+
|
|
545
|
+
request : typing.Optional[TokenReason]
|
|
546
|
+
|
|
547
|
+
request_options : typing.Optional[RequestOptions]
|
|
548
|
+
Request-specific configuration.
|
|
549
|
+
|
|
550
|
+
Returns
|
|
551
|
+
-------
|
|
552
|
+
TokenOut
|
|
553
|
+
The token after the change.
|
|
554
|
+
|
|
555
|
+
Examples
|
|
556
|
+
--------
|
|
557
|
+
from evcloud import EvcloudClient, TokenReason
|
|
558
|
+
|
|
559
|
+
client = EvcloudClient(
|
|
560
|
+
token="YOUR_TOKEN",
|
|
561
|
+
)
|
|
562
|
+
client.emsp.tokens.revoke(
|
|
563
|
+
token_id=77,
|
|
564
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
565
|
+
request=TokenReason(
|
|
566
|
+
reason="Contract ended",
|
|
567
|
+
),
|
|
568
|
+
)
|
|
569
|
+
"""
|
|
570
|
+
_response = self._raw_client.revoke(
|
|
571
|
+
token_id, idempotency_key=idempotency_key, request=request, request_options=request_options
|
|
572
|
+
)
|
|
573
|
+
return _response.data
|
|
574
|
+
|
|
575
|
+
def suspend(
|
|
576
|
+
self,
|
|
577
|
+
token_id: int,
|
|
578
|
+
*,
|
|
579
|
+
idempotency_key: str,
|
|
580
|
+
request: typing.Optional[TokenReason] = None,
|
|
581
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
582
|
+
) -> TokenOut:
|
|
583
|
+
"""
|
|
584
|
+
ACTIVE → SUSPENDED: pushed to partners with ``valid: false``. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
585
|
+
|
|
586
|
+
Parameters
|
|
587
|
+
----------
|
|
588
|
+
token_id : int
|
|
589
|
+
The token's ``id``.
|
|
590
|
+
|
|
591
|
+
idempotency_key : str
|
|
592
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
593
|
+
|
|
594
|
+
request : typing.Optional[TokenReason]
|
|
595
|
+
|
|
596
|
+
request_options : typing.Optional[RequestOptions]
|
|
597
|
+
Request-specific configuration.
|
|
598
|
+
|
|
599
|
+
Returns
|
|
600
|
+
-------
|
|
601
|
+
TokenOut
|
|
602
|
+
The token after the change.
|
|
603
|
+
|
|
604
|
+
Examples
|
|
605
|
+
--------
|
|
606
|
+
from evcloud import EvcloudClient, TokenReason
|
|
607
|
+
|
|
608
|
+
client = EvcloudClient(
|
|
609
|
+
token="YOUR_TOKEN",
|
|
610
|
+
)
|
|
611
|
+
client.emsp.tokens.suspend(
|
|
612
|
+
token_id=77,
|
|
613
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
614
|
+
request=TokenReason(
|
|
615
|
+
reason="Reported lost",
|
|
616
|
+
),
|
|
617
|
+
)
|
|
618
|
+
"""
|
|
619
|
+
_response = self._raw_client.suspend(
|
|
620
|
+
token_id, idempotency_key=idempotency_key, request=request, request_options=request_options
|
|
621
|
+
)
|
|
622
|
+
return _response.data
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
class AsyncTokensClient:
|
|
626
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
627
|
+
self._raw_client = AsyncRawTokensClient(client_wrapper=client_wrapper)
|
|
628
|
+
|
|
629
|
+
@property
|
|
630
|
+
def with_raw_response(self) -> AsyncRawTokensClient:
|
|
631
|
+
"""
|
|
632
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
633
|
+
|
|
634
|
+
Returns
|
|
635
|
+
-------
|
|
636
|
+
AsyncRawTokensClient
|
|
637
|
+
"""
|
|
638
|
+
return self._raw_client
|
|
639
|
+
|
|
640
|
+
async def list(
|
|
641
|
+
self,
|
|
642
|
+
*,
|
|
643
|
+
status: typing.Optional[ListTokensRequestStatus] = None,
|
|
644
|
+
type: typing.Optional[ListTokensRequestType] = None,
|
|
645
|
+
search: typing.Optional[str] = None,
|
|
646
|
+
after: typing.Optional[str] = None,
|
|
647
|
+
limit: typing.Optional[int] = None,
|
|
648
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
649
|
+
) -> AsyncPager[TokenOut, TokenPage]:
|
|
650
|
+
"""
|
|
651
|
+
Tokens you issued, filtered by status, type or text in uid, contract id or printed number.
|
|
652
|
+
|
|
653
|
+
Parameters
|
|
654
|
+
----------
|
|
655
|
+
status : typing.Optional[ListTokensRequestStatus]
|
|
656
|
+
Only this status. EXPIRED means ``valid_until`` has passed and the token is not revoked.
|
|
657
|
+
|
|
658
|
+
type : typing.Optional[ListTokensRequestType]
|
|
659
|
+
Only this OCPI token type.
|
|
660
|
+
|
|
661
|
+
search : typing.Optional[str]
|
|
662
|
+
Text in uid, contract id or printed number.
|
|
663
|
+
|
|
664
|
+
after : typing.Optional[str]
|
|
665
|
+
Cursor: the previous page's ``pagination.end_cursor``. Omit it for the first page.
|
|
666
|
+
|
|
667
|
+
limit : typing.Optional[int]
|
|
668
|
+
Maximum rows per page (default 50, max 200).
|
|
669
|
+
|
|
670
|
+
request_options : typing.Optional[RequestOptions]
|
|
671
|
+
Request-specific configuration.
|
|
672
|
+
|
|
673
|
+
Returns
|
|
674
|
+
-------
|
|
675
|
+
AsyncPager[TokenOut, TokenPage]
|
|
676
|
+
One page of tokens.
|
|
677
|
+
|
|
678
|
+
Examples
|
|
679
|
+
--------
|
|
680
|
+
import asyncio
|
|
681
|
+
|
|
682
|
+
from evcloud import AsyncEvcloudClient
|
|
683
|
+
|
|
684
|
+
client = AsyncEvcloudClient(
|
|
685
|
+
token="YOUR_TOKEN",
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
async def main() -> None:
|
|
690
|
+
response = await client.emsp.tokens.list(
|
|
691
|
+
limit=50,
|
|
692
|
+
status="ACTIVE",
|
|
693
|
+
type="RFID",
|
|
694
|
+
)
|
|
695
|
+
async for item in response:
|
|
696
|
+
yield item
|
|
697
|
+
|
|
698
|
+
# alternatively, you can paginate page-by-page
|
|
699
|
+
async for page in response.iter_pages():
|
|
700
|
+
yield page
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
asyncio.run(main())
|
|
704
|
+
"""
|
|
705
|
+
return await self._raw_client.list(
|
|
706
|
+
status=status, type=type, search=search, after=after, limit=limit, request_options=request_options
|
|
707
|
+
)
|
|
708
|
+
|
|
709
|
+
async def provision(
|
|
710
|
+
self,
|
|
711
|
+
*,
|
|
712
|
+
idempotency_key: str,
|
|
713
|
+
uid: str,
|
|
714
|
+
type: TokenCreateType,
|
|
715
|
+
contract_id: str,
|
|
716
|
+
issuer: str,
|
|
717
|
+
visual_number: typing.Optional[str] = OMIT,
|
|
718
|
+
group_id: typing.Optional[str] = OMIT,
|
|
719
|
+
whitelist: typing.Optional[TokenCreateWhitelist] = OMIT,
|
|
720
|
+
language: typing.Optional[str] = OMIT,
|
|
721
|
+
valid_from: typing.Optional[dt.datetime] = OMIT,
|
|
722
|
+
valid_until: typing.Optional[dt.datetime] = OMIT,
|
|
723
|
+
country_code: typing.Optional[str] = OMIT,
|
|
724
|
+
party_id: typing.Optional[str] = OMIT,
|
|
725
|
+
ocpi_version: typing.Optional[TokenCreateOcpiVersion] = OMIT,
|
|
726
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
727
|
+
is_roaming: typing.Optional[bool] = OMIT,
|
|
728
|
+
default_profile_type: typing.Optional[TokenCreateDefaultProfileType] = OMIT,
|
|
729
|
+
energy_contract: typing.Optional[EnergyContract] = OMIT,
|
|
730
|
+
auto_activate: typing.Optional[bool] = OMIT,
|
|
731
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
732
|
+
) -> TokenOut:
|
|
733
|
+
"""
|
|
734
|
+
Creates the token as PROVISIONED; with ``auto_activate`` it is pushed to roaming partners and stored ACTIVE. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
735
|
+
|
|
736
|
+
Parameters
|
|
737
|
+
----------
|
|
738
|
+
idempotency_key : str
|
|
739
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
740
|
+
|
|
741
|
+
uid : str
|
|
742
|
+
|
|
743
|
+
type : TokenCreateType
|
|
744
|
+
|
|
745
|
+
contract_id : str
|
|
746
|
+
|
|
747
|
+
issuer : str
|
|
748
|
+
|
|
749
|
+
visual_number : typing.Optional[str]
|
|
750
|
+
|
|
751
|
+
group_id : typing.Optional[str]
|
|
752
|
+
|
|
753
|
+
whitelist : typing.Optional[TokenCreateWhitelist]
|
|
754
|
+
|
|
755
|
+
language : typing.Optional[str]
|
|
756
|
+
|
|
757
|
+
valid_from : typing.Optional[dt.datetime]
|
|
758
|
+
|
|
759
|
+
valid_until : typing.Optional[dt.datetime]
|
|
760
|
+
|
|
761
|
+
country_code : typing.Optional[str]
|
|
762
|
+
|
|
763
|
+
party_id : typing.Optional[str]
|
|
764
|
+
|
|
765
|
+
ocpi_version : typing.Optional[TokenCreateOcpiVersion]
|
|
766
|
+
|
|
767
|
+
metadata : typing.Optional[typing.Dict[str, typing.Any]]
|
|
768
|
+
|
|
769
|
+
is_roaming : typing.Optional[bool]
|
|
770
|
+
|
|
771
|
+
default_profile_type : typing.Optional[TokenCreateDefaultProfileType]
|
|
772
|
+
|
|
773
|
+
energy_contract : typing.Optional[EnergyContract]
|
|
774
|
+
|
|
775
|
+
auto_activate : typing.Optional[bool]
|
|
776
|
+
|
|
777
|
+
request_options : typing.Optional[RequestOptions]
|
|
778
|
+
Request-specific configuration.
|
|
779
|
+
|
|
780
|
+
Returns
|
|
781
|
+
-------
|
|
782
|
+
TokenOut
|
|
783
|
+
The token; ACTIVE when ``auto_activate`` was set, else PROVISIONED.
|
|
784
|
+
|
|
785
|
+
Examples
|
|
786
|
+
--------
|
|
787
|
+
import asyncio
|
|
788
|
+
|
|
789
|
+
from evcloud import AsyncEvcloudClient
|
|
790
|
+
|
|
791
|
+
client = AsyncEvcloudClient(
|
|
792
|
+
token="YOUR_TOKEN",
|
|
793
|
+
)
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
async def main() -> None:
|
|
797
|
+
await client.emsp.tokens.provision(
|
|
798
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
799
|
+
uid="04A2B3C4D5E6F7",
|
|
800
|
+
type="RFID",
|
|
801
|
+
contract_id="NL-OCP-C12345678-X",
|
|
802
|
+
issuer="ev-cloud Mobility",
|
|
803
|
+
visual_number="OCP-0001",
|
|
804
|
+
language="nl",
|
|
805
|
+
metadata={"driver_id": "drv-123"},
|
|
806
|
+
auto_activate=True,
|
|
807
|
+
)
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
asyncio.run(main())
|
|
811
|
+
"""
|
|
812
|
+
_response = await self._raw_client.provision(
|
|
813
|
+
idempotency_key=idempotency_key,
|
|
814
|
+
uid=uid,
|
|
815
|
+
type=type,
|
|
816
|
+
contract_id=contract_id,
|
|
817
|
+
issuer=issuer,
|
|
818
|
+
visual_number=visual_number,
|
|
819
|
+
group_id=group_id,
|
|
820
|
+
whitelist=whitelist,
|
|
821
|
+
language=language,
|
|
822
|
+
valid_from=valid_from,
|
|
823
|
+
valid_until=valid_until,
|
|
824
|
+
country_code=country_code,
|
|
825
|
+
party_id=party_id,
|
|
826
|
+
ocpi_version=ocpi_version,
|
|
827
|
+
metadata=metadata,
|
|
828
|
+
is_roaming=is_roaming,
|
|
829
|
+
default_profile_type=default_profile_type,
|
|
830
|
+
energy_contract=energy_contract,
|
|
831
|
+
auto_activate=auto_activate,
|
|
832
|
+
request_options=request_options,
|
|
833
|
+
)
|
|
834
|
+
return _response.data
|
|
835
|
+
|
|
836
|
+
async def bulk_provision(
|
|
837
|
+
self,
|
|
838
|
+
*,
|
|
839
|
+
idempotency_key: str,
|
|
840
|
+
tokens: typing.Sequence[TokenCreate],
|
|
841
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
842
|
+
) -> TokenBulkOut:
|
|
843
|
+
"""
|
|
844
|
+
The batch is validated and created as a whole. With ``auto_activate`` each token is pushed in turn; a failed push is listed and that token stays PROVISIONED.
|
|
845
|
+
|
|
846
|
+
Parameters
|
|
847
|
+
----------
|
|
848
|
+
idempotency_key : str
|
|
849
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
850
|
+
|
|
851
|
+
tokens : typing.Sequence[TokenCreate]
|
|
852
|
+
|
|
853
|
+
request_options : typing.Optional[RequestOptions]
|
|
854
|
+
Request-specific configuration.
|
|
855
|
+
|
|
856
|
+
Returns
|
|
857
|
+
-------
|
|
858
|
+
TokenBulkOut
|
|
859
|
+
How many tokens were provisioned and activated, and which pushes failed.
|
|
860
|
+
|
|
861
|
+
Examples
|
|
862
|
+
--------
|
|
863
|
+
import asyncio
|
|
864
|
+
|
|
865
|
+
from evcloud import AsyncEvcloudClient, TokenCreate
|
|
866
|
+
|
|
867
|
+
client = AsyncEvcloudClient(
|
|
868
|
+
token="YOUR_TOKEN",
|
|
869
|
+
)
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
async def main() -> None:
|
|
873
|
+
await client.emsp.tokens.bulk_provision(
|
|
874
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
875
|
+
tokens=[
|
|
876
|
+
TokenCreate(
|
|
877
|
+
uid="04A2B3C4D5E6F7",
|
|
878
|
+
type="RFID",
|
|
879
|
+
contract_id="NL-OCP-C12345678-X",
|
|
880
|
+
issuer="ev-cloud Mobility",
|
|
881
|
+
visual_number="OCP-0001",
|
|
882
|
+
language="nl",
|
|
883
|
+
metadata={"driver_id": "drv-123"},
|
|
884
|
+
auto_activate=True,
|
|
885
|
+
),
|
|
886
|
+
TokenCreate(
|
|
887
|
+
uid="04A2B3C4D5E6F8",
|
|
888
|
+
type="RFID",
|
|
889
|
+
contract_id="NL-OCP-C12345678-X",
|
|
890
|
+
issuer="ev-cloud Mobility",
|
|
891
|
+
visual_number="OCP-0002",
|
|
892
|
+
language="nl",
|
|
893
|
+
metadata={"driver_id": "drv-123"},
|
|
894
|
+
auto_activate=True,
|
|
895
|
+
),
|
|
896
|
+
],
|
|
897
|
+
)
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
asyncio.run(main())
|
|
901
|
+
"""
|
|
902
|
+
_response = await self._raw_client.bulk_provision(
|
|
903
|
+
idempotency_key=idempotency_key, tokens=tokens, request_options=request_options
|
|
904
|
+
)
|
|
905
|
+
return _response.data
|
|
906
|
+
|
|
907
|
+
async def get(self, token_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> TokenOut:
|
|
908
|
+
"""
|
|
909
|
+
One token you issued.
|
|
910
|
+
|
|
911
|
+
Parameters
|
|
912
|
+
----------
|
|
913
|
+
token_id : int
|
|
914
|
+
The token's ``id``.
|
|
915
|
+
|
|
916
|
+
request_options : typing.Optional[RequestOptions]
|
|
917
|
+
Request-specific configuration.
|
|
918
|
+
|
|
919
|
+
Returns
|
|
920
|
+
-------
|
|
921
|
+
TokenOut
|
|
922
|
+
The token.
|
|
923
|
+
|
|
924
|
+
Examples
|
|
925
|
+
--------
|
|
926
|
+
import asyncio
|
|
927
|
+
|
|
928
|
+
from evcloud import AsyncEvcloudClient
|
|
929
|
+
|
|
930
|
+
client = AsyncEvcloudClient(
|
|
931
|
+
token="YOUR_TOKEN",
|
|
932
|
+
)
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
async def main() -> None:
|
|
936
|
+
await client.emsp.tokens.get(
|
|
937
|
+
token_id=77,
|
|
938
|
+
)
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
asyncio.run(main())
|
|
942
|
+
"""
|
|
943
|
+
_response = await self._raw_client.get(token_id, request_options=request_options)
|
|
944
|
+
return _response.data
|
|
945
|
+
|
|
946
|
+
async def update(
|
|
947
|
+
self,
|
|
948
|
+
token_id: int,
|
|
949
|
+
*,
|
|
950
|
+
visual_number: typing.Optional[str] = OMIT,
|
|
951
|
+
contract_id: typing.Optional[str] = OMIT,
|
|
952
|
+
issuer: typing.Optional[str] = OMIT,
|
|
953
|
+
language: typing.Optional[str] = OMIT,
|
|
954
|
+
whitelist: typing.Optional[TokenUpdateWhitelist] = OMIT,
|
|
955
|
+
group_id: typing.Optional[str] = OMIT,
|
|
956
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
|
957
|
+
is_roaming: typing.Optional[bool] = OMIT,
|
|
958
|
+
default_profile_type: typing.Optional[TokenUpdateDefaultProfileType] = OMIT,
|
|
959
|
+
energy_contract: typing.Optional[EnergyContract] = OMIT,
|
|
960
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
961
|
+
) -> TokenOut:
|
|
962
|
+
"""
|
|
963
|
+
Only the fields sent change. ACTIVE and SUSPENDED tokens are pushed to partners again before the change is saved. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
964
|
+
|
|
965
|
+
Parameters
|
|
966
|
+
----------
|
|
967
|
+
token_id : int
|
|
968
|
+
The token's ``id``.
|
|
969
|
+
|
|
970
|
+
visual_number : typing.Optional[str]
|
|
971
|
+
|
|
972
|
+
contract_id : typing.Optional[str]
|
|
973
|
+
|
|
974
|
+
issuer : typing.Optional[str]
|
|
975
|
+
|
|
976
|
+
language : typing.Optional[str]
|
|
977
|
+
|
|
978
|
+
whitelist : typing.Optional[TokenUpdateWhitelist]
|
|
979
|
+
|
|
980
|
+
group_id : typing.Optional[str]
|
|
981
|
+
|
|
982
|
+
metadata : typing.Optional[typing.Dict[str, typing.Any]]
|
|
983
|
+
|
|
984
|
+
is_roaming : typing.Optional[bool]
|
|
985
|
+
|
|
986
|
+
default_profile_type : typing.Optional[TokenUpdateDefaultProfileType]
|
|
987
|
+
|
|
988
|
+
energy_contract : typing.Optional[EnergyContract]
|
|
989
|
+
|
|
990
|
+
request_options : typing.Optional[RequestOptions]
|
|
991
|
+
Request-specific configuration.
|
|
992
|
+
|
|
993
|
+
Returns
|
|
994
|
+
-------
|
|
995
|
+
TokenOut
|
|
996
|
+
The token after the update.
|
|
997
|
+
|
|
998
|
+
Examples
|
|
999
|
+
--------
|
|
1000
|
+
import asyncio
|
|
1001
|
+
|
|
1002
|
+
from evcloud import AsyncEvcloudClient
|
|
1003
|
+
|
|
1004
|
+
client = AsyncEvcloudClient(
|
|
1005
|
+
token="YOUR_TOKEN",
|
|
1006
|
+
)
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
async def main() -> None:
|
|
1010
|
+
await client.emsp.tokens.update(
|
|
1011
|
+
token_id=77,
|
|
1012
|
+
visual_number="OCP-0002",
|
|
1013
|
+
)
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
asyncio.run(main())
|
|
1017
|
+
"""
|
|
1018
|
+
_response = await self._raw_client.update(
|
|
1019
|
+
token_id,
|
|
1020
|
+
visual_number=visual_number,
|
|
1021
|
+
contract_id=contract_id,
|
|
1022
|
+
issuer=issuer,
|
|
1023
|
+
language=language,
|
|
1024
|
+
whitelist=whitelist,
|
|
1025
|
+
group_id=group_id,
|
|
1026
|
+
metadata=metadata,
|
|
1027
|
+
is_roaming=is_roaming,
|
|
1028
|
+
default_profile_type=default_profile_type,
|
|
1029
|
+
energy_contract=energy_contract,
|
|
1030
|
+
request_options=request_options,
|
|
1031
|
+
)
|
|
1032
|
+
return _response.data
|
|
1033
|
+
|
|
1034
|
+
async def activate(
|
|
1035
|
+
self, token_id: int, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
1036
|
+
) -> TokenOut:
|
|
1037
|
+
"""
|
|
1038
|
+
PROVISIONED → ACTIVE: pushed to partners with ``valid: true``. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
1039
|
+
|
|
1040
|
+
Parameters
|
|
1041
|
+
----------
|
|
1042
|
+
token_id : int
|
|
1043
|
+
The token's ``id``.
|
|
1044
|
+
|
|
1045
|
+
idempotency_key : str
|
|
1046
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
1047
|
+
|
|
1048
|
+
request_options : typing.Optional[RequestOptions]
|
|
1049
|
+
Request-specific configuration.
|
|
1050
|
+
|
|
1051
|
+
Returns
|
|
1052
|
+
-------
|
|
1053
|
+
TokenOut
|
|
1054
|
+
The token after the change.
|
|
1055
|
+
|
|
1056
|
+
Examples
|
|
1057
|
+
--------
|
|
1058
|
+
import asyncio
|
|
1059
|
+
|
|
1060
|
+
from evcloud import AsyncEvcloudClient
|
|
1061
|
+
|
|
1062
|
+
client = AsyncEvcloudClient(
|
|
1063
|
+
token="YOUR_TOKEN",
|
|
1064
|
+
)
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
async def main() -> None:
|
|
1068
|
+
await client.emsp.tokens.activate(
|
|
1069
|
+
token_id=77,
|
|
1070
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
1071
|
+
)
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
asyncio.run(main())
|
|
1075
|
+
"""
|
|
1076
|
+
_response = await self._raw_client.activate(
|
|
1077
|
+
token_id, idempotency_key=idempotency_key, request_options=request_options
|
|
1078
|
+
)
|
|
1079
|
+
return _response.data
|
|
1080
|
+
|
|
1081
|
+
async def history(
|
|
1082
|
+
self,
|
|
1083
|
+
token_id: int,
|
|
1084
|
+
*,
|
|
1085
|
+
after: typing.Optional[str] = None,
|
|
1086
|
+
limit: typing.Optional[int] = None,
|
|
1087
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1088
|
+
) -> AsyncPager[TokenEventOut, TokenEventPage]:
|
|
1089
|
+
"""
|
|
1090
|
+
Lifecycle changes of the token, newest first.
|
|
1091
|
+
|
|
1092
|
+
Parameters
|
|
1093
|
+
----------
|
|
1094
|
+
token_id : int
|
|
1095
|
+
The token's ``id``.
|
|
1096
|
+
|
|
1097
|
+
after : typing.Optional[str]
|
|
1098
|
+
Cursor: the previous page's ``pagination.end_cursor``. Omit it for the first page.
|
|
1099
|
+
|
|
1100
|
+
limit : typing.Optional[int]
|
|
1101
|
+
Maximum rows per page (default 50, max 200).
|
|
1102
|
+
|
|
1103
|
+
request_options : typing.Optional[RequestOptions]
|
|
1104
|
+
Request-specific configuration.
|
|
1105
|
+
|
|
1106
|
+
Returns
|
|
1107
|
+
-------
|
|
1108
|
+
AsyncPager[TokenEventOut, TokenEventPage]
|
|
1109
|
+
One page of lifecycle events, newest first.
|
|
1110
|
+
|
|
1111
|
+
Examples
|
|
1112
|
+
--------
|
|
1113
|
+
import asyncio
|
|
1114
|
+
|
|
1115
|
+
from evcloud import AsyncEvcloudClient
|
|
1116
|
+
|
|
1117
|
+
client = AsyncEvcloudClient(
|
|
1118
|
+
token="YOUR_TOKEN",
|
|
1119
|
+
)
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
async def main() -> None:
|
|
1123
|
+
response = await client.emsp.tokens.history(
|
|
1124
|
+
token_id=77,
|
|
1125
|
+
limit=50,
|
|
1126
|
+
)
|
|
1127
|
+
async for item in response:
|
|
1128
|
+
yield item
|
|
1129
|
+
|
|
1130
|
+
# alternatively, you can paginate page-by-page
|
|
1131
|
+
async for page in response.iter_pages():
|
|
1132
|
+
yield page
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
asyncio.run(main())
|
|
1136
|
+
"""
|
|
1137
|
+
return await self._raw_client.history(token_id, after=after, limit=limit, request_options=request_options)
|
|
1138
|
+
|
|
1139
|
+
async def reactivate(
|
|
1140
|
+
self, token_id: int, *, idempotency_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
1141
|
+
) -> TokenOut:
|
|
1142
|
+
"""
|
|
1143
|
+
SUSPENDED → ACTIVE: pushed to partners with ``valid: true``. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
1144
|
+
|
|
1145
|
+
Parameters
|
|
1146
|
+
----------
|
|
1147
|
+
token_id : int
|
|
1148
|
+
The token's ``id``.
|
|
1149
|
+
|
|
1150
|
+
idempotency_key : str
|
|
1151
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
1152
|
+
|
|
1153
|
+
request_options : typing.Optional[RequestOptions]
|
|
1154
|
+
Request-specific configuration.
|
|
1155
|
+
|
|
1156
|
+
Returns
|
|
1157
|
+
-------
|
|
1158
|
+
TokenOut
|
|
1159
|
+
The token after the change.
|
|
1160
|
+
|
|
1161
|
+
Examples
|
|
1162
|
+
--------
|
|
1163
|
+
import asyncio
|
|
1164
|
+
|
|
1165
|
+
from evcloud import AsyncEvcloudClient
|
|
1166
|
+
|
|
1167
|
+
client = AsyncEvcloudClient(
|
|
1168
|
+
token="YOUR_TOKEN",
|
|
1169
|
+
)
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
async def main() -> None:
|
|
1173
|
+
await client.emsp.tokens.reactivate(
|
|
1174
|
+
token_id=77,
|
|
1175
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
1176
|
+
)
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
asyncio.run(main())
|
|
1180
|
+
"""
|
|
1181
|
+
_response = await self._raw_client.reactivate(
|
|
1182
|
+
token_id, idempotency_key=idempotency_key, request_options=request_options
|
|
1183
|
+
)
|
|
1184
|
+
return _response.data
|
|
1185
|
+
|
|
1186
|
+
async def revoke(
|
|
1187
|
+
self,
|
|
1188
|
+
token_id: int,
|
|
1189
|
+
*,
|
|
1190
|
+
idempotency_key: str,
|
|
1191
|
+
request: typing.Optional[TokenReason] = None,
|
|
1192
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1193
|
+
) -> TokenOut:
|
|
1194
|
+
"""
|
|
1195
|
+
Final: any status except REVOKED. A token partners already have is pushed with ``valid: false`` first. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
1196
|
+
|
|
1197
|
+
Parameters
|
|
1198
|
+
----------
|
|
1199
|
+
token_id : int
|
|
1200
|
+
The token's ``id``.
|
|
1201
|
+
|
|
1202
|
+
idempotency_key : str
|
|
1203
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
1204
|
+
|
|
1205
|
+
request : typing.Optional[TokenReason]
|
|
1206
|
+
|
|
1207
|
+
request_options : typing.Optional[RequestOptions]
|
|
1208
|
+
Request-specific configuration.
|
|
1209
|
+
|
|
1210
|
+
Returns
|
|
1211
|
+
-------
|
|
1212
|
+
TokenOut
|
|
1213
|
+
The token after the change.
|
|
1214
|
+
|
|
1215
|
+
Examples
|
|
1216
|
+
--------
|
|
1217
|
+
import asyncio
|
|
1218
|
+
|
|
1219
|
+
from evcloud import AsyncEvcloudClient, TokenReason
|
|
1220
|
+
|
|
1221
|
+
client = AsyncEvcloudClient(
|
|
1222
|
+
token="YOUR_TOKEN",
|
|
1223
|
+
)
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
async def main() -> None:
|
|
1227
|
+
await client.emsp.tokens.revoke(
|
|
1228
|
+
token_id=77,
|
|
1229
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
1230
|
+
request=TokenReason(
|
|
1231
|
+
reason="Contract ended",
|
|
1232
|
+
),
|
|
1233
|
+
)
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
asyncio.run(main())
|
|
1237
|
+
"""
|
|
1238
|
+
_response = await self._raw_client.revoke(
|
|
1239
|
+
token_id, idempotency_key=idempotency_key, request=request, request_options=request_options
|
|
1240
|
+
)
|
|
1241
|
+
return _response.data
|
|
1242
|
+
|
|
1243
|
+
async def suspend(
|
|
1244
|
+
self,
|
|
1245
|
+
token_id: int,
|
|
1246
|
+
*,
|
|
1247
|
+
idempotency_key: str,
|
|
1248
|
+
request: typing.Optional[TokenReason] = None,
|
|
1249
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1250
|
+
) -> TokenOut:
|
|
1251
|
+
"""
|
|
1252
|
+
ACTIVE → SUSPENDED: pushed to partners with ``valid: false``. If the push to roaming partners fails the call answers 502 and the token is left as it was; retry with the same Idempotency-Key.
|
|
1253
|
+
|
|
1254
|
+
Parameters
|
|
1255
|
+
----------
|
|
1256
|
+
token_id : int
|
|
1257
|
+
The token's ``id``.
|
|
1258
|
+
|
|
1259
|
+
idempotency_key : str
|
|
1260
|
+
A unique key you choose for this call, e.g. a UUID. Retrying with the same key returns the first result instead of acting twice.
|
|
1261
|
+
|
|
1262
|
+
request : typing.Optional[TokenReason]
|
|
1263
|
+
|
|
1264
|
+
request_options : typing.Optional[RequestOptions]
|
|
1265
|
+
Request-specific configuration.
|
|
1266
|
+
|
|
1267
|
+
Returns
|
|
1268
|
+
-------
|
|
1269
|
+
TokenOut
|
|
1270
|
+
The token after the change.
|
|
1271
|
+
|
|
1272
|
+
Examples
|
|
1273
|
+
--------
|
|
1274
|
+
import asyncio
|
|
1275
|
+
|
|
1276
|
+
from evcloud import AsyncEvcloudClient, TokenReason
|
|
1277
|
+
|
|
1278
|
+
client = AsyncEvcloudClient(
|
|
1279
|
+
token="YOUR_TOKEN",
|
|
1280
|
+
)
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
async def main() -> None:
|
|
1284
|
+
await client.emsp.tokens.suspend(
|
|
1285
|
+
token_id=77,
|
|
1286
|
+
idempotency_key="5d1f7c2e-8b3a-4e6f-9c0d-1a2b3c4d5e6f",
|
|
1287
|
+
request=TokenReason(
|
|
1288
|
+
reason="Reported lost",
|
|
1289
|
+
),
|
|
1290
|
+
)
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
asyncio.run(main())
|
|
1294
|
+
"""
|
|
1295
|
+
_response = await self._raw_client.suspend(
|
|
1296
|
+
token_id, idempotency_key=idempotency_key, request=request, request_options=request_options
|
|
1297
|
+
)
|
|
1298
|
+
return _response.data
|