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,2809 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from ...core.api_error import ApiError
8
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ...core.datetime_utils import serialize_datetime
10
+ from ...core.http_response import AsyncHttpResponse, HttpResponse
11
+ from ...core.jsonable_encoder import encode_path_param
12
+ from ...core.pagination import AsyncPager, SyncPager
13
+ from ...core.parse_error import ParsingError
14
+ from ...core.pydantic_utilities import parse_obj_as
15
+ from ...core.request_options import RequestOptions
16
+ from ...core.serialization import convert_and_respect_annotation_metadata
17
+ from ...errors.bad_gateway_error import BadGatewayError
18
+ from ...errors.conflict_error import ConflictError
19
+ from ...errors.gateway_timeout_error import GatewayTimeoutError
20
+ from ...errors.not_found_error import NotFoundError
21
+ from ...errors.too_many_requests_error import TooManyRequestsError
22
+ from ...errors.unauthorized_error import UnauthorizedError
23
+ from ...errors.unprocessable_entity_error import UnprocessableEntityError
24
+ from ...types.access_mode import AccessMode
25
+ from ...types.cdr_out import CdrOut
26
+ from ...types.cdr_page import CdrPage
27
+ from ...types.charge_point_created_out import ChargePointCreatedOut
28
+ from ...types.charge_point_out import ChargePointOut
29
+ from ...types.charge_point_page import ChargePointPage
30
+ from ...types.connector_page import ConnectorPage
31
+ from ...types.cpo_connector_out import CpoConnectorOut
32
+ from ...types.cpo_evse_out import CpoEvseOut
33
+ from ...types.evse_page import EvsePage
34
+ from ...types.http_error_response import HttpErrorResponse
35
+ from ...types.http_validation_error import HttpValidationError
36
+ from ...types.ocpp_version import OcppVersion
37
+ from ...types.pricing_mode import PricingMode
38
+ from ...types.session_out import SessionOut
39
+ from ...types.session_page import SessionPage
40
+ from ...types.sharing_slot_input import SharingSlotInput
41
+ from ...types.site_type import SiteType
42
+ from .types.list_charge_points_request_ocpp_version import ListChargePointsRequestOcppVersion
43
+ from pydantic import ValidationError
44
+
45
+ # this is used as the default value for optional parameters
46
+ OMIT = typing.cast(typing.Any, ...)
47
+
48
+
49
+ class RawChargePointsClient:
50
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
51
+ self._client_wrapper = client_wrapper
52
+
53
+ def list(
54
+ self,
55
+ *,
56
+ location_id: typing.Optional[int] = None,
57
+ is_online: typing.Optional[bool] = None,
58
+ ocpp_version: typing.Optional[ListChargePointsRequestOcppVersion] = None,
59
+ offset: typing.Optional[int] = None,
60
+ limit: typing.Optional[int] = None,
61
+ request_options: typing.Optional[RequestOptions] = None,
62
+ ) -> SyncPager[ChargePointOut, ChargePointPage]:
63
+ """
64
+ Your chargers, sorted by OCPP identity. Online state, heartbeat and firmware come from the chargers themselves.
65
+
66
+ Parameters
67
+ ----------
68
+ location_id : typing.Optional[int]
69
+ Only this location, by its numeric ``id`` (not its OCPI location id).
70
+
71
+ is_online : typing.Optional[bool]
72
+ Only connected (true) or disconnected (false) chargers.
73
+
74
+ ocpp_version : typing.Optional[ListChargePointsRequestOcppVersion]
75
+ Only chargers speaking this OCPP version.
76
+
77
+ offset : typing.Optional[int]
78
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
79
+
80
+ limit : typing.Optional[int]
81
+ Maximum rows per page (default 50, max 200).
82
+
83
+ request_options : typing.Optional[RequestOptions]
84
+ Request-specific configuration.
85
+
86
+ Returns
87
+ -------
88
+ SyncPager[ChargePointOut, ChargePointPage]
89
+ One page of results; ``next_offset`` is null on the last page.
90
+ """
91
+ _response = self._client_wrapper.httpx_client.request(
92
+ "cpo/charge-points",
93
+ method="GET",
94
+ params={
95
+ "location_id": location_id,
96
+ "is_online": is_online,
97
+ "ocpp_version": ocpp_version,
98
+ "offset": offset,
99
+ "limit": limit,
100
+ },
101
+ request_options=request_options,
102
+ )
103
+ try:
104
+ if 200 <= _response.status_code < 300:
105
+ _parsed_response = typing.cast(
106
+ ChargePointPage,
107
+ parse_obj_as(
108
+ type_=ChargePointPage, # type: ignore
109
+ object_=_response.json(),
110
+ ),
111
+ )
112
+ _items = _parsed_response.items
113
+ _parsed_next = _parsed_response.next_offset
114
+ _has_next = _parsed_next is not None and _parsed_next != ""
115
+ _get_next = lambda: self.list(
116
+ location_id=location_id,
117
+ is_online=is_online,
118
+ ocpp_version=ocpp_version,
119
+ offset=_parsed_next,
120
+ limit=limit,
121
+ request_options=request_options,
122
+ )
123
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
124
+ if _response.status_code == 401:
125
+ raise UnauthorizedError(
126
+ headers=dict(_response.headers),
127
+ body=typing.cast(
128
+ HttpErrorResponse,
129
+ parse_obj_as(
130
+ type_=HttpErrorResponse, # type: ignore
131
+ object_=_response.json(),
132
+ ),
133
+ ),
134
+ )
135
+ if _response.status_code == 422:
136
+ raise UnprocessableEntityError(
137
+ headers=dict(_response.headers),
138
+ body=typing.cast(
139
+ HttpValidationError,
140
+ parse_obj_as(
141
+ type_=HttpValidationError, # type: ignore
142
+ object_=_response.json(),
143
+ ),
144
+ ),
145
+ )
146
+ if _response.status_code == 429:
147
+ raise TooManyRequestsError(
148
+ headers=dict(_response.headers),
149
+ body=typing.cast(
150
+ HttpErrorResponse,
151
+ parse_obj_as(
152
+ type_=HttpErrorResponse, # type: ignore
153
+ object_=_response.json(),
154
+ ),
155
+ ),
156
+ )
157
+ if _response.status_code == 502:
158
+ raise BadGatewayError(
159
+ headers=dict(_response.headers),
160
+ body=typing.cast(
161
+ HttpErrorResponse,
162
+ parse_obj_as(
163
+ type_=HttpErrorResponse, # type: ignore
164
+ object_=_response.json(),
165
+ ),
166
+ ),
167
+ )
168
+ if _response.status_code == 504:
169
+ raise GatewayTimeoutError(
170
+ headers=dict(_response.headers),
171
+ body=typing.cast(
172
+ HttpErrorResponse,
173
+ parse_obj_as(
174
+ type_=HttpErrorResponse, # type: ignore
175
+ object_=_response.json(),
176
+ ),
177
+ ),
178
+ )
179
+ _response_json = _response.json()
180
+ except JSONDecodeError:
181
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
182
+ except ValidationError as e:
183
+ raise ParsingError(
184
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
185
+ )
186
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
187
+
188
+ def create(
189
+ self,
190
+ *,
191
+ charge_point_id: str,
192
+ ocpp_version: typing.Optional[OcppVersion] = OMIT,
193
+ charge_point_vendor: typing.Optional[str] = OMIT,
194
+ charge_point_model: typing.Optional[str] = OMIT,
195
+ location_id: typing.Optional[int] = OMIT,
196
+ coordinates: typing.Optional[str] = OMIT,
197
+ floor_level: typing.Optional[str] = OMIT,
198
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
199
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
200
+ max_power_kw: typing.Optional[float] = OMIT,
201
+ connector_type: typing.Optional[str] = OMIT,
202
+ connector_count: typing.Optional[int] = OMIT,
203
+ accessibility: typing.Optional[str] = OMIT,
204
+ use_status_notification0: typing.Optional[bool] = OMIT,
205
+ image_url: typing.Optional[str] = OMIT,
206
+ is_roaming: typing.Optional[bool] = OMIT,
207
+ access_mode: typing.Optional[AccessMode] = OMIT,
208
+ site_type: typing.Optional[SiteType] = OMIT,
209
+ customer_id: typing.Optional[int] = OMIT,
210
+ sharing_schedule: typing.Optional[typing.Sequence[SharingSlotInput]] = OMIT,
211
+ sharing_paused: typing.Optional[bool] = OMIT,
212
+ pricing: typing.Optional[PricingMode] = OMIT,
213
+ free_vend: typing.Optional[bool] = OMIT,
214
+ free_vend_id_tag: typing.Optional[str] = OMIT,
215
+ request_options: typing.Optional[RequestOptions] = None,
216
+ ) -> HttpResponse[ChargePointCreatedOut]:
217
+ """
218
+ Registers a charger. It starts offline. The gateway refuses its connection until the charger is registered with the gateway; ``gateway_registered`` says whether it already is. 409 if the OCPP identity is taken.
219
+
220
+ Parameters
221
+ ----------
222
+ charge_point_id : str
223
+
224
+ ocpp_version : typing.Optional[OcppVersion]
225
+
226
+ charge_point_vendor : typing.Optional[str]
227
+
228
+ charge_point_model : typing.Optional[str]
229
+
230
+ location_id : typing.Optional[int]
231
+
232
+ coordinates : typing.Optional[str]
233
+
234
+ floor_level : typing.Optional[str]
235
+
236
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
237
+
238
+ capabilities : typing.Optional[typing.Sequence[str]]
239
+
240
+ max_power_kw : typing.Optional[float]
241
+
242
+ connector_type : typing.Optional[str]
243
+
244
+ connector_count : typing.Optional[int]
245
+
246
+ accessibility : typing.Optional[str]
247
+
248
+ use_status_notification0 : typing.Optional[bool]
249
+
250
+ image_url : typing.Optional[str]
251
+
252
+ is_roaming : typing.Optional[bool]
253
+
254
+ access_mode : typing.Optional[AccessMode]
255
+
256
+ site_type : typing.Optional[SiteType]
257
+
258
+ customer_id : typing.Optional[int]
259
+
260
+ sharing_schedule : typing.Optional[typing.Sequence[SharingSlotInput]]
261
+
262
+ sharing_paused : typing.Optional[bool]
263
+
264
+ pricing : typing.Optional[PricingMode]
265
+
266
+ free_vend : typing.Optional[bool]
267
+
268
+ free_vend_id_tag : typing.Optional[str]
269
+
270
+ request_options : typing.Optional[RequestOptions]
271
+ Request-specific configuration.
272
+
273
+ Returns
274
+ -------
275
+ HttpResponse[ChargePointCreatedOut]
276
+ The created object.
277
+ """
278
+ _request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
279
+ {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
280
+ )
281
+ _response = self._client_wrapper.httpx_client.request(
282
+ "cpo/charge-points",
283
+ method="POST",
284
+ json={
285
+ "charge_point_id": charge_point_id,
286
+ "ocpp_version": ocpp_version,
287
+ "charge_point_vendor": charge_point_vendor,
288
+ "charge_point_model": charge_point_model,
289
+ "location_id": location_id,
290
+ "coordinates": coordinates,
291
+ "floor_level": floor_level,
292
+ "parking_restrictions": parking_restrictions,
293
+ "capabilities": capabilities,
294
+ "max_power_kw": max_power_kw,
295
+ "connector_type": connector_type,
296
+ "connector_count": connector_count,
297
+ "accessibility": accessibility,
298
+ "use_status_notification_0": use_status_notification0,
299
+ "image_url": image_url,
300
+ "is_roaming": is_roaming,
301
+ "access_mode": access_mode,
302
+ "site_type": site_type,
303
+ "customer_id": customer_id,
304
+ "sharing_schedule": convert_and_respect_annotation_metadata(
305
+ object_=sharing_schedule,
306
+ annotation=typing.Optional[typing.Sequence[SharingSlotInput]],
307
+ direction="write",
308
+ ),
309
+ "sharing_paused": sharing_paused,
310
+ "pricing": pricing,
311
+ "free_vend": free_vend,
312
+ "free_vend_id_tag": free_vend_id_tag,
313
+ },
314
+ headers={
315
+ "content-type": "application/json",
316
+ },
317
+ request_options=_request_options_with_retries_disabled,
318
+ omit=OMIT,
319
+ )
320
+ try:
321
+ if 200 <= _response.status_code < 300:
322
+ _data = typing.cast(
323
+ ChargePointCreatedOut,
324
+ parse_obj_as(
325
+ type_=ChargePointCreatedOut, # type: ignore
326
+ object_=_response.json(),
327
+ ),
328
+ )
329
+ return HttpResponse(response=_response, data=_data)
330
+ if _response.status_code == 401:
331
+ raise UnauthorizedError(
332
+ headers=dict(_response.headers),
333
+ body=typing.cast(
334
+ HttpErrorResponse,
335
+ parse_obj_as(
336
+ type_=HttpErrorResponse, # type: ignore
337
+ object_=_response.json(),
338
+ ),
339
+ ),
340
+ )
341
+ if _response.status_code == 404:
342
+ raise NotFoundError(
343
+ headers=dict(_response.headers),
344
+ body=typing.cast(
345
+ HttpErrorResponse,
346
+ parse_obj_as(
347
+ type_=HttpErrorResponse, # type: ignore
348
+ object_=_response.json(),
349
+ ),
350
+ ),
351
+ )
352
+ if _response.status_code == 409:
353
+ raise ConflictError(
354
+ headers=dict(_response.headers),
355
+ body=typing.cast(
356
+ HttpErrorResponse,
357
+ parse_obj_as(
358
+ type_=HttpErrorResponse, # type: ignore
359
+ object_=_response.json(),
360
+ ),
361
+ ),
362
+ )
363
+ if _response.status_code == 422:
364
+ raise UnprocessableEntityError(
365
+ headers=dict(_response.headers),
366
+ body=typing.cast(
367
+ HttpValidationError,
368
+ parse_obj_as(
369
+ type_=HttpValidationError, # type: ignore
370
+ object_=_response.json(),
371
+ ),
372
+ ),
373
+ )
374
+ if _response.status_code == 429:
375
+ raise TooManyRequestsError(
376
+ headers=dict(_response.headers),
377
+ body=typing.cast(
378
+ HttpErrorResponse,
379
+ parse_obj_as(
380
+ type_=HttpErrorResponse, # type: ignore
381
+ object_=_response.json(),
382
+ ),
383
+ ),
384
+ )
385
+ if _response.status_code == 502:
386
+ raise BadGatewayError(
387
+ headers=dict(_response.headers),
388
+ body=typing.cast(
389
+ HttpErrorResponse,
390
+ parse_obj_as(
391
+ type_=HttpErrorResponse, # type: ignore
392
+ object_=_response.json(),
393
+ ),
394
+ ),
395
+ )
396
+ if _response.status_code == 504:
397
+ raise GatewayTimeoutError(
398
+ headers=dict(_response.headers),
399
+ body=typing.cast(
400
+ HttpErrorResponse,
401
+ parse_obj_as(
402
+ type_=HttpErrorResponse, # type: ignore
403
+ object_=_response.json(),
404
+ ),
405
+ ),
406
+ )
407
+ _response_json = _response.json()
408
+ except JSONDecodeError:
409
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
410
+ except ValidationError as e:
411
+ raise ParsingError(
412
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
413
+ )
414
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
415
+
416
+ def get(
417
+ self, charge_point_id: str, *, request_options: typing.Optional[RequestOptions] = None
418
+ ) -> HttpResponse[ChargePointOut]:
419
+ """
420
+ One charger by its OCPP identity.
421
+
422
+ Parameters
423
+ ----------
424
+ charge_point_id : str
425
+ The charger's OCPP identity.
426
+
427
+ request_options : typing.Optional[RequestOptions]
428
+ Request-specific configuration.
429
+
430
+ Returns
431
+ -------
432
+ HttpResponse[ChargePointOut]
433
+ The requested object.
434
+ """
435
+ _response = self._client_wrapper.httpx_client.request(
436
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}",
437
+ method="GET",
438
+ request_options=request_options,
439
+ )
440
+ try:
441
+ if 200 <= _response.status_code < 300:
442
+ _data = typing.cast(
443
+ ChargePointOut,
444
+ parse_obj_as(
445
+ type_=ChargePointOut, # type: ignore
446
+ object_=_response.json(),
447
+ ),
448
+ )
449
+ return HttpResponse(response=_response, data=_data)
450
+ if _response.status_code == 401:
451
+ raise UnauthorizedError(
452
+ headers=dict(_response.headers),
453
+ body=typing.cast(
454
+ HttpErrorResponse,
455
+ parse_obj_as(
456
+ type_=HttpErrorResponse, # type: ignore
457
+ object_=_response.json(),
458
+ ),
459
+ ),
460
+ )
461
+ if _response.status_code == 404:
462
+ raise NotFoundError(
463
+ headers=dict(_response.headers),
464
+ body=typing.cast(
465
+ HttpErrorResponse,
466
+ parse_obj_as(
467
+ type_=HttpErrorResponse, # type: ignore
468
+ object_=_response.json(),
469
+ ),
470
+ ),
471
+ )
472
+ if _response.status_code == 422:
473
+ raise UnprocessableEntityError(
474
+ headers=dict(_response.headers),
475
+ body=typing.cast(
476
+ HttpValidationError,
477
+ parse_obj_as(
478
+ type_=HttpValidationError, # type: ignore
479
+ object_=_response.json(),
480
+ ),
481
+ ),
482
+ )
483
+ if _response.status_code == 429:
484
+ raise TooManyRequestsError(
485
+ headers=dict(_response.headers),
486
+ body=typing.cast(
487
+ HttpErrorResponse,
488
+ parse_obj_as(
489
+ type_=HttpErrorResponse, # type: ignore
490
+ object_=_response.json(),
491
+ ),
492
+ ),
493
+ )
494
+ if _response.status_code == 502:
495
+ raise BadGatewayError(
496
+ headers=dict(_response.headers),
497
+ body=typing.cast(
498
+ HttpErrorResponse,
499
+ parse_obj_as(
500
+ type_=HttpErrorResponse, # type: ignore
501
+ object_=_response.json(),
502
+ ),
503
+ ),
504
+ )
505
+ if _response.status_code == 504:
506
+ raise GatewayTimeoutError(
507
+ headers=dict(_response.headers),
508
+ body=typing.cast(
509
+ HttpErrorResponse,
510
+ parse_obj_as(
511
+ type_=HttpErrorResponse, # type: ignore
512
+ object_=_response.json(),
513
+ ),
514
+ ),
515
+ )
516
+ _response_json = _response.json()
517
+ except JSONDecodeError:
518
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
519
+ except ValidationError as e:
520
+ raise ParsingError(
521
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
522
+ )
523
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
524
+
525
+ def delete(
526
+ self, charge_point_id: str, *, request_options: typing.Optional[RequestOptions] = None
527
+ ) -> HttpResponse[None]:
528
+ """
529
+ Deletes the charger with its EVSEs and connectors. Refused with 409 while charging sessions reference it, because that would erase their history.
530
+
531
+ Parameters
532
+ ----------
533
+ charge_point_id : str
534
+ The charger's OCPP identity.
535
+
536
+ request_options : typing.Optional[RequestOptions]
537
+ Request-specific configuration.
538
+
539
+ Returns
540
+ -------
541
+ HttpResponse[None]
542
+ """
543
+ _response = self._client_wrapper.httpx_client.request(
544
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}",
545
+ method="DELETE",
546
+ request_options=request_options,
547
+ )
548
+ try:
549
+ if 200 <= _response.status_code < 300:
550
+ return HttpResponse(response=_response, data=None)
551
+ if _response.status_code == 401:
552
+ raise UnauthorizedError(
553
+ headers=dict(_response.headers),
554
+ body=typing.cast(
555
+ HttpErrorResponse,
556
+ parse_obj_as(
557
+ type_=HttpErrorResponse, # type: ignore
558
+ object_=_response.json(),
559
+ ),
560
+ ),
561
+ )
562
+ if _response.status_code == 404:
563
+ raise NotFoundError(
564
+ headers=dict(_response.headers),
565
+ body=typing.cast(
566
+ HttpErrorResponse,
567
+ parse_obj_as(
568
+ type_=HttpErrorResponse, # type: ignore
569
+ object_=_response.json(),
570
+ ),
571
+ ),
572
+ )
573
+ if _response.status_code == 409:
574
+ raise ConflictError(
575
+ headers=dict(_response.headers),
576
+ body=typing.cast(
577
+ HttpErrorResponse,
578
+ parse_obj_as(
579
+ type_=HttpErrorResponse, # type: ignore
580
+ object_=_response.json(),
581
+ ),
582
+ ),
583
+ )
584
+ if _response.status_code == 422:
585
+ raise UnprocessableEntityError(
586
+ headers=dict(_response.headers),
587
+ body=typing.cast(
588
+ HttpValidationError,
589
+ parse_obj_as(
590
+ type_=HttpValidationError, # type: ignore
591
+ object_=_response.json(),
592
+ ),
593
+ ),
594
+ )
595
+ if _response.status_code == 429:
596
+ raise TooManyRequestsError(
597
+ headers=dict(_response.headers),
598
+ body=typing.cast(
599
+ HttpErrorResponse,
600
+ parse_obj_as(
601
+ type_=HttpErrorResponse, # type: ignore
602
+ object_=_response.json(),
603
+ ),
604
+ ),
605
+ )
606
+ if _response.status_code == 502:
607
+ raise BadGatewayError(
608
+ headers=dict(_response.headers),
609
+ body=typing.cast(
610
+ HttpErrorResponse,
611
+ parse_obj_as(
612
+ type_=HttpErrorResponse, # type: ignore
613
+ object_=_response.json(),
614
+ ),
615
+ ),
616
+ )
617
+ if _response.status_code == 504:
618
+ raise GatewayTimeoutError(
619
+ headers=dict(_response.headers),
620
+ body=typing.cast(
621
+ HttpErrorResponse,
622
+ parse_obj_as(
623
+ type_=HttpErrorResponse, # type: ignore
624
+ object_=_response.json(),
625
+ ),
626
+ ),
627
+ )
628
+ _response_json = _response.json()
629
+ except JSONDecodeError:
630
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
631
+ except ValidationError as e:
632
+ raise ParsingError(
633
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
634
+ )
635
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
636
+
637
+ def update(
638
+ self,
639
+ charge_point_id: str,
640
+ *,
641
+ expected_revision: typing.Optional[int] = OMIT,
642
+ ocpp_version: typing.Optional[OcppVersion] = OMIT,
643
+ charge_point_vendor: typing.Optional[str] = OMIT,
644
+ charge_point_model: typing.Optional[str] = OMIT,
645
+ location_id: typing.Optional[int] = OMIT,
646
+ coordinates: typing.Optional[str] = OMIT,
647
+ floor_level: typing.Optional[str] = OMIT,
648
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
649
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
650
+ max_power_kw: typing.Optional[float] = OMIT,
651
+ connector_type: typing.Optional[str] = OMIT,
652
+ connector_count: typing.Optional[int] = OMIT,
653
+ accessibility: typing.Optional[str] = OMIT,
654
+ use_status_notification0: typing.Optional[bool] = OMIT,
655
+ image_url: typing.Optional[str] = OMIT,
656
+ is_roaming: typing.Optional[bool] = OMIT,
657
+ access_mode: typing.Optional[AccessMode] = OMIT,
658
+ site_type: typing.Optional[SiteType] = OMIT,
659
+ customer_id: typing.Optional[int] = OMIT,
660
+ sharing_schedule: typing.Optional[typing.Sequence[SharingSlotInput]] = OMIT,
661
+ sharing_paused: typing.Optional[bool] = OMIT,
662
+ pricing: typing.Optional[PricingMode] = OMIT,
663
+ free_vend: typing.Optional[bool] = OMIT,
664
+ free_vend_id_tag: typing.Optional[str] = OMIT,
665
+ request_options: typing.Optional[RequestOptions] = None,
666
+ ) -> HttpResponse[ChargePointOut]:
667
+ """
668
+ Changes only the fields sent; send null to clear a field. Send ``expected_revision`` to have the update refused with 409 if the charger changed since you read it.
669
+
670
+ Parameters
671
+ ----------
672
+ charge_point_id : str
673
+ The charger's OCPP identity.
674
+
675
+ expected_revision : typing.Optional[int]
676
+
677
+ ocpp_version : typing.Optional[OcppVersion]
678
+
679
+ charge_point_vendor : typing.Optional[str]
680
+
681
+ charge_point_model : typing.Optional[str]
682
+
683
+ location_id : typing.Optional[int]
684
+
685
+ coordinates : typing.Optional[str]
686
+
687
+ floor_level : typing.Optional[str]
688
+
689
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
690
+
691
+ capabilities : typing.Optional[typing.Sequence[str]]
692
+
693
+ max_power_kw : typing.Optional[float]
694
+
695
+ connector_type : typing.Optional[str]
696
+
697
+ connector_count : typing.Optional[int]
698
+
699
+ accessibility : typing.Optional[str]
700
+
701
+ use_status_notification0 : typing.Optional[bool]
702
+
703
+ image_url : typing.Optional[str]
704
+
705
+ is_roaming : typing.Optional[bool]
706
+
707
+ access_mode : typing.Optional[AccessMode]
708
+
709
+ site_type : typing.Optional[SiteType]
710
+
711
+ customer_id : typing.Optional[int]
712
+
713
+ sharing_schedule : typing.Optional[typing.Sequence[SharingSlotInput]]
714
+
715
+ sharing_paused : typing.Optional[bool]
716
+
717
+ pricing : typing.Optional[PricingMode]
718
+
719
+ free_vend : typing.Optional[bool]
720
+
721
+ free_vend_id_tag : typing.Optional[str]
722
+
723
+ request_options : typing.Optional[RequestOptions]
724
+ Request-specific configuration.
725
+
726
+ Returns
727
+ -------
728
+ HttpResponse[ChargePointOut]
729
+ The object after the update.
730
+ """
731
+ _response = self._client_wrapper.httpx_client.request(
732
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}",
733
+ method="PATCH",
734
+ json={
735
+ "expected_revision": expected_revision,
736
+ "ocpp_version": ocpp_version,
737
+ "charge_point_vendor": charge_point_vendor,
738
+ "charge_point_model": charge_point_model,
739
+ "location_id": location_id,
740
+ "coordinates": coordinates,
741
+ "floor_level": floor_level,
742
+ "parking_restrictions": parking_restrictions,
743
+ "capabilities": capabilities,
744
+ "max_power_kw": max_power_kw,
745
+ "connector_type": connector_type,
746
+ "connector_count": connector_count,
747
+ "accessibility": accessibility,
748
+ "use_status_notification_0": use_status_notification0,
749
+ "image_url": image_url,
750
+ "is_roaming": is_roaming,
751
+ "access_mode": access_mode,
752
+ "site_type": site_type,
753
+ "customer_id": customer_id,
754
+ "sharing_schedule": convert_and_respect_annotation_metadata(
755
+ object_=sharing_schedule,
756
+ annotation=typing.Optional[typing.Sequence[SharingSlotInput]],
757
+ direction="write",
758
+ ),
759
+ "sharing_paused": sharing_paused,
760
+ "pricing": pricing,
761
+ "free_vend": free_vend,
762
+ "free_vend_id_tag": free_vend_id_tag,
763
+ },
764
+ headers={
765
+ "content-type": "application/json",
766
+ },
767
+ request_options=request_options,
768
+ omit=OMIT,
769
+ )
770
+ try:
771
+ if 200 <= _response.status_code < 300:
772
+ _data = typing.cast(
773
+ ChargePointOut,
774
+ parse_obj_as(
775
+ type_=ChargePointOut, # type: ignore
776
+ object_=_response.json(),
777
+ ),
778
+ )
779
+ return HttpResponse(response=_response, data=_data)
780
+ if _response.status_code == 401:
781
+ raise UnauthorizedError(
782
+ headers=dict(_response.headers),
783
+ body=typing.cast(
784
+ HttpErrorResponse,
785
+ parse_obj_as(
786
+ type_=HttpErrorResponse, # type: ignore
787
+ object_=_response.json(),
788
+ ),
789
+ ),
790
+ )
791
+ if _response.status_code == 404:
792
+ raise NotFoundError(
793
+ headers=dict(_response.headers),
794
+ body=typing.cast(
795
+ HttpErrorResponse,
796
+ parse_obj_as(
797
+ type_=HttpErrorResponse, # type: ignore
798
+ object_=_response.json(),
799
+ ),
800
+ ),
801
+ )
802
+ if _response.status_code == 409:
803
+ raise ConflictError(
804
+ headers=dict(_response.headers),
805
+ body=typing.cast(
806
+ HttpErrorResponse,
807
+ parse_obj_as(
808
+ type_=HttpErrorResponse, # type: ignore
809
+ object_=_response.json(),
810
+ ),
811
+ ),
812
+ )
813
+ if _response.status_code == 422:
814
+ raise UnprocessableEntityError(
815
+ headers=dict(_response.headers),
816
+ body=typing.cast(
817
+ HttpValidationError,
818
+ parse_obj_as(
819
+ type_=HttpValidationError, # type: ignore
820
+ object_=_response.json(),
821
+ ),
822
+ ),
823
+ )
824
+ if _response.status_code == 429:
825
+ raise TooManyRequestsError(
826
+ headers=dict(_response.headers),
827
+ body=typing.cast(
828
+ HttpErrorResponse,
829
+ parse_obj_as(
830
+ type_=HttpErrorResponse, # type: ignore
831
+ object_=_response.json(),
832
+ ),
833
+ ),
834
+ )
835
+ if _response.status_code == 502:
836
+ raise BadGatewayError(
837
+ headers=dict(_response.headers),
838
+ body=typing.cast(
839
+ HttpErrorResponse,
840
+ parse_obj_as(
841
+ type_=HttpErrorResponse, # type: ignore
842
+ object_=_response.json(),
843
+ ),
844
+ ),
845
+ )
846
+ if _response.status_code == 504:
847
+ raise GatewayTimeoutError(
848
+ headers=dict(_response.headers),
849
+ body=typing.cast(
850
+ HttpErrorResponse,
851
+ parse_obj_as(
852
+ type_=HttpErrorResponse, # type: ignore
853
+ object_=_response.json(),
854
+ ),
855
+ ),
856
+ )
857
+ _response_json = _response.json()
858
+ except JSONDecodeError:
859
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
860
+ except ValidationError as e:
861
+ raise ParsingError(
862
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
863
+ )
864
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
865
+
866
+ def list_cdrs(
867
+ self,
868
+ charge_point_id: str,
869
+ *,
870
+ date_from: typing.Optional[dt.datetime] = None,
871
+ date_to: typing.Optional[dt.datetime] = None,
872
+ offset: typing.Optional[int] = None,
873
+ limit: typing.Optional[int] = None,
874
+ request_options: typing.Optional[RequestOptions] = None,
875
+ ) -> SyncPager[CdrOut, CdrPage]:
876
+ """
877
+ CDRs of sessions on the charger, newest start first, optionally within a time window. 404 if the charger does not exist.
878
+
879
+ Parameters
880
+ ----------
881
+ charge_point_id : str
882
+ The charger's OCPP identity.
883
+
884
+ date_from : typing.Optional[dt.datetime]
885
+ Only rows starting at or after this time (inclusive).
886
+
887
+ date_to : typing.Optional[dt.datetime]
888
+ Only rows starting before this time (exclusive).
889
+
890
+ offset : typing.Optional[int]
891
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
892
+
893
+ limit : typing.Optional[int]
894
+ Maximum rows per page (default 50, max 200).
895
+
896
+ request_options : typing.Optional[RequestOptions]
897
+ Request-specific configuration.
898
+
899
+ Returns
900
+ -------
901
+ SyncPager[CdrOut, CdrPage]
902
+ One page of results; ``next_offset`` is null on the last page.
903
+ """
904
+ _response = self._client_wrapper.httpx_client.request(
905
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/cdrs",
906
+ method="GET",
907
+ params={
908
+ "date_from": serialize_datetime(date_from) if date_from is not None else None,
909
+ "date_to": serialize_datetime(date_to) if date_to is not None else None,
910
+ "offset": offset,
911
+ "limit": limit,
912
+ },
913
+ request_options=request_options,
914
+ )
915
+ try:
916
+ if 200 <= _response.status_code < 300:
917
+ _parsed_response = typing.cast(
918
+ CdrPage,
919
+ parse_obj_as(
920
+ type_=CdrPage, # type: ignore
921
+ object_=_response.json(),
922
+ ),
923
+ )
924
+ _items = _parsed_response.items
925
+ _parsed_next = _parsed_response.next_offset
926
+ _has_next = _parsed_next is not None and _parsed_next != ""
927
+ _get_next = lambda: self.list_cdrs(
928
+ charge_point_id,
929
+ date_from=date_from,
930
+ date_to=date_to,
931
+ offset=_parsed_next,
932
+ limit=limit,
933
+ request_options=request_options,
934
+ )
935
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
936
+ if _response.status_code == 401:
937
+ raise UnauthorizedError(
938
+ headers=dict(_response.headers),
939
+ body=typing.cast(
940
+ HttpErrorResponse,
941
+ parse_obj_as(
942
+ type_=HttpErrorResponse, # type: ignore
943
+ object_=_response.json(),
944
+ ),
945
+ ),
946
+ )
947
+ if _response.status_code == 404:
948
+ raise NotFoundError(
949
+ headers=dict(_response.headers),
950
+ body=typing.cast(
951
+ HttpErrorResponse,
952
+ parse_obj_as(
953
+ type_=HttpErrorResponse, # type: ignore
954
+ object_=_response.json(),
955
+ ),
956
+ ),
957
+ )
958
+ if _response.status_code == 422:
959
+ raise UnprocessableEntityError(
960
+ headers=dict(_response.headers),
961
+ body=typing.cast(
962
+ HttpValidationError,
963
+ parse_obj_as(
964
+ type_=HttpValidationError, # type: ignore
965
+ object_=_response.json(),
966
+ ),
967
+ ),
968
+ )
969
+ if _response.status_code == 429:
970
+ raise TooManyRequestsError(
971
+ headers=dict(_response.headers),
972
+ body=typing.cast(
973
+ HttpErrorResponse,
974
+ parse_obj_as(
975
+ type_=HttpErrorResponse, # type: ignore
976
+ object_=_response.json(),
977
+ ),
978
+ ),
979
+ )
980
+ if _response.status_code == 502:
981
+ raise BadGatewayError(
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 == 504:
992
+ raise GatewayTimeoutError(
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
+ _response_json = _response.json()
1003
+ except JSONDecodeError:
1004
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1005
+ except ValidationError as e:
1006
+ raise ParsingError(
1007
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1008
+ )
1009
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1010
+
1011
+ def list_connectors(
1012
+ self,
1013
+ charge_point_id: str,
1014
+ *,
1015
+ offset: typing.Optional[int] = None,
1016
+ limit: typing.Optional[int] = None,
1017
+ request_options: typing.Optional[RequestOptions] = None,
1018
+ ) -> SyncPager[CpoConnectorOut, ConnectorPage]:
1019
+ """
1020
+ The charger's connectors. 404 if the charger does not exist.
1021
+
1022
+ Parameters
1023
+ ----------
1024
+ charge_point_id : str
1025
+ The charger's OCPP identity.
1026
+
1027
+ offset : typing.Optional[int]
1028
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
1029
+
1030
+ limit : typing.Optional[int]
1031
+ Maximum rows per page (default 50, max 200).
1032
+
1033
+ request_options : typing.Optional[RequestOptions]
1034
+ Request-specific configuration.
1035
+
1036
+ Returns
1037
+ -------
1038
+ SyncPager[CpoConnectorOut, ConnectorPage]
1039
+ One page of results; ``next_offset`` is null on the last page.
1040
+ """
1041
+ _response = self._client_wrapper.httpx_client.request(
1042
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/connectors",
1043
+ method="GET",
1044
+ params={
1045
+ "offset": offset,
1046
+ "limit": limit,
1047
+ },
1048
+ request_options=request_options,
1049
+ )
1050
+ try:
1051
+ if 200 <= _response.status_code < 300:
1052
+ _parsed_response = typing.cast(
1053
+ ConnectorPage,
1054
+ parse_obj_as(
1055
+ type_=ConnectorPage, # type: ignore
1056
+ object_=_response.json(),
1057
+ ),
1058
+ )
1059
+ _items = _parsed_response.items
1060
+ _parsed_next = _parsed_response.next_offset
1061
+ _has_next = _parsed_next is not None and _parsed_next != ""
1062
+ _get_next = lambda: self.list_connectors(
1063
+ charge_point_id,
1064
+ offset=_parsed_next,
1065
+ limit=limit,
1066
+ request_options=request_options,
1067
+ )
1068
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
1069
+ if _response.status_code == 401:
1070
+ raise UnauthorizedError(
1071
+ headers=dict(_response.headers),
1072
+ body=typing.cast(
1073
+ HttpErrorResponse,
1074
+ parse_obj_as(
1075
+ type_=HttpErrorResponse, # type: ignore
1076
+ object_=_response.json(),
1077
+ ),
1078
+ ),
1079
+ )
1080
+ if _response.status_code == 404:
1081
+ raise NotFoundError(
1082
+ headers=dict(_response.headers),
1083
+ body=typing.cast(
1084
+ HttpErrorResponse,
1085
+ parse_obj_as(
1086
+ type_=HttpErrorResponse, # type: ignore
1087
+ object_=_response.json(),
1088
+ ),
1089
+ ),
1090
+ )
1091
+ if _response.status_code == 422:
1092
+ raise UnprocessableEntityError(
1093
+ headers=dict(_response.headers),
1094
+ body=typing.cast(
1095
+ HttpValidationError,
1096
+ parse_obj_as(
1097
+ type_=HttpValidationError, # type: ignore
1098
+ object_=_response.json(),
1099
+ ),
1100
+ ),
1101
+ )
1102
+ if _response.status_code == 429:
1103
+ raise TooManyRequestsError(
1104
+ headers=dict(_response.headers),
1105
+ body=typing.cast(
1106
+ HttpErrorResponse,
1107
+ parse_obj_as(
1108
+ type_=HttpErrorResponse, # type: ignore
1109
+ object_=_response.json(),
1110
+ ),
1111
+ ),
1112
+ )
1113
+ if _response.status_code == 502:
1114
+ raise BadGatewayError(
1115
+ headers=dict(_response.headers),
1116
+ body=typing.cast(
1117
+ HttpErrorResponse,
1118
+ parse_obj_as(
1119
+ type_=HttpErrorResponse, # type: ignore
1120
+ object_=_response.json(),
1121
+ ),
1122
+ ),
1123
+ )
1124
+ if _response.status_code == 504:
1125
+ raise GatewayTimeoutError(
1126
+ headers=dict(_response.headers),
1127
+ body=typing.cast(
1128
+ HttpErrorResponse,
1129
+ parse_obj_as(
1130
+ type_=HttpErrorResponse, # type: ignore
1131
+ object_=_response.json(),
1132
+ ),
1133
+ ),
1134
+ )
1135
+ _response_json = _response.json()
1136
+ except JSONDecodeError:
1137
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1138
+ except ValidationError as e:
1139
+ raise ParsingError(
1140
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1141
+ )
1142
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1143
+
1144
+ def list_evses(
1145
+ self,
1146
+ charge_point_id: str,
1147
+ *,
1148
+ offset: typing.Optional[int] = None,
1149
+ limit: typing.Optional[int] = None,
1150
+ request_options: typing.Optional[RequestOptions] = None,
1151
+ ) -> SyncPager[CpoEvseOut, EvsePage]:
1152
+ """
1153
+ The charger's EVSEs. 404 if the charger does not exist.
1154
+
1155
+ Parameters
1156
+ ----------
1157
+ charge_point_id : str
1158
+ The charger's OCPP identity.
1159
+
1160
+ offset : typing.Optional[int]
1161
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
1162
+
1163
+ limit : typing.Optional[int]
1164
+ Maximum rows per page (default 50, max 200).
1165
+
1166
+ request_options : typing.Optional[RequestOptions]
1167
+ Request-specific configuration.
1168
+
1169
+ Returns
1170
+ -------
1171
+ SyncPager[CpoEvseOut, EvsePage]
1172
+ One page of results; ``next_offset`` is null on the last page.
1173
+ """
1174
+ _response = self._client_wrapper.httpx_client.request(
1175
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/evses",
1176
+ method="GET",
1177
+ params={
1178
+ "offset": offset,
1179
+ "limit": limit,
1180
+ },
1181
+ request_options=request_options,
1182
+ )
1183
+ try:
1184
+ if 200 <= _response.status_code < 300:
1185
+ _parsed_response = typing.cast(
1186
+ EvsePage,
1187
+ parse_obj_as(
1188
+ type_=EvsePage, # type: ignore
1189
+ object_=_response.json(),
1190
+ ),
1191
+ )
1192
+ _items = _parsed_response.items
1193
+ _parsed_next = _parsed_response.next_offset
1194
+ _has_next = _parsed_next is not None and _parsed_next != ""
1195
+ _get_next = lambda: self.list_evses(
1196
+ charge_point_id,
1197
+ offset=_parsed_next,
1198
+ limit=limit,
1199
+ request_options=request_options,
1200
+ )
1201
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
1202
+ if _response.status_code == 401:
1203
+ raise UnauthorizedError(
1204
+ headers=dict(_response.headers),
1205
+ body=typing.cast(
1206
+ HttpErrorResponse,
1207
+ parse_obj_as(
1208
+ type_=HttpErrorResponse, # type: ignore
1209
+ object_=_response.json(),
1210
+ ),
1211
+ ),
1212
+ )
1213
+ if _response.status_code == 404:
1214
+ raise NotFoundError(
1215
+ headers=dict(_response.headers),
1216
+ body=typing.cast(
1217
+ HttpErrorResponse,
1218
+ parse_obj_as(
1219
+ type_=HttpErrorResponse, # type: ignore
1220
+ object_=_response.json(),
1221
+ ),
1222
+ ),
1223
+ )
1224
+ if _response.status_code == 422:
1225
+ raise UnprocessableEntityError(
1226
+ headers=dict(_response.headers),
1227
+ body=typing.cast(
1228
+ HttpValidationError,
1229
+ parse_obj_as(
1230
+ type_=HttpValidationError, # type: ignore
1231
+ object_=_response.json(),
1232
+ ),
1233
+ ),
1234
+ )
1235
+ if _response.status_code == 429:
1236
+ raise TooManyRequestsError(
1237
+ headers=dict(_response.headers),
1238
+ body=typing.cast(
1239
+ HttpErrorResponse,
1240
+ parse_obj_as(
1241
+ type_=HttpErrorResponse, # type: ignore
1242
+ object_=_response.json(),
1243
+ ),
1244
+ ),
1245
+ )
1246
+ if _response.status_code == 502:
1247
+ raise BadGatewayError(
1248
+ headers=dict(_response.headers),
1249
+ body=typing.cast(
1250
+ HttpErrorResponse,
1251
+ parse_obj_as(
1252
+ type_=HttpErrorResponse, # type: ignore
1253
+ object_=_response.json(),
1254
+ ),
1255
+ ),
1256
+ )
1257
+ if _response.status_code == 504:
1258
+ raise GatewayTimeoutError(
1259
+ headers=dict(_response.headers),
1260
+ body=typing.cast(
1261
+ HttpErrorResponse,
1262
+ parse_obj_as(
1263
+ type_=HttpErrorResponse, # type: ignore
1264
+ object_=_response.json(),
1265
+ ),
1266
+ ),
1267
+ )
1268
+ _response_json = _response.json()
1269
+ except JSONDecodeError:
1270
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1271
+ except ValidationError as e:
1272
+ raise ParsingError(
1273
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1274
+ )
1275
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1276
+
1277
+ def list_sessions(
1278
+ self,
1279
+ charge_point_id: str,
1280
+ *,
1281
+ date_from: typing.Optional[dt.datetime] = None,
1282
+ date_to: typing.Optional[dt.datetime] = None,
1283
+ offset: typing.Optional[int] = None,
1284
+ limit: typing.Optional[int] = None,
1285
+ request_options: typing.Optional[RequestOptions] = None,
1286
+ ) -> SyncPager[SessionOut, SessionPage]:
1287
+ """
1288
+ Charging sessions on the charger, newest start first, optionally within a time window. 404 if the charger does not exist.
1289
+
1290
+ Parameters
1291
+ ----------
1292
+ charge_point_id : str
1293
+ The charger's OCPP identity.
1294
+
1295
+ date_from : typing.Optional[dt.datetime]
1296
+ Only rows starting at or after this time (inclusive).
1297
+
1298
+ date_to : typing.Optional[dt.datetime]
1299
+ Only rows starting before this time (exclusive).
1300
+
1301
+ offset : typing.Optional[int]
1302
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
1303
+
1304
+ limit : typing.Optional[int]
1305
+ Maximum rows per page (default 50, max 200).
1306
+
1307
+ request_options : typing.Optional[RequestOptions]
1308
+ Request-specific configuration.
1309
+
1310
+ Returns
1311
+ -------
1312
+ SyncPager[SessionOut, SessionPage]
1313
+ One page of results; ``next_offset`` is null on the last page.
1314
+ """
1315
+ _response = self._client_wrapper.httpx_client.request(
1316
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/sessions",
1317
+ method="GET",
1318
+ params={
1319
+ "date_from": serialize_datetime(date_from) if date_from is not None else None,
1320
+ "date_to": serialize_datetime(date_to) if date_to is not None else None,
1321
+ "offset": offset,
1322
+ "limit": limit,
1323
+ },
1324
+ request_options=request_options,
1325
+ )
1326
+ try:
1327
+ if 200 <= _response.status_code < 300:
1328
+ _parsed_response = typing.cast(
1329
+ SessionPage,
1330
+ parse_obj_as(
1331
+ type_=SessionPage, # type: ignore
1332
+ object_=_response.json(),
1333
+ ),
1334
+ )
1335
+ _items = _parsed_response.items
1336
+ _parsed_next = _parsed_response.next_offset
1337
+ _has_next = _parsed_next is not None and _parsed_next != ""
1338
+ _get_next = lambda: self.list_sessions(
1339
+ charge_point_id,
1340
+ date_from=date_from,
1341
+ date_to=date_to,
1342
+ offset=_parsed_next,
1343
+ limit=limit,
1344
+ request_options=request_options,
1345
+ )
1346
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
1347
+ if _response.status_code == 401:
1348
+ raise UnauthorizedError(
1349
+ headers=dict(_response.headers),
1350
+ body=typing.cast(
1351
+ HttpErrorResponse,
1352
+ parse_obj_as(
1353
+ type_=HttpErrorResponse, # type: ignore
1354
+ object_=_response.json(),
1355
+ ),
1356
+ ),
1357
+ )
1358
+ if _response.status_code == 404:
1359
+ raise NotFoundError(
1360
+ headers=dict(_response.headers),
1361
+ body=typing.cast(
1362
+ HttpErrorResponse,
1363
+ parse_obj_as(
1364
+ type_=HttpErrorResponse, # type: ignore
1365
+ object_=_response.json(),
1366
+ ),
1367
+ ),
1368
+ )
1369
+ if _response.status_code == 422:
1370
+ raise UnprocessableEntityError(
1371
+ headers=dict(_response.headers),
1372
+ body=typing.cast(
1373
+ HttpValidationError,
1374
+ parse_obj_as(
1375
+ type_=HttpValidationError, # type: ignore
1376
+ object_=_response.json(),
1377
+ ),
1378
+ ),
1379
+ )
1380
+ if _response.status_code == 429:
1381
+ raise TooManyRequestsError(
1382
+ headers=dict(_response.headers),
1383
+ body=typing.cast(
1384
+ HttpErrorResponse,
1385
+ parse_obj_as(
1386
+ type_=HttpErrorResponse, # type: ignore
1387
+ object_=_response.json(),
1388
+ ),
1389
+ ),
1390
+ )
1391
+ if _response.status_code == 502:
1392
+ raise BadGatewayError(
1393
+ headers=dict(_response.headers),
1394
+ body=typing.cast(
1395
+ HttpErrorResponse,
1396
+ parse_obj_as(
1397
+ type_=HttpErrorResponse, # type: ignore
1398
+ object_=_response.json(),
1399
+ ),
1400
+ ),
1401
+ )
1402
+ if _response.status_code == 504:
1403
+ raise GatewayTimeoutError(
1404
+ headers=dict(_response.headers),
1405
+ body=typing.cast(
1406
+ HttpErrorResponse,
1407
+ parse_obj_as(
1408
+ type_=HttpErrorResponse, # type: ignore
1409
+ object_=_response.json(),
1410
+ ),
1411
+ ),
1412
+ )
1413
+ _response_json = _response.json()
1414
+ except JSONDecodeError:
1415
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1416
+ except ValidationError as e:
1417
+ raise ParsingError(
1418
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1419
+ )
1420
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1421
+
1422
+
1423
+ class AsyncRawChargePointsClient:
1424
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
1425
+ self._client_wrapper = client_wrapper
1426
+
1427
+ async def list(
1428
+ self,
1429
+ *,
1430
+ location_id: typing.Optional[int] = None,
1431
+ is_online: typing.Optional[bool] = None,
1432
+ ocpp_version: typing.Optional[ListChargePointsRequestOcppVersion] = None,
1433
+ offset: typing.Optional[int] = None,
1434
+ limit: typing.Optional[int] = None,
1435
+ request_options: typing.Optional[RequestOptions] = None,
1436
+ ) -> AsyncPager[ChargePointOut, ChargePointPage]:
1437
+ """
1438
+ Your chargers, sorted by OCPP identity. Online state, heartbeat and firmware come from the chargers themselves.
1439
+
1440
+ Parameters
1441
+ ----------
1442
+ location_id : typing.Optional[int]
1443
+ Only this location, by its numeric ``id`` (not its OCPI location id).
1444
+
1445
+ is_online : typing.Optional[bool]
1446
+ Only connected (true) or disconnected (false) chargers.
1447
+
1448
+ ocpp_version : typing.Optional[ListChargePointsRequestOcppVersion]
1449
+ Only chargers speaking this OCPP version.
1450
+
1451
+ offset : typing.Optional[int]
1452
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
1453
+
1454
+ limit : typing.Optional[int]
1455
+ Maximum rows per page (default 50, max 200).
1456
+
1457
+ request_options : typing.Optional[RequestOptions]
1458
+ Request-specific configuration.
1459
+
1460
+ Returns
1461
+ -------
1462
+ AsyncPager[ChargePointOut, ChargePointPage]
1463
+ One page of results; ``next_offset`` is null on the last page.
1464
+ """
1465
+ _response = await self._client_wrapper.httpx_client.request(
1466
+ "cpo/charge-points",
1467
+ method="GET",
1468
+ params={
1469
+ "location_id": location_id,
1470
+ "is_online": is_online,
1471
+ "ocpp_version": ocpp_version,
1472
+ "offset": offset,
1473
+ "limit": limit,
1474
+ },
1475
+ request_options=request_options,
1476
+ )
1477
+ try:
1478
+ if 200 <= _response.status_code < 300:
1479
+ _parsed_response = typing.cast(
1480
+ ChargePointPage,
1481
+ parse_obj_as(
1482
+ type_=ChargePointPage, # type: ignore
1483
+ object_=_response.json(),
1484
+ ),
1485
+ )
1486
+ _items = _parsed_response.items
1487
+ _parsed_next = _parsed_response.next_offset
1488
+ _has_next = _parsed_next is not None and _parsed_next != ""
1489
+
1490
+ async def _get_next():
1491
+ return await self.list(
1492
+ location_id=location_id,
1493
+ is_online=is_online,
1494
+ ocpp_version=ocpp_version,
1495
+ offset=_parsed_next,
1496
+ limit=limit,
1497
+ request_options=request_options,
1498
+ )
1499
+
1500
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
1501
+ if _response.status_code == 401:
1502
+ raise UnauthorizedError(
1503
+ headers=dict(_response.headers),
1504
+ body=typing.cast(
1505
+ HttpErrorResponse,
1506
+ parse_obj_as(
1507
+ type_=HttpErrorResponse, # type: ignore
1508
+ object_=_response.json(),
1509
+ ),
1510
+ ),
1511
+ )
1512
+ if _response.status_code == 422:
1513
+ raise UnprocessableEntityError(
1514
+ headers=dict(_response.headers),
1515
+ body=typing.cast(
1516
+ HttpValidationError,
1517
+ parse_obj_as(
1518
+ type_=HttpValidationError, # type: ignore
1519
+ object_=_response.json(),
1520
+ ),
1521
+ ),
1522
+ )
1523
+ if _response.status_code == 429:
1524
+ raise TooManyRequestsError(
1525
+ headers=dict(_response.headers),
1526
+ body=typing.cast(
1527
+ HttpErrorResponse,
1528
+ parse_obj_as(
1529
+ type_=HttpErrorResponse, # type: ignore
1530
+ object_=_response.json(),
1531
+ ),
1532
+ ),
1533
+ )
1534
+ if _response.status_code == 502:
1535
+ raise BadGatewayError(
1536
+ headers=dict(_response.headers),
1537
+ body=typing.cast(
1538
+ HttpErrorResponse,
1539
+ parse_obj_as(
1540
+ type_=HttpErrorResponse, # type: ignore
1541
+ object_=_response.json(),
1542
+ ),
1543
+ ),
1544
+ )
1545
+ if _response.status_code == 504:
1546
+ raise GatewayTimeoutError(
1547
+ headers=dict(_response.headers),
1548
+ body=typing.cast(
1549
+ HttpErrorResponse,
1550
+ parse_obj_as(
1551
+ type_=HttpErrorResponse, # type: ignore
1552
+ object_=_response.json(),
1553
+ ),
1554
+ ),
1555
+ )
1556
+ _response_json = _response.json()
1557
+ except JSONDecodeError:
1558
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1559
+ except ValidationError as e:
1560
+ raise ParsingError(
1561
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1562
+ )
1563
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1564
+
1565
+ async def create(
1566
+ self,
1567
+ *,
1568
+ charge_point_id: str,
1569
+ ocpp_version: typing.Optional[OcppVersion] = OMIT,
1570
+ charge_point_vendor: typing.Optional[str] = OMIT,
1571
+ charge_point_model: typing.Optional[str] = OMIT,
1572
+ location_id: typing.Optional[int] = OMIT,
1573
+ coordinates: typing.Optional[str] = OMIT,
1574
+ floor_level: typing.Optional[str] = OMIT,
1575
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
1576
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
1577
+ max_power_kw: typing.Optional[float] = OMIT,
1578
+ connector_type: typing.Optional[str] = OMIT,
1579
+ connector_count: typing.Optional[int] = OMIT,
1580
+ accessibility: typing.Optional[str] = OMIT,
1581
+ use_status_notification0: typing.Optional[bool] = OMIT,
1582
+ image_url: typing.Optional[str] = OMIT,
1583
+ is_roaming: typing.Optional[bool] = OMIT,
1584
+ access_mode: typing.Optional[AccessMode] = OMIT,
1585
+ site_type: typing.Optional[SiteType] = OMIT,
1586
+ customer_id: typing.Optional[int] = OMIT,
1587
+ sharing_schedule: typing.Optional[typing.Sequence[SharingSlotInput]] = OMIT,
1588
+ sharing_paused: typing.Optional[bool] = OMIT,
1589
+ pricing: typing.Optional[PricingMode] = OMIT,
1590
+ free_vend: typing.Optional[bool] = OMIT,
1591
+ free_vend_id_tag: typing.Optional[str] = OMIT,
1592
+ request_options: typing.Optional[RequestOptions] = None,
1593
+ ) -> AsyncHttpResponse[ChargePointCreatedOut]:
1594
+ """
1595
+ Registers a charger. It starts offline. The gateway refuses its connection until the charger is registered with the gateway; ``gateway_registered`` says whether it already is. 409 if the OCPP identity is taken.
1596
+
1597
+ Parameters
1598
+ ----------
1599
+ charge_point_id : str
1600
+
1601
+ ocpp_version : typing.Optional[OcppVersion]
1602
+
1603
+ charge_point_vendor : typing.Optional[str]
1604
+
1605
+ charge_point_model : typing.Optional[str]
1606
+
1607
+ location_id : typing.Optional[int]
1608
+
1609
+ coordinates : typing.Optional[str]
1610
+
1611
+ floor_level : typing.Optional[str]
1612
+
1613
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
1614
+
1615
+ capabilities : typing.Optional[typing.Sequence[str]]
1616
+
1617
+ max_power_kw : typing.Optional[float]
1618
+
1619
+ connector_type : typing.Optional[str]
1620
+
1621
+ connector_count : typing.Optional[int]
1622
+
1623
+ accessibility : typing.Optional[str]
1624
+
1625
+ use_status_notification0 : typing.Optional[bool]
1626
+
1627
+ image_url : typing.Optional[str]
1628
+
1629
+ is_roaming : typing.Optional[bool]
1630
+
1631
+ access_mode : typing.Optional[AccessMode]
1632
+
1633
+ site_type : typing.Optional[SiteType]
1634
+
1635
+ customer_id : typing.Optional[int]
1636
+
1637
+ sharing_schedule : typing.Optional[typing.Sequence[SharingSlotInput]]
1638
+
1639
+ sharing_paused : typing.Optional[bool]
1640
+
1641
+ pricing : typing.Optional[PricingMode]
1642
+
1643
+ free_vend : typing.Optional[bool]
1644
+
1645
+ free_vend_id_tag : typing.Optional[str]
1646
+
1647
+ request_options : typing.Optional[RequestOptions]
1648
+ Request-specific configuration.
1649
+
1650
+ Returns
1651
+ -------
1652
+ AsyncHttpResponse[ChargePointCreatedOut]
1653
+ The created object.
1654
+ """
1655
+ _request_options_with_retries_disabled: typing.Optional[RequestOptions] = (
1656
+ {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0}
1657
+ )
1658
+ _response = await self._client_wrapper.httpx_client.request(
1659
+ "cpo/charge-points",
1660
+ method="POST",
1661
+ json={
1662
+ "charge_point_id": charge_point_id,
1663
+ "ocpp_version": ocpp_version,
1664
+ "charge_point_vendor": charge_point_vendor,
1665
+ "charge_point_model": charge_point_model,
1666
+ "location_id": location_id,
1667
+ "coordinates": coordinates,
1668
+ "floor_level": floor_level,
1669
+ "parking_restrictions": parking_restrictions,
1670
+ "capabilities": capabilities,
1671
+ "max_power_kw": max_power_kw,
1672
+ "connector_type": connector_type,
1673
+ "connector_count": connector_count,
1674
+ "accessibility": accessibility,
1675
+ "use_status_notification_0": use_status_notification0,
1676
+ "image_url": image_url,
1677
+ "is_roaming": is_roaming,
1678
+ "access_mode": access_mode,
1679
+ "site_type": site_type,
1680
+ "customer_id": customer_id,
1681
+ "sharing_schedule": convert_and_respect_annotation_metadata(
1682
+ object_=sharing_schedule,
1683
+ annotation=typing.Optional[typing.Sequence[SharingSlotInput]],
1684
+ direction="write",
1685
+ ),
1686
+ "sharing_paused": sharing_paused,
1687
+ "pricing": pricing,
1688
+ "free_vend": free_vend,
1689
+ "free_vend_id_tag": free_vend_id_tag,
1690
+ },
1691
+ headers={
1692
+ "content-type": "application/json",
1693
+ },
1694
+ request_options=_request_options_with_retries_disabled,
1695
+ omit=OMIT,
1696
+ )
1697
+ try:
1698
+ if 200 <= _response.status_code < 300:
1699
+ _data = typing.cast(
1700
+ ChargePointCreatedOut,
1701
+ parse_obj_as(
1702
+ type_=ChargePointCreatedOut, # type: ignore
1703
+ object_=_response.json(),
1704
+ ),
1705
+ )
1706
+ return AsyncHttpResponse(response=_response, data=_data)
1707
+ if _response.status_code == 401:
1708
+ raise UnauthorizedError(
1709
+ headers=dict(_response.headers),
1710
+ body=typing.cast(
1711
+ HttpErrorResponse,
1712
+ parse_obj_as(
1713
+ type_=HttpErrorResponse, # type: ignore
1714
+ object_=_response.json(),
1715
+ ),
1716
+ ),
1717
+ )
1718
+ if _response.status_code == 404:
1719
+ raise NotFoundError(
1720
+ headers=dict(_response.headers),
1721
+ body=typing.cast(
1722
+ HttpErrorResponse,
1723
+ parse_obj_as(
1724
+ type_=HttpErrorResponse, # type: ignore
1725
+ object_=_response.json(),
1726
+ ),
1727
+ ),
1728
+ )
1729
+ if _response.status_code == 409:
1730
+ raise ConflictError(
1731
+ headers=dict(_response.headers),
1732
+ body=typing.cast(
1733
+ HttpErrorResponse,
1734
+ parse_obj_as(
1735
+ type_=HttpErrorResponse, # type: ignore
1736
+ object_=_response.json(),
1737
+ ),
1738
+ ),
1739
+ )
1740
+ if _response.status_code == 422:
1741
+ raise UnprocessableEntityError(
1742
+ headers=dict(_response.headers),
1743
+ body=typing.cast(
1744
+ HttpValidationError,
1745
+ parse_obj_as(
1746
+ type_=HttpValidationError, # type: ignore
1747
+ object_=_response.json(),
1748
+ ),
1749
+ ),
1750
+ )
1751
+ if _response.status_code == 429:
1752
+ raise TooManyRequestsError(
1753
+ headers=dict(_response.headers),
1754
+ body=typing.cast(
1755
+ HttpErrorResponse,
1756
+ parse_obj_as(
1757
+ type_=HttpErrorResponse, # type: ignore
1758
+ object_=_response.json(),
1759
+ ),
1760
+ ),
1761
+ )
1762
+ if _response.status_code == 502:
1763
+ raise BadGatewayError(
1764
+ headers=dict(_response.headers),
1765
+ body=typing.cast(
1766
+ HttpErrorResponse,
1767
+ parse_obj_as(
1768
+ type_=HttpErrorResponse, # type: ignore
1769
+ object_=_response.json(),
1770
+ ),
1771
+ ),
1772
+ )
1773
+ if _response.status_code == 504:
1774
+ raise GatewayTimeoutError(
1775
+ headers=dict(_response.headers),
1776
+ body=typing.cast(
1777
+ HttpErrorResponse,
1778
+ parse_obj_as(
1779
+ type_=HttpErrorResponse, # type: ignore
1780
+ object_=_response.json(),
1781
+ ),
1782
+ ),
1783
+ )
1784
+ _response_json = _response.json()
1785
+ except JSONDecodeError:
1786
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1787
+ except ValidationError as e:
1788
+ raise ParsingError(
1789
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1790
+ )
1791
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1792
+
1793
+ async def get(
1794
+ self, charge_point_id: str, *, request_options: typing.Optional[RequestOptions] = None
1795
+ ) -> AsyncHttpResponse[ChargePointOut]:
1796
+ """
1797
+ One charger by its OCPP identity.
1798
+
1799
+ Parameters
1800
+ ----------
1801
+ charge_point_id : str
1802
+ The charger's OCPP identity.
1803
+
1804
+ request_options : typing.Optional[RequestOptions]
1805
+ Request-specific configuration.
1806
+
1807
+ Returns
1808
+ -------
1809
+ AsyncHttpResponse[ChargePointOut]
1810
+ The requested object.
1811
+ """
1812
+ _response = await self._client_wrapper.httpx_client.request(
1813
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}",
1814
+ method="GET",
1815
+ request_options=request_options,
1816
+ )
1817
+ try:
1818
+ if 200 <= _response.status_code < 300:
1819
+ _data = typing.cast(
1820
+ ChargePointOut,
1821
+ parse_obj_as(
1822
+ type_=ChargePointOut, # type: ignore
1823
+ object_=_response.json(),
1824
+ ),
1825
+ )
1826
+ return AsyncHttpResponse(response=_response, data=_data)
1827
+ if _response.status_code == 401:
1828
+ raise UnauthorizedError(
1829
+ headers=dict(_response.headers),
1830
+ body=typing.cast(
1831
+ HttpErrorResponse,
1832
+ parse_obj_as(
1833
+ type_=HttpErrorResponse, # type: ignore
1834
+ object_=_response.json(),
1835
+ ),
1836
+ ),
1837
+ )
1838
+ if _response.status_code == 404:
1839
+ raise NotFoundError(
1840
+ headers=dict(_response.headers),
1841
+ body=typing.cast(
1842
+ HttpErrorResponse,
1843
+ parse_obj_as(
1844
+ type_=HttpErrorResponse, # type: ignore
1845
+ object_=_response.json(),
1846
+ ),
1847
+ ),
1848
+ )
1849
+ if _response.status_code == 422:
1850
+ raise UnprocessableEntityError(
1851
+ headers=dict(_response.headers),
1852
+ body=typing.cast(
1853
+ HttpValidationError,
1854
+ parse_obj_as(
1855
+ type_=HttpValidationError, # type: ignore
1856
+ object_=_response.json(),
1857
+ ),
1858
+ ),
1859
+ )
1860
+ if _response.status_code == 429:
1861
+ raise TooManyRequestsError(
1862
+ headers=dict(_response.headers),
1863
+ body=typing.cast(
1864
+ HttpErrorResponse,
1865
+ parse_obj_as(
1866
+ type_=HttpErrorResponse, # type: ignore
1867
+ object_=_response.json(),
1868
+ ),
1869
+ ),
1870
+ )
1871
+ if _response.status_code == 502:
1872
+ raise BadGatewayError(
1873
+ headers=dict(_response.headers),
1874
+ body=typing.cast(
1875
+ HttpErrorResponse,
1876
+ parse_obj_as(
1877
+ type_=HttpErrorResponse, # type: ignore
1878
+ object_=_response.json(),
1879
+ ),
1880
+ ),
1881
+ )
1882
+ if _response.status_code == 504:
1883
+ raise GatewayTimeoutError(
1884
+ headers=dict(_response.headers),
1885
+ body=typing.cast(
1886
+ HttpErrorResponse,
1887
+ parse_obj_as(
1888
+ type_=HttpErrorResponse, # type: ignore
1889
+ object_=_response.json(),
1890
+ ),
1891
+ ),
1892
+ )
1893
+ _response_json = _response.json()
1894
+ except JSONDecodeError:
1895
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1896
+ except ValidationError as e:
1897
+ raise ParsingError(
1898
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1899
+ )
1900
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1901
+
1902
+ async def delete(
1903
+ self, charge_point_id: str, *, request_options: typing.Optional[RequestOptions] = None
1904
+ ) -> AsyncHttpResponse[None]:
1905
+ """
1906
+ Deletes the charger with its EVSEs and connectors. Refused with 409 while charging sessions reference it, because that would erase their history.
1907
+
1908
+ Parameters
1909
+ ----------
1910
+ charge_point_id : str
1911
+ The charger's OCPP identity.
1912
+
1913
+ request_options : typing.Optional[RequestOptions]
1914
+ Request-specific configuration.
1915
+
1916
+ Returns
1917
+ -------
1918
+ AsyncHttpResponse[None]
1919
+ """
1920
+ _response = await self._client_wrapper.httpx_client.request(
1921
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}",
1922
+ method="DELETE",
1923
+ request_options=request_options,
1924
+ )
1925
+ try:
1926
+ if 200 <= _response.status_code < 300:
1927
+ return AsyncHttpResponse(response=_response, data=None)
1928
+ if _response.status_code == 401:
1929
+ raise UnauthorizedError(
1930
+ headers=dict(_response.headers),
1931
+ body=typing.cast(
1932
+ HttpErrorResponse,
1933
+ parse_obj_as(
1934
+ type_=HttpErrorResponse, # type: ignore
1935
+ object_=_response.json(),
1936
+ ),
1937
+ ),
1938
+ )
1939
+ if _response.status_code == 404:
1940
+ raise NotFoundError(
1941
+ headers=dict(_response.headers),
1942
+ body=typing.cast(
1943
+ HttpErrorResponse,
1944
+ parse_obj_as(
1945
+ type_=HttpErrorResponse, # type: ignore
1946
+ object_=_response.json(),
1947
+ ),
1948
+ ),
1949
+ )
1950
+ if _response.status_code == 409:
1951
+ raise ConflictError(
1952
+ headers=dict(_response.headers),
1953
+ body=typing.cast(
1954
+ HttpErrorResponse,
1955
+ parse_obj_as(
1956
+ type_=HttpErrorResponse, # type: ignore
1957
+ object_=_response.json(),
1958
+ ),
1959
+ ),
1960
+ )
1961
+ if _response.status_code == 422:
1962
+ raise UnprocessableEntityError(
1963
+ headers=dict(_response.headers),
1964
+ body=typing.cast(
1965
+ HttpValidationError,
1966
+ parse_obj_as(
1967
+ type_=HttpValidationError, # type: ignore
1968
+ object_=_response.json(),
1969
+ ),
1970
+ ),
1971
+ )
1972
+ if _response.status_code == 429:
1973
+ raise TooManyRequestsError(
1974
+ headers=dict(_response.headers),
1975
+ body=typing.cast(
1976
+ HttpErrorResponse,
1977
+ parse_obj_as(
1978
+ type_=HttpErrorResponse, # type: ignore
1979
+ object_=_response.json(),
1980
+ ),
1981
+ ),
1982
+ )
1983
+ if _response.status_code == 502:
1984
+ raise BadGatewayError(
1985
+ headers=dict(_response.headers),
1986
+ body=typing.cast(
1987
+ HttpErrorResponse,
1988
+ parse_obj_as(
1989
+ type_=HttpErrorResponse, # type: ignore
1990
+ object_=_response.json(),
1991
+ ),
1992
+ ),
1993
+ )
1994
+ if _response.status_code == 504:
1995
+ raise GatewayTimeoutError(
1996
+ headers=dict(_response.headers),
1997
+ body=typing.cast(
1998
+ HttpErrorResponse,
1999
+ parse_obj_as(
2000
+ type_=HttpErrorResponse, # type: ignore
2001
+ object_=_response.json(),
2002
+ ),
2003
+ ),
2004
+ )
2005
+ _response_json = _response.json()
2006
+ except JSONDecodeError:
2007
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2008
+ except ValidationError as e:
2009
+ raise ParsingError(
2010
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
2011
+ )
2012
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2013
+
2014
+ async def update(
2015
+ self,
2016
+ charge_point_id: str,
2017
+ *,
2018
+ expected_revision: typing.Optional[int] = OMIT,
2019
+ ocpp_version: typing.Optional[OcppVersion] = OMIT,
2020
+ charge_point_vendor: typing.Optional[str] = OMIT,
2021
+ charge_point_model: typing.Optional[str] = OMIT,
2022
+ location_id: typing.Optional[int] = OMIT,
2023
+ coordinates: typing.Optional[str] = OMIT,
2024
+ floor_level: typing.Optional[str] = OMIT,
2025
+ parking_restrictions: typing.Optional[typing.Sequence[str]] = OMIT,
2026
+ capabilities: typing.Optional[typing.Sequence[str]] = OMIT,
2027
+ max_power_kw: typing.Optional[float] = OMIT,
2028
+ connector_type: typing.Optional[str] = OMIT,
2029
+ connector_count: typing.Optional[int] = OMIT,
2030
+ accessibility: typing.Optional[str] = OMIT,
2031
+ use_status_notification0: typing.Optional[bool] = OMIT,
2032
+ image_url: typing.Optional[str] = OMIT,
2033
+ is_roaming: typing.Optional[bool] = OMIT,
2034
+ access_mode: typing.Optional[AccessMode] = OMIT,
2035
+ site_type: typing.Optional[SiteType] = OMIT,
2036
+ customer_id: typing.Optional[int] = OMIT,
2037
+ sharing_schedule: typing.Optional[typing.Sequence[SharingSlotInput]] = OMIT,
2038
+ sharing_paused: typing.Optional[bool] = OMIT,
2039
+ pricing: typing.Optional[PricingMode] = OMIT,
2040
+ free_vend: typing.Optional[bool] = OMIT,
2041
+ free_vend_id_tag: typing.Optional[str] = OMIT,
2042
+ request_options: typing.Optional[RequestOptions] = None,
2043
+ ) -> AsyncHttpResponse[ChargePointOut]:
2044
+ """
2045
+ Changes only the fields sent; send null to clear a field. Send ``expected_revision`` to have the update refused with 409 if the charger changed since you read it.
2046
+
2047
+ Parameters
2048
+ ----------
2049
+ charge_point_id : str
2050
+ The charger's OCPP identity.
2051
+
2052
+ expected_revision : typing.Optional[int]
2053
+
2054
+ ocpp_version : typing.Optional[OcppVersion]
2055
+
2056
+ charge_point_vendor : typing.Optional[str]
2057
+
2058
+ charge_point_model : typing.Optional[str]
2059
+
2060
+ location_id : typing.Optional[int]
2061
+
2062
+ coordinates : typing.Optional[str]
2063
+
2064
+ floor_level : typing.Optional[str]
2065
+
2066
+ parking_restrictions : typing.Optional[typing.Sequence[str]]
2067
+
2068
+ capabilities : typing.Optional[typing.Sequence[str]]
2069
+
2070
+ max_power_kw : typing.Optional[float]
2071
+
2072
+ connector_type : typing.Optional[str]
2073
+
2074
+ connector_count : typing.Optional[int]
2075
+
2076
+ accessibility : typing.Optional[str]
2077
+
2078
+ use_status_notification0 : typing.Optional[bool]
2079
+
2080
+ image_url : typing.Optional[str]
2081
+
2082
+ is_roaming : typing.Optional[bool]
2083
+
2084
+ access_mode : typing.Optional[AccessMode]
2085
+
2086
+ site_type : typing.Optional[SiteType]
2087
+
2088
+ customer_id : typing.Optional[int]
2089
+
2090
+ sharing_schedule : typing.Optional[typing.Sequence[SharingSlotInput]]
2091
+
2092
+ sharing_paused : typing.Optional[bool]
2093
+
2094
+ pricing : typing.Optional[PricingMode]
2095
+
2096
+ free_vend : typing.Optional[bool]
2097
+
2098
+ free_vend_id_tag : typing.Optional[str]
2099
+
2100
+ request_options : typing.Optional[RequestOptions]
2101
+ Request-specific configuration.
2102
+
2103
+ Returns
2104
+ -------
2105
+ AsyncHttpResponse[ChargePointOut]
2106
+ The object after the update.
2107
+ """
2108
+ _response = await self._client_wrapper.httpx_client.request(
2109
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}",
2110
+ method="PATCH",
2111
+ json={
2112
+ "expected_revision": expected_revision,
2113
+ "ocpp_version": ocpp_version,
2114
+ "charge_point_vendor": charge_point_vendor,
2115
+ "charge_point_model": charge_point_model,
2116
+ "location_id": location_id,
2117
+ "coordinates": coordinates,
2118
+ "floor_level": floor_level,
2119
+ "parking_restrictions": parking_restrictions,
2120
+ "capabilities": capabilities,
2121
+ "max_power_kw": max_power_kw,
2122
+ "connector_type": connector_type,
2123
+ "connector_count": connector_count,
2124
+ "accessibility": accessibility,
2125
+ "use_status_notification_0": use_status_notification0,
2126
+ "image_url": image_url,
2127
+ "is_roaming": is_roaming,
2128
+ "access_mode": access_mode,
2129
+ "site_type": site_type,
2130
+ "customer_id": customer_id,
2131
+ "sharing_schedule": convert_and_respect_annotation_metadata(
2132
+ object_=sharing_schedule,
2133
+ annotation=typing.Optional[typing.Sequence[SharingSlotInput]],
2134
+ direction="write",
2135
+ ),
2136
+ "sharing_paused": sharing_paused,
2137
+ "pricing": pricing,
2138
+ "free_vend": free_vend,
2139
+ "free_vend_id_tag": free_vend_id_tag,
2140
+ },
2141
+ headers={
2142
+ "content-type": "application/json",
2143
+ },
2144
+ request_options=request_options,
2145
+ omit=OMIT,
2146
+ )
2147
+ try:
2148
+ if 200 <= _response.status_code < 300:
2149
+ _data = typing.cast(
2150
+ ChargePointOut,
2151
+ parse_obj_as(
2152
+ type_=ChargePointOut, # type: ignore
2153
+ object_=_response.json(),
2154
+ ),
2155
+ )
2156
+ return AsyncHttpResponse(response=_response, data=_data)
2157
+ if _response.status_code == 401:
2158
+ raise UnauthorizedError(
2159
+ headers=dict(_response.headers),
2160
+ body=typing.cast(
2161
+ HttpErrorResponse,
2162
+ parse_obj_as(
2163
+ type_=HttpErrorResponse, # type: ignore
2164
+ object_=_response.json(),
2165
+ ),
2166
+ ),
2167
+ )
2168
+ if _response.status_code == 404:
2169
+ raise NotFoundError(
2170
+ headers=dict(_response.headers),
2171
+ body=typing.cast(
2172
+ HttpErrorResponse,
2173
+ parse_obj_as(
2174
+ type_=HttpErrorResponse, # type: ignore
2175
+ object_=_response.json(),
2176
+ ),
2177
+ ),
2178
+ )
2179
+ if _response.status_code == 409:
2180
+ raise ConflictError(
2181
+ headers=dict(_response.headers),
2182
+ body=typing.cast(
2183
+ HttpErrorResponse,
2184
+ parse_obj_as(
2185
+ type_=HttpErrorResponse, # type: ignore
2186
+ object_=_response.json(),
2187
+ ),
2188
+ ),
2189
+ )
2190
+ if _response.status_code == 422:
2191
+ raise UnprocessableEntityError(
2192
+ headers=dict(_response.headers),
2193
+ body=typing.cast(
2194
+ HttpValidationError,
2195
+ parse_obj_as(
2196
+ type_=HttpValidationError, # type: ignore
2197
+ object_=_response.json(),
2198
+ ),
2199
+ ),
2200
+ )
2201
+ if _response.status_code == 429:
2202
+ raise TooManyRequestsError(
2203
+ headers=dict(_response.headers),
2204
+ body=typing.cast(
2205
+ HttpErrorResponse,
2206
+ parse_obj_as(
2207
+ type_=HttpErrorResponse, # type: ignore
2208
+ object_=_response.json(),
2209
+ ),
2210
+ ),
2211
+ )
2212
+ if _response.status_code == 502:
2213
+ raise BadGatewayError(
2214
+ headers=dict(_response.headers),
2215
+ body=typing.cast(
2216
+ HttpErrorResponse,
2217
+ parse_obj_as(
2218
+ type_=HttpErrorResponse, # type: ignore
2219
+ object_=_response.json(),
2220
+ ),
2221
+ ),
2222
+ )
2223
+ if _response.status_code == 504:
2224
+ raise GatewayTimeoutError(
2225
+ headers=dict(_response.headers),
2226
+ body=typing.cast(
2227
+ HttpErrorResponse,
2228
+ parse_obj_as(
2229
+ type_=HttpErrorResponse, # type: ignore
2230
+ object_=_response.json(),
2231
+ ),
2232
+ ),
2233
+ )
2234
+ _response_json = _response.json()
2235
+ except JSONDecodeError:
2236
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2237
+ except ValidationError as e:
2238
+ raise ParsingError(
2239
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
2240
+ )
2241
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2242
+
2243
+ async def list_cdrs(
2244
+ self,
2245
+ charge_point_id: str,
2246
+ *,
2247
+ date_from: typing.Optional[dt.datetime] = None,
2248
+ date_to: typing.Optional[dt.datetime] = None,
2249
+ offset: typing.Optional[int] = None,
2250
+ limit: typing.Optional[int] = None,
2251
+ request_options: typing.Optional[RequestOptions] = None,
2252
+ ) -> AsyncPager[CdrOut, CdrPage]:
2253
+ """
2254
+ CDRs of sessions on the charger, newest start first, optionally within a time window. 404 if the charger does not exist.
2255
+
2256
+ Parameters
2257
+ ----------
2258
+ charge_point_id : str
2259
+ The charger's OCPP identity.
2260
+
2261
+ date_from : typing.Optional[dt.datetime]
2262
+ Only rows starting at or after this time (inclusive).
2263
+
2264
+ date_to : typing.Optional[dt.datetime]
2265
+ Only rows starting before this time (exclusive).
2266
+
2267
+ offset : typing.Optional[int]
2268
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
2269
+
2270
+ limit : typing.Optional[int]
2271
+ Maximum rows per page (default 50, max 200).
2272
+
2273
+ request_options : typing.Optional[RequestOptions]
2274
+ Request-specific configuration.
2275
+
2276
+ Returns
2277
+ -------
2278
+ AsyncPager[CdrOut, CdrPage]
2279
+ One page of results; ``next_offset`` is null on the last page.
2280
+ """
2281
+ _response = await self._client_wrapper.httpx_client.request(
2282
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/cdrs",
2283
+ method="GET",
2284
+ params={
2285
+ "date_from": serialize_datetime(date_from) if date_from is not None else None,
2286
+ "date_to": serialize_datetime(date_to) if date_to is not None else None,
2287
+ "offset": offset,
2288
+ "limit": limit,
2289
+ },
2290
+ request_options=request_options,
2291
+ )
2292
+ try:
2293
+ if 200 <= _response.status_code < 300:
2294
+ _parsed_response = typing.cast(
2295
+ CdrPage,
2296
+ parse_obj_as(
2297
+ type_=CdrPage, # type: ignore
2298
+ object_=_response.json(),
2299
+ ),
2300
+ )
2301
+ _items = _parsed_response.items
2302
+ _parsed_next = _parsed_response.next_offset
2303
+ _has_next = _parsed_next is not None and _parsed_next != ""
2304
+
2305
+ async def _get_next():
2306
+ return await self.list_cdrs(
2307
+ charge_point_id,
2308
+ date_from=date_from,
2309
+ date_to=date_to,
2310
+ offset=_parsed_next,
2311
+ limit=limit,
2312
+ request_options=request_options,
2313
+ )
2314
+
2315
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
2316
+ if _response.status_code == 401:
2317
+ raise UnauthorizedError(
2318
+ headers=dict(_response.headers),
2319
+ body=typing.cast(
2320
+ HttpErrorResponse,
2321
+ parse_obj_as(
2322
+ type_=HttpErrorResponse, # type: ignore
2323
+ object_=_response.json(),
2324
+ ),
2325
+ ),
2326
+ )
2327
+ if _response.status_code == 404:
2328
+ raise NotFoundError(
2329
+ headers=dict(_response.headers),
2330
+ body=typing.cast(
2331
+ HttpErrorResponse,
2332
+ parse_obj_as(
2333
+ type_=HttpErrorResponse, # type: ignore
2334
+ object_=_response.json(),
2335
+ ),
2336
+ ),
2337
+ )
2338
+ if _response.status_code == 422:
2339
+ raise UnprocessableEntityError(
2340
+ headers=dict(_response.headers),
2341
+ body=typing.cast(
2342
+ HttpValidationError,
2343
+ parse_obj_as(
2344
+ type_=HttpValidationError, # type: ignore
2345
+ object_=_response.json(),
2346
+ ),
2347
+ ),
2348
+ )
2349
+ if _response.status_code == 429:
2350
+ raise TooManyRequestsError(
2351
+ headers=dict(_response.headers),
2352
+ body=typing.cast(
2353
+ HttpErrorResponse,
2354
+ parse_obj_as(
2355
+ type_=HttpErrorResponse, # type: ignore
2356
+ object_=_response.json(),
2357
+ ),
2358
+ ),
2359
+ )
2360
+ if _response.status_code == 502:
2361
+ raise BadGatewayError(
2362
+ headers=dict(_response.headers),
2363
+ body=typing.cast(
2364
+ HttpErrorResponse,
2365
+ parse_obj_as(
2366
+ type_=HttpErrorResponse, # type: ignore
2367
+ object_=_response.json(),
2368
+ ),
2369
+ ),
2370
+ )
2371
+ if _response.status_code == 504:
2372
+ raise GatewayTimeoutError(
2373
+ headers=dict(_response.headers),
2374
+ body=typing.cast(
2375
+ HttpErrorResponse,
2376
+ parse_obj_as(
2377
+ type_=HttpErrorResponse, # type: ignore
2378
+ object_=_response.json(),
2379
+ ),
2380
+ ),
2381
+ )
2382
+ _response_json = _response.json()
2383
+ except JSONDecodeError:
2384
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2385
+ except ValidationError as e:
2386
+ raise ParsingError(
2387
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
2388
+ )
2389
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2390
+
2391
+ async def list_connectors(
2392
+ self,
2393
+ charge_point_id: str,
2394
+ *,
2395
+ offset: typing.Optional[int] = None,
2396
+ limit: typing.Optional[int] = None,
2397
+ request_options: typing.Optional[RequestOptions] = None,
2398
+ ) -> AsyncPager[CpoConnectorOut, ConnectorPage]:
2399
+ """
2400
+ The charger's connectors. 404 if the charger does not exist.
2401
+
2402
+ Parameters
2403
+ ----------
2404
+ charge_point_id : str
2405
+ The charger's OCPP identity.
2406
+
2407
+ offset : typing.Optional[int]
2408
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
2409
+
2410
+ limit : typing.Optional[int]
2411
+ Maximum rows per page (default 50, max 200).
2412
+
2413
+ request_options : typing.Optional[RequestOptions]
2414
+ Request-specific configuration.
2415
+
2416
+ Returns
2417
+ -------
2418
+ AsyncPager[CpoConnectorOut, ConnectorPage]
2419
+ One page of results; ``next_offset`` is null on the last page.
2420
+ """
2421
+ _response = await self._client_wrapper.httpx_client.request(
2422
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/connectors",
2423
+ method="GET",
2424
+ params={
2425
+ "offset": offset,
2426
+ "limit": limit,
2427
+ },
2428
+ request_options=request_options,
2429
+ )
2430
+ try:
2431
+ if 200 <= _response.status_code < 300:
2432
+ _parsed_response = typing.cast(
2433
+ ConnectorPage,
2434
+ parse_obj_as(
2435
+ type_=ConnectorPage, # type: ignore
2436
+ object_=_response.json(),
2437
+ ),
2438
+ )
2439
+ _items = _parsed_response.items
2440
+ _parsed_next = _parsed_response.next_offset
2441
+ _has_next = _parsed_next is not None and _parsed_next != ""
2442
+
2443
+ async def _get_next():
2444
+ return await self.list_connectors(
2445
+ charge_point_id,
2446
+ offset=_parsed_next,
2447
+ limit=limit,
2448
+ request_options=request_options,
2449
+ )
2450
+
2451
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
2452
+ if _response.status_code == 401:
2453
+ raise UnauthorizedError(
2454
+ headers=dict(_response.headers),
2455
+ body=typing.cast(
2456
+ HttpErrorResponse,
2457
+ parse_obj_as(
2458
+ type_=HttpErrorResponse, # type: ignore
2459
+ object_=_response.json(),
2460
+ ),
2461
+ ),
2462
+ )
2463
+ if _response.status_code == 404:
2464
+ raise NotFoundError(
2465
+ headers=dict(_response.headers),
2466
+ body=typing.cast(
2467
+ HttpErrorResponse,
2468
+ parse_obj_as(
2469
+ type_=HttpErrorResponse, # type: ignore
2470
+ object_=_response.json(),
2471
+ ),
2472
+ ),
2473
+ )
2474
+ if _response.status_code == 422:
2475
+ raise UnprocessableEntityError(
2476
+ headers=dict(_response.headers),
2477
+ body=typing.cast(
2478
+ HttpValidationError,
2479
+ parse_obj_as(
2480
+ type_=HttpValidationError, # type: ignore
2481
+ object_=_response.json(),
2482
+ ),
2483
+ ),
2484
+ )
2485
+ if _response.status_code == 429:
2486
+ raise TooManyRequestsError(
2487
+ headers=dict(_response.headers),
2488
+ body=typing.cast(
2489
+ HttpErrorResponse,
2490
+ parse_obj_as(
2491
+ type_=HttpErrorResponse, # type: ignore
2492
+ object_=_response.json(),
2493
+ ),
2494
+ ),
2495
+ )
2496
+ if _response.status_code == 502:
2497
+ raise BadGatewayError(
2498
+ headers=dict(_response.headers),
2499
+ body=typing.cast(
2500
+ HttpErrorResponse,
2501
+ parse_obj_as(
2502
+ type_=HttpErrorResponse, # type: ignore
2503
+ object_=_response.json(),
2504
+ ),
2505
+ ),
2506
+ )
2507
+ if _response.status_code == 504:
2508
+ raise GatewayTimeoutError(
2509
+ headers=dict(_response.headers),
2510
+ body=typing.cast(
2511
+ HttpErrorResponse,
2512
+ parse_obj_as(
2513
+ type_=HttpErrorResponse, # type: ignore
2514
+ object_=_response.json(),
2515
+ ),
2516
+ ),
2517
+ )
2518
+ _response_json = _response.json()
2519
+ except JSONDecodeError:
2520
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2521
+ except ValidationError as e:
2522
+ raise ParsingError(
2523
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
2524
+ )
2525
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2526
+
2527
+ async def list_evses(
2528
+ self,
2529
+ charge_point_id: str,
2530
+ *,
2531
+ offset: typing.Optional[int] = None,
2532
+ limit: typing.Optional[int] = None,
2533
+ request_options: typing.Optional[RequestOptions] = None,
2534
+ ) -> AsyncPager[CpoEvseOut, EvsePage]:
2535
+ """
2536
+ The charger's EVSEs. 404 if the charger does not exist.
2537
+
2538
+ Parameters
2539
+ ----------
2540
+ charge_point_id : str
2541
+ The charger's OCPP identity.
2542
+
2543
+ offset : typing.Optional[int]
2544
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
2545
+
2546
+ limit : typing.Optional[int]
2547
+ Maximum rows per page (default 50, max 200).
2548
+
2549
+ request_options : typing.Optional[RequestOptions]
2550
+ Request-specific configuration.
2551
+
2552
+ Returns
2553
+ -------
2554
+ AsyncPager[CpoEvseOut, EvsePage]
2555
+ One page of results; ``next_offset`` is null on the last page.
2556
+ """
2557
+ _response = await self._client_wrapper.httpx_client.request(
2558
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/evses",
2559
+ method="GET",
2560
+ params={
2561
+ "offset": offset,
2562
+ "limit": limit,
2563
+ },
2564
+ request_options=request_options,
2565
+ )
2566
+ try:
2567
+ if 200 <= _response.status_code < 300:
2568
+ _parsed_response = typing.cast(
2569
+ EvsePage,
2570
+ parse_obj_as(
2571
+ type_=EvsePage, # type: ignore
2572
+ object_=_response.json(),
2573
+ ),
2574
+ )
2575
+ _items = _parsed_response.items
2576
+ _parsed_next = _parsed_response.next_offset
2577
+ _has_next = _parsed_next is not None and _parsed_next != ""
2578
+
2579
+ async def _get_next():
2580
+ return await self.list_evses(
2581
+ charge_point_id,
2582
+ offset=_parsed_next,
2583
+ limit=limit,
2584
+ request_options=request_options,
2585
+ )
2586
+
2587
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
2588
+ if _response.status_code == 401:
2589
+ raise UnauthorizedError(
2590
+ headers=dict(_response.headers),
2591
+ body=typing.cast(
2592
+ HttpErrorResponse,
2593
+ parse_obj_as(
2594
+ type_=HttpErrorResponse, # type: ignore
2595
+ object_=_response.json(),
2596
+ ),
2597
+ ),
2598
+ )
2599
+ if _response.status_code == 404:
2600
+ raise NotFoundError(
2601
+ headers=dict(_response.headers),
2602
+ body=typing.cast(
2603
+ HttpErrorResponse,
2604
+ parse_obj_as(
2605
+ type_=HttpErrorResponse, # type: ignore
2606
+ object_=_response.json(),
2607
+ ),
2608
+ ),
2609
+ )
2610
+ if _response.status_code == 422:
2611
+ raise UnprocessableEntityError(
2612
+ headers=dict(_response.headers),
2613
+ body=typing.cast(
2614
+ HttpValidationError,
2615
+ parse_obj_as(
2616
+ type_=HttpValidationError, # type: ignore
2617
+ object_=_response.json(),
2618
+ ),
2619
+ ),
2620
+ )
2621
+ if _response.status_code == 429:
2622
+ raise TooManyRequestsError(
2623
+ headers=dict(_response.headers),
2624
+ body=typing.cast(
2625
+ HttpErrorResponse,
2626
+ parse_obj_as(
2627
+ type_=HttpErrorResponse, # type: ignore
2628
+ object_=_response.json(),
2629
+ ),
2630
+ ),
2631
+ )
2632
+ if _response.status_code == 502:
2633
+ raise BadGatewayError(
2634
+ headers=dict(_response.headers),
2635
+ body=typing.cast(
2636
+ HttpErrorResponse,
2637
+ parse_obj_as(
2638
+ type_=HttpErrorResponse, # type: ignore
2639
+ object_=_response.json(),
2640
+ ),
2641
+ ),
2642
+ )
2643
+ if _response.status_code == 504:
2644
+ raise GatewayTimeoutError(
2645
+ headers=dict(_response.headers),
2646
+ body=typing.cast(
2647
+ HttpErrorResponse,
2648
+ parse_obj_as(
2649
+ type_=HttpErrorResponse, # type: ignore
2650
+ object_=_response.json(),
2651
+ ),
2652
+ ),
2653
+ )
2654
+ _response_json = _response.json()
2655
+ except JSONDecodeError:
2656
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2657
+ except ValidationError as e:
2658
+ raise ParsingError(
2659
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
2660
+ )
2661
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2662
+
2663
+ async def list_sessions(
2664
+ self,
2665
+ charge_point_id: str,
2666
+ *,
2667
+ date_from: typing.Optional[dt.datetime] = None,
2668
+ date_to: typing.Optional[dt.datetime] = None,
2669
+ offset: typing.Optional[int] = None,
2670
+ limit: typing.Optional[int] = None,
2671
+ request_options: typing.Optional[RequestOptions] = None,
2672
+ ) -> AsyncPager[SessionOut, SessionPage]:
2673
+ """
2674
+ Charging sessions on the charger, newest start first, optionally within a time window. 404 if the charger does not exist.
2675
+
2676
+ Parameters
2677
+ ----------
2678
+ charge_point_id : str
2679
+ The charger's OCPP identity.
2680
+
2681
+ date_from : typing.Optional[dt.datetime]
2682
+ Only rows starting at or after this time (inclusive).
2683
+
2684
+ date_to : typing.Optional[dt.datetime]
2685
+ Only rows starting before this time (exclusive).
2686
+
2687
+ offset : typing.Optional[int]
2688
+ Rows to skip. Pass the previous page's ``next_offset`` to continue.
2689
+
2690
+ limit : typing.Optional[int]
2691
+ Maximum rows per page (default 50, max 200).
2692
+
2693
+ request_options : typing.Optional[RequestOptions]
2694
+ Request-specific configuration.
2695
+
2696
+ Returns
2697
+ -------
2698
+ AsyncPager[SessionOut, SessionPage]
2699
+ One page of results; ``next_offset`` is null on the last page.
2700
+ """
2701
+ _response = await self._client_wrapper.httpx_client.request(
2702
+ f"cpo/charge-points/{encode_path_param(charge_point_id)}/sessions",
2703
+ method="GET",
2704
+ params={
2705
+ "date_from": serialize_datetime(date_from) if date_from is not None else None,
2706
+ "date_to": serialize_datetime(date_to) if date_to is not None else None,
2707
+ "offset": offset,
2708
+ "limit": limit,
2709
+ },
2710
+ request_options=request_options,
2711
+ )
2712
+ try:
2713
+ if 200 <= _response.status_code < 300:
2714
+ _parsed_response = typing.cast(
2715
+ SessionPage,
2716
+ parse_obj_as(
2717
+ type_=SessionPage, # type: ignore
2718
+ object_=_response.json(),
2719
+ ),
2720
+ )
2721
+ _items = _parsed_response.items
2722
+ _parsed_next = _parsed_response.next_offset
2723
+ _has_next = _parsed_next is not None and _parsed_next != ""
2724
+
2725
+ async def _get_next():
2726
+ return await self.list_sessions(
2727
+ charge_point_id,
2728
+ date_from=date_from,
2729
+ date_to=date_to,
2730
+ offset=_parsed_next,
2731
+ limit=limit,
2732
+ request_options=request_options,
2733
+ )
2734
+
2735
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
2736
+ if _response.status_code == 401:
2737
+ raise UnauthorizedError(
2738
+ headers=dict(_response.headers),
2739
+ body=typing.cast(
2740
+ HttpErrorResponse,
2741
+ parse_obj_as(
2742
+ type_=HttpErrorResponse, # type: ignore
2743
+ object_=_response.json(),
2744
+ ),
2745
+ ),
2746
+ )
2747
+ if _response.status_code == 404:
2748
+ raise NotFoundError(
2749
+ headers=dict(_response.headers),
2750
+ body=typing.cast(
2751
+ HttpErrorResponse,
2752
+ parse_obj_as(
2753
+ type_=HttpErrorResponse, # type: ignore
2754
+ object_=_response.json(),
2755
+ ),
2756
+ ),
2757
+ )
2758
+ if _response.status_code == 422:
2759
+ raise UnprocessableEntityError(
2760
+ headers=dict(_response.headers),
2761
+ body=typing.cast(
2762
+ HttpValidationError,
2763
+ parse_obj_as(
2764
+ type_=HttpValidationError, # type: ignore
2765
+ object_=_response.json(),
2766
+ ),
2767
+ ),
2768
+ )
2769
+ if _response.status_code == 429:
2770
+ raise TooManyRequestsError(
2771
+ headers=dict(_response.headers),
2772
+ body=typing.cast(
2773
+ HttpErrorResponse,
2774
+ parse_obj_as(
2775
+ type_=HttpErrorResponse, # type: ignore
2776
+ object_=_response.json(),
2777
+ ),
2778
+ ),
2779
+ )
2780
+ if _response.status_code == 502:
2781
+ raise BadGatewayError(
2782
+ headers=dict(_response.headers),
2783
+ body=typing.cast(
2784
+ HttpErrorResponse,
2785
+ parse_obj_as(
2786
+ type_=HttpErrorResponse, # type: ignore
2787
+ object_=_response.json(),
2788
+ ),
2789
+ ),
2790
+ )
2791
+ if _response.status_code == 504:
2792
+ raise GatewayTimeoutError(
2793
+ headers=dict(_response.headers),
2794
+ body=typing.cast(
2795
+ HttpErrorResponse,
2796
+ parse_obj_as(
2797
+ type_=HttpErrorResponse, # type: ignore
2798
+ object_=_response.json(),
2799
+ ),
2800
+ ),
2801
+ )
2802
+ _response_json = _response.json()
2803
+ except JSONDecodeError:
2804
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2805
+ except ValidationError as e:
2806
+ raise ParsingError(
2807
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
2808
+ )
2809
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)