1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! An async OICP client over mutual TLS: pushes, pulls, streaming crawls.
//!
//! # What is different about this client
//!
//! **`HTTP 200` is not success.** Hubject answers a refused push with a 200 and a body saying it
//! did not happen. Every method here turns that into an `Err` — see [`OicpError`].
//!
//! **The certificate is checked before the first request.** OICP authenticates with a client
//! certificate and authorises by comparing your `OperatorID`/`ProviderID` against it. A mismatch
//! is `017 Unauthorized Access` on *every* call, with nothing to say which side is wrong.
//! [`ClientIdentity::check_against`] does that comparison locally at construction.
//!
//! **Crawls stream.** A European `PullEvseData` is hundreds of thousands of records.
//! [`EmpClient::crawl_evse_data`] yields records, holding one page at a time, and a record that
//! fails to decode is reported as one bad record rather than one lost page.
//!
//! **Retries know what they are retrying.** [`RetryPolicy`] refuses to repeat a remote start,
//! because a duplicate could start a second charging session.
//!
//! ```no_run
//! # use oicp_kit::client::{CpoClient, ClientIdentity};
//! # use oicp_kit::transport::HubjectEnv;
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let identity = ClientIdentity::from_pem_file("hubject-client.pem")?;
//! let client = CpoClient::builder()
//! .environment(HubjectEnv::Qa)
//! .operator_id("DE*ABC".parse()?)
//! .identity(identity)
//! .build()?;
//!
//! # let record = oicp_kit::testkit::samples::evse_data_record("DE*ABC*E1");
//! client.push_evse_data_insert(vec![record], "ABC technologies").await?;
//! # Ok(())
//! # }
//! ```
pub use CpoClient;
pub use ;
pub use ;
pub use ;
pub use RetryPolicy;
pub use crate;