main
rs 41 lines 1.15 KB
Raw
1 //! A typed client for the [sigit.si](https://sigit.si) JSON API.
2 //!
3 //! ```no_run
4 //! use sigit_si_api::{Client, Environment, issues::State};
5 //!
6 //! # async fn example() -> sigit_si_api::Result<()> {
7 //! let client = Client::new(Environment::Production)?.with_token("…");
8 //!
9 //! let me = client.user().await?;
10 //! let repos = client.repos().await?;
11 //! let open = client.pulls("seto/sigit-si", State::Open).await?;
12 //! # Ok(())
13 //! # }
14 //! ```
15 //!
16 //! Two transports sit behind one [`Client`]. Accounts, repositories, hooks,
17 //! Cloud Sessions, and billing are plain REST under `/api/v1`. Issues, pull
18 //! requests, and code search have no REST surface yet, so they go over the
19 //! JSON-RPC MCP endpoint at `/api/v1/mcp` — that split is invisible at the call
20 //! site, and can disappear later without breaking callers.
21
22 pub mod account;
23 pub mod billing;
24 pub mod client;
25 pub mod code;
26 pub mod environment;
27 pub mod error;
28 pub mod issues;
29 pub mod mcp;
30 pub mod models;
31 pub mod pulls;
32 pub mod repos;
33 pub mod sessions;
34
35 pub use {
36 client::Client,
37 environment::Environment,
38 error::{ApiError, ErrorResponse, Result},
39 issues::State,
40 repos::NewRepository,
41 };