## installation: ```bash cargo add pb-sdk ``` or add to cargo.toml ```toml [dependencies] pb-sdk = "0.5.0" ``` ## example usage: ```rust use pb_sdk::{PbAdminClient, GetListSuccess}; use serde::{Deserialize, Serialize}; #[derive(Deserialize)] struct Post { id: String, name: String, content: String } #[derive(Serialize)] struct CreatePost { name: String, content: String } #[tokio::main] async fn main() -> Result<(), Box>{ // authenticate let client = PbAdminClient::new("http://localhost:8090").auth_with_password("admin_username@example.com", "admin_password").await?; // list posts let posts: GetListSuccess = client.collection("posts").unwrap().get_list(1, 50).call().await?; // view post let post: Post = client.collection("posts").unwrap().get_one("s42mpy041qkmnzp").call().await?; // create post let new_post = CreatePost { name: "wood".to_string(), content: "yes".to_string() }; let create_resp: Post = client.collection("posts").unwrap().create(new_post).call().await?; // update post let updated_post = CreatePost { name: "not_wood".to_string(), content: "no".to_string() }; let updated_post: Post = client.collection("posts").unwrap().update("s42mpy041qkmnzp", updated_post).call().await?; // delete post client.collection("posts").unwrap().delete("yqh6x1oz9sesnc2").call().await?; Ok(()) } ```