1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// 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 `search` resource — 2 operation(s).
///
/// Web-grounded answers with citations, and search across your own code.
///
/// Reached through [`crate::MisarDev::search`].
#[derive(Debug, Clone, Copy)]
pub struct SearchResource<'a> {
pub(crate) t: &'a Transport,
}
impl SearchResource<'_> {
/// `GET /search`
///
/// Optional query: `cursor`, `limit`, `q`, `type`, `types`.
///
/// misardev:method search.code
pub async fn code(self, query: Option<Value>) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, "/search", &build_query(query.as_ref(), &[]), None).await
}
/// `POST /v1/search`
///
/// misardev:method search.web
pub async fn web(self, body: Option<Value>) -> Result<Value, MisarDevError> {
self.t.request(Method::POST, "/v1/search", "", Some(body_or_empty(body))).await
}
}