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::build_query;
use crate::transport::encode_path;
use reqwest::Method;
use serde_json::Value;

/// The `social` resource — 4 operation(s).
///
/// Your relationship with a person, and people suggestions.
///
/// Reached through [`crate::MisarDev::social`].
#[derive(Debug, Clone, Copy)]
pub struct SocialResource<'a> {
    pub(crate) t: &'a Transport,
}

impl SocialResource<'_> {
    /// `POST /social/suggestions/:handle/dismiss`
    ///
    /// misardev:method social.dismissSuggestion
    pub async fn dismiss_suggestion(self, handle: &str) -> Result<Value, MisarDevError> {
        self.t.request(Method::POST, &format!("/social/suggestions/{}/dismiss", encode_path(handle)), "", None).await
    }

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

    /// `GET /social/me/mutuals`
    ///
    /// Optional query: `include`, `limit`.
    ///
    /// misardev:method social.meMutuals
    pub async fn me_mutuals(self, query: Option<Value>) -> Result<Value, MisarDevError> {
        self.t.request(Method::GET, "/social/me/mutuals", &build_query(query.as_ref(), &[]), None).await
    }

    /// `GET /social/relationship/:handle`
    ///
    /// misardev:method social.relationship
    pub async fn relationship(self, handle: &str) -> Result<Value, MisarDevError> {
        self.t.request(Method::GET, &format!("/social/relationship/{}", encode_path(handle)), "", None).await
    }
}