TheMovieDB 0.1.0

A robust and idiomatic Rust API wrapper for The Movie Database (TMDb) v3 API.
Documentation
use TheMovieDB::account::Lists;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // IMPORTANT: Replace with a valid session ID. This usually requires user authentication.
    // This example will likely fail without a real session ID.
    let session_id = "YOUR_SESSION_ID".to_string();
    let mut lists = Lists::new(0, session_id);

    let payload = json!({
        "name": "My New Rust List",
        "description": "A list created via Rust API wrapper",
        "iso_639_1": "en"
    });

    println!("Creating a new list");
    let create_response = lists.list_create(None, Some(payload)).await;
    println!("Create List Response: {:#?}", create_response);

    // The `lists` object now holds the new list ID
    println!("Newly created list ID: {}", lists.id);

    Ok(())
}