uarp_sdk/generated/api/
meta.rs1#![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#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18pub struct SearchParams {
19 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#[derive(Debug, Clone)]
29pub struct MetaApi {
30 pub(crate) client: Client,
31}
32
33impl Client {
34 pub fn meta(&self) -> MetaApi {
36 MetaApi { client: self.clone() }
37 }
38}
39
40impl MetaApi {
41 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 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 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 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 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}