Skip to main content

uarp_sdk/generated/api/
meta.rs

1// Code generated by @uarp/codegen from spec/openapi.json. DO NOT EDIT.
2//!
3//! API metadata
4
5#![allow(unused_imports, clippy::too_many_arguments)]
6
7use reqwest::Method;
8use serde::{Deserialize, Serialize};
9
10use crate::client::{Client, Request, NO_BODY, NO_QUERY};
11use crate::error::Result;
12use crate::generated::models;
13use crate::multipart::{field_text, FilePart};
14use crate::util::encode_path;
15
16/// Query and header parameters for `search`.
17#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18pub struct SearchParams {
19    /// Search query
20    pub q: String,
21    #[serde(default, skip_serializing_if = "Option::is_none")]
22    pub r#type: Option<models::SearchType>,
23    #[serde(default, skip_serializing_if = "Option::is_none")]
24    pub limit: Option<i64>,
25}
26
27/// API metadata
28#[derive(Debug, Clone)]
29pub struct MetaApi {
30    pub(crate) client: Client,
31}
32
33impl Client {
34    /// API metadata
35    pub fn meta(&self) -> MetaApi {
36        MetaApi { client: self.clone() }
37    }
38}
39
40impl MetaApi {
41    /// Apple App Site Association — Universal Links manifest
42    ///
43    /// Apple iOS fetches this to verify that the app on the user's device is allowed to claim
44    /// Universal Links on this domain. Served as `application/json`, also at
45    /// `/apple-app-site-association` for legacy iOS. Configured via `APPLE_TEAM_ID` +
46    /// `APPLE_BUNDLE_ID` (+ optional `APPLE_EXTRA_BUNDLE_IDS` comma-list for TestFlight/dev).
47    ///
48    /// `GET /.well-known/apple-app-site-association`
49    pub async fn get_apple_app_site_association(&self) -> Result<models::GetAppleAppSiteAssociationResponse> {
50        self.client
51            .request_json(Request {
52                method: Method::GET,
53                path: "/.well-known/apple-app-site-association".to_string(),
54                query: NO_QUERY,
55                body: NO_BODY,
56                headers: Vec::new(),
57                idempotent: false,
58            })
59            .await
60    }
61
62    /// Client-side config
63    ///
64    /// `GET /api/v1/client-config`
65    pub async fn get_client_config(&self) -> Result<models::GetClientConfigResponse> {
66        self.client
67            .request_json(Request {
68                method: Method::GET,
69                path: "/api/v1/client-config".to_string(),
70                query: NO_QUERY,
71                body: NO_BODY,
72                headers: Vec::new(),
73                idempotent: false,
74            })
75            .await
76    }
77
78    /// Get OpenAPI spec
79    ///
80    /// `GET /api/v1/openapi.json`
81    pub async fn get_open_api_spec(&self) -> Result<serde_json::Map<String, serde_json::Value>> {
82        self.client
83            .request_json(Request {
84                method: Method::GET,
85                path: "/api/v1/openapi.json".to_string(),
86                query: NO_QUERY,
87                body: NO_BODY,
88                headers: Vec::new(),
89                idempotent: false,
90            })
91            .await
92    }
93
94    /// Get public landing page statistics
95    ///
96    /// `GET /api/v1/public/landing-stats`
97    pub async fn get_public_landing_stats(&self) -> Result<models::LandingStats> {
98        self.client
99            .request_json(Request {
100                method: Method::GET,
101                path: "/api/v1/public/landing-stats".to_string(),
102                query: NO_QUERY,
103                body: NO_BODY,
104                headers: Vec::new(),
105                idempotent: false,
106            })
107            .await
108    }
109
110    /// Search across agents, sessions, runs
111    ///
112    /// `GET /api/v1/search`
113    ///
114    /// Required scopes: `search:read`.
115    pub async fn search(&self, params: &SearchParams) -> Result<serde_json::Value> {
116        self.client
117            .request_json(Request {
118                method: Method::GET,
119                path: "/api/v1/search".to_string(),
120                query: Some(params),
121                body: NO_BODY,
122                headers: Vec::new(),
123                idempotent: false,
124            })
125            .await
126    }
127}