misardev 1.1.0

Async Rust client for the Misar.Dev API: create projects, write files, build and deploy, start from templates, run OpenAI-compatible chat completions, search code and read usage. Retries, typed plan-limit errors, SSE streaming.
Documentation
// GENERATED by scripts/generate-sdk-resources.mjs from sdks/manifest.json.
// Do not edit by hand — change the route, run `pnpm sdk:sync`, and regenerate.

use crate::error::MisarDevError;
use crate::transport::Transport;
use crate::transport::body_or_empty;
use crate::transport::build_query;
use reqwest::Method;
use serde_json::Value;

/// The `closeFriends` resource — 3 operation(s).
///
/// Your close-friends list for stories.
///
/// Reached through [`crate::MisarDev::close_friends`].
#[derive(Debug, Clone, Copy)]
pub struct CloseFriendsResource<'a> {
    pub(crate) t: &'a Transport,
}

impl CloseFriendsResource<'_> {
    /// `POST /close-friends`
    ///
    /// misardev:method closeFriends.add
    pub async fn add(self, body: Option<Value>) -> Result<Value, MisarDevError> {
        self.t.request(Method::POST, "/close-friends", "", Some(body_or_empty(body))).await
    }

    /// `GET /close-friends`
    ///
    /// Optional query: `cursor`, `limit`.
    ///
    /// misardev:method closeFriends.list
    pub async fn list(self, query: Option<Value>) -> Result<Value, MisarDevError> {
        self.t.request(Method::GET, "/close-friends", &build_query(query.as_ref(), &[]), None).await
    }

    /// `DELETE /close-friends`
    ///
    /// misardev:method closeFriends.remove
    pub async fn remove(self, body: Option<Value>) -> Result<Value, MisarDevError> {
        self.t.request(Method::DELETE, "/close-friends", "", Some(body_or_empty(body))).await
    }
}