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.
Files changed (635) hide show
  1. evcloud/__init__.py +802 -0
  2. evcloud/_default_clients.py +30 -0
  3. evcloud/client.py +200 -0
  4. evcloud/core/__init__.py +67 -0
  5. evcloud/core/api_error.py +23 -0
  6. evcloud/core/client_wrapper.py +108 -0
  7. evcloud/core/datetime_utils.py +70 -0
  8. evcloud/core/file.py +67 -0
  9. evcloud/core/force_multipart.py +18 -0
  10. evcloud/core/http_client.py +840 -0
  11. evcloud/core/http_response.py +59 -0
  12. evcloud/core/http_sse/__init__.py +9 -0
  13. evcloud/core/http_sse/_api.py +112 -0
  14. evcloud/core/http_sse/_decoders.py +61 -0
  15. evcloud/core/http_sse/_exceptions.py +7 -0
  16. evcloud/core/http_sse/_models.py +17 -0
  17. evcloud/core/jsonable_encoder.py +120 -0
  18. evcloud/core/logging.py +107 -0
  19. evcloud/core/pagination.py +82 -0
  20. evcloud/core/parse_error.py +36 -0
  21. evcloud/core/pydantic_utilities.py +634 -0
  22. evcloud/core/query_encoder.py +58 -0
  23. evcloud/core/remove_none_from_dict.py +11 -0
  24. evcloud/core/request_options.py +35 -0
  25. evcloud/core/serialization.py +276 -0
  26. evcloud/cpo/__init__.py +31 -0
  27. evcloud/cpo/cdrs/__init__.py +4 -0
  28. evcloud/cpo/cdrs/client.py +311 -0
  29. evcloud/cpo/cdrs/raw_client.py +592 -0
  30. evcloud/cpo/charge_points/__init__.py +7 -0
  31. evcloud/cpo/charge_points/client.py +1436 -0
  32. evcloud/cpo/charge_points/raw_client.py +2809 -0
  33. evcloud/cpo/charge_points/types/__init__.py +7 -0
  34. evcloud/cpo/charge_points/types/list_charge_points_request_ocpp_version.py +5 -0
  35. evcloud/cpo/client.py +62 -0
  36. evcloud/cpo/connectors/__init__.py +4 -0
  37. evcloud/cpo/connectors/client.py +698 -0
  38. evcloud/cpo/connectors/raw_client.py +1457 -0
  39. evcloud/cpo/evses/__init__.py +4 -0
  40. evcloud/cpo/evses/client.py +691 -0
  41. evcloud/cpo/evses/raw_client.py +1457 -0
  42. evcloud/cpo/health/__init__.py +4 -0
  43. evcloud/cpo/health/client.py +100 -0
  44. evcloud/cpo/health/raw_client.py +192 -0
  45. evcloud/cpo/locations/__init__.py +4 -0
  46. evcloud/cpo/locations/client.py +1021 -0
  47. evcloud/cpo/locations/raw_client.py +1887 -0
  48. evcloud/cpo/raw_client.py +13 -0
  49. evcloud/cpo/sessions/__init__.py +7 -0
  50. evcloud/cpo/sessions/client.py +430 -0
  51. evcloud/cpo/sessions/raw_client.py +889 -0
  52. evcloud/cpo/sessions/types/__init__.py +8 -0
  53. evcloud/cpo/sessions/types/list_sessions_request_billing_state.py +5 -0
  54. evcloud/cpo/sessions/types/list_sessions_request_status.py +7 -0
  55. evcloud/cpo/tariffs/__init__.py +17 -0
  56. evcloud/cpo/tariffs/client.py +1232 -0
  57. evcloud/cpo/tariffs/raw_client.py +2526 -0
  58. evcloud/cpo/tariffs/types/__init__.py +15 -0
  59. evcloud/cpo/tariffs/types/list_tariffs_request_type.py +7 -0
  60. evcloud/cpo/tariffs/types/tariff_create_ocpi_version.py +5 -0
  61. evcloud/cpo/tariffs/types/tariff_create_preauthorize_amount.py +5 -0
  62. evcloud/cpo/tariffs/types/tariff_patch_preauthorize_amount.py +5 -0
  63. evcloud/emsp/__init__.py +55 -0
  64. evcloud/emsp/cdrs/__init__.py +4 -0
  65. evcloud/emsp/cdrs/client.py +300 -0
  66. evcloud/emsp/cdrs/raw_client.py +610 -0
  67. evcloud/emsp/chargers/__init__.py +7 -0
  68. evcloud/emsp/chargers/client.py +167 -0
  69. evcloud/emsp/chargers/raw_client.py +331 -0
  70. evcloud/emsp/chargers/types/__init__.py +11 -0
  71. evcloud/emsp/chargers/types/resolve_chargers_response.py +53 -0
  72. evcloud/emsp/client.py +77 -0
  73. evcloud/emsp/commands/__init__.py +7 -0
  74. evcloud/emsp/commands/client.py +516 -0
  75. evcloud/emsp/commands/raw_client.py +979 -0
  76. evcloud/emsp/commands/types/__init__.py +7 -0
  77. evcloud/emsp/commands/types/send_commands_request_command.py +7 -0
  78. evcloud/emsp/emp_identities/__init__.py +4 -0
  79. evcloud/emsp/emp_identities/client.py +548 -0
  80. evcloud/emsp/emp_identities/raw_client.py +1277 -0
  81. evcloud/emsp/evses/__init__.py +4 -0
  82. evcloud/emsp/evses/client.py +154 -0
  83. evcloud/emsp/evses/raw_client.py +288 -0
  84. evcloud/emsp/health/__init__.py +4 -0
  85. evcloud/emsp/health/client.py +100 -0
  86. evcloud/emsp/health/raw_client.py +192 -0
  87. evcloud/emsp/locations/__init__.py +4 -0
  88. evcloud/emsp/locations/client.py +1386 -0
  89. evcloud/emsp/locations/raw_client.py +2903 -0
  90. evcloud/emsp/networks/__init__.py +7 -0
  91. evcloud/emsp/networks/client.py +1615 -0
  92. evcloud/emsp/networks/raw_client.py +3725 -0
  93. evcloud/emsp/networks/types/__init__.py +9 -0
  94. evcloud/emsp/networks/types/list_networks_request_network_type.py +5 -0
  95. evcloud/emsp/networks/types/list_rules_networks_request_validity.py +5 -0
  96. evcloud/emsp/networks/types/network_rule_create_request_rule_type.py +5 -0
  97. evcloud/emsp/raw_client.py +13 -0
  98. evcloud/emsp/sessions/__init__.py +4 -0
  99. evcloud/emsp/sessions/client.py +300 -0
  100. evcloud/emsp/sessions/raw_client.py +610 -0
  101. evcloud/emsp/tariffs/__init__.py +7 -0
  102. evcloud/emsp/tariffs/client.py +421 -0
  103. evcloud/emsp/tariffs/raw_client.py +883 -0
  104. evcloud/emsp/tariffs/types/__init__.py +8 -0
  105. evcloud/emsp/tariffs/types/estimate_request_kwh.py +5 -0
  106. evcloud/emsp/tariffs/types/estimate_request_minutes.py +5 -0
  107. evcloud/emsp/tenant/__init__.py +4 -0
  108. evcloud/emsp/tenant/client.py +328 -0
  109. evcloud/emsp/tenant/raw_client.py +869 -0
  110. evcloud/emsp/token_groups/__init__.py +7 -0
  111. evcloud/emsp/token_groups/client.py +1256 -0
  112. evcloud/emsp/token_groups/raw_client.py +3288 -0
  113. evcloud/emsp/token_groups/types/__init__.py +7 -0
  114. evcloud/emsp/token_groups/types/remove_token_token_groups_request_type.py +5 -0
  115. evcloud/emsp/tokens/__init__.py +7 -0
  116. evcloud/emsp/tokens/client.py +1298 -0
  117. evcloud/emsp/tokens/raw_client.py +2947 -0
  118. evcloud/emsp/tokens/types/__init__.py +10 -0
  119. evcloud/emsp/tokens/types/list_tokens_request_status.py +7 -0
  120. evcloud/emsp/tokens/types/list_tokens_request_type.py +5 -0
  121. evcloud/emsp/tokens/types/token_update_default_profile_type.py +5 -0
  122. evcloud/emsp/tokens/types/token_update_whitelist.py +5 -0
  123. evcloud/energy/__init__.py +8 -0
  124. evcloud/energy/client.py +47 -0
  125. evcloud/energy/control_requests/__init__.py +7 -0
  126. evcloud/energy/control_requests/client.py +399 -0
  127. evcloud/energy/control_requests/raw_client.py +835 -0
  128. evcloud/energy/control_requests/types/__init__.py +7 -0
  129. evcloud/energy/control_requests/types/list_control_requests_request_result.py +15 -0
  130. evcloud/energy/health/__init__.py +4 -0
  131. evcloud/energy/health/client.py +100 -0
  132. evcloud/energy/health/raw_client.py +192 -0
  133. evcloud/energy/power_measurements/__init__.py +4 -0
  134. evcloud/energy/power_measurements/client.py +254 -0
  135. evcloud/energy/power_measurements/raw_client.py +527 -0
  136. evcloud/energy/raw_client.py +13 -0
  137. evcloud/environment.py +7 -0
  138. evcloud/errors/__init__.py +25 -0
  139. evcloud/errors/bad_gateway_error.py +11 -0
  140. evcloud/errors/bad_request_error.py +11 -0
  141. evcloud/errors/conflict_error.py +11 -0
  142. evcloud/errors/forbidden_error.py +11 -0
  143. evcloud/errors/gateway_timeout_error.py +11 -0
  144. evcloud/errors/not_found_error.py +11 -0
  145. evcloud/errors/too_many_requests_error.py +11 -0
  146. evcloud/errors/unauthorized_error.py +11 -0
  147. evcloud/errors/unprocessable_entity_error.py +11 -0
  148. evcloud/health/__init__.py +4 -0
  149. evcloud/health/client.py +99 -0
  150. evcloud/health/raw_client.py +100 -0
  151. evcloud/ocpi/__init__.py +123 -0
  152. evcloud/ocpi/client.py +56 -0
  153. evcloud/ocpi/cpo_data/__init__.py +31 -0
  154. evcloud/ocpi/cpo_data/client.py +1553 -0
  155. evcloud/ocpi/cpo_data/raw_client.py +3119 -0
  156. evcloud/ocpi/cpo_data/types/__init__.py +29 -0
  157. evcloud/ocpi/cpo_data/types/cancel_reservation_cpo_data_request_version.py +5 -0
  158. evcloud/ocpi/cpo_data/types/create_cdr_cpo_data_request_version.py +5 -0
  159. evcloud/ocpi/cpo_data/types/delete_tariff_cpo_data_request_version.py +5 -0
  160. evcloud/ocpi/cpo_data/types/send_active_charging_profile_cpo_data_request_version.py +5 -0
  161. evcloud/ocpi/cpo_data/types/update_connector_cpo_data_request_version.py +5 -0
  162. evcloud/ocpi/cpo_data/types/update_evse_status_cpo_data_request_version.py +5 -0
  163. evcloud/ocpi/cpo_data/types/update_location_cpo_data_request_version.py +5 -0
  164. evcloud/ocpi/cpo_data/types/update_session_cpo_data_request_version.py +5 -0
  165. evcloud/ocpi/cpo_data/types/upsert_location_cpo_data_request_version.py +5 -0
  166. evcloud/ocpi/cpo_data/types/upsert_session_cpo_data_request_version.py +5 -0
  167. evcloud/ocpi/cpo_data/types/upsert_tariff_cpo_data_request_version.py +5 -0
  168. evcloud/ocpi/credentials/__init__.py +31 -0
  169. evcloud/ocpi/credentials/client.py +750 -0
  170. evcloud/ocpi/credentials/raw_client.py +1537 -0
  171. evcloud/ocpi/credentials/types/__init__.py +29 -0
  172. evcloud/ocpi/credentials/types/partner_versions_pull_request_partner_token_encoding.py +5 -0
  173. evcloud/ocpi/credentials/types/pull_versions_credentials_request_role.py +5 -0
  174. evcloud/ocpi/credentials/types/pull_versions_credentials_request_version.py +5 -0
  175. evcloud/ocpi/credentials/types/rotate_credentials_request_role.py +5 -0
  176. evcloud/ocpi/credentials/types/rotate_credentials_request_version.py +5 -0
  177. evcloud/ocpi/credentials/types/start_handshake_credentials_request_role.py +5 -0
  178. evcloud/ocpi/credentials/types/start_handshake_credentials_request_version.py +5 -0
  179. evcloud/ocpi/credentials/types/status_credentials_request_role.py +5 -0
  180. evcloud/ocpi/credentials/types/status_credentials_request_version.py +5 -0
  181. evcloud/ocpi/credentials/types/unregister_credentials_request_role.py +5 -0
  182. evcloud/ocpi/credentials/types/unregister_credentials_request_version.py +5 -0
  183. evcloud/ocpi/emsp/__init__.py +27 -0
  184. evcloud/ocpi/emsp/client.py +1142 -0
  185. evcloud/ocpi/emsp/raw_client.py +2209 -0
  186. evcloud/ocpi/emsp/types/__init__.py +25 -0
  187. evcloud/ocpi/emsp/types/charging_preferences_request_profile_type.py +5 -0
  188. evcloud/ocpi/emsp/types/clear_charging_profile_emsp_request_version.py +5 -0
  189. evcloud/ocpi/emsp/types/get_active_charging_profile_emsp_request_version.py +5 -0
  190. evcloud/ocpi/emsp/types/send_command_emsp_request_command.py +7 -0
  191. evcloud/ocpi/emsp/types/send_command_emsp_request_version.py +5 -0
  192. evcloud/ocpi/emsp/types/set_charging_preferences_emsp_request_version.py +5 -0
  193. evcloud/ocpi/emsp/types/set_charging_profile_emsp_request_version.py +5 -0
  194. evcloud/ocpi/emsp/types/update_token_emsp_request_version.py +5 -0
  195. evcloud/ocpi/emsp/types/upsert_token_emsp_request_version.py +5 -0
  196. evcloud/ocpi/invites/__init__.py +19 -0
  197. evcloud/ocpi/invites/client.py +385 -0
  198. evcloud/ocpi/invites/raw_client.py +887 -0
  199. evcloud/ocpi/invites/types/__init__.py +17 -0
  200. evcloud/ocpi/invites/types/partner_invite_create_request_gateway_role.py +5 -0
  201. evcloud/ocpi/invites/types/partner_invite_create_request_role.py +5 -0
  202. evcloud/ocpi/invites/types/partner_invite_create_request_version.py +5 -0
  203. evcloud/ocpi/invites/types/partner_invite_update_request_gateway_role.py +5 -0
  204. evcloud/ocpi/invites/types/partner_invite_update_request_version.py +5 -0
  205. evcloud/ocpi/partners/__init__.py +7 -0
  206. evcloud/ocpi/partners/client.py +581 -0
  207. evcloud/ocpi/partners/raw_client.py +1340 -0
  208. evcloud/ocpi/partners/types/__init__.py +8 -0
  209. evcloud/ocpi/partners/types/partner_register_request_ocpi_version.py +5 -0
  210. evcloud/ocpi/partners/types/partner_update_request_ocpi_version.py +5 -0
  211. evcloud/ocpi/raw_client.py +13 -0
  212. evcloud/ocpi/sync/__init__.py +33 -0
  213. evcloud/ocpi/sync/client.py +1701 -0
  214. evcloud/ocpi/sync/raw_client.py +3685 -0
  215. evcloud/ocpi/sync/types/__init__.py +31 -0
  216. evcloud/ocpi/sync/types/pull_cdrs_sync_request_version.py +5 -0
  217. evcloud/ocpi/sync/types/pull_hub_client_info_as_cpo_sync_request_version.py +5 -0
  218. evcloud/ocpi/sync/types/pull_hub_client_info_as_emsp_sync_request_version.py +5 -0
  219. evcloud/ocpi/sync/types/pull_locations_sync_request_version.py +5 -0
  220. evcloud/ocpi/sync/types/pull_sessions_sync_request_version.py +5 -0
  221. evcloud/ocpi/sync/types/pull_tariffs_sync_request_version.py +5 -0
  222. evcloud/ocpi/sync/types/pull_tokens_sync_request_version.py +5 -0
  223. evcloud/ocpi/sync/types/push_cdr_sync_request_version.py +5 -0
  224. evcloud/ocpi/sync/types/push_location_sync_request_version.py +5 -0
  225. evcloud/ocpi/sync/types/push_session_sync_request_version.py +5 -0
  226. evcloud/ocpi/sync/types/push_tariff_sync_request_version.py +5 -0
  227. evcloud/ocpi/sync/types/push_token_sync_request_version.py +5 -0
  228. evcloud/py.typed +0 -0
  229. evcloud/types/__init__.py +759 -0
  230. evcloud/types/access_mode.py +5 -0
  231. evcloud/types/asset_connector.py +26 -0
  232. evcloud/types/asset_updated_event.py +29 -0
  233. evcloud/types/availability_page.py +26 -0
  234. evcloud/types/batch_response.py +26 -0
  235. evcloud/types/batch_response_missing_item.py +7 -0
  236. evcloud/types/cdr_event.py +41 -0
  237. evcloud/types/cdr_out.py +75 -0
  238. evcloud/types/cdr_out_auth_method.py +7 -0
  239. evcloud/types/cdr_out_auth_method_zero.py +5 -0
  240. evcloud/types/cdr_out_origin.py +7 -0
  241. evcloud/types/cdr_out_origin_zero.py +5 -0
  242. evcloud/types/cdr_page.py +27 -0
  243. evcloud/types/cdr_write_response.py +26 -0
  244. evcloud/types/charge_point_created_out.py +74 -0
  245. evcloud/types/charge_point_created_out_access_mode.py +7 -0
  246. evcloud/types/charge_point_created_out_access_mode_zero.py +5 -0
  247. evcloud/types/charge_point_created_out_pricing.py +7 -0
  248. evcloud/types/charge_point_created_out_pricing_zero.py +5 -0
  249. evcloud/types/charge_point_created_out_site_type.py +7 -0
  250. evcloud/types/charge_point_created_out_site_type_zero.py +5 -0
  251. evcloud/types/charge_point_out.py +73 -0
  252. evcloud/types/charge_point_out_access_mode.py +7 -0
  253. evcloud/types/charge_point_out_access_mode_zero.py +5 -0
  254. evcloud/types/charge_point_out_pricing.py +7 -0
  255. evcloud/types/charge_point_out_pricing_zero.py +5 -0
  256. evcloud/types/charge_point_out_site_type.py +7 -0
  257. evcloud/types/charge_point_out_site_type_zero.py +5 -0
  258. evcloud/types/charge_point_page.py +27 -0
  259. evcloud/types/charging_preferences_response.py +28 -0
  260. evcloud/types/charging_preferences_response_result.py +10 -0
  261. evcloud/types/charging_profile.py +30 -0
  262. evcloud/types/charging_profile_charging_rate_unit.py +5 -0
  263. evcloud/types/charging_profile_period.py +31 -0
  264. evcloud/types/charging_profile_response.py +32 -0
  265. evcloud/types/cluster_page.py +26 -0
  266. evcloud/types/command_accepted.py +30 -0
  267. evcloud/types/command_accepted_route.py +53 -0
  268. evcloud/types/command_accepted_route_own.py +28 -0
  269. evcloud/types/command_accepted_route_own_ocpi_version.py +7 -0
  270. evcloud/types/command_accepted_route_own_ocpi_version_zero.py +5 -0
  271. evcloud/types/command_accepted_route_roaming.py +30 -0
  272. evcloud/types/command_accepted_route_roaming_ocpi_version.py +7 -0
  273. evcloud/types/command_accepted_route_roaming_ocpi_version_zero.py +5 -0
  274. evcloud/types/command_accepted_status.py +7 -0
  275. evcloud/types/command_accepted_status_zero.py +20 -0
  276. evcloud/types/command_page.py +26 -0
  277. evcloud/types/command_record.py +40 -0
  278. evcloud/types/command_record_command.py +7 -0
  279. evcloud/types/command_record_command_zero.py +7 -0
  280. evcloud/types/command_record_route.py +53 -0
  281. evcloud/types/command_record_route_own.py +28 -0
  282. evcloud/types/command_record_route_own_ocpi_version.py +7 -0
  283. evcloud/types/command_record_route_own_ocpi_version_zero.py +5 -0
  284. evcloud/types/command_record_route_roaming.py +30 -0
  285. evcloud/types/command_record_route_roaming_ocpi_version.py +7 -0
  286. evcloud/types/command_record_route_roaming_ocpi_version_zero.py +5 -0
  287. evcloud/types/command_record_status.py +7 -0
  288. evcloud/types/command_record_status_zero.py +20 -0
  289. evcloud/types/command_response_out.py +26 -0
  290. evcloud/types/command_response_out_result.py +7 -0
  291. evcloud/types/command_response_out_result_zero.py +7 -0
  292. evcloud/types/command_result_event.py +39 -0
  293. evcloud/types/command_result_event_module.py +5 -0
  294. evcloud/types/command_result_event_protocol.py +5 -0
  295. evcloud/types/command_result_event_status.py +5 -0
  296. evcloud/types/command_send_response.py +31 -0
  297. evcloud/types/command_token.py +36 -0
  298. evcloud/types/connector_format.py +5 -0
  299. evcloud/types/connector_page.py +27 -0
  300. evcloud/types/connector_status_event.py +29 -0
  301. evcloud/types/connector_write_response.py +27 -0
  302. evcloud/types/control_action.py +5 -0
  303. evcloud/types/control_request_page.py +27 -0
  304. evcloud/types/control_request_response.py +38 -0
  305. evcloud/types/control_request_response_action.py +7 -0
  306. evcloud/types/control_request_response_action_zero.py +7 -0
  307. evcloud/types/control_request_response_result.py +7 -0
  308. evcloud/types/control_request_response_result_zero.py +15 -0
  309. evcloud/types/control_request_response_unit.py +7 -0
  310. evcloud/types/control_request_response_unit_zero.py +5 -0
  311. evcloud/types/control_response_event.py +38 -0
  312. evcloud/types/control_response_event_action.py +5 -0
  313. evcloud/types/control_response_event_result.py +15 -0
  314. evcloud/types/control_response_event_unit.py +5 -0
  315. evcloud/types/cpo_connector_out.py +58 -0
  316. evcloud/types/cpo_connector_out_format.py +7 -0
  317. evcloud/types/cpo_connector_out_format_zero.py +5 -0
  318. evcloud/types/cpo_connector_out_ocpi_status.py +7 -0
  319. evcloud/types/cpo_connector_out_ocpi_status_zero.py +10 -0
  320. evcloud/types/cpo_connector_out_power_type.py +7 -0
  321. evcloud/types/cpo_connector_out_power_type_zero.py +7 -0
  322. evcloud/types/cpo_evse_out.py +61 -0
  323. evcloud/types/cpo_evse_out_origin.py +7 -0
  324. evcloud/types/cpo_evse_out_origin_zero.py +5 -0
  325. evcloud/types/cpo_evse_out_status.py +7 -0
  326. evcloud/types/cpo_evse_out_status_zero.py +10 -0
  327. evcloud/types/credentials_handshake_request.py +44 -0
  328. evcloud/types/credentials_handshake_request_partner_token_encoding.py +5 -0
  329. evcloud/types/credentials_handshake_response.py +32 -0
  330. evcloud/types/credentials_handshake_response_action.py +7 -0
  331. evcloud/types/credentials_handshake_response_version.py +5 -0
  332. evcloud/types/deliver_event_response.py +23 -0
  333. evcloud/types/delivery_drift_event.py +30 -0
  334. evcloud/types/display_text.py +24 -0
  335. evcloud/types/effective_cpo.py +27 -0
  336. evcloud/types/effective_cpo_source.py +7 -0
  337. evcloud/types/effective_cpo_source_zero.py +5 -0
  338. evcloud/types/effective_view_response.py +29 -0
  339. evcloud/types/emp_identity_out.py +35 -0
  340. evcloud/types/emp_identity_out_status.py +7 -0
  341. evcloud/types/emp_identity_out_status_zero.py +5 -0
  342. evcloud/types/emp_identity_page.py +26 -0
  343. evcloud/types/emsp_cdr_out.py +41 -0
  344. evcloud/types/emsp_cdr_out_source.py +7 -0
  345. evcloud/types/emsp_cdr_out_source_zero.py +5 -0
  346. evcloud/types/emsp_cdr_page.py +26 -0
  347. evcloud/types/emsp_connector_out.py +30 -0
  348. evcloud/types/emsp_evse_out.py +32 -0
  349. evcloud/types/emsp_gateway_schema_commands_location_key.py +25 -0
  350. evcloud/types/emsp_gateway_schema_location_lookup_location_key.py +25 -0
  351. evcloud/types/emsp_gateway_schema_locations_location_out.py +47 -0
  352. evcloud/types/emsp_gateway_schema_locations_location_page.py +26 -0
  353. evcloud/types/emsp_gateway_schema_networks_location_out.py +37 -0
  354. evcloud/types/emsp_gateway_schema_networks_location_page.py +26 -0
  355. evcloud/types/emsp_session_out.py +41 -0
  356. evcloud/types/emsp_session_out_source.py +7 -0
  357. evcloud/types/emsp_session_out_source_zero.py +5 -0
  358. evcloud/types/emsp_session_page.py +26 -0
  359. evcloud/types/emsp_tariff_page.py +26 -0
  360. evcloud/types/energy_contract.py +24 -0
  361. evcloud/types/estimate_line.py +27 -0
  362. evcloud/types/estimate_line_type.py +7 -0
  363. evcloud/types/estimate_line_type_zero.py +5 -0
  364. evcloud/types/estimate_response.py +30 -0
  365. evcloud/types/event_type_list.py +24 -0
  366. evcloud/types/event_type_response.py +27 -0
  367. evcloud/types/event_type_response_type.py +7 -0
  368. evcloud/types/event_type_response_type_zero.py +27 -0
  369. evcloud/types/event_type_version.py +24 -0
  370. evcloud/types/evse_connector_status.py +26 -0
  371. evcloud/types/evse_page.py +27 -0
  372. evcloud/types/evse_parking.py +25 -0
  373. evcloud/types/evse_parking_evse_position.py +7 -0
  374. evcloud/types/evse_parking_evse_position_zero.py +5 -0
  375. evcloud/types/evse_status_event.py +31 -0
  376. evcloud/types/evse_status_out.py +32 -0
  377. evcloud/types/evse_status_write_response.py +28 -0
  378. evcloud/types/facility_count.py +24 -0
  379. evcloud/types/facility_page.py +26 -0
  380. evcloud/types/health_ok.py +24 -0
  381. evcloud/types/health_ok_status.py +7 -0
  382. evcloud/types/health_ok_status_zero.py +5 -0
  383. evcloud/types/http_error_response.py +29 -0
  384. evcloud/types/http_validation_error.py +24 -0
  385. evcloud/types/limit_unit.py +5 -0
  386. evcloud/types/location_availability.py +28 -0
  387. evcloud/types/location_availability_status.py +7 -0
  388. evcloud/types/location_availability_status_zero.py +7 -0
  389. evcloud/types/location_base.py +53 -0
  390. evcloud/types/location_base_parking_type.py +7 -0
  391. evcloud/types/location_base_parking_type_zero.py +8 -0
  392. evcloud/types/location_cluster.py +26 -0
  393. evcloud/types/location_detail.py +51 -0
  394. evcloud/types/location_key_input.py +25 -0
  395. evcloud/types/location_list.py +24 -0
  396. evcloud/types/location_out.py +79 -0
  397. evcloud/types/location_out_access_mode.py +7 -0
  398. evcloud/types/location_out_access_mode_zero.py +5 -0
  399. evcloud/types/location_out_ocpi_version.py +7 -0
  400. evcloud/types/location_out_ocpi_version_zero.py +5 -0
  401. evcloud/types/location_out_origin.py +7 -0
  402. evcloud/types/location_out_origin_zero.py +5 -0
  403. evcloud/types/location_out_parking_type.py +7 -0
  404. evcloud/types/location_out_parking_type_zero.py +8 -0
  405. evcloud/types/location_out_role.py +7 -0
  406. evcloud/types/location_out_role_zero.py +5 -0
  407. evcloud/types/location_out_site_type.py +7 -0
  408. evcloud/types/location_out_site_type_zero.py +5 -0
  409. evcloud/types/location_page.py +27 -0
  410. evcloud/types/location_summary.py +43 -0
  411. evcloud/types/location_updated_event.py +30 -0
  412. evcloud/types/location_write_response.py +26 -0
  413. evcloud/types/map_cluster.py +28 -0
  414. evcloud/types/map_page.py +29 -0
  415. evcloud/types/network_consumer.py +25 -0
  416. evcloud/types/network_consumer_page.py +26 -0
  417. evcloud/types/network_detail_response.py +49 -0
  418. evcloud/types/network_detail_response_network_type.py +7 -0
  419. evcloud/types/network_detail_response_network_type_zero.py +5 -0
  420. evcloud/types/network_detail_response_publish_state.py +7 -0
  421. evcloud/types/network_detail_response_publish_state_zero.py +7 -0
  422. evcloud/types/network_page.py +26 -0
  423. evcloud/types/network_priority_order.py +23 -0
  424. evcloud/types/network_response.py +46 -0
  425. evcloud/types/network_response_network_type.py +7 -0
  426. evcloud/types/network_response_network_type_zero.py +5 -0
  427. evcloud/types/network_response_publish_state.py +7 -0
  428. evcloud/types/network_response_publish_state_zero.py +5 -0
  429. evcloud/types/network_rule_page.py +26 -0
  430. evcloud/types/network_rule_response.py +33 -0
  431. evcloud/types/network_rule_response_rule_type.py +7 -0
  432. evcloud/types/network_rule_response_rule_type_zero.py +5 -0
  433. evcloud/types/ocpi_business_details.py +26 -0
  434. evcloud/types/ocpi_business_details_input.py +26 -0
  435. evcloud/types/ocpi_cdr_dimension.py +24 -0
  436. evcloud/types/ocpi_cdr_location.py +30 -0
  437. evcloud/types/ocpi_cdr_token.py +30 -0
  438. evcloud/types/ocpi_charging_period.py +27 -0
  439. evcloud/types/ocpi_display_text.py +24 -0
  440. evcloud/types/ocpi_energy_mix.py +29 -0
  441. evcloud/types/ocpi_energy_mix_input.py +29 -0
  442. evcloud/types/ocpi_energy_source.py +24 -0
  443. evcloud/types/ocpi_energy_source_input.py +24 -0
  444. evcloud/types/ocpi_environmental_impact.py +24 -0
  445. evcloud/types/ocpi_evse_parking.py +24 -0
  446. evcloud/types/ocpi_exceptional_period.py +25 -0
  447. evcloud/types/ocpi_geo_location.py +24 -0
  448. evcloud/types/ocpi_geo_location_in.py +24 -0
  449. evcloud/types/ocpi_image.py +28 -0
  450. evcloud/types/ocpi_image_input.py +28 -0
  451. evcloud/types/ocpi_opening_times.py +28 -0
  452. evcloud/types/ocpi_opening_times_input.py +28 -0
  453. evcloud/types/ocpi_parking_place.py +44 -0
  454. evcloud/types/ocpi_parking_place_input.py +44 -0
  455. evcloud/types/ocpi_price_component_input.py +28 -0
  456. evcloud/types/ocpi_price_component_input_price.py +5 -0
  457. evcloud/types/ocpi_price_component_input_vat.py +5 -0
  458. evcloud/types/ocpi_price_component_output.py +26 -0
  459. evcloud/types/ocpi_price_input.py +26 -0
  460. evcloud/types/ocpi_price_input_excl_vat.py +5 -0
  461. evcloud/types/ocpi_price_input_incl_vat.py +5 -0
  462. evcloud/types/ocpi_price_output.py +24 -0
  463. evcloud/types/ocpi_publish_token.py +27 -0
  464. evcloud/types/ocpi_regular_hours.py +25 -0
  465. evcloud/types/ocpi_regular_hours_input.py +25 -0
  466. evcloud/types/ocpi_related_location.py +26 -0
  467. evcloud/types/ocpi_signed_data.py +28 -0
  468. evcloud/types/ocpi_signed_value.py +25 -0
  469. evcloud/types/ocpi_status_schedule.py +26 -0
  470. evcloud/types/ocpi_tariff_element_input.py +26 -0
  471. evcloud/types/ocpi_tariff_element_output.py +26 -0
  472. evcloud/types/ocpi_tariff_restrictions_input.py +33 -0
  473. evcloud/types/ocpi_tariff_restrictions_input_max_kwh.py +5 -0
  474. evcloud/types/ocpi_tariff_restrictions_input_min_kwh.py +5 -0
  475. evcloud/types/ocpi_tariff_restrictions_output.py +31 -0
  476. evcloud/types/ocpi_tariff_snapshot.py +26 -0
  477. evcloud/types/ocpp_version.py +5 -0
  478. evcloud/types/page_info.py +24 -0
  479. evcloud/types/parking.py +45 -0
  480. evcloud/types/parking_direction.py +7 -0
  481. evcloud/types/parking_direction_zero.py +5 -0
  482. evcloud/types/parking_type.py +8 -0
  483. evcloud/types/parking_vehicle_types_item.py +7 -0
  484. evcloud/types/parking_vehicle_types_item_zero.py +18 -0
  485. evcloud/types/partner_invite_response.py +47 -0
  486. evcloud/types/partner_invite_response_action.py +5 -0
  487. evcloud/types/partner_invite_response_role.py +5 -0
  488. evcloud/types/partner_invite_response_version.py +5 -0
  489. evcloud/types/partner_invite_revoke_response.py +31 -0
  490. evcloud/types/partner_invite_revoke_response_role.py +5 -0
  491. evcloud/types/partner_response.py +41 -0
  492. evcloud/types/partner_response_ocpi_version.py +5 -0
  493. evcloud/types/partner_token_updated_event.py +35 -0
  494. evcloud/types/partner_versions_pull_response.py +29 -0
  495. evcloud/types/partner_versions_pull_response_code.py +8 -0
  496. evcloud/types/partner_versions_pull_response_version.py +5 -0
  497. evcloud/types/power_measurement.py +30 -0
  498. evcloud/types/power_measurement_event.py +30 -0
  499. evcloud/types/power_measurement_list.py +24 -0
  500. evcloud/types/power_type.py +5 -0
  501. evcloud/types/price_component.py +26 -0
  502. evcloud/types/price_limit.py +24 -0
  503. evcloud/types/pricing_mode.py +5 -0
  504. evcloud/types/queue_health.py +34 -0
  505. evcloud/types/reservation_cancel_response.py +25 -0
  506. evcloud/types/resolve_chargers_response_own.py +28 -0
  507. evcloud/types/resolve_chargers_response_own_ocpi_version.py +7 -0
  508. evcloud/types/resolve_chargers_response_own_ocpi_version_zero.py +5 -0
  509. evcloud/types/resolve_chargers_response_roaming.py +30 -0
  510. evcloud/types/resolve_chargers_response_roaming_ocpi_version.py +7 -0
  511. evcloud/types/resolve_chargers_response_roaming_ocpi_version_zero.py +5 -0
  512. evcloud/types/session_event.py +39 -0
  513. evcloud/types/session_out.py +60 -0
  514. evcloud/types/session_out_auth_method.py +7 -0
  515. evcloud/types/session_out_auth_method_zero.py +5 -0
  516. evcloud/types/session_out_billing_state.py +7 -0
  517. evcloud/types/session_out_billing_state_zero.py +5 -0
  518. evcloud/types/session_out_origin.py +7 -0
  519. evcloud/types/session_out_origin_zero.py +5 -0
  520. evcloud/types/session_out_status.py +7 -0
  521. evcloud/types/session_out_status_zero.py +7 -0
  522. evcloud/types/session_page.py +27 -0
  523. evcloud/types/session_write_response.py +27 -0
  524. evcloud/types/sharing_slot.py +25 -0
  525. evcloud/types/sharing_slot_input.py +25 -0
  526. evcloud/types/site_type.py +5 -0
  527. evcloud/types/sync_patch_request.py +26 -0
  528. evcloud/types/sync_pull_response.py +31 -0
  529. evcloud/types/sync_push_response.py +31 -0
  530. evcloud/types/sync_push_response_status.py +5 -0
  531. evcloud/types/tariff.py +42 -0
  532. evcloud/types/tariff_assignment_out.py +32 -0
  533. evcloud/types/tariff_assignment_page.py +27 -0
  534. evcloud/types/tariff_delete_response.py +26 -0
  535. evcloud/types/tariff_display.py +27 -0
  536. evcloud/types/tariff_element.py +26 -0
  537. evcloud/types/tariff_out.py +57 -0
  538. evcloud/types/tariff_out_origin.py +7 -0
  539. evcloud/types/tariff_out_origin_zero.py +5 -0
  540. evcloud/types/tariff_out_tax_included.py +7 -0
  541. evcloud/types/tariff_out_tax_included_zero.py +5 -0
  542. evcloud/types/tariff_out_type.py +7 -0
  543. evcloud/types/tariff_out_type_zero.py +7 -0
  544. evcloud/types/tariff_page.py +27 -0
  545. evcloud/types/tariff_restrictions.py +36 -0
  546. evcloud/types/tariff_summary.py +29 -0
  547. evcloud/types/tariff_tax_included.py +7 -0
  548. evcloud/types/tariff_tax_included_zero.py +5 -0
  549. evcloud/types/tariff_type.py +7 -0
  550. evcloud/types/tariff_updated_event.py +29 -0
  551. evcloud/types/tariff_write_response.py +26 -0
  552. evcloud/types/tax_included.py +5 -0
  553. evcloud/types/tenant_profile_out.py +31 -0
  554. evcloud/types/token_bulk_out.py +26 -0
  555. evcloud/types/token_create.py +46 -0
  556. evcloud/types/token_create_default_profile_type.py +5 -0
  557. evcloud/types/token_create_ocpi_version.py +5 -0
  558. evcloud/types/token_create_type.py +5 -0
  559. evcloud/types/token_create_whitelist.py +5 -0
  560. evcloud/types/token_event_data.py +47 -0
  561. evcloud/types/token_event_data_status.py +7 -0
  562. evcloud/types/token_event_data_type.py +5 -0
  563. evcloud/types/token_event_data_whitelist.py +5 -0
  564. evcloud/types/token_event_out.py +32 -0
  565. evcloud/types/token_event_out_event.py +7 -0
  566. evcloud/types/token_event_out_event_zero.py +7 -0
  567. evcloud/types/token_event_page.py +26 -0
  568. evcloud/types/token_failure_item.py +24 -0
  569. evcloud/types/token_group_action_out.py +27 -0
  570. evcloud/types/token_group_failure.py +24 -0
  571. evcloud/types/token_group_member_out.py +26 -0
  572. evcloud/types/token_group_network_out.py +35 -0
  573. evcloud/types/token_group_network_page.py +26 -0
  574. evcloud/types/token_group_out.py +31 -0
  575. evcloud/types/token_group_page.py +26 -0
  576. evcloud/types/token_out.py +55 -0
  577. evcloud/types/token_out_status.py +7 -0
  578. evcloud/types/token_out_status_zero.py +7 -0
  579. evcloud/types/token_out_type.py +7 -0
  580. evcloud/types/token_out_type_zero.py +5 -0
  581. evcloud/types/token_out_whitelist.py +7 -0
  582. evcloud/types/token_out_whitelist_zero.py +5 -0
  583. evcloud/types/token_page.py +26 -0
  584. evcloud/types/token_reason.py +23 -0
  585. evcloud/types/token_ref.py +26 -0
  586. evcloud/types/token_ref_ocpi_version.py +5 -0
  587. evcloud/types/token_write_response.py +28 -0
  588. evcloud/types/validation_error.py +28 -0
  589. evcloud/types/validation_error_loc_item.py +5 -0
  590. evcloud/types/webhook_delivery_page.py +27 -0
  591. evcloud/types/webhook_delivery_response.py +35 -0
  592. evcloud/types/webhook_page.py +27 -0
  593. evcloud/types/webhook_response.py +42 -0
  594. evcloud/types/webhook_response_event.py +7 -0
  595. evcloud/types/webhook_response_event_zero.py +27 -0
  596. evcloud/types/webhook_response_status.py +7 -0
  597. evcloud/types/webhook_response_status_zero.py +5 -0
  598. evcloud/types/webhook_test_result.py +25 -0
  599. evcloud/types/webhook_with_secret_response.py +43 -0
  600. evcloud/types/webhook_with_secret_response_event.py +7 -0
  601. evcloud/types/webhook_with_secret_response_event_zero.py +27 -0
  602. evcloud/types/webhook_with_secret_response_status.py +7 -0
  603. evcloud/types/webhook_with_secret_response_status_zero.py +5 -0
  604. evcloud/version.py +3 -0
  605. evcloud/webhooks/__init__.py +28 -0
  606. evcloud/webhooks/client.py +53 -0
  607. evcloud/webhooks/deliveries/__init__.py +4 -0
  608. evcloud/webhooks/deliveries/client.py +141 -0
  609. evcloud/webhooks/deliveries/raw_client.py +268 -0
  610. evcloud/webhooks/endpoints/__init__.py +17 -0
  611. evcloud/webhooks/endpoints/client.py +642 -0
  612. evcloud/webhooks/endpoints/raw_client.py +1521 -0
  613. evcloud/webhooks/endpoints/types/__init__.py +15 -0
  614. evcloud/webhooks/endpoints/types/list_endpoints_request_event_types_item.py +27 -0
  615. evcloud/webhooks/endpoints/types/webhook_create_request_api_version.py +5 -0
  616. evcloud/webhooks/endpoints/types/webhook_create_request_event.py +27 -0
  617. evcloud/webhooks/endpoints/types/webhook_update_request_status.py +5 -0
  618. evcloud/webhooks/event_types/__init__.py +7 -0
  619. evcloud/webhooks/event_types/client.py +176 -0
  620. evcloud/webhooks/event_types/raw_client.py +418 -0
  621. evcloud/webhooks/event_types/types/__init__.py +7 -0
  622. evcloud/webhooks/event_types/types/get_event_types_request_type.py +27 -0
  623. evcloud/webhooks/events/__init__.py +7 -0
  624. evcloud/webhooks/events/client.py +207 -0
  625. evcloud/webhooks/events/raw_client.py +355 -0
  626. evcloud/webhooks/events/types/__init__.py +8 -0
  627. evcloud/webhooks/events/types/deliver_event_request_data.py +33 -0
  628. evcloud/webhooks/events/types/deliver_event_request_event.py +27 -0
  629. evcloud/webhooks/health/__init__.py +4 -0
  630. evcloud/webhooks/health/client.py +161 -0
  631. evcloud/webhooks/health/raw_client.py +380 -0
  632. evcloud/webhooks/raw_client.py +13 -0
  633. evcloud-0.1.0.dist-info/METADATA +257 -0
  634. evcloud-0.1.0.dist-info/RECORD +635 -0
  635. evcloud-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,1457 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ...core.api_error import ApiError
7
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ...core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ...core.jsonable_encoder import encode_path_param
10
+ from ...core.pagination import AsyncPager, SyncPager
11
+ from ...core.parse_error import ParsingError
12
+ from ...core.pydantic_utilities import parse_obj_as
13
+ from ...core.request_options import RequestOptions
14
+ from ...core.serialization import convert_and_respect_annotation_metadata
15
+ from ...errors.bad_gateway_error import BadGatewayError
16
+ from ...errors.conflict_error import ConflictError
17
+ from ...errors.gateway_timeout_error import GatewayTimeoutError
18
+ from ...errors.not_found_error import NotFoundError
19
+ from ...errors.too_many_requests_error import TooManyRequestsError
20
+ from ...errors.unauthorized_error import UnauthorizedError
21
+ from ...errors.unprocessable_entity_error import UnprocessableEntityError
22
+ from ...types.cpo_evse_out import CpoEvseOut
23
+ from ...types.evse_page import EvsePage
24
+ from ...types.http_error_response import HttpErrorResponse
25
+ from ...types.http_validation_error import HttpValidationError
26
+ from ...types.ocpi_display_text import OcpiDisplayText
27
+ from ...types.ocpi_geo_location_in import OcpiGeoLocationIn
28
+ from ...types.ocpi_image_input import OcpiImageInput
29
+ from pydantic import ValidationError
30
+
31
+ # this is used as the default value for optional parameters
32
+ OMIT = typing.cast(typing.Any, ...)
33
+
34
+
35
+ class RawEvsesClient:
36
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
37
+ self._client_wrapper = client_wrapper
38
+
39
+ def list(
40
+ self,
41
+ *,
42
+ location_db_id: typing.Optional[int] = None,
43
+ charge_point_id: typing.Optional[str] = None,
44
+ offset: typing.Optional[int] = None,
45
+ limit: typing.Optional[int] = None,
46
+ request_options: typing.Optional[RequestOptions] = None,
47
+ ) -> SyncPager[CpoEvseOut, EvsePage]:
48
+ """
49
+ Your live EVSEs, newest first, optionally of one location or charger.
50
+
51
+ Parameters
52
+ ----------
53
+ location_db_id : typing.Optional[int]
54
+ Only this location, by its numeric ``id`` (not its OCPI location id).
55
+
56
+ charge_point_id : typing.Optional[str]
57
+ Only this charger (its OCPP identity).
58
+
59
+ offset : typing.Optional[int]
60
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
61
+
62
+ limit : typing.Optional[int]
63
+ Maximum rows per page (default 50, max 200).
64
+
65
+ request_options : typing.Optional[RequestOptions]
66
+ Request-specific configuration.
67
+
68
+ Returns
69
+ -------
70
+ SyncPager[CpoEvseOut, EvsePage]
71
+ One page of results; ``next_offset`` is null on the last page.
72
+ """
73
+ _response = self._client_wrapper.httpx_client.request(
74
+ "cpo/evses",
75
+ method="GET",
76
+ params={
77
+ "location_db_id": location_db_id,
78
+ "charge_point_id": charge_point_id,
79
+ "offset": offset,
80
+ "limit": limit,
81
+ },
82
+ request_options=request_options,
83
+ )
84
+ try:
85
+ if 200 <= _response.status_code < 300:
86
+ _parsed_response = typing.cast(
87
+ EvsePage,
88
+ parse_obj_as(
89
+ type_=EvsePage, # type: ignore
90
+ object_=_response.json(),
91
+ ),
92
+ )
93
+ _items = _parsed_response.items
94
+ _parsed_next = _parsed_response.next_offset
95
+ _has_next = _parsed_next is not None and _parsed_next != ""
96
+ _get_next = lambda: self.list(
97
+ location_db_id=location_db_id,
98
+ charge_point_id=charge_point_id,
99
+ offset=_parsed_next,
100
+ limit=limit,
101
+ request_options=request_options,
102
+ )
103
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
104
+ if _response.status_code == 401:
105
+ raise UnauthorizedError(
106
+ headers=dict(_response.headers),
107
+ body=typing.cast(
108
+ HttpErrorResponse,
109
+ parse_obj_as(
110
+ type_=HttpErrorResponse, # type: ignore
111
+ object_=_response.json(),
112
+ ),
113
+ ),
114
+ )
115
+ if _response.status_code == 422:
116
+ raise UnprocessableEntityError(
117
+ headers=dict(_response.headers),
118
+ body=typing.cast(
119
+ HttpValidationError,
120
+ parse_obj_as(
121
+ type_=HttpValidationError, # type: ignore
122
+ object_=_response.json(),
123
+ ),
124
+ ),
125
+ )
126
+ if _response.status_code == 429:
127
+ raise TooManyRequestsError(
128
+ headers=dict(_response.headers),
129
+ body=typing.cast(
130
+ HttpErrorResponse,
131
+ parse_obj_as(
132
+ type_=HttpErrorResponse, # type: ignore
133
+ object_=_response.json(),
134
+ ),
135
+ ),
136
+ )
137
+ if _response.status_code == 502:
138
+ raise BadGatewayError(
139
+ headers=dict(_response.headers),
140
+ body=typing.cast(
141
+ HttpErrorResponse,
142
+ parse_obj_as(
143
+ type_=HttpErrorResponse, # type: ignore
144
+ object_=_response.json(),
145
+ ),
146
+ ),
147
+ )
148
+ if _response.status_code == 504:
149
+ raise GatewayTimeoutError(
150
+ headers=dict(_response.headers),
151
+ body=typing.cast(
152
+ HttpErrorResponse,
153
+ parse_obj_as(
154
+ type_=HttpErrorResponse, # type: ignore
155
+ object_=_response.json(),
156
+ ),
157
+ ),
158
+ )
159
+ _response_json = _response.json()
160
+ except JSONDecodeError:
161
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
162
+ except ValidationError as e:
163
+ raise ParsingError(
164
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
165
+ )
166
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
167
+
168
+ def create(
169
+ self,
170
+ *,
171
+ charge_point_id: str,
172
+ evse_type_id: int,
173
+ evse_uid: typing.Optional[str] = OMIT,
174
+ evse_id: typing.Optional[str] = OMIT,
175
+ physical_reference: typing.Optional[str] = OMIT,
176
+ location_id: typing.Optional[str] = OMIT,
177
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
178
+ floor_level: typing.Optional[str] = OMIT,
179
+ coordinates: typing.Optional[OcpiGeoLocationIn] = OMIT,
180
+ directions: typing.Optional[typing.Sequence[OcpiDisplayText]] = OMIT,
181
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
182
+ accepted_service_providers: typing.Optional[typing.Sequence[str]] = OMIT,
183
+ images: typing.Optional[typing.Sequence[OcpiImageInput]] = OMIT,
184
+ request_options: typing.Optional[RequestOptions] = None,
185
+ ) -> HttpResponse[CpoEvseOut]:
186
+ """
187
+ Adds an EVSE to one of your chargers. Set ``location_id`` and ``evse_uid`` so its connectors can be priced and roaming commands reach it.
188
+
189
+ Parameters
190
+ ----------
191
+ charge_point_id : str
192
+
193
+ evse_type_id : int
194
+
195
+ evse_uid : typing.Optional[str]
196
+
197
+ evse_id : typing.Optional[str]
198
+
199
+ physical_reference : typing.Optional[str]
200
+
201
+ location_id : typing.Optional[str]
202
+
203
+ capabilities : typing.Optional[typing.Sequence[str]]
204
+
205
+ floor_level : typing.Optional[str]
206
+
207
+ coordinates : typing.Optional[OcpiGeoLocationIn]
208
+
209
+ directions : typing.Optional[typing.Sequence[OcpiDisplayText]]
210
+
211
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
212
+
213
+ accepted_service_providers : typing.Optional[typing.Sequence[str]]
214
+
215
+ images : typing.Optional[typing.Sequence[OcpiImageInput]]
216
+
217
+ request_options : typing.Optional[RequestOptions]
218
+ Request-specific configuration.
219
+
220
+ Returns
221
+ -------
222
+ HttpResponse[CpoEvseOut]
223
+ The created object.
224
+ """
225
+ _request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
226
+ {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
227
+ )
228
+ _response = self._client_wrapper.httpx_client.request(
229
+ "cpo/evses",
230
+ method="POST",
231
+ json={
232
+ "charge_point_id": charge_point_id,
233
+ "evse_type_id": evse_type_id,
234
+ "evse_uid": evse_uid,
235
+ "evse_id": evse_id,
236
+ "physical_reference": physical_reference,
237
+ "location_id": location_id,
238
+ "capabilities": capabilities,
239
+ "floor_level": floor_level,
240
+ "coordinates": convert_and_respect_annotation_metadata(
241
+ object_=coordinates, annotation=typing.Optional[OcpiGeoLocationIn], direction="write"
242
+ ),
243
+ "directions": convert_and_respect_annotation_metadata(
244
+ object_=directions, annotation=typing.Optional[typing.Sequence[OcpiDisplayText]], direction="write"
245
+ ),
246
+ "parking_restrictions": parking_restrictions,
247
+ "accepted_service_providers": accepted_service_providers,
248
+ "images": convert_and_respect_annotation_metadata(
249
+ object_=images, annotation=typing.Optional[typing.Sequence[OcpiImageInput]], direction="write"
250
+ ),
251
+ },
252
+ headers={
253
+ "content-type": "application/json",
254
+ },
255
+ request_options=_request_options_with_retries_disabled,
256
+ omit=OMIT,
257
+ )
258
+ try:
259
+ if 200 <= _response.status_code < 300:
260
+ _data = typing.cast(
261
+ CpoEvseOut,
262
+ parse_obj_as(
263
+ type_=CpoEvseOut, # type: ignore
264
+ object_=_response.json(),
265
+ ),
266
+ )
267
+ return HttpResponse(response=_response, data=_data)
268
+ if _response.status_code == 401:
269
+ raise UnauthorizedError(
270
+ headers=dict(_response.headers),
271
+ body=typing.cast(
272
+ HttpErrorResponse,
273
+ parse_obj_as(
274
+ type_=HttpErrorResponse, # type: ignore
275
+ object_=_response.json(),
276
+ ),
277
+ ),
278
+ )
279
+ if _response.status_code == 404:
280
+ raise NotFoundError(
281
+ headers=dict(_response.headers),
282
+ body=typing.cast(
283
+ HttpErrorResponse,
284
+ parse_obj_as(
285
+ type_=HttpErrorResponse, # type: ignore
286
+ object_=_response.json(),
287
+ ),
288
+ ),
289
+ )
290
+ if _response.status_code == 409:
291
+ raise ConflictError(
292
+ headers=dict(_response.headers),
293
+ body=typing.cast(
294
+ HttpErrorResponse,
295
+ parse_obj_as(
296
+ type_=HttpErrorResponse, # type: ignore
297
+ object_=_response.json(),
298
+ ),
299
+ ),
300
+ )
301
+ if _response.status_code == 422:
302
+ raise UnprocessableEntityError(
303
+ headers=dict(_response.headers),
304
+ body=typing.cast(
305
+ HttpValidationError,
306
+ parse_obj_as(
307
+ type_=HttpValidationError, # type: ignore
308
+ object_=_response.json(),
309
+ ),
310
+ ),
311
+ )
312
+ if _response.status_code == 429:
313
+ raise TooManyRequestsError(
314
+ headers=dict(_response.headers),
315
+ body=typing.cast(
316
+ HttpErrorResponse,
317
+ parse_obj_as(
318
+ type_=HttpErrorResponse, # type: ignore
319
+ object_=_response.json(),
320
+ ),
321
+ ),
322
+ )
323
+ if _response.status_code == 502:
324
+ raise BadGatewayError(
325
+ headers=dict(_response.headers),
326
+ body=typing.cast(
327
+ HttpErrorResponse,
328
+ parse_obj_as(
329
+ type_=HttpErrorResponse, # type: ignore
330
+ object_=_response.json(),
331
+ ),
332
+ ),
333
+ )
334
+ if _response.status_code == 504:
335
+ raise GatewayTimeoutError(
336
+ headers=dict(_response.headers),
337
+ body=typing.cast(
338
+ HttpErrorResponse,
339
+ parse_obj_as(
340
+ type_=HttpErrorResponse, # type: ignore
341
+ object_=_response.json(),
342
+ ),
343
+ ),
344
+ )
345
+ _response_json = _response.json()
346
+ except JSONDecodeError:
347
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
348
+ except ValidationError as e:
349
+ raise ParsingError(
350
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
351
+ )
352
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
353
+
354
+ def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[CpoEvseOut]:
355
+ """
356
+ One live EVSE by its ``id``.
357
+
358
+ Parameters
359
+ ----------
360
+ id : int
361
+ The EVSE's ``id``.
362
+
363
+ request_options : typing.Optional[RequestOptions]
364
+ Request-specific configuration.
365
+
366
+ Returns
367
+ -------
368
+ HttpResponse[CpoEvseOut]
369
+ The requested object.
370
+ """
371
+ _response = self._client_wrapper.httpx_client.request(
372
+ f"cpo/evses/{encode_path_param(id)}",
373
+ method="GET",
374
+ request_options=request_options,
375
+ )
376
+ try:
377
+ if 200 <= _response.status_code < 300:
378
+ _data = typing.cast(
379
+ CpoEvseOut,
380
+ parse_obj_as(
381
+ type_=CpoEvseOut, # type: ignore
382
+ object_=_response.json(),
383
+ ),
384
+ )
385
+ return HttpResponse(response=_response, data=_data)
386
+ if _response.status_code == 401:
387
+ raise UnauthorizedError(
388
+ headers=dict(_response.headers),
389
+ body=typing.cast(
390
+ HttpErrorResponse,
391
+ parse_obj_as(
392
+ type_=HttpErrorResponse, # type: ignore
393
+ object_=_response.json(),
394
+ ),
395
+ ),
396
+ )
397
+ if _response.status_code == 404:
398
+ raise NotFoundError(
399
+ headers=dict(_response.headers),
400
+ body=typing.cast(
401
+ HttpErrorResponse,
402
+ parse_obj_as(
403
+ type_=HttpErrorResponse, # type: ignore
404
+ object_=_response.json(),
405
+ ),
406
+ ),
407
+ )
408
+ if _response.status_code == 422:
409
+ raise UnprocessableEntityError(
410
+ headers=dict(_response.headers),
411
+ body=typing.cast(
412
+ HttpValidationError,
413
+ parse_obj_as(
414
+ type_=HttpValidationError, # type: ignore
415
+ object_=_response.json(),
416
+ ),
417
+ ),
418
+ )
419
+ if _response.status_code == 429:
420
+ raise TooManyRequestsError(
421
+ headers=dict(_response.headers),
422
+ body=typing.cast(
423
+ HttpErrorResponse,
424
+ parse_obj_as(
425
+ type_=HttpErrorResponse, # type: ignore
426
+ object_=_response.json(),
427
+ ),
428
+ ),
429
+ )
430
+ if _response.status_code == 502:
431
+ raise BadGatewayError(
432
+ headers=dict(_response.headers),
433
+ body=typing.cast(
434
+ HttpErrorResponse,
435
+ parse_obj_as(
436
+ type_=HttpErrorResponse, # type: ignore
437
+ object_=_response.json(),
438
+ ),
439
+ ),
440
+ )
441
+ if _response.status_code == 504:
442
+ raise GatewayTimeoutError(
443
+ headers=dict(_response.headers),
444
+ body=typing.cast(
445
+ HttpErrorResponse,
446
+ parse_obj_as(
447
+ type_=HttpErrorResponse, # type: ignore
448
+ object_=_response.json(),
449
+ ),
450
+ ),
451
+ )
452
+ _response_json = _response.json()
453
+ except JSONDecodeError:
454
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
455
+ except ValidationError as e:
456
+ raise ParsingError(
457
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
458
+ )
459
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
460
+
461
+ def delete(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]:
462
+ """
463
+ Removes the EVSE from reads and ends the tariff links on its connectors. Its id stays reserved.
464
+
465
+ Parameters
466
+ ----------
467
+ id : int
468
+ The EVSE's ``id``.
469
+
470
+ request_options : typing.Optional[RequestOptions]
471
+ Request-specific configuration.
472
+
473
+ Returns
474
+ -------
475
+ HttpResponse[None]
476
+ """
477
+ _response = self._client_wrapper.httpx_client.request(
478
+ f"cpo/evses/{encode_path_param(id)}",
479
+ method="DELETE",
480
+ request_options=request_options,
481
+ )
482
+ try:
483
+ if 200 <= _response.status_code < 300:
484
+ return HttpResponse(response=_response, data=None)
485
+ if _response.status_code == 401:
486
+ raise UnauthorizedError(
487
+ headers=dict(_response.headers),
488
+ body=typing.cast(
489
+ HttpErrorResponse,
490
+ parse_obj_as(
491
+ type_=HttpErrorResponse, # type: ignore
492
+ object_=_response.json(),
493
+ ),
494
+ ),
495
+ )
496
+ if _response.status_code == 404:
497
+ raise NotFoundError(
498
+ headers=dict(_response.headers),
499
+ body=typing.cast(
500
+ HttpErrorResponse,
501
+ parse_obj_as(
502
+ type_=HttpErrorResponse, # type: ignore
503
+ object_=_response.json(),
504
+ ),
505
+ ),
506
+ )
507
+ if _response.status_code == 422:
508
+ raise UnprocessableEntityError(
509
+ headers=dict(_response.headers),
510
+ body=typing.cast(
511
+ HttpValidationError,
512
+ parse_obj_as(
513
+ type_=HttpValidationError, # type: ignore
514
+ object_=_response.json(),
515
+ ),
516
+ ),
517
+ )
518
+ if _response.status_code == 429:
519
+ raise TooManyRequestsError(
520
+ headers=dict(_response.headers),
521
+ body=typing.cast(
522
+ HttpErrorResponse,
523
+ parse_obj_as(
524
+ type_=HttpErrorResponse, # type: ignore
525
+ object_=_response.json(),
526
+ ),
527
+ ),
528
+ )
529
+ if _response.status_code == 502:
530
+ raise BadGatewayError(
531
+ headers=dict(_response.headers),
532
+ body=typing.cast(
533
+ HttpErrorResponse,
534
+ parse_obj_as(
535
+ type_=HttpErrorResponse, # type: ignore
536
+ object_=_response.json(),
537
+ ),
538
+ ),
539
+ )
540
+ if _response.status_code == 504:
541
+ raise GatewayTimeoutError(
542
+ headers=dict(_response.headers),
543
+ body=typing.cast(
544
+ HttpErrorResponse,
545
+ parse_obj_as(
546
+ type_=HttpErrorResponse, # type: ignore
547
+ object_=_response.json(),
548
+ ),
549
+ ),
550
+ )
551
+ _response_json = _response.json()
552
+ except JSONDecodeError:
553
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
554
+ except ValidationError as e:
555
+ raise ParsingError(
556
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
557
+ )
558
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
559
+
560
+ def update(
561
+ self,
562
+ id: int,
563
+ *,
564
+ expected_revision: typing.Optional[int] = OMIT,
565
+ evse_uid: typing.Optional[str] = OMIT,
566
+ evse_id: typing.Optional[str] = OMIT,
567
+ physical_reference: typing.Optional[str] = OMIT,
568
+ location_id: typing.Optional[str] = OMIT,
569
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
570
+ floor_level: typing.Optional[str] = OMIT,
571
+ coordinates: typing.Optional[OcpiGeoLocationIn] = OMIT,
572
+ directions: typing.Optional[typing.Sequence[OcpiDisplayText]] = OMIT,
573
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
574
+ accepted_service_providers: typing.Optional[typing.Sequence[str]] = OMIT,
575
+ images: typing.Optional[typing.Sequence[OcpiImageInput]] = OMIT,
576
+ request_options: typing.Optional[RequestOptions] = None,
577
+ ) -> HttpResponse[CpoEvseOut]:
578
+ """
579
+ Changes only the fields sent; send null to clear a field. Guard it with ``expected_revision`` to avoid overwriting someone else's change.
580
+
581
+ Parameters
582
+ ----------
583
+ id : int
584
+ The EVSE's ``id``.
585
+
586
+ expected_revision : typing.Optional[int]
587
+
588
+ evse_uid : typing.Optional[str]
589
+
590
+ evse_id : typing.Optional[str]
591
+
592
+ physical_reference : typing.Optional[str]
593
+
594
+ location_id : typing.Optional[str]
595
+
596
+ capabilities : typing.Optional[typing.Sequence[str]]
597
+
598
+ floor_level : typing.Optional[str]
599
+
600
+ coordinates : typing.Optional[OcpiGeoLocationIn]
601
+
602
+ directions : typing.Optional[typing.Sequence[OcpiDisplayText]]
603
+
604
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
605
+
606
+ accepted_service_providers : typing.Optional[typing.Sequence[str]]
607
+
608
+ images : typing.Optional[typing.Sequence[OcpiImageInput]]
609
+
610
+ request_options : typing.Optional[RequestOptions]
611
+ Request-specific configuration.
612
+
613
+ Returns
614
+ -------
615
+ HttpResponse[CpoEvseOut]
616
+ The object after the update.
617
+ """
618
+ _response = self._client_wrapper.httpx_client.request(
619
+ f"cpo/evses/{encode_path_param(id)}",
620
+ method="PATCH",
621
+ json={
622
+ "expected_revision": expected_revision,
623
+ "evse_uid": evse_uid,
624
+ "evse_id": evse_id,
625
+ "physical_reference": physical_reference,
626
+ "location_id": location_id,
627
+ "capabilities": capabilities,
628
+ "floor_level": floor_level,
629
+ "coordinates": convert_and_respect_annotation_metadata(
630
+ object_=coordinates, annotation=typing.Optional[OcpiGeoLocationIn], direction="write"
631
+ ),
632
+ "directions": convert_and_respect_annotation_metadata(
633
+ object_=directions, annotation=typing.Optional[typing.Sequence[OcpiDisplayText]], direction="write"
634
+ ),
635
+ "parking_restrictions": parking_restrictions,
636
+ "accepted_service_providers": accepted_service_providers,
637
+ "images": convert_and_respect_annotation_metadata(
638
+ object_=images, annotation=typing.Optional[typing.Sequence[OcpiImageInput]], direction="write"
639
+ ),
640
+ },
641
+ headers={
642
+ "content-type": "application/json",
643
+ },
644
+ request_options=request_options,
645
+ omit=OMIT,
646
+ )
647
+ try:
648
+ if 200 <= _response.status_code < 300:
649
+ _data = typing.cast(
650
+ CpoEvseOut,
651
+ parse_obj_as(
652
+ type_=CpoEvseOut, # type: ignore
653
+ object_=_response.json(),
654
+ ),
655
+ )
656
+ return HttpResponse(response=_response, data=_data)
657
+ if _response.status_code == 401:
658
+ raise UnauthorizedError(
659
+ headers=dict(_response.headers),
660
+ body=typing.cast(
661
+ HttpErrorResponse,
662
+ parse_obj_as(
663
+ type_=HttpErrorResponse, # type: ignore
664
+ object_=_response.json(),
665
+ ),
666
+ ),
667
+ )
668
+ if _response.status_code == 404:
669
+ raise NotFoundError(
670
+ headers=dict(_response.headers),
671
+ body=typing.cast(
672
+ HttpErrorResponse,
673
+ parse_obj_as(
674
+ type_=HttpErrorResponse, # type: ignore
675
+ object_=_response.json(),
676
+ ),
677
+ ),
678
+ )
679
+ if _response.status_code == 409:
680
+ raise ConflictError(
681
+ headers=dict(_response.headers),
682
+ body=typing.cast(
683
+ HttpErrorResponse,
684
+ parse_obj_as(
685
+ type_=HttpErrorResponse, # type: ignore
686
+ object_=_response.json(),
687
+ ),
688
+ ),
689
+ )
690
+ if _response.status_code == 422:
691
+ raise UnprocessableEntityError(
692
+ headers=dict(_response.headers),
693
+ body=typing.cast(
694
+ HttpValidationError,
695
+ parse_obj_as(
696
+ type_=HttpValidationError, # type: ignore
697
+ object_=_response.json(),
698
+ ),
699
+ ),
700
+ )
701
+ if _response.status_code == 429:
702
+ raise TooManyRequestsError(
703
+ headers=dict(_response.headers),
704
+ body=typing.cast(
705
+ HttpErrorResponse,
706
+ parse_obj_as(
707
+ type_=HttpErrorResponse, # type: ignore
708
+ object_=_response.json(),
709
+ ),
710
+ ),
711
+ )
712
+ if _response.status_code == 502:
713
+ raise BadGatewayError(
714
+ headers=dict(_response.headers),
715
+ body=typing.cast(
716
+ HttpErrorResponse,
717
+ parse_obj_as(
718
+ type_=HttpErrorResponse, # type: ignore
719
+ object_=_response.json(),
720
+ ),
721
+ ),
722
+ )
723
+ if _response.status_code == 504:
724
+ raise GatewayTimeoutError(
725
+ headers=dict(_response.headers),
726
+ body=typing.cast(
727
+ HttpErrorResponse,
728
+ parse_obj_as(
729
+ type_=HttpErrorResponse, # type: ignore
730
+ object_=_response.json(),
731
+ ),
732
+ ),
733
+ )
734
+ _response_json = _response.json()
735
+ except JSONDecodeError:
736
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
737
+ except ValidationError as e:
738
+ raise ParsingError(
739
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
740
+ )
741
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
742
+
743
+
744
+ class AsyncRawEvsesClient:
745
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
746
+ self._client_wrapper = client_wrapper
747
+
748
+ async def list(
749
+ self,
750
+ *,
751
+ location_db_id: typing.Optional[int] = None,
752
+ charge_point_id: typing.Optional[str] = None,
753
+ offset: typing.Optional[int] = None,
754
+ limit: typing.Optional[int] = None,
755
+ request_options: typing.Optional[RequestOptions] = None,
756
+ ) -> AsyncPager[CpoEvseOut, EvsePage]:
757
+ """
758
+ Your live EVSEs, newest first, optionally of one location or charger.
759
+
760
+ Parameters
761
+ ----------
762
+ location_db_id : typing.Optional[int]
763
+ Only this location, by its numeric ``id`` (not its OCPI location id).
764
+
765
+ charge_point_id : typing.Optional[str]
766
+ Only this charger (its OCPP identity).
767
+
768
+ offset : typing.Optional[int]
769
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
770
+
771
+ limit : typing.Optional[int]
772
+ Maximum rows per page (default 50, max 200).
773
+
774
+ request_options : typing.Optional[RequestOptions]
775
+ Request-specific configuration.
776
+
777
+ Returns
778
+ -------
779
+ AsyncPager[CpoEvseOut, EvsePage]
780
+ One page of results; ``next_offset`` is null on the last page.
781
+ """
782
+ _response = await self._client_wrapper.httpx_client.request(
783
+ "cpo/evses",
784
+ method="GET",
785
+ params={
786
+ "location_db_id": location_db_id,
787
+ "charge_point_id": charge_point_id,
788
+ "offset": offset,
789
+ "limit": limit,
790
+ },
791
+ request_options=request_options,
792
+ )
793
+ try:
794
+ if 200 <= _response.status_code < 300:
795
+ _parsed_response = typing.cast(
796
+ EvsePage,
797
+ parse_obj_as(
798
+ type_=EvsePage, # type: ignore
799
+ object_=_response.json(),
800
+ ),
801
+ )
802
+ _items = _parsed_response.items
803
+ _parsed_next = _parsed_response.next_offset
804
+ _has_next = _parsed_next is not None and _parsed_next != ""
805
+
806
+ async def _get_next():
807
+ return await self.list(
808
+ location_db_id=location_db_id,
809
+ charge_point_id=charge_point_id,
810
+ offset=_parsed_next,
811
+ limit=limit,
812
+ request_options=request_options,
813
+ )
814
+
815
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
816
+ if _response.status_code == 401:
817
+ raise UnauthorizedError(
818
+ headers=dict(_response.headers),
819
+ body=typing.cast(
820
+ HttpErrorResponse,
821
+ parse_obj_as(
822
+ type_=HttpErrorResponse, # type: ignore
823
+ object_=_response.json(),
824
+ ),
825
+ ),
826
+ )
827
+ if _response.status_code == 422:
828
+ raise UnprocessableEntityError(
829
+ headers=dict(_response.headers),
830
+ body=typing.cast(
831
+ HttpValidationError,
832
+ parse_obj_as(
833
+ type_=HttpValidationError, # type: ignore
834
+ object_=_response.json(),
835
+ ),
836
+ ),
837
+ )
838
+ if _response.status_code == 429:
839
+ raise TooManyRequestsError(
840
+ headers=dict(_response.headers),
841
+ body=typing.cast(
842
+ HttpErrorResponse,
843
+ parse_obj_as(
844
+ type_=HttpErrorResponse, # type: ignore
845
+ object_=_response.json(),
846
+ ),
847
+ ),
848
+ )
849
+ if _response.status_code == 502:
850
+ raise BadGatewayError(
851
+ headers=dict(_response.headers),
852
+ body=typing.cast(
853
+ HttpErrorResponse,
854
+ parse_obj_as(
855
+ type_=HttpErrorResponse, # type: ignore
856
+ object_=_response.json(),
857
+ ),
858
+ ),
859
+ )
860
+ if _response.status_code == 504:
861
+ raise GatewayTimeoutError(
862
+ headers=dict(_response.headers),
863
+ body=typing.cast(
864
+ HttpErrorResponse,
865
+ parse_obj_as(
866
+ type_=HttpErrorResponse, # type: ignore
867
+ object_=_response.json(),
868
+ ),
869
+ ),
870
+ )
871
+ _response_json = _response.json()
872
+ except JSONDecodeError:
873
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
874
+ except ValidationError as e:
875
+ raise ParsingError(
876
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
877
+ )
878
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
879
+
880
+ async def create(
881
+ self,
882
+ *,
883
+ charge_point_id: str,
884
+ evse_type_id: int,
885
+ evse_uid: typing.Optional[str] = OMIT,
886
+ evse_id: typing.Optional[str] = OMIT,
887
+ physical_reference: typing.Optional[str] = OMIT,
888
+ location_id: typing.Optional[str] = OMIT,
889
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
890
+ floor_level: typing.Optional[str] = OMIT,
891
+ coordinates: typing.Optional[OcpiGeoLocationIn] = OMIT,
892
+ directions: typing.Optional[typing.Sequence[OcpiDisplayText]] = OMIT,
893
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
894
+ accepted_service_providers: typing.Optional[typing.Sequence[str]] = OMIT,
895
+ images: typing.Optional[typing.Sequence[OcpiImageInput]] = OMIT,
896
+ request_options: typing.Optional[RequestOptions] = None,
897
+ ) -> AsyncHttpResponse[CpoEvseOut]:
898
+ """
899
+ Adds an EVSE to one of your chargers. Set ``location_id`` and ``evse_uid`` so its connectors can be priced and roaming commands reach it.
900
+
901
+ Parameters
902
+ ----------
903
+ charge_point_id : str
904
+
905
+ evse_type_id : int
906
+
907
+ evse_uid : typing.Optional[str]
908
+
909
+ evse_id : typing.Optional[str]
910
+
911
+ physical_reference : typing.Optional[str]
912
+
913
+ location_id : typing.Optional[str]
914
+
915
+ capabilities : typing.Optional[typing.Sequence[str]]
916
+
917
+ floor_level : typing.Optional[str]
918
+
919
+ coordinates : typing.Optional[OcpiGeoLocationIn]
920
+
921
+ directions : typing.Optional[typing.Sequence[OcpiDisplayText]]
922
+
923
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
924
+
925
+ accepted_service_providers : typing.Optional[typing.Sequence[str]]
926
+
927
+ images : typing.Optional[typing.Sequence[OcpiImageInput]]
928
+
929
+ request_options : typing.Optional[RequestOptions]
930
+ Request-specific configuration.
931
+
932
+ Returns
933
+ -------
934
+ AsyncHttpResponse[CpoEvseOut]
935
+ The created object.
936
+ """
937
+ _request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
938
+ {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
939
+ )
940
+ _response = await self._client_wrapper.httpx_client.request(
941
+ "cpo/evses",
942
+ method="POST",
943
+ json={
944
+ "charge_point_id": charge_point_id,
945
+ "evse_type_id": evse_type_id,
946
+ "evse_uid": evse_uid,
947
+ "evse_id": evse_id,
948
+ "physical_reference": physical_reference,
949
+ "location_id": location_id,
950
+ "capabilities": capabilities,
951
+ "floor_level": floor_level,
952
+ "coordinates": convert_and_respect_annotation_metadata(
953
+ object_=coordinates, annotation=typing.Optional[OcpiGeoLocationIn], direction="write"
954
+ ),
955
+ "directions": convert_and_respect_annotation_metadata(
956
+ object_=directions, annotation=typing.Optional[typing.Sequence[OcpiDisplayText]], direction="write"
957
+ ),
958
+ "parking_restrictions": parking_restrictions,
959
+ "accepted_service_providers": accepted_service_providers,
960
+ "images": convert_and_respect_annotation_metadata(
961
+ object_=images, annotation=typing.Optional[typing.Sequence[OcpiImageInput]], direction="write"
962
+ ),
963
+ },
964
+ headers={
965
+ "content-type": "application/json",
966
+ },
967
+ request_options=_request_options_with_retries_disabled,
968
+ omit=OMIT,
969
+ )
970
+ try:
971
+ if 200 <= _response.status_code < 300:
972
+ _data = typing.cast(
973
+ CpoEvseOut,
974
+ parse_obj_as(
975
+ type_=CpoEvseOut, # type: ignore
976
+ object_=_response.json(),
977
+ ),
978
+ )
979
+ return AsyncHttpResponse(response=_response, data=_data)
980
+ if _response.status_code == 401:
981
+ raise UnauthorizedError(
982
+ headers=dict(_response.headers),
983
+ body=typing.cast(
984
+ HttpErrorResponse,
985
+ parse_obj_as(
986
+ type_=HttpErrorResponse, # type: ignore
987
+ object_=_response.json(),
988
+ ),
989
+ ),
990
+ )
991
+ if _response.status_code == 404:
992
+ raise NotFoundError(
993
+ headers=dict(_response.headers),
994
+ body=typing.cast(
995
+ HttpErrorResponse,
996
+ parse_obj_as(
997
+ type_=HttpErrorResponse, # type: ignore
998
+ object_=_response.json(),
999
+ ),
1000
+ ),
1001
+ )
1002
+ if _response.status_code == 409:
1003
+ raise ConflictError(
1004
+ headers=dict(_response.headers),
1005
+ body=typing.cast(
1006
+ HttpErrorResponse,
1007
+ parse_obj_as(
1008
+ type_=HttpErrorResponse, # type: ignore
1009
+ object_=_response.json(),
1010
+ ),
1011
+ ),
1012
+ )
1013
+ if _response.status_code == 422:
1014
+ raise UnprocessableEntityError(
1015
+ headers=dict(_response.headers),
1016
+ body=typing.cast(
1017
+ HttpValidationError,
1018
+ parse_obj_as(
1019
+ type_=HttpValidationError, # type: ignore
1020
+ object_=_response.json(),
1021
+ ),
1022
+ ),
1023
+ )
1024
+ if _response.status_code == 429:
1025
+ raise TooManyRequestsError(
1026
+ headers=dict(_response.headers),
1027
+ body=typing.cast(
1028
+ HttpErrorResponse,
1029
+ parse_obj_as(
1030
+ type_=HttpErrorResponse, # type: ignore
1031
+ object_=_response.json(),
1032
+ ),
1033
+ ),
1034
+ )
1035
+ if _response.status_code == 502:
1036
+ raise BadGatewayError(
1037
+ headers=dict(_response.headers),
1038
+ body=typing.cast(
1039
+ HttpErrorResponse,
1040
+ parse_obj_as(
1041
+ type_=HttpErrorResponse, # type: ignore
1042
+ object_=_response.json(),
1043
+ ),
1044
+ ),
1045
+ )
1046
+ if _response.status_code == 504:
1047
+ raise GatewayTimeoutError(
1048
+ headers=dict(_response.headers),
1049
+ body=typing.cast(
1050
+ HttpErrorResponse,
1051
+ parse_obj_as(
1052
+ type_=HttpErrorResponse, # type: ignore
1053
+ object_=_response.json(),
1054
+ ),
1055
+ ),
1056
+ )
1057
+ _response_json = _response.json()
1058
+ except JSONDecodeError:
1059
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1060
+ except ValidationError as e:
1061
+ raise ParsingError(
1062
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1063
+ )
1064
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1065
+
1066
+ async def get(
1067
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
1068
+ ) -> AsyncHttpResponse[CpoEvseOut]:
1069
+ """
1070
+ One live EVSE by its ``id``.
1071
+
1072
+ Parameters
1073
+ ----------
1074
+ id : int
1075
+ The EVSE's ``id``.
1076
+
1077
+ request_options : typing.Optional[RequestOptions]
1078
+ Request-specific configuration.
1079
+
1080
+ Returns
1081
+ -------
1082
+ AsyncHttpResponse[CpoEvseOut]
1083
+ The requested object.
1084
+ """
1085
+ _response = await self._client_wrapper.httpx_client.request(
1086
+ f"cpo/evses/{encode_path_param(id)}",
1087
+ method="GET",
1088
+ request_options=request_options,
1089
+ )
1090
+ try:
1091
+ if 200 <= _response.status_code < 300:
1092
+ _data = typing.cast(
1093
+ CpoEvseOut,
1094
+ parse_obj_as(
1095
+ type_=CpoEvseOut, # type: ignore
1096
+ object_=_response.json(),
1097
+ ),
1098
+ )
1099
+ return AsyncHttpResponse(response=_response, data=_data)
1100
+ if _response.status_code == 401:
1101
+ raise UnauthorizedError(
1102
+ headers=dict(_response.headers),
1103
+ body=typing.cast(
1104
+ HttpErrorResponse,
1105
+ parse_obj_as(
1106
+ type_=HttpErrorResponse, # type: ignore
1107
+ object_=_response.json(),
1108
+ ),
1109
+ ),
1110
+ )
1111
+ if _response.status_code == 404:
1112
+ raise NotFoundError(
1113
+ headers=dict(_response.headers),
1114
+ body=typing.cast(
1115
+ HttpErrorResponse,
1116
+ parse_obj_as(
1117
+ type_=HttpErrorResponse, # type: ignore
1118
+ object_=_response.json(),
1119
+ ),
1120
+ ),
1121
+ )
1122
+ if _response.status_code == 422:
1123
+ raise UnprocessableEntityError(
1124
+ headers=dict(_response.headers),
1125
+ body=typing.cast(
1126
+ HttpValidationError,
1127
+ parse_obj_as(
1128
+ type_=HttpValidationError, # type: ignore
1129
+ object_=_response.json(),
1130
+ ),
1131
+ ),
1132
+ )
1133
+ if _response.status_code == 429:
1134
+ raise TooManyRequestsError(
1135
+ headers=dict(_response.headers),
1136
+ body=typing.cast(
1137
+ HttpErrorResponse,
1138
+ parse_obj_as(
1139
+ type_=HttpErrorResponse, # type: ignore
1140
+ object_=_response.json(),
1141
+ ),
1142
+ ),
1143
+ )
1144
+ if _response.status_code == 502:
1145
+ raise BadGatewayError(
1146
+ headers=dict(_response.headers),
1147
+ body=typing.cast(
1148
+ HttpErrorResponse,
1149
+ parse_obj_as(
1150
+ type_=HttpErrorResponse, # type: ignore
1151
+ object_=_response.json(),
1152
+ ),
1153
+ ),
1154
+ )
1155
+ if _response.status_code == 504:
1156
+ raise GatewayTimeoutError(
1157
+ headers=dict(_response.headers),
1158
+ body=typing.cast(
1159
+ HttpErrorResponse,
1160
+ parse_obj_as(
1161
+ type_=HttpErrorResponse, # type: ignore
1162
+ object_=_response.json(),
1163
+ ),
1164
+ ),
1165
+ )
1166
+ _response_json = _response.json()
1167
+ except JSONDecodeError:
1168
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1169
+ except ValidationError as e:
1170
+ raise ParsingError(
1171
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1172
+ )
1173
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1174
+
1175
+ async def delete(
1176
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
1177
+ ) -> AsyncHttpResponse[None]:
1178
+ """
1179
+ Removes the EVSE from reads and ends the tariff links on its connectors. Its id stays reserved.
1180
+
1181
+ Parameters
1182
+ ----------
1183
+ id : int
1184
+ The EVSE's ``id``.
1185
+
1186
+ request_options : typing.Optional[RequestOptions]
1187
+ Request-specific configuration.
1188
+
1189
+ Returns
1190
+ -------
1191
+ AsyncHttpResponse[None]
1192
+ """
1193
+ _response = await self._client_wrapper.httpx_client.request(
1194
+ f"cpo/evses/{encode_path_param(id)}",
1195
+ method="DELETE",
1196
+ request_options=request_options,
1197
+ )
1198
+ try:
1199
+ if 200 <= _response.status_code < 300:
1200
+ return AsyncHttpResponse(response=_response, data=None)
1201
+ if _response.status_code == 401:
1202
+ raise UnauthorizedError(
1203
+ headers=dict(_response.headers),
1204
+ body=typing.cast(
1205
+ HttpErrorResponse,
1206
+ parse_obj_as(
1207
+ type_=HttpErrorResponse, # type: ignore
1208
+ object_=_response.json(),
1209
+ ),
1210
+ ),
1211
+ )
1212
+ if _response.status_code == 404:
1213
+ raise NotFoundError(
1214
+ headers=dict(_response.headers),
1215
+ body=typing.cast(
1216
+ HttpErrorResponse,
1217
+ parse_obj_as(
1218
+ type_=HttpErrorResponse, # type: ignore
1219
+ object_=_response.json(),
1220
+ ),
1221
+ ),
1222
+ )
1223
+ if _response.status_code == 422:
1224
+ raise UnprocessableEntityError(
1225
+ headers=dict(_response.headers),
1226
+ body=typing.cast(
1227
+ HttpValidationError,
1228
+ parse_obj_as(
1229
+ type_=HttpValidationError, # type: ignore
1230
+ object_=_response.json(),
1231
+ ),
1232
+ ),
1233
+ )
1234
+ if _response.status_code == 429:
1235
+ raise TooManyRequestsError(
1236
+ headers=dict(_response.headers),
1237
+ body=typing.cast(
1238
+ HttpErrorResponse,
1239
+ parse_obj_as(
1240
+ type_=HttpErrorResponse, # type: ignore
1241
+ object_=_response.json(),
1242
+ ),
1243
+ ),
1244
+ )
1245
+ if _response.status_code == 502:
1246
+ raise BadGatewayError(
1247
+ headers=dict(_response.headers),
1248
+ body=typing.cast(
1249
+ HttpErrorResponse,
1250
+ parse_obj_as(
1251
+ type_=HttpErrorResponse, # type: ignore
1252
+ object_=_response.json(),
1253
+ ),
1254
+ ),
1255
+ )
1256
+ if _response.status_code == 504:
1257
+ raise GatewayTimeoutError(
1258
+ headers=dict(_response.headers),
1259
+ body=typing.cast(
1260
+ HttpErrorResponse,
1261
+ parse_obj_as(
1262
+ type_=HttpErrorResponse, # type: ignore
1263
+ object_=_response.json(),
1264
+ ),
1265
+ ),
1266
+ )
1267
+ _response_json = _response.json()
1268
+ except JSONDecodeError:
1269
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1270
+ except ValidationError as e:
1271
+ raise ParsingError(
1272
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1273
+ )
1274
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1275
+
1276
+ async def update(
1277
+ self,
1278
+ id: int,
1279
+ *,
1280
+ expected_revision: typing.Optional[int] = OMIT,
1281
+ evse_uid: typing.Optional[str] = OMIT,
1282
+ evse_id: typing.Optional[str] = OMIT,
1283
+ physical_reference: typing.Optional[str] = OMIT,
1284
+ location_id: typing.Optional[str] = OMIT,
1285
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
1286
+ floor_level: typing.Optional[str] = OMIT,
1287
+ coordinates: typing.Optional[OcpiGeoLocationIn] = OMIT,
1288
+ directions: typing.Optional[typing.Sequence[OcpiDisplayText]] = OMIT,
1289
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
1290
+ accepted_service_providers: typing.Optional[typing.Sequence[str]] = OMIT,
1291
+ images: typing.Optional[typing.Sequence[OcpiImageInput]] = OMIT,
1292
+ request_options: typing.Optional[RequestOptions] = None,
1293
+ ) -> AsyncHttpResponse[CpoEvseOut]:
1294
+ """
1295
+ Changes only the fields sent; send null to clear a field. Guard it with ``expected_revision`` to avoid overwriting someone else's change.
1296
+
1297
+ Parameters
1298
+ ----------
1299
+ id : int
1300
+ The EVSE's ``id``.
1301
+
1302
+ expected_revision : typing.Optional[int]
1303
+
1304
+ evse_uid : typing.Optional[str]
1305
+
1306
+ evse_id : typing.Optional[str]
1307
+
1308
+ physical_reference : typing.Optional[str]
1309
+
1310
+ location_id : typing.Optional[str]
1311
+
1312
+ capabilities : typing.Optional[typing.Sequence[str]]
1313
+
1314
+ floor_level : typing.Optional[str]
1315
+
1316
+ coordinates : typing.Optional[OcpiGeoLocationIn]
1317
+
1318
+ directions : typing.Optional[typing.Sequence[OcpiDisplayText]]
1319
+
1320
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
1321
+
1322
+ accepted_service_providers : typing.Optional[typing.Sequence[str]]
1323
+
1324
+ images : typing.Optional[typing.Sequence[OcpiImageInput]]
1325
+
1326
+ request_options : typing.Optional[RequestOptions]
1327
+ Request-specific configuration.
1328
+
1329
+ Returns
1330
+ -------
1331
+ AsyncHttpResponse[CpoEvseOut]
1332
+ The object after the update.
1333
+ """
1334
+ _response = await self._client_wrapper.httpx_client.request(
1335
+ f"cpo/evses/{encode_path_param(id)}",
1336
+ method="PATCH",
1337
+ json={
1338
+ "expected_revision": expected_revision,
1339
+ "evse_uid": evse_uid,
1340
+ "evse_id": evse_id,
1341
+ "physical_reference": physical_reference,
1342
+ "location_id": location_id,
1343
+ "capabilities": capabilities,
1344
+ "floor_level": floor_level,
1345
+ "coordinates": convert_and_respect_annotation_metadata(
1346
+ object_=coordinates, annotation=typing.Optional[OcpiGeoLocationIn], direction="write"
1347
+ ),
1348
+ "directions": convert_and_respect_annotation_metadata(
1349
+ object_=directions, annotation=typing.Optional[typing.Sequence[OcpiDisplayText]], direction="write"
1350
+ ),
1351
+ "parking_restrictions": parking_restrictions,
1352
+ "accepted_service_providers": accepted_service_providers,
1353
+ "images": convert_and_respect_annotation_metadata(
1354
+ object_=images, annotation=typing.Optional[typing.Sequence[OcpiImageInput]], direction="write"
1355
+ ),
1356
+ },
1357
+ headers={
1358
+ "content-type": "application/json",
1359
+ },
1360
+ request_options=request_options,
1361
+ omit=OMIT,
1362
+ )
1363
+ try:
1364
+ if 200 <= _response.status_code < 300:
1365
+ _data = typing.cast(
1366
+ CpoEvseOut,
1367
+ parse_obj_as(
1368
+ type_=CpoEvseOut, # type: ignore
1369
+ object_=_response.json(),
1370
+ ),
1371
+ )
1372
+ return AsyncHttpResponse(response=_response, data=_data)
1373
+ if _response.status_code == 401:
1374
+ raise UnauthorizedError(
1375
+ headers=dict(_response.headers),
1376
+ body=typing.cast(
1377
+ HttpErrorResponse,
1378
+ parse_obj_as(
1379
+ type_=HttpErrorResponse, # type: ignore
1380
+ object_=_response.json(),
1381
+ ),
1382
+ ),
1383
+ )
1384
+ if _response.status_code == 404:
1385
+ raise NotFoundError(
1386
+ headers=dict(_response.headers),
1387
+ body=typing.cast(
1388
+ HttpErrorResponse,
1389
+ parse_obj_as(
1390
+ type_=HttpErrorResponse, # type: ignore
1391
+ object_=_response.json(),
1392
+ ),
1393
+ ),
1394
+ )
1395
+ if _response.status_code == 409:
1396
+ raise ConflictError(
1397
+ headers=dict(_response.headers),
1398
+ body=typing.cast(
1399
+ HttpErrorResponse,
1400
+ parse_obj_as(
1401
+ type_=HttpErrorResponse, # type: ignore
1402
+ object_=_response.json(),
1403
+ ),
1404
+ ),
1405
+ )
1406
+ if _response.status_code == 422:
1407
+ raise UnprocessableEntityError(
1408
+ headers=dict(_response.headers),
1409
+ body=typing.cast(
1410
+ HttpValidationError,
1411
+ parse_obj_as(
1412
+ type_=HttpValidationError, # type: ignore
1413
+ object_=_response.json(),
1414
+ ),
1415
+ ),
1416
+ )
1417
+ if _response.status_code == 429:
1418
+ raise TooManyRequestsError(
1419
+ headers=dict(_response.headers),
1420
+ body=typing.cast(
1421
+ HttpErrorResponse,
1422
+ parse_obj_as(
1423
+ type_=HttpErrorResponse, # type: ignore
1424
+ object_=_response.json(),
1425
+ ),
1426
+ ),
1427
+ )
1428
+ if _response.status_code == 502:
1429
+ raise BadGatewayError(
1430
+ headers=dict(_response.headers),
1431
+ body=typing.cast(
1432
+ HttpErrorResponse,
1433
+ parse_obj_as(
1434
+ type_=HttpErrorResponse, # type: ignore
1435
+ object_=_response.json(),
1436
+ ),
1437
+ ),
1438
+ )
1439
+ if _response.status_code == 504:
1440
+ raise GatewayTimeoutError(
1441
+ headers=dict(_response.headers),
1442
+ body=typing.cast(
1443
+ HttpErrorResponse,
1444
+ parse_obj_as(
1445
+ type_=HttpErrorResponse, # type: ignore
1446
+ object_=_response.json(),
1447
+ ),
1448
+ ),
1449
+ )
1450
+ _response_json = _response.json()
1451
+ except JSONDecodeError:
1452
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1453
+ except ValidationError as e:
1454
+ raise ParsingError(
1455
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1456
+ )
1457
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)