Skip to main content

uapi_sdk_rust/services/
mod.rs

1use crate::client::Client;
2use crate::errors::Error;
3use crate::Result;
4use reqwest::header::{HeaderMap, HeaderValue};
5use reqwest::Method;
6use serde_json::Value;
7use tracing::instrument;
8use urlencoding::encode;
9
10#[derive(Debug, Clone)]
11pub enum GetImageBingDailyResponse {
12    Json(crate::models::FormatJson),
13    Bytes(Vec<u8>),
14}
15#[derive(Debug, Clone)]
16pub struct ClipzyZaiXianJianTieBanService<'a> {
17    pub(crate) client: &'a Client,
18}
19
20impl<'a> ClipzyZaiXianJianTieBanService<'a> {
21/// 步骤2 (方法一): 获取加密数据
22    #[instrument(skip(self, params))]
23    pub async fn get_clipzy_get(&self, params: GetClipzyGetParams) -> Result<crate::models::GetClipzyGet200Response> {
24        let mut path = "/api/v1/api/get".to_string();
25
26        let mut query: Vec<(String, String)> = Vec::new();
27        query.push(("id".to_string(), params.id_query.clone()));
28        if let Some(value) = &params._t {
29            query.push(("_t".to_string(), value.clone()));
30        }
31        let query = if query.is_empty() { None } else { Some(query) };
32
33        let mut extra_headers = HeaderMap::new();
34        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
35        let body = None;
36        self.client
37            .request_json(
38                Method::GET,
39                &path,
40                headers,
41                query,
42                body,
43                params.disable_cache,
44            )
45            .await
46    }
47/// 步骤2 (方法二): 获取原始文本
48    #[instrument(skip(self, params))]
49    pub async fn get_clipzy_raw(&self, params: GetClipzyRawParams) -> Result<String> {
50        let mut path = "/api/v1/api/raw/{id}".to_string();
51        {
52            let encoded = encode(&params.id_path).into_owned();
53            path = path.replace("{id}", &encoded);
54        }
55
56        let mut query: Vec<(String, String)> = Vec::new();
57        query.push(("key".to_string(), params.key_query.clone()));
58        if let Some(value) = &params._t {
59            query.push(("_t".to_string(), value.clone()));
60        }
61        let query = if query.is_empty() { None } else { Some(query) };
62
63        let mut extra_headers = HeaderMap::new();
64        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
65        let body = None;
66        self.client
67            .request_json(
68                Method::GET,
69                &path,
70                headers,
71                query,
72                body,
73                params.disable_cache,
74            )
75            .await
76    }
77/// 步骤1:上传加密数据
78    #[instrument(skip(self, params))]
79    pub async fn post_clipzy_store(&self, params: PostClipzyStoreParams) -> Result<crate::models::PostClipzyStore200Response> {
80        let mut path = "/api/v1/api/store".to_string();
81
82        let mut query: Vec<(String, String)> = Vec::new();
83        if let Some(value) = &params._t {
84            query.push(("_t".to_string(), value.clone()));
85        }
86        let query = if query.is_empty() { None } else { Some(query) };
87
88        let mut extra_headers = HeaderMap::new();
89        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
90        let body = params.body.clone();
91        self.client
92            .request_json(
93                Method::POST,
94                &path,
95                headers,
96                query,
97                body,
98                params.disable_cache,
99            )
100            .await
101    }
102}
103
104#[derive(Debug, Clone)]
105pub struct GetClipzyGetParams {
106    pub id_query: String,
107    pub disable_cache: Option<bool>,
108    pub _t: Option<String>,
109}
110
111impl GetClipzyGetParams {
112    pub fn new(id_query: impl Into<String>) -> Self {
113        Self {
114            id_query: id_query.into(),
115            disable_cache: None,
116            _t: None,
117        }
118    }
119    pub fn disable_cache(mut self, value: bool) -> Self {
120        self.disable_cache = Some(value);
121        self
122    }
123    pub fn _t(mut self, value: impl Into<String>) -> Self {
124        self._t = Some(value.into());
125        self
126    }
127}
128
129#[derive(Debug, Clone)]
130pub struct GetClipzyRawParams {
131    pub id_path: String,
132    pub key_query: String,
133    pub disable_cache: Option<bool>,
134    pub _t: Option<String>,
135}
136
137impl GetClipzyRawParams {
138    pub fn new(id_path: impl Into<String>, key_query: impl Into<String>) -> Self {
139        Self {
140            id_path: id_path.into(),
141            key_query: key_query.into(),
142            disable_cache: None,
143            _t: None,
144        }
145    }
146    pub fn disable_cache(mut self, value: bool) -> Self {
147        self.disable_cache = Some(value);
148        self
149    }
150    pub fn _t(mut self, value: impl Into<String>) -> Self {
151        self._t = Some(value.into());
152        self
153    }
154}
155
156#[derive(Debug, Clone)]
157pub struct PostClipzyStoreParams {
158    pub body: Option<Value>,
159    pub disable_cache: Option<bool>,
160    pub _t: Option<String>,
161}
162
163impl PostClipzyStoreParams {
164    pub fn new() -> Self {
165        Self {
166            body: None,
167            disable_cache: None,
168            _t: None,
169        }
170    }
171    pub fn disable_cache(mut self, value: bool) -> Self {
172        self.disable_cache = Some(value);
173        self
174    }
175    pub fn _t(mut self, value: impl Into<String>) -> Self {
176        self._t = Some(value.into());
177        self
178    }
179    pub fn body(mut self, value: Value) -> Self {
180        self.body = Some(value);
181        self
182    }
183}
184#[derive(Debug, Clone)]
185pub struct ConvertService<'a> {
186    pub(crate) client: &'a Client,
187}
188
189impl<'a> ConvertService<'a> {
190/// 时间戳转换
191    #[instrument(skip(self, params))]
192    pub async fn get_convert_unixtime(&self, params: GetConvertUnixtimeParams) -> Result<crate::models::GetConvertUnixtime200Response> {
193        let mut path = "/api/v1/convert/unixtime".to_string();
194
195        let mut query: Vec<(String, String)> = Vec::new();
196        query.push(("time".to_string(), params.time_query.clone()));
197        if let Some(value) = &params._t {
198            query.push(("_t".to_string(), value.clone()));
199        }
200        let query = if query.is_empty() { None } else { Some(query) };
201
202        let mut extra_headers = HeaderMap::new();
203        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
204        let body = None;
205        self.client
206            .request_json(
207                Method::GET,
208                &path,
209                headers,
210                query,
211                body,
212                params.disable_cache,
213            )
214            .await
215    }
216/// JSON 格式化
217    #[instrument(skip(self, params))]
218    pub async fn post_convert_json(&self, params: PostConvertJsonParams) -> Result<crate::models::PostConvertJson200Response> {
219        let mut path = "/api/v1/convert/json".to_string();
220
221        let mut query: Vec<(String, String)> = Vec::new();
222        if let Some(value) = &params._t {
223            query.push(("_t".to_string(), value.clone()));
224        }
225        let query = if query.is_empty() { None } else { Some(query) };
226
227        let mut extra_headers = HeaderMap::new();
228        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
229        let body = params.body.clone();
230        self.client
231            .request_json(
232                Method::POST,
233                &path,
234                headers,
235                query,
236                body,
237                params.disable_cache,
238            )
239            .await
240    }
241}
242
243#[derive(Debug, Clone)]
244pub struct GetConvertUnixtimeParams {
245    pub time_query: String,
246    pub disable_cache: Option<bool>,
247    pub _t: Option<String>,
248}
249
250impl GetConvertUnixtimeParams {
251    pub fn new(time_query: impl Into<String>) -> Self {
252        Self {
253            time_query: time_query.into(),
254            disable_cache: None,
255            _t: None,
256        }
257    }
258    pub fn disable_cache(mut self, value: bool) -> Self {
259        self.disable_cache = Some(value);
260        self
261    }
262    pub fn _t(mut self, value: impl Into<String>) -> Self {
263        self._t = Some(value.into());
264        self
265    }
266}
267
268#[derive(Debug, Clone)]
269pub struct PostConvertJsonParams {
270    pub body: Option<Value>,
271    pub disable_cache: Option<bool>,
272    pub _t: Option<String>,
273}
274
275impl PostConvertJsonParams {
276    pub fn new() -> Self {
277        Self {
278            body: None,
279            disable_cache: None,
280            _t: None,
281        }
282    }
283    pub fn disable_cache(mut self, value: bool) -> Self {
284        self.disable_cache = Some(value);
285        self
286    }
287    pub fn _t(mut self, value: impl Into<String>) -> Self {
288        self._t = Some(value.into());
289        self
290    }
291    pub fn body(mut self, value: Value) -> Self {
292        self.body = Some(value);
293        self
294    }
295}
296#[derive(Debug, Clone)]
297pub struct DailyService<'a> {
298    pub(crate) client: &'a Client,
299}
300
301impl<'a> DailyService<'a> {
302/// 每日新闻图
303    #[instrument(skip(self))]
304    pub async fn get_daily_news_image(&self) -> Result<Vec<u8>> {
305        let mut path = "/api/v1/daily/news-image".to_string();
306
307        let mut query: Vec<(String, String)> = Vec::new();
308        let query = if query.is_empty() { None } else { Some(query) };
309
310        let mut extra_headers = HeaderMap::new();
311        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
312        let body = None;
313        self.client
314            .request_bytes(
315                Method::GET,
316                &path,
317                headers,
318                query,
319                body,
320                None,
321            )
322            .await
323    }
324}
325
326#[derive(Debug, Clone)]
327pub struct GameService<'a> {
328    pub(crate) client: &'a Client,
329}
330
331impl<'a> GameService<'a> {
332/// Epic 免费游戏
333    #[instrument(skip(self))]
334    pub async fn get_game_epic_free(&self) -> Result<crate::models::GetGameEpicFree200Response> {
335        let mut path = "/api/v1/game/epic-free".to_string();
336
337        let mut query: Vec<(String, String)> = Vec::new();
338        let query = if query.is_empty() { None } else { Some(query) };
339
340        let mut extra_headers = HeaderMap::new();
341        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
342        let body = None;
343        self.client
344            .request_json(
345                Method::GET,
346                &path,
347                headers,
348                query,
349                body,
350                None,
351            )
352            .await
353    }
354/// 查询 MC 曾用名
355    #[instrument(skip(self, params))]
356    pub async fn get_game_minecraft_historyid(&self, params: GetGameMinecraftHistoryidParams) -> Result<crate::models::GetGameMinecraftHistoryid200Response> {
357        let mut path = "/api/v1/game/minecraft/historyid".to_string();
358
359        let mut query: Vec<(String, String)> = Vec::new();
360        if let Some(value) = &params.name_query {
361            query.push(("name".to_string(), value.clone()));
362        }
363        if let Some(value) = &params.uuid_query {
364            query.push(("uuid".to_string(), value.clone()));
365        }
366        if let Some(value) = &params._t {
367            query.push(("_t".to_string(), value.clone()));
368        }
369        let query = if query.is_empty() { None } else { Some(query) };
370
371        let mut extra_headers = HeaderMap::new();
372        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
373        let body = None;
374        self.client
375            .request_json(
376                Method::GET,
377                &path,
378                headers,
379                query,
380                body,
381                params.disable_cache,
382            )
383            .await
384    }
385/// 查询 MC 服务器
386    #[instrument(skip(self, params))]
387    pub async fn get_game_minecraft_serverstatus(&self, params: GetGameMinecraftServerstatusParams) -> Result<crate::models::GetGameMinecraftServerstatus200Response> {
388        let mut path = "/api/v1/game/minecraft/serverstatus".to_string();
389
390        let mut query: Vec<(String, String)> = Vec::new();
391        query.push(("server".to_string(), params.server_query.clone()));
392        if let Some(value) = &params._t {
393            query.push(("_t".to_string(), value.clone()));
394        }
395        let query = if query.is_empty() { None } else { Some(query) };
396
397        let mut extra_headers = HeaderMap::new();
398        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
399        let body = None;
400        self.client
401            .request_json(
402                Method::GET,
403                &path,
404                headers,
405                query,
406                body,
407                params.disable_cache,
408            )
409            .await
410    }
411/// 查询 MC 玩家
412    #[instrument(skip(self, params))]
413    pub async fn get_game_minecraft_userinfo(&self, params: GetGameMinecraftUserinfoParams) -> Result<crate::models::GetGameMinecraftUserinfo200Response> {
414        let mut path = "/api/v1/game/minecraft/userinfo".to_string();
415
416        let mut query: Vec<(String, String)> = Vec::new();
417        query.push(("username".to_string(), params.username_query.clone()));
418        if let Some(value) = &params._t {
419            query.push(("_t".to_string(), value.clone()));
420        }
421        let query = if query.is_empty() { None } else { Some(query) };
422
423        let mut extra_headers = HeaderMap::new();
424        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
425        let body = None;
426        self.client
427            .request_json(
428                Method::GET,
429                &path,
430                headers,
431                query,
432                body,
433                params.disable_cache,
434            )
435            .await
436    }
437/// 查询 Steam 用户
438    #[instrument(skip(self, params))]
439    pub async fn get_game_steam_summary(&self, params: GetGameSteamSummaryParams) -> Result<crate::models::GetGameSteamSummary200Response> {
440        let mut path = "/api/v1/game/steam/summary".to_string();
441
442        let mut query: Vec<(String, String)> = Vec::new();
443        if let Some(value) = &params.steamid_query {
444            query.push(("steamid".to_string(), value.clone()));
445        }
446        if let Some(value) = &params.id_query {
447            query.push(("id".to_string(), value.clone()));
448        }
449        if let Some(value) = &params.id_3_query {
450            query.push(("id3".to_string(), value.clone()));
451        }
452        if let Some(value) = &params.key_query {
453            query.push(("key".to_string(), value.clone()));
454        }
455        if let Some(value) = &params._t {
456            query.push(("_t".to_string(), value.clone()));
457        }
458        let query = if query.is_empty() { None } else { Some(query) };
459
460        let mut extra_headers = HeaderMap::new();
461        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
462        let body = None;
463        self.client
464            .request_json(
465                Method::GET,
466                &path,
467                headers,
468                query,
469                body,
470                params.disable_cache,
471            )
472            .await
473    }
474}
475
476
477#[derive(Debug, Clone)]
478pub struct GetGameMinecraftHistoryidParams {
479    pub name_query: Option<String>,
480    pub uuid_query: Option<String>,
481    pub disable_cache: Option<bool>,
482    pub _t: Option<String>,
483}
484
485impl GetGameMinecraftHistoryidParams {
486    pub fn new() -> Self {
487        Self {
488            name_query: None,
489            uuid_query: None,
490            disable_cache: None,
491            _t: None,
492        }
493    }
494    pub fn name_query(mut self, value: impl Into<String>) -> Self {
495        self.name_query = Some(value.into());
496        self
497    }
498    pub fn uuid_query(mut self, value: impl Into<String>) -> Self {
499        self.uuid_query = Some(value.into());
500        self
501    }
502    pub fn disable_cache(mut self, value: bool) -> Self {
503        self.disable_cache = Some(value);
504        self
505    }
506    pub fn _t(mut self, value: impl Into<String>) -> Self {
507        self._t = Some(value.into());
508        self
509    }
510}
511
512#[derive(Debug, Clone)]
513pub struct GetGameMinecraftServerstatusParams {
514    pub server_query: String,
515    pub disable_cache: Option<bool>,
516    pub _t: Option<String>,
517}
518
519impl GetGameMinecraftServerstatusParams {
520    pub fn new(server_query: impl Into<String>) -> Self {
521        Self {
522            server_query: server_query.into(),
523            disable_cache: None,
524            _t: None,
525        }
526    }
527    pub fn disable_cache(mut self, value: bool) -> Self {
528        self.disable_cache = Some(value);
529        self
530    }
531    pub fn _t(mut self, value: impl Into<String>) -> Self {
532        self._t = Some(value.into());
533        self
534    }
535}
536
537#[derive(Debug, Clone)]
538pub struct GetGameMinecraftUserinfoParams {
539    pub username_query: String,
540    pub disable_cache: Option<bool>,
541    pub _t: Option<String>,
542}
543
544impl GetGameMinecraftUserinfoParams {
545    pub fn new(username_query: impl Into<String>) -> Self {
546        Self {
547            username_query: username_query.into(),
548            disable_cache: None,
549            _t: None,
550        }
551    }
552    pub fn disable_cache(mut self, value: bool) -> Self {
553        self.disable_cache = Some(value);
554        self
555    }
556    pub fn _t(mut self, value: impl Into<String>) -> Self {
557        self._t = Some(value.into());
558        self
559    }
560}
561
562#[derive(Debug, Clone)]
563pub struct GetGameSteamSummaryParams {
564    pub steamid_query: Option<String>,
565    pub id_query: Option<String>,
566    pub id_3_query: Option<String>,
567    pub key_query: Option<String>,
568    pub disable_cache: Option<bool>,
569    pub _t: Option<String>,
570}
571
572impl GetGameSteamSummaryParams {
573    pub fn new() -> Self {
574        Self {
575            steamid_query: None,
576            id_query: None,
577            id_3_query: None,
578            key_query: None,
579            disable_cache: None,
580            _t: None,
581        }
582    }
583    pub fn steamid_query(mut self, value: impl Into<String>) -> Self {
584        self.steamid_query = Some(value.into());
585        self
586    }
587    pub fn id_query(mut self, value: impl Into<String>) -> Self {
588        self.id_query = Some(value.into());
589        self
590    }
591    pub fn id_3_query(mut self, value: impl Into<String>) -> Self {
592        self.id_3_query = Some(value.into());
593        self
594    }
595    pub fn key_query(mut self, value: impl Into<String>) -> Self {
596        self.key_query = Some(value.into());
597        self
598    }
599    pub fn disable_cache(mut self, value: bool) -> Self {
600        self.disable_cache = Some(value);
601        self
602    }
603    pub fn _t(mut self, value: impl Into<String>) -> Self {
604        self._t = Some(value.into());
605        self
606    }
607}
608#[derive(Debug, Clone)]
609pub struct ImageService<'a> {
610    pub(crate) client: &'a Client,
611}
612
613impl<'a> ImageService<'a> {
614/// 获取Gravatar头像
615    #[instrument(skip(self, params))]
616    pub async fn get_avatar_gravatar(&self, params: GetAvatarGravatarParams) -> Result<Vec<u8>> {
617        let mut path = "/api/v1/avatar/gravatar".to_string();
618
619        let mut query: Vec<(String, String)> = Vec::new();
620        if let Some(value) = &params.email_query {
621            query.push(("email".to_string(), value.clone()));
622        }
623        if let Some(value) = &params.hash_query {
624            query.push(("hash".to_string(), value.clone()));
625        }
626        if let Some(value) = &params.s_query {
627            query.push(("s".to_string(), value.clone()));
628        }
629        if let Some(value) = &params.d_query {
630            query.push(("d".to_string(), value.clone()));
631        }
632        if let Some(value) = &params.r_query {
633            query.push(("r".to_string(), value.clone()));
634        }
635        if let Some(value) = &params._t {
636            query.push(("_t".to_string(), value.clone()));
637        }
638        let query = if query.is_empty() { None } else { Some(query) };
639
640        let mut extra_headers = HeaderMap::new();
641        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
642        let body = None;
643        self.client
644            .request_bytes(
645                Method::GET,
646                &path,
647                headers,
648                query,
649                body,
650                params.disable_cache,
651            )
652            .await
653    }
654/// 获取必应每日壁纸
655    #[instrument(skip(self, params))]
656    pub async fn get_image_bing_daily(&self, params: GetImageBingDailyParams) -> Result<GetImageBingDailyResponse> {
657        let mut path = "/api/v1/image/bing-daily".to_string();
658
659        let mut query: Vec<(String, String)> = Vec::new();
660        if let Some(value) = &params.date_query {
661            query.push(("date".to_string(), value.clone()));
662        }
663        if let Some(value) = &params.resolution_query {
664            query.push(("resolution".to_string(), value.clone()));
665        }
666        if let Some(value) = &params.format_query {
667            query.push(("format".to_string(), value.clone()));
668        }
669        if let Some(value) = &params._t {
670            query.push(("_t".to_string(), value.clone()));
671        }
672        let query = if query.is_empty() { None } else { Some(query) };
673
674        let mut extra_headers = HeaderMap::new();
675        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
676        let body = None;
677        let wants_json = matches!(params.format_query.as_deref(), Some("json"));
678        if wants_json {
679            return self.client
680                .request_json(
681                    Method::GET,
682                    &path,
683                    headers,
684                    query,
685                    body,
686                    params.disable_cache,
687                )
688                .await
689                .map(GetImageBingDailyResponse::Json);
690        }
691
692        return self.client
693            .request_bytes(
694                Method::GET,
695                &path,
696                headers,
697                query,
698                body,
699                params.disable_cache,
700            )
701            .await
702            .map(GetImageBingDailyResponse::Bytes);
703    }
704/// 查询必应壁纸历史
705    #[instrument(skip(self, params))]
706    pub async fn get_image_bing_daily_history(&self, params: GetImageBingDailyHistoryParams) -> Result<crate::models::GetImageBingDailyHistory200Response> {
707        let mut path = "/api/v1/image/bing-daily/history".to_string();
708
709        let mut query: Vec<(String, String)> = Vec::new();
710        if let Some(value) = &params.date_query {
711            query.push(("date".to_string(), value.clone()));
712        }
713        if let Some(value) = &params.resolution_query {
714            query.push(("resolution".to_string(), value.clone()));
715        }
716        if let Some(value) = &params.page_query {
717            query.push(("page".to_string(), value.clone()));
718        }
719        if let Some(value) = &params.page_size_query {
720            query.push(("page_size".to_string(), value.clone()));
721        }
722        if let Some(value) = &params._t {
723            query.push(("_t".to_string(), value.clone()));
724        }
725        let query = if query.is_empty() { None } else { Some(query) };
726
727        let mut extra_headers = HeaderMap::new();
728        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
729        let body = None;
730        self.client
731            .request_json(
732                Method::GET,
733                &path,
734                headers,
735                query,
736                body,
737                params.disable_cache,
738            )
739            .await
740    }
741/// 生成摸摸头GIF (QQ号)
742    #[instrument(skip(self, params))]
743    pub async fn get_image_motou(&self, params: GetImageMotouParams) -> Result<Vec<u8>> {
744        let mut path = "/api/v1/image/motou".to_string();
745
746        let mut query: Vec<(String, String)> = Vec::new();
747        query.push(("qq".to_string(), params.qq_query.clone()));
748        if let Some(value) = &params.bg_color_query {
749            query.push(("bg_color".to_string(), value.clone()));
750        }
751        if let Some(value) = &params._t {
752            query.push(("_t".to_string(), value.clone()));
753        }
754        let query = if query.is_empty() { None } else { Some(query) };
755
756        let mut extra_headers = HeaderMap::new();
757        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
758        let body = None;
759        self.client
760            .request_bytes(
761                Method::GET,
762                &path,
763                headers,
764                query,
765                body,
766                params.disable_cache,
767            )
768            .await
769    }
770/// 生成二维码
771    #[instrument(skip(self, params))]
772    pub async fn get_image_qrcode(&self, params: GetImageQrcodeParams) -> Result<crate::models::GetImageQrcode200Response> {
773        let mut path = "/api/v1/image/qrcode".to_string();
774
775        let mut query: Vec<(String, String)> = Vec::new();
776        query.push(("text".to_string(), params.text_query.clone()));
777        if let Some(value) = &params.size_query {
778            query.push(("size".to_string(), value.clone()));
779        }
780        if let Some(value) = &params.format_query {
781            query.push(("format".to_string(), value.clone()));
782        }
783        if let Some(value) = &params.transparent_query {
784            query.push(("transparent".to_string(), value.clone()));
785        }
786        if let Some(value) = &params.fgcolor_query {
787            query.push(("fgcolor".to_string(), value.clone()));
788        }
789        if let Some(value) = &params.bgcolor_query {
790            query.push(("bgcolor".to_string(), value.clone()));
791        }
792        if let Some(value) = &params._t {
793            query.push(("_t".to_string(), value.clone()));
794        }
795        let query = if query.is_empty() { None } else { Some(query) };
796
797        let mut extra_headers = HeaderMap::new();
798        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
799        let body = None;
800        self.client
801            .request_json(
802                Method::GET,
803                &path,
804                headers,
805                query,
806                body,
807                params.disable_cache,
808            )
809            .await
810    }
811/// 图片转 Base64
812    #[instrument(skip(self, params))]
813    pub async fn get_image_tobase_64(&self, params: GetImageTobase64Params) -> Result<crate::models::GetImageTobase64200Response> {
814        let mut path = "/api/v1/image/tobase64".to_string();
815
816        let mut query: Vec<(String, String)> = Vec::new();
817        query.push(("url".to_string(), params.url_query.clone()));
818        if let Some(value) = &params._t {
819            query.push(("_t".to_string(), value.clone()));
820        }
821        let query = if query.is_empty() { None } else { Some(query) };
822
823        let mut extra_headers = HeaderMap::new();
824        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
825        let body = None;
826        self.client
827            .request_json(
828                Method::GET,
829                &path,
830                headers,
831                query,
832                body,
833                params.disable_cache,
834            )
835            .await
836    }
837/// 无损压缩图片
838    #[instrument(skip(self, params))]
839    pub async fn post_image_compress(&self, params: PostImageCompressParams) -> Result<Vec<u8>> {
840        let mut path = "/api/v1/image/compress".to_string();
841
842        let mut query: Vec<(String, String)> = Vec::new();
843        if let Some(value) = &params.level_query {
844            query.push(("level".to_string(), value.clone()));
845        }
846        if let Some(value) = &params.format_query {
847            query.push(("format".to_string(), value.clone()));
848        }
849        if let Some(value) = &params._t {
850            query.push(("_t".to_string(), value.clone()));
851        }
852        let query = if query.is_empty() { None } else { Some(query) };
853
854        let mut extra_headers = HeaderMap::new();
855        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
856        let body = params.body.clone();
857        self.client
858            .request_multipart_bytes(
859                Method::POST,
860                &path,
861                headers,
862                query,
863                body,
864                &["file",],
865                params.disable_cache,
866            )
867            .await
868    }
869/// 解码并缩放图片
870    #[instrument(skip(self, params))]
871    pub async fn post_image_decode(&self, params: PostImageDecodeParams) -> Result<Vec<u8>> {
872        let mut path = "/api/v1/image/decode".to_string();
873
874        let mut query: Vec<(String, String)> = Vec::new();
875        if let Some(value) = &params.width_query {
876            query.push(("width".to_string(), value.clone()));
877        }
878        if let Some(value) = &params.height_query {
879            query.push(("height".to_string(), value.clone()));
880        }
881        if let Some(value) = &params.max_width_query {
882            query.push(("max_width".to_string(), value.clone()));
883        }
884        if let Some(value) = &params.max_height_query {
885            query.push(("max_height".to_string(), value.clone()));
886        }
887        if let Some(value) = &params.format_query {
888            query.push(("format".to_string(), value.clone()));
889        }
890        if let Some(value) = &params.color_mode_query {
891            query.push(("color_mode".to_string(), value.clone()));
892        }
893        if let Some(value) = &params.fit_query {
894            query.push(("fit".to_string(), value.clone()));
895        }
896        if let Some(value) = &params.background_query {
897            query.push(("background".to_string(), value.clone()));
898        }
899        if let Some(value) = &params._t {
900            query.push(("_t".to_string(), value.clone()));
901        }
902        let query = if query.is_empty() { None } else { Some(query) };
903
904        let mut extra_headers = HeaderMap::new();
905        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
906        let body = params.body.clone();
907        self.client
908            .request_multipart_bytes(
909                Method::POST,
910                &path,
911                headers,
912                query,
913                body,
914                &["file",],
915                params.disable_cache,
916            )
917            .await
918    }
919/// 通过Base64编码上传图片
920    #[instrument(skip(self, params))]
921    pub async fn post_image_frombase_64(&self, params: PostImageFrombase64Params) -> Result<crate::models::PostImageFrombase64200Response> {
922        let mut path = "/api/v1/image/frombase64".to_string();
923
924        let mut query: Vec<(String, String)> = Vec::new();
925        if let Some(value) = &params._t {
926            query.push(("_t".to_string(), value.clone()));
927        }
928        let query = if query.is_empty() { None } else { Some(query) };
929
930        let mut extra_headers = HeaderMap::new();
931        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
932        let body = params.body.clone();
933        self.client
934            .request_json(
935                Method::POST,
936                &path,
937                headers,
938                query,
939                body,
940                params.disable_cache,
941            )
942            .await
943    }
944/// 生成摸摸头GIF
945    #[instrument(skip(self, params))]
946    pub async fn post_image_motou(&self, params: PostImageMotouParams) -> Result<Vec<u8>> {
947        let mut path = "/api/v1/image/motou".to_string();
948
949        let mut query: Vec<(String, String)> = Vec::new();
950        if let Some(value) = &params._t {
951            query.push(("_t".to_string(), value.clone()));
952        }
953        let query = if query.is_empty() { None } else { Some(query) };
954
955        let mut extra_headers = HeaderMap::new();
956        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
957        let body = params.body.clone();
958        self.client
959            .request_multipart_bytes(
960                Method::POST,
961                &path,
962                headers,
963                query,
964                body,
965                &["file",],
966                params.disable_cache,
967            )
968            .await
969    }
970/// 图片敏感检测
971    #[instrument(skip(self, params))]
972    pub async fn post_image_nsfw(&self, params: PostImageNsfwParams) -> Result<crate::models::PostImageNsfw200Response> {
973        let mut path = "/api/v1/image/nsfw".to_string();
974
975        let mut query: Vec<(String, String)> = Vec::new();
976        if let Some(value) = &params._t {
977            query.push(("_t".to_string(), value.clone()));
978        }
979        let query = if query.is_empty() { None } else { Some(query) };
980
981        let mut extra_headers = HeaderMap::new();
982        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
983        let body = params.body.clone();
984        self.client
985            .request_multipart_json(
986                Method::POST,
987                &path,
988                headers,
989                query,
990                body,
991                &["file",],
992                params.disable_cache,
993            )
994            .await
995    }
996/// 通用 OCR 文字识别
997    #[instrument(skip(self, params))]
998    pub async fn post_image_ocr(&self, params: PostImageOcrParams) -> Result<crate::models::PostImageOcr200Response> {
999        let mut path = "/api/v1/image/ocr".to_string();
1000
1001        let mut query: Vec<(String, String)> = Vec::new();
1002        if let Some(value) = &params._t {
1003            query.push(("_t".to_string(), value.clone()));
1004        }
1005        let query = if query.is_empty() { None } else { Some(query) };
1006
1007        let mut extra_headers = HeaderMap::new();
1008        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1009        let body = params.body.clone();
1010        self.client
1011            .request_multipart_json(
1012                Method::POST,
1013                &path,
1014                headers,
1015                query,
1016                body,
1017                &["file",],
1018                params.disable_cache,
1019            )
1020            .await
1021    }
1022/// 生成你们怎么不说话了表情包
1023    #[instrument(skip(self, params))]
1024    pub async fn post_image_speechless(&self, params: PostImageSpeechlessParams) -> Result<Vec<u8>> {
1025        let mut path = "/api/v1/image/speechless".to_string();
1026
1027        let mut query: Vec<(String, String)> = Vec::new();
1028        if let Some(value) = &params._t {
1029            query.push(("_t".to_string(), value.clone()));
1030        }
1031        let query = if query.is_empty() { None } else { Some(query) };
1032
1033        let mut extra_headers = HeaderMap::new();
1034        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1035        let body = params.body.clone();
1036        self.client
1037            .request_bytes(
1038                Method::POST,
1039                &path,
1040                headers,
1041                query,
1042                body,
1043                params.disable_cache,
1044            )
1045            .await
1046    }
1047/// SVG转图片
1048    #[instrument(skip(self, params))]
1049    pub async fn post_image_svg(&self, params: PostImageSvgParams) -> Result<Vec<u8>> {
1050        let mut path = "/api/v1/image/svg".to_string();
1051
1052        let mut query: Vec<(String, String)> = Vec::new();
1053        if let Some(value) = &params.format_query {
1054            query.push(("format".to_string(), value.clone()));
1055        }
1056        if let Some(value) = &params.width_query {
1057            query.push(("width".to_string(), value.clone()));
1058        }
1059        if let Some(value) = &params.height_query {
1060            query.push(("height".to_string(), value.clone()));
1061        }
1062        if let Some(value) = &params.quality_query {
1063            query.push(("quality".to_string(), value.clone()));
1064        }
1065        if let Some(value) = &params._t {
1066            query.push(("_t".to_string(), value.clone()));
1067        }
1068        let query = if query.is_empty() { None } else { Some(query) };
1069
1070        let mut extra_headers = HeaderMap::new();
1071        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1072        let body = params.body.clone();
1073        self.client
1074            .request_multipart_bytes(
1075                Method::POST,
1076                &path,
1077                headers,
1078                query,
1079                body,
1080                &["file",],
1081                params.disable_cache,
1082            )
1083            .await
1084    }
1085}
1086
1087#[derive(Debug, Clone)]
1088pub struct GetAvatarGravatarParams {
1089    pub email_query: Option<String>,
1090    pub hash_query: Option<String>,
1091    pub s_query: Option<String>,
1092    pub d_query: Option<String>,
1093    pub r_query: Option<String>,
1094    pub disable_cache: Option<bool>,
1095    pub _t: Option<String>,
1096}
1097
1098impl GetAvatarGravatarParams {
1099    pub fn new() -> Self {
1100        Self {
1101            email_query: None,
1102            hash_query: None,
1103            s_query: None,
1104            d_query: None,
1105            r_query: None,
1106            disable_cache: None,
1107            _t: None,
1108        }
1109    }
1110    pub fn email_query(mut self, value: impl Into<String>) -> Self {
1111        self.email_query = Some(value.into());
1112        self
1113    }
1114    pub fn hash_query(mut self, value: impl Into<String>) -> Self {
1115        self.hash_query = Some(value.into());
1116        self
1117    }
1118    pub fn s_query(mut self, value: impl Into<String>) -> Self {
1119        self.s_query = Some(value.into());
1120        self
1121    }
1122    pub fn d_query(mut self, value: impl Into<String>) -> Self {
1123        self.d_query = Some(value.into());
1124        self
1125    }
1126    pub fn r_query(mut self, value: impl Into<String>) -> Self {
1127        self.r_query = Some(value.into());
1128        self
1129    }
1130    pub fn disable_cache(mut self, value: bool) -> Self {
1131        self.disable_cache = Some(value);
1132        self
1133    }
1134    pub fn _t(mut self, value: impl Into<String>) -> Self {
1135        self._t = Some(value.into());
1136        self
1137    }
1138}
1139
1140#[derive(Debug, Clone)]
1141pub struct GetImageBingDailyParams {
1142    pub date_query: Option<String>,
1143    pub resolution_query: Option<String>,
1144    pub format_query: Option<String>,
1145    pub disable_cache: Option<bool>,
1146    pub _t: Option<String>,
1147}
1148
1149impl GetImageBingDailyParams {
1150    pub fn new() -> Self {
1151        Self {
1152            date_query: None,
1153            resolution_query: None,
1154            format_query: None,
1155            disable_cache: None,
1156            _t: None,
1157        }
1158    }
1159    pub fn date_query(mut self, value: impl Into<String>) -> Self {
1160        self.date_query = Some(value.into());
1161        self
1162    }
1163    pub fn resolution_query(mut self, value: impl Into<String>) -> Self {
1164        self.resolution_query = Some(value.into());
1165        self
1166    }
1167    pub fn format_query(mut self, value: impl Into<String>) -> Self {
1168        self.format_query = Some(value.into());
1169        self
1170    }
1171    pub fn disable_cache(mut self, value: bool) -> Self {
1172        self.disable_cache = Some(value);
1173        self
1174    }
1175    pub fn _t(mut self, value: impl Into<String>) -> Self {
1176        self._t = Some(value.into());
1177        self
1178    }
1179}
1180
1181#[derive(Debug, Clone)]
1182pub struct GetImageBingDailyHistoryParams {
1183    pub date_query: Option<String>,
1184    pub resolution_query: Option<String>,
1185    pub page_query: Option<String>,
1186    pub page_size_query: Option<String>,
1187    pub disable_cache: Option<bool>,
1188    pub _t: Option<String>,
1189}
1190
1191impl GetImageBingDailyHistoryParams {
1192    pub fn new() -> Self {
1193        Self {
1194            date_query: None,
1195            resolution_query: None,
1196            page_query: None,
1197            page_size_query: None,
1198            disable_cache: None,
1199            _t: None,
1200        }
1201    }
1202    pub fn date_query(mut self, value: impl Into<String>) -> Self {
1203        self.date_query = Some(value.into());
1204        self
1205    }
1206    pub fn resolution_query(mut self, value: impl Into<String>) -> Self {
1207        self.resolution_query = Some(value.into());
1208        self
1209    }
1210    pub fn page_query(mut self, value: impl Into<String>) -> Self {
1211        self.page_query = Some(value.into());
1212        self
1213    }
1214    pub fn page_size_query(mut self, value: impl Into<String>) -> Self {
1215        self.page_size_query = Some(value.into());
1216        self
1217    }
1218    pub fn disable_cache(mut self, value: bool) -> Self {
1219        self.disable_cache = Some(value);
1220        self
1221    }
1222    pub fn _t(mut self, value: impl Into<String>) -> Self {
1223        self._t = Some(value.into());
1224        self
1225    }
1226}
1227
1228#[derive(Debug, Clone)]
1229pub struct GetImageMotouParams {
1230    pub qq_query: String,
1231    pub bg_color_query: Option<String>,
1232    pub disable_cache: Option<bool>,
1233    pub _t: Option<String>,
1234}
1235
1236impl GetImageMotouParams {
1237    pub fn new(qq_query: impl Into<String>) -> Self {
1238        Self {
1239            qq_query: qq_query.into(),
1240            bg_color_query: None,
1241            disable_cache: None,
1242            _t: None,
1243        }
1244    }
1245    pub fn bg_color_query(mut self, value: impl Into<String>) -> Self {
1246        self.bg_color_query = Some(value.into());
1247        self
1248    }
1249    pub fn disable_cache(mut self, value: bool) -> Self {
1250        self.disable_cache = Some(value);
1251        self
1252    }
1253    pub fn _t(mut self, value: impl Into<String>) -> Self {
1254        self._t = Some(value.into());
1255        self
1256    }
1257}
1258
1259#[derive(Debug, Clone)]
1260pub struct GetImageQrcodeParams {
1261    pub text_query: String,
1262    pub size_query: Option<String>,
1263    pub format_query: Option<String>,
1264    pub transparent_query: Option<String>,
1265    pub fgcolor_query: Option<String>,
1266    pub bgcolor_query: Option<String>,
1267    pub disable_cache: Option<bool>,
1268    pub _t: Option<String>,
1269}
1270
1271impl GetImageQrcodeParams {
1272    pub fn new(text_query: impl Into<String>) -> Self {
1273        Self {
1274            text_query: text_query.into(),
1275            size_query: None,
1276            format_query: None,
1277            transparent_query: None,
1278            fgcolor_query: None,
1279            bgcolor_query: None,
1280            disable_cache: None,
1281            _t: None,
1282        }
1283    }
1284    pub fn size_query(mut self, value: impl Into<String>) -> Self {
1285        self.size_query = Some(value.into());
1286        self
1287    }
1288    pub fn format_query(mut self, value: impl Into<String>) -> Self {
1289        self.format_query = Some(value.into());
1290        self
1291    }
1292    pub fn transparent_query(mut self, value: impl Into<String>) -> Self {
1293        self.transparent_query = Some(value.into());
1294        self
1295    }
1296    pub fn fgcolor_query(mut self, value: impl Into<String>) -> Self {
1297        self.fgcolor_query = Some(value.into());
1298        self
1299    }
1300    pub fn bgcolor_query(mut self, value: impl Into<String>) -> Self {
1301        self.bgcolor_query = Some(value.into());
1302        self
1303    }
1304    pub fn disable_cache(mut self, value: bool) -> Self {
1305        self.disable_cache = Some(value);
1306        self
1307    }
1308    pub fn _t(mut self, value: impl Into<String>) -> Self {
1309        self._t = Some(value.into());
1310        self
1311    }
1312}
1313
1314#[derive(Debug, Clone)]
1315pub struct GetImageTobase64Params {
1316    pub url_query: String,
1317    pub disable_cache: Option<bool>,
1318    pub _t: Option<String>,
1319}
1320
1321impl GetImageTobase64Params {
1322    pub fn new(url_query: impl Into<String>) -> Self {
1323        Self {
1324            url_query: url_query.into(),
1325            disable_cache: None,
1326            _t: None,
1327        }
1328    }
1329    pub fn disable_cache(mut self, value: bool) -> Self {
1330        self.disable_cache = Some(value);
1331        self
1332    }
1333    pub fn _t(mut self, value: impl Into<String>) -> Self {
1334        self._t = Some(value.into());
1335        self
1336    }
1337}
1338
1339#[derive(Debug, Clone)]
1340pub struct PostImageCompressParams {
1341    pub level_query: Option<String>,
1342    pub format_query: Option<String>,
1343    pub body: Option<Value>,
1344    pub disable_cache: Option<bool>,
1345    pub _t: Option<String>,
1346}
1347
1348impl PostImageCompressParams {
1349    pub fn new() -> Self {
1350        Self {
1351            level_query: None,
1352            format_query: None,
1353            body: None,
1354            disable_cache: None,
1355            _t: None,
1356        }
1357    }
1358    pub fn level_query(mut self, value: impl Into<String>) -> Self {
1359        self.level_query = Some(value.into());
1360        self
1361    }
1362    pub fn format_query(mut self, value: impl Into<String>) -> Self {
1363        self.format_query = Some(value.into());
1364        self
1365    }
1366    pub fn disable_cache(mut self, value: bool) -> Self {
1367        self.disable_cache = Some(value);
1368        self
1369    }
1370    pub fn _t(mut self, value: impl Into<String>) -> Self {
1371        self._t = Some(value.into());
1372        self
1373    }
1374    pub fn body(mut self, value: Value) -> Self {
1375        self.body = Some(value);
1376        self
1377    }
1378}
1379
1380#[derive(Debug, Clone)]
1381pub struct PostImageDecodeParams {
1382    pub width_query: Option<String>,
1383    pub height_query: Option<String>,
1384    pub max_width_query: Option<String>,
1385    pub max_height_query: Option<String>,
1386    pub format_query: Option<String>,
1387    pub color_mode_query: Option<String>,
1388    pub fit_query: Option<String>,
1389    pub background_query: Option<String>,
1390    pub body: Option<Value>,
1391    pub disable_cache: Option<bool>,
1392    pub _t: Option<String>,
1393}
1394
1395impl PostImageDecodeParams {
1396    pub fn new() -> Self {
1397        Self {
1398            width_query: None,
1399            height_query: None,
1400            max_width_query: None,
1401            max_height_query: None,
1402            format_query: None,
1403            color_mode_query: None,
1404            fit_query: None,
1405            background_query: None,
1406            body: None,
1407            disable_cache: None,
1408            _t: None,
1409        }
1410    }
1411    pub fn width_query(mut self, value: impl Into<String>) -> Self {
1412        self.width_query = Some(value.into());
1413        self
1414    }
1415    pub fn height_query(mut self, value: impl Into<String>) -> Self {
1416        self.height_query = Some(value.into());
1417        self
1418    }
1419    pub fn max_width_query(mut self, value: impl Into<String>) -> Self {
1420        self.max_width_query = Some(value.into());
1421        self
1422    }
1423    pub fn max_height_query(mut self, value: impl Into<String>) -> Self {
1424        self.max_height_query = Some(value.into());
1425        self
1426    }
1427    pub fn format_query(mut self, value: impl Into<String>) -> Self {
1428        self.format_query = Some(value.into());
1429        self
1430    }
1431    pub fn color_mode_query(mut self, value: impl Into<String>) -> Self {
1432        self.color_mode_query = Some(value.into());
1433        self
1434    }
1435    pub fn fit_query(mut self, value: impl Into<String>) -> Self {
1436        self.fit_query = Some(value.into());
1437        self
1438    }
1439    pub fn background_query(mut self, value: impl Into<String>) -> Self {
1440        self.background_query = Some(value.into());
1441        self
1442    }
1443    pub fn disable_cache(mut self, value: bool) -> Self {
1444        self.disable_cache = Some(value);
1445        self
1446    }
1447    pub fn _t(mut self, value: impl Into<String>) -> Self {
1448        self._t = Some(value.into());
1449        self
1450    }
1451    pub fn body(mut self, value: Value) -> Self {
1452        self.body = Some(value);
1453        self
1454    }
1455}
1456
1457#[derive(Debug, Clone)]
1458pub struct PostImageFrombase64Params {
1459    pub body: Option<Value>,
1460    pub disable_cache: Option<bool>,
1461    pub _t: Option<String>,
1462}
1463
1464impl PostImageFrombase64Params {
1465    pub fn new() -> Self {
1466        Self {
1467            body: None,
1468            disable_cache: None,
1469            _t: None,
1470        }
1471    }
1472    pub fn disable_cache(mut self, value: bool) -> Self {
1473        self.disable_cache = Some(value);
1474        self
1475    }
1476    pub fn _t(mut self, value: impl Into<String>) -> Self {
1477        self._t = Some(value.into());
1478        self
1479    }
1480    pub fn body(mut self, value: Value) -> Self {
1481        self.body = Some(value);
1482        self
1483    }
1484}
1485
1486#[derive(Debug, Clone)]
1487pub struct PostImageMotouParams {
1488    pub body: Option<Value>,
1489    pub disable_cache: Option<bool>,
1490    pub _t: Option<String>,
1491}
1492
1493impl PostImageMotouParams {
1494    pub fn new() -> Self {
1495        Self {
1496            body: None,
1497            disable_cache: None,
1498            _t: None,
1499        }
1500    }
1501    pub fn disable_cache(mut self, value: bool) -> Self {
1502        self.disable_cache = Some(value);
1503        self
1504    }
1505    pub fn _t(mut self, value: impl Into<String>) -> Self {
1506        self._t = Some(value.into());
1507        self
1508    }
1509    pub fn body(mut self, value: Value) -> Self {
1510        self.body = Some(value);
1511        self
1512    }
1513}
1514
1515#[derive(Debug, Clone)]
1516pub struct PostImageNsfwParams {
1517    pub body: Option<Value>,
1518    pub disable_cache: Option<bool>,
1519    pub _t: Option<String>,
1520}
1521
1522impl PostImageNsfwParams {
1523    pub fn new() -> Self {
1524        Self {
1525            body: None,
1526            disable_cache: None,
1527            _t: None,
1528        }
1529    }
1530    pub fn disable_cache(mut self, value: bool) -> Self {
1531        self.disable_cache = Some(value);
1532        self
1533    }
1534    pub fn _t(mut self, value: impl Into<String>) -> Self {
1535        self._t = Some(value.into());
1536        self
1537    }
1538    pub fn body(mut self, value: Value) -> Self {
1539        self.body = Some(value);
1540        self
1541    }
1542}
1543
1544#[derive(Debug, Clone)]
1545pub struct PostImageOcrParams {
1546    pub body: Option<Value>,
1547    pub disable_cache: Option<bool>,
1548    pub _t: Option<String>,
1549}
1550
1551impl PostImageOcrParams {
1552    pub fn new() -> Self {
1553        Self {
1554            body: None,
1555            disable_cache: None,
1556            _t: None,
1557        }
1558    }
1559    pub fn disable_cache(mut self, value: bool) -> Self {
1560        self.disable_cache = Some(value);
1561        self
1562    }
1563    pub fn _t(mut self, value: impl Into<String>) -> Self {
1564        self._t = Some(value.into());
1565        self
1566    }
1567    pub fn body(mut self, value: Value) -> Self {
1568        self.body = Some(value);
1569        self
1570    }
1571}
1572
1573#[derive(Debug, Clone)]
1574pub struct PostImageSpeechlessParams {
1575    pub body: Option<Value>,
1576    pub disable_cache: Option<bool>,
1577    pub _t: Option<String>,
1578}
1579
1580impl PostImageSpeechlessParams {
1581    pub fn new() -> Self {
1582        Self {
1583            body: None,
1584            disable_cache: None,
1585            _t: None,
1586        }
1587    }
1588    pub fn disable_cache(mut self, value: bool) -> Self {
1589        self.disable_cache = Some(value);
1590        self
1591    }
1592    pub fn _t(mut self, value: impl Into<String>) -> Self {
1593        self._t = Some(value.into());
1594        self
1595    }
1596    pub fn body(mut self, value: Value) -> Self {
1597        self.body = Some(value);
1598        self
1599    }
1600}
1601
1602#[derive(Debug, Clone)]
1603pub struct PostImageSvgParams {
1604    pub format_query: Option<String>,
1605    pub width_query: Option<String>,
1606    pub height_query: Option<String>,
1607    pub quality_query: Option<String>,
1608    pub body: Option<Value>,
1609    pub disable_cache: Option<bool>,
1610    pub _t: Option<String>,
1611}
1612
1613impl PostImageSvgParams {
1614    pub fn new() -> Self {
1615        Self {
1616            format_query: None,
1617            width_query: None,
1618            height_query: None,
1619            quality_query: None,
1620            body: None,
1621            disable_cache: None,
1622            _t: None,
1623        }
1624    }
1625    pub fn format_query(mut self, value: impl Into<String>) -> Self {
1626        self.format_query = Some(value.into());
1627        self
1628    }
1629    pub fn width_query(mut self, value: impl Into<String>) -> Self {
1630        self.width_query = Some(value.into());
1631        self
1632    }
1633    pub fn height_query(mut self, value: impl Into<String>) -> Self {
1634        self.height_query = Some(value.into());
1635        self
1636    }
1637    pub fn quality_query(mut self, value: impl Into<String>) -> Self {
1638        self.quality_query = Some(value.into());
1639        self
1640    }
1641    pub fn disable_cache(mut self, value: bool) -> Self {
1642        self.disable_cache = Some(value);
1643        self
1644    }
1645    pub fn _t(mut self, value: impl Into<String>) -> Self {
1646        self._t = Some(value.into());
1647        self
1648    }
1649    pub fn body(mut self, value: Value) -> Self {
1650        self.body = Some(value);
1651        self
1652    }
1653}
1654#[derive(Debug, Clone)]
1655pub struct MiscService<'a> {
1656    pub(crate) client: &'a Client,
1657}
1658
1659impl<'a> MiscService<'a> {
1660/// 程序员历史事件
1661    #[instrument(skip(self, params))]
1662    pub async fn get_history_programmer(&self, params: GetHistoryProgrammerParams) -> Result<crate::models::GetHistoryProgrammer200Response> {
1663        let mut path = "/api/v1/history/programmer".to_string();
1664
1665        let mut query: Vec<(String, String)> = Vec::new();
1666        query.push(("month".to_string(), params.month_query.clone()));
1667        query.push(("day".to_string(), params.day_query.clone()));
1668        if let Some(value) = &params._t {
1669            query.push(("_t".to_string(), value.clone()));
1670        }
1671        let query = if query.is_empty() { None } else { Some(query) };
1672
1673        let mut extra_headers = HeaderMap::new();
1674        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1675        let body = None;
1676        self.client
1677            .request_json(
1678                Method::GET,
1679                &path,
1680                headers,
1681                query,
1682                body,
1683                params.disable_cache,
1684            )
1685            .await
1686    }
1687/// 程序员历史上的今天
1688    #[instrument(skip(self))]
1689    pub async fn get_history_programmer_today(&self) -> Result<crate::models::GetHistoryProgrammerToday200Response> {
1690        let mut path = "/api/v1/history/programmer/today".to_string();
1691
1692        let mut query: Vec<(String, String)> = Vec::new();
1693        let query = if query.is_empty() { None } else { Some(query) };
1694
1695        let mut extra_headers = HeaderMap::new();
1696        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1697        let body = None;
1698        self.client
1699            .request_json(
1700                Method::GET,
1701                &path,
1702                headers,
1703                query,
1704                body,
1705                None,
1706            )
1707            .await
1708    }
1709/// Adcode 国内外行政区域查询
1710    #[instrument(skip(self, params))]
1711    pub async fn get_misc_district(&self, params: GetMiscDistrictParams) -> Result<crate::models::GetMiscDistrict200Response> {
1712        let mut path = "/api/v1/misc/district".to_string();
1713
1714        let mut query: Vec<(String, String)> = Vec::new();
1715        if let Some(value) = &params.keywords_query {
1716            query.push(("keywords".to_string(), value.clone()));
1717        }
1718        if let Some(value) = &params.adcode_query {
1719            query.push(("adcode".to_string(), value.clone()));
1720        }
1721        if let Some(value) = &params.lat_query {
1722            query.push(("lat".to_string(), value.clone()));
1723        }
1724        if let Some(value) = &params.lng_query {
1725            query.push(("lng".to_string(), value.clone()));
1726        }
1727        if let Some(value) = &params.level_query {
1728            query.push(("level".to_string(), value.clone()));
1729        }
1730        if let Some(value) = &params.country_query {
1731            query.push(("country".to_string(), value.clone()));
1732        }
1733        if let Some(value) = &params.limit_query {
1734            query.push(("limit".to_string(), value.clone()));
1735        }
1736        if let Some(value) = &params._t {
1737            query.push(("_t".to_string(), value.clone()));
1738        }
1739        let query = if query.is_empty() { None } else { Some(query) };
1740
1741        let mut extra_headers = HeaderMap::new();
1742        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1743        let body = None;
1744        self.client
1745            .request_json(
1746                Method::GET,
1747                &path,
1748                headers,
1749                query,
1750                body,
1751                params.disable_cache,
1752            )
1753            .await
1754    }
1755/// 查询节假日与万年历
1756    #[instrument(skip(self, params))]
1757    pub async fn get_misc_holiday_calendar(&self, params: GetMiscHolidayCalendarParams) -> Result<crate::models::GetMiscHolidayCalendar200Response> {
1758        let mut path = "/api/v1/misc/holiday-calendar".to_string();
1759
1760        let mut query: Vec<(String, String)> = Vec::new();
1761        if let Some(value) = &params.date_query {
1762            query.push(("date".to_string(), value.clone()));
1763        }
1764        if let Some(value) = &params.month_query {
1765            query.push(("month".to_string(), value.clone()));
1766        }
1767        if let Some(value) = &params.year_query {
1768            query.push(("year".to_string(), value.clone()));
1769        }
1770        if let Some(value) = &params.timezone_query {
1771            query.push(("timezone".to_string(), value.clone()));
1772        }
1773        if let Some(value) = &params.holiday_type_query {
1774            query.push(("holiday_type".to_string(), value.clone()));
1775        }
1776        if let Some(value) = &params.include_nearby_query {
1777            query.push(("include_nearby".to_string(), value.clone()));
1778        }
1779        if let Some(value) = &params.nearby_limit_query {
1780            query.push(("nearby_limit".to_string(), value.clone()));
1781        }
1782        if let Some(value) = &params.exclude_past_query {
1783            query.push(("exclude_past".to_string(), value.clone()));
1784        }
1785        if let Some(value) = &params._t {
1786            query.push(("_t".to_string(), value.clone()));
1787        }
1788        let query = if query.is_empty() { None } else { Some(query) };
1789
1790        let mut extra_headers = HeaderMap::new();
1791        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1792        let body = None;
1793        self.client
1794            .request_json(
1795                Method::GET,
1796                &path,
1797                headers,
1798                query,
1799                body,
1800                params.disable_cache,
1801            )
1802            .await
1803    }
1804/// 查询热榜
1805    #[instrument(skip(self, params))]
1806    pub async fn get_misc_hotboard(&self, params: GetMiscHotboardParams) -> Result<crate::models::GetMiscHotboard200Response> {
1807        let mut path = "/api/v1/misc/hotboard".to_string();
1808
1809        let mut query: Vec<(String, String)> = Vec::new();
1810        query.push(("type".to_string(), params.type_query.clone()));
1811        if let Some(value) = &params.time_query {
1812            query.push(("time".to_string(), value.clone()));
1813        }
1814        if let Some(value) = &params.keyword_query {
1815            query.push(("keyword".to_string(), value.clone()));
1816        }
1817        if let Some(value) = &params.time_start_query {
1818            query.push(("time_start".to_string(), value.clone()));
1819        }
1820        if let Some(value) = &params.time_end_query {
1821            query.push(("time_end".to_string(), value.clone()));
1822        }
1823        if let Some(value) = &params.limit_query {
1824            query.push(("limit".to_string(), value.clone()));
1825        }
1826        if let Some(value) = &params._t {
1827            query.push(("_t".to_string(), value.clone()));
1828        }
1829        let query = if query.is_empty() { None } else { Some(query) };
1830
1831        let mut extra_headers = HeaderMap::new();
1832        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1833        let body = None;
1834        self.client
1835            .request_json(
1836                Method::GET,
1837                &path,
1838                headers,
1839                query,
1840                body,
1841                params.disable_cache,
1842            )
1843            .await
1844    }
1845/// 查询农历时间
1846    #[instrument(skip(self, params))]
1847    pub async fn get_misc_lunartime(&self, params: GetMiscLunartimeParams) -> Result<crate::models::GetMiscLunartime200Response> {
1848        let mut path = "/api/v1/misc/lunartime".to_string();
1849
1850        let mut query: Vec<(String, String)> = Vec::new();
1851        if let Some(value) = &params.ts_query {
1852            query.push(("ts".to_string(), value.clone()));
1853        }
1854        if let Some(value) = &params.timezone_query {
1855            query.push(("timezone".to_string(), value.clone()));
1856        }
1857        if let Some(value) = &params._t {
1858            query.push(("_t".to_string(), value.clone()));
1859        }
1860        let query = if query.is_empty() { None } else { Some(query) };
1861
1862        let mut extra_headers = HeaderMap::new();
1863        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1864        let body = None;
1865        self.client
1866            .request_json(
1867                Method::GET,
1868                &path,
1869                headers,
1870                query,
1871                body,
1872                params.disable_cache,
1873            )
1874            .await
1875    }
1876/// 查询手机归属地
1877    #[instrument(skip(self, params))]
1878    pub async fn get_misc_phoneinfo(&self, params: GetMiscPhoneinfoParams) -> Result<crate::models::GetMiscPhoneinfo200Response> {
1879        let mut path = "/api/v1/misc/phoneinfo".to_string();
1880
1881        let mut query: Vec<(String, String)> = Vec::new();
1882        query.push(("phone".to_string(), params.phone_query.clone()));
1883        if let Some(value) = &params._t {
1884            query.push(("_t".to_string(), value.clone()));
1885        }
1886        let query = if query.is_empty() { None } else { Some(query) };
1887
1888        let mut extra_headers = HeaderMap::new();
1889        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1890        let body = None;
1891        self.client
1892            .request_json(
1893                Method::GET,
1894                &path,
1895                headers,
1896                query,
1897                body,
1898                params.disable_cache,
1899            )
1900            .await
1901    }
1902/// 随机数生成
1903    #[instrument(skip(self, params))]
1904    pub async fn get_misc_randomnumber(&self, params: GetMiscRandomnumberParams) -> Result<crate::models::GetMiscRandomnumber200Response> {
1905        let mut path = "/api/v1/misc/randomnumber".to_string();
1906
1907        let mut query: Vec<(String, String)> = Vec::new();
1908        if let Some(value) = &params.min_query {
1909            query.push(("min".to_string(), value.clone()));
1910        }
1911        if let Some(value) = &params.max_query {
1912            query.push(("max".to_string(), value.clone()));
1913        }
1914        if let Some(value) = &params.count_query {
1915            query.push(("count".to_string(), value.clone()));
1916        }
1917        if let Some(value) = &params.allow_repeat_query {
1918            query.push(("allow_repeat".to_string(), value.clone()));
1919        }
1920        if let Some(value) = &params.allow_decimal_query {
1921            query.push(("allow_decimal".to_string(), value.clone()));
1922        }
1923        if let Some(value) = &params.decimal_places_query {
1924            query.push(("decimal_places".to_string(), value.clone()));
1925        }
1926        if let Some(value) = &params._t {
1927            query.push(("_t".to_string(), value.clone()));
1928        }
1929        let query = if query.is_empty() { None } else { Some(query) };
1930
1931        let mut extra_headers = HeaderMap::new();
1932        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1933        let body = None;
1934        self.client
1935            .request_json(
1936                Method::GET,
1937                &path,
1938                headers,
1939                query,
1940                body,
1941                params.disable_cache,
1942            )
1943            .await
1944    }
1945/// 转换时间戳 (旧版,推荐使用/convert/unixtime)
1946    #[instrument(skip(self, params))]
1947    pub async fn get_misc_timestamp(&self, params: GetMiscTimestampParams) -> Result<crate::models::GetMiscTimestamp200Response> {
1948        let mut path = "/api/v1/misc/timestamp".to_string();
1949
1950        let mut query: Vec<(String, String)> = Vec::new();
1951        query.push(("ts".to_string(), params.ts_query.clone()));
1952        if let Some(value) = &params._t {
1953            query.push(("_t".to_string(), value.clone()));
1954        }
1955        let query = if query.is_empty() { None } else { Some(query) };
1956
1957        let mut extra_headers = HeaderMap::new();
1958        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1959        let body = None;
1960        self.client
1961            .request_json(
1962                Method::GET,
1963                &path,
1964                headers,
1965                query,
1966                body,
1967                params.disable_cache,
1968            )
1969            .await
1970    }
1971/// 获取支持的快递公司列表
1972    #[instrument(skip(self))]
1973    pub async fn get_misc_tracking_carriers(&self) -> Result<crate::models::GetMiscTrackingCarriers200Response> {
1974        let mut path = "/api/v1/misc/tracking/carriers".to_string();
1975
1976        let mut query: Vec<(String, String)> = Vec::new();
1977        let query = if query.is_empty() { None } else { Some(query) };
1978
1979        let mut extra_headers = HeaderMap::new();
1980        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1981        let body = None;
1982        self.client
1983            .request_json(
1984                Method::GET,
1985                &path,
1986                headers,
1987                query,
1988                body,
1989                None,
1990            )
1991            .await
1992    }
1993/// 识别快递公司
1994    #[instrument(skip(self, params))]
1995    pub async fn get_misc_tracking_detect(&self, params: GetMiscTrackingDetectParams) -> Result<crate::models::GetMiscTrackingDetect200Response> {
1996        let mut path = "/api/v1/misc/tracking/detect".to_string();
1997
1998        let mut query: Vec<(String, String)> = Vec::new();
1999        query.push(("tracking_number".to_string(), params.tracking_number_query.clone()));
2000        if let Some(value) = &params._t {
2001            query.push(("_t".to_string(), value.clone()));
2002        }
2003        let query = if query.is_empty() { None } else { Some(query) };
2004
2005        let mut extra_headers = HeaderMap::new();
2006        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2007        let body = None;
2008        self.client
2009            .request_json(
2010                Method::GET,
2011                &path,
2012                headers,
2013                query,
2014                body,
2015                params.disable_cache,
2016            )
2017            .await
2018    }
2019/// 查询快递物流信息
2020    #[instrument(skip(self, params))]
2021    pub async fn get_misc_tracking_query(&self, params: GetMiscTrackingQueryParams) -> Result<crate::models::GetMiscTrackingQuery200Response> {
2022        let mut path = "/api/v1/misc/tracking/query".to_string();
2023
2024        let mut query: Vec<(String, String)> = Vec::new();
2025        query.push(("tracking_number".to_string(), params.tracking_number_query.clone()));
2026        if let Some(value) = &params.carrier_code_query {
2027            query.push(("carrier_code".to_string(), value.clone()));
2028        }
2029        if let Some(value) = &params.phone_query {
2030            query.push(("phone".to_string(), value.clone()));
2031        }
2032        if let Some(value) = &params.full_query {
2033            query.push(("full".to_string(), value.clone()));
2034        }
2035        if let Some(value) = &params._t {
2036            query.push(("_t".to_string(), value.clone()));
2037        }
2038        let query = if query.is_empty() { None } else { Some(query) };
2039
2040        let mut extra_headers = HeaderMap::new();
2041        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2042        let body = None;
2043        self.client
2044            .request_json(
2045                Method::GET,
2046                &path,
2047                headers,
2048                query,
2049                body,
2050                params.disable_cache,
2051            )
2052            .await
2053    }
2054/// 查询天气
2055    #[instrument(skip(self, params))]
2056    pub async fn get_misc_weather(&self, params: GetMiscWeatherParams) -> Result<crate::models::GetMiscWeather200Response> {
2057        let mut path = "/api/v1/misc/weather".to_string();
2058
2059        let mut query: Vec<(String, String)> = Vec::new();
2060        if let Some(value) = &params.city_query {
2061            query.push(("city".to_string(), value.clone()));
2062        }
2063        if let Some(value) = &params.adcode_query {
2064            query.push(("adcode".to_string(), value.clone()));
2065        }
2066        if let Some(value) = &params.extended_query {
2067            query.push(("extended".to_string(), value.clone()));
2068        }
2069        if let Some(value) = &params.forecast_query {
2070            query.push(("forecast".to_string(), value.clone()));
2071        }
2072        if let Some(value) = &params.hourly_query {
2073            query.push(("hourly".to_string(), value.clone()));
2074        }
2075        if let Some(value) = &params.minutely_query {
2076            query.push(("minutely".to_string(), value.clone()));
2077        }
2078        if let Some(value) = &params.indices_query {
2079            query.push(("indices".to_string(), value.clone()));
2080        }
2081        if let Some(value) = &params.lang_query {
2082            query.push(("lang".to_string(), value.clone()));
2083        }
2084        if let Some(value) = &params._t {
2085            query.push(("_t".to_string(), value.clone()));
2086        }
2087        let query = if query.is_empty() { None } else { Some(query) };
2088
2089        let mut extra_headers = HeaderMap::new();
2090        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2091        let body = None;
2092        self.client
2093            .request_json(
2094                Method::GET,
2095                &path,
2096                headers,
2097                query,
2098                body,
2099                params.disable_cache,
2100            )
2101            .await
2102    }
2103/// 查询世界时间
2104    #[instrument(skip(self, params))]
2105    pub async fn get_misc_worldtime(&self, params: GetMiscWorldtimeParams) -> Result<crate::models::GetMiscWorldtime200Response> {
2106        let mut path = "/api/v1/misc/worldtime".to_string();
2107
2108        let mut query: Vec<(String, String)> = Vec::new();
2109        query.push(("city".to_string(), params.city_query.clone()));
2110        if let Some(value) = &params._t {
2111            query.push(("_t".to_string(), value.clone()));
2112        }
2113        let query = if query.is_empty() { None } else { Some(query) };
2114
2115        let mut extra_headers = HeaderMap::new();
2116        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2117        let body = None;
2118        self.client
2119            .request_json(
2120                Method::GET,
2121                &path,
2122                headers,
2123                query,
2124                body,
2125                params.disable_cache,
2126            )
2127            .await
2128    }
2129/// 计算两个日期之间的时间差值
2130    #[instrument(skip(self, params))]
2131    pub async fn post_misc_date_diff(&self, params: PostMiscDateDiffParams) -> Result<crate::models::PostMiscDateDiff200Response> {
2132        let mut path = "/api/v1/misc/date-diff".to_string();
2133
2134        let mut query: Vec<(String, String)> = Vec::new();
2135        if let Some(value) = &params._t {
2136            query.push(("_t".to_string(), value.clone()));
2137        }
2138        let query = if query.is_empty() { None } else { Some(query) };
2139
2140        let mut extra_headers = HeaderMap::new();
2141        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2142        let body = params.body.clone();
2143        self.client
2144            .request_json(
2145                Method::POST,
2146                &path,
2147                headers,
2148                query,
2149                body,
2150                params.disable_cache,
2151            )
2152            .await
2153    }
2154}
2155
2156#[derive(Debug, Clone)]
2157pub struct GetHistoryProgrammerParams {
2158    pub month_query: String,
2159    pub day_query: String,
2160    pub disable_cache: Option<bool>,
2161    pub _t: Option<String>,
2162}
2163
2164impl GetHistoryProgrammerParams {
2165    pub fn new(month_query: impl Into<String>, day_query: impl Into<String>) -> Self {
2166        Self {
2167            month_query: month_query.into(),
2168            day_query: day_query.into(),
2169            disable_cache: None,
2170            _t: None,
2171        }
2172    }
2173    pub fn disable_cache(mut self, value: bool) -> Self {
2174        self.disable_cache = Some(value);
2175        self
2176    }
2177    pub fn _t(mut self, value: impl Into<String>) -> Self {
2178        self._t = Some(value.into());
2179        self
2180    }
2181}
2182
2183
2184#[derive(Debug, Clone)]
2185pub struct GetMiscDistrictParams {
2186    pub keywords_query: Option<String>,
2187    pub adcode_query: Option<String>,
2188    pub lat_query: Option<String>,
2189    pub lng_query: Option<String>,
2190    pub level_query: Option<String>,
2191    pub country_query: Option<String>,
2192    pub limit_query: Option<String>,
2193    pub disable_cache: Option<bool>,
2194    pub _t: Option<String>,
2195}
2196
2197impl GetMiscDistrictParams {
2198    pub fn new() -> Self {
2199        Self {
2200            keywords_query: None,
2201            adcode_query: None,
2202            lat_query: None,
2203            lng_query: None,
2204            level_query: None,
2205            country_query: None,
2206            limit_query: None,
2207            disable_cache: None,
2208            _t: None,
2209        }
2210    }
2211    pub fn keywords_query(mut self, value: impl Into<String>) -> Self {
2212        self.keywords_query = Some(value.into());
2213        self
2214    }
2215    pub fn adcode_query(mut self, value: impl Into<String>) -> Self {
2216        self.adcode_query = Some(value.into());
2217        self
2218    }
2219    pub fn lat_query(mut self, value: impl Into<String>) -> Self {
2220        self.lat_query = Some(value.into());
2221        self
2222    }
2223    pub fn lng_query(mut self, value: impl Into<String>) -> Self {
2224        self.lng_query = Some(value.into());
2225        self
2226    }
2227    pub fn level_query(mut self, value: impl Into<String>) -> Self {
2228        self.level_query = Some(value.into());
2229        self
2230    }
2231    pub fn country_query(mut self, value: impl Into<String>) -> Self {
2232        self.country_query = Some(value.into());
2233        self
2234    }
2235    pub fn limit_query(mut self, value: impl Into<String>) -> Self {
2236        self.limit_query = Some(value.into());
2237        self
2238    }
2239    pub fn disable_cache(mut self, value: bool) -> Self {
2240        self.disable_cache = Some(value);
2241        self
2242    }
2243    pub fn _t(mut self, value: impl Into<String>) -> Self {
2244        self._t = Some(value.into());
2245        self
2246    }
2247}
2248
2249#[derive(Debug, Clone)]
2250pub struct GetMiscHolidayCalendarParams {
2251    pub date_query: Option<String>,
2252    pub month_query: Option<String>,
2253    pub year_query: Option<String>,
2254    pub timezone_query: Option<String>,
2255    pub holiday_type_query: Option<String>,
2256    pub include_nearby_query: Option<String>,
2257    pub nearby_limit_query: Option<String>,
2258    pub exclude_past_query: Option<String>,
2259    pub disable_cache: Option<bool>,
2260    pub _t: Option<String>,
2261}
2262
2263impl GetMiscHolidayCalendarParams {
2264    pub fn new() -> Self {
2265        Self {
2266            date_query: None,
2267            month_query: None,
2268            year_query: None,
2269            timezone_query: None,
2270            holiday_type_query: None,
2271            include_nearby_query: None,
2272            nearby_limit_query: None,
2273            exclude_past_query: None,
2274            disable_cache: None,
2275            _t: None,
2276        }
2277    }
2278    pub fn date_query(mut self, value: impl Into<String>) -> Self {
2279        self.date_query = Some(value.into());
2280        self
2281    }
2282    pub fn month_query(mut self, value: impl Into<String>) -> Self {
2283        self.month_query = Some(value.into());
2284        self
2285    }
2286    pub fn year_query(mut self, value: impl Into<String>) -> Self {
2287        self.year_query = Some(value.into());
2288        self
2289    }
2290    pub fn timezone_query(mut self, value: impl Into<String>) -> Self {
2291        self.timezone_query = Some(value.into());
2292        self
2293    }
2294    pub fn holiday_type_query(mut self, value: impl Into<String>) -> Self {
2295        self.holiday_type_query = Some(value.into());
2296        self
2297    }
2298    pub fn include_nearby_query(mut self, value: impl Into<String>) -> Self {
2299        self.include_nearby_query = Some(value.into());
2300        self
2301    }
2302    pub fn nearby_limit_query(mut self, value: impl Into<String>) -> Self {
2303        self.nearby_limit_query = Some(value.into());
2304        self
2305    }
2306    pub fn exclude_past_query(mut self, value: impl Into<String>) -> Self {
2307        self.exclude_past_query = Some(value.into());
2308        self
2309    }
2310    pub fn disable_cache(mut self, value: bool) -> Self {
2311        self.disable_cache = Some(value);
2312        self
2313    }
2314    pub fn _t(mut self, value: impl Into<String>) -> Self {
2315        self._t = Some(value.into());
2316        self
2317    }
2318}
2319
2320#[derive(Debug, Clone)]
2321pub struct GetMiscHotboardParams {
2322    pub type_query: String,
2323    pub time_query: Option<String>,
2324    pub keyword_query: Option<String>,
2325    pub time_start_query: Option<String>,
2326    pub time_end_query: Option<String>,
2327    pub limit_query: Option<String>,
2328    pub disable_cache: Option<bool>,
2329    pub _t: Option<String>,
2330}
2331
2332impl GetMiscHotboardParams {
2333    pub fn new(type_query: impl Into<String>) -> Self {
2334        Self {
2335            type_query: type_query.into(),
2336            time_query: None,
2337            keyword_query: None,
2338            time_start_query: None,
2339            time_end_query: None,
2340            limit_query: None,
2341            disable_cache: None,
2342            _t: None,
2343        }
2344    }
2345    pub fn time_query(mut self, value: impl Into<String>) -> Self {
2346        self.time_query = Some(value.into());
2347        self
2348    }
2349    pub fn keyword_query(mut self, value: impl Into<String>) -> Self {
2350        self.keyword_query = Some(value.into());
2351        self
2352    }
2353    pub fn time_start_query(mut self, value: impl Into<String>) -> Self {
2354        self.time_start_query = Some(value.into());
2355        self
2356    }
2357    pub fn time_end_query(mut self, value: impl Into<String>) -> Self {
2358        self.time_end_query = Some(value.into());
2359        self
2360    }
2361    pub fn limit_query(mut self, value: impl Into<String>) -> Self {
2362        self.limit_query = Some(value.into());
2363        self
2364    }
2365    pub fn disable_cache(mut self, value: bool) -> Self {
2366        self.disable_cache = Some(value);
2367        self
2368    }
2369    pub fn _t(mut self, value: impl Into<String>) -> Self {
2370        self._t = Some(value.into());
2371        self
2372    }
2373}
2374
2375#[derive(Debug, Clone)]
2376pub struct GetMiscLunartimeParams {
2377    pub ts_query: Option<String>,
2378    pub timezone_query: Option<String>,
2379    pub disable_cache: Option<bool>,
2380    pub _t: Option<String>,
2381}
2382
2383impl GetMiscLunartimeParams {
2384    pub fn new() -> Self {
2385        Self {
2386            ts_query: None,
2387            timezone_query: None,
2388            disable_cache: None,
2389            _t: None,
2390        }
2391    }
2392    pub fn ts_query(mut self, value: impl Into<String>) -> Self {
2393        self.ts_query = Some(value.into());
2394        self
2395    }
2396    pub fn timezone_query(mut self, value: impl Into<String>) -> Self {
2397        self.timezone_query = Some(value.into());
2398        self
2399    }
2400    pub fn disable_cache(mut self, value: bool) -> Self {
2401        self.disable_cache = Some(value);
2402        self
2403    }
2404    pub fn _t(mut self, value: impl Into<String>) -> Self {
2405        self._t = Some(value.into());
2406        self
2407    }
2408}
2409
2410#[derive(Debug, Clone)]
2411pub struct GetMiscPhoneinfoParams {
2412    pub phone_query: String,
2413    pub disable_cache: Option<bool>,
2414    pub _t: Option<String>,
2415}
2416
2417impl GetMiscPhoneinfoParams {
2418    pub fn new(phone_query: impl Into<String>) -> Self {
2419        Self {
2420            phone_query: phone_query.into(),
2421            disable_cache: None,
2422            _t: None,
2423        }
2424    }
2425    pub fn disable_cache(mut self, value: bool) -> Self {
2426        self.disable_cache = Some(value);
2427        self
2428    }
2429    pub fn _t(mut self, value: impl Into<String>) -> Self {
2430        self._t = Some(value.into());
2431        self
2432    }
2433}
2434
2435#[derive(Debug, Clone)]
2436pub struct GetMiscRandomnumberParams {
2437    pub min_query: Option<String>,
2438    pub max_query: Option<String>,
2439    pub count_query: Option<String>,
2440    pub allow_repeat_query: Option<String>,
2441    pub allow_decimal_query: Option<String>,
2442    pub decimal_places_query: Option<String>,
2443    pub disable_cache: Option<bool>,
2444    pub _t: Option<String>,
2445}
2446
2447impl GetMiscRandomnumberParams {
2448    pub fn new() -> Self {
2449        Self {
2450            min_query: None,
2451            max_query: None,
2452            count_query: None,
2453            allow_repeat_query: None,
2454            allow_decimal_query: None,
2455            decimal_places_query: None,
2456            disable_cache: None,
2457            _t: None,
2458        }
2459    }
2460    pub fn min_query(mut self, value: impl Into<String>) -> Self {
2461        self.min_query = Some(value.into());
2462        self
2463    }
2464    pub fn max_query(mut self, value: impl Into<String>) -> Self {
2465        self.max_query = Some(value.into());
2466        self
2467    }
2468    pub fn count_query(mut self, value: impl Into<String>) -> Self {
2469        self.count_query = Some(value.into());
2470        self
2471    }
2472    pub fn allow_repeat_query(mut self, value: impl Into<String>) -> Self {
2473        self.allow_repeat_query = Some(value.into());
2474        self
2475    }
2476    pub fn allow_decimal_query(mut self, value: impl Into<String>) -> Self {
2477        self.allow_decimal_query = Some(value.into());
2478        self
2479    }
2480    pub fn decimal_places_query(mut self, value: impl Into<String>) -> Self {
2481        self.decimal_places_query = Some(value.into());
2482        self
2483    }
2484    pub fn disable_cache(mut self, value: bool) -> Self {
2485        self.disable_cache = Some(value);
2486        self
2487    }
2488    pub fn _t(mut self, value: impl Into<String>) -> Self {
2489        self._t = Some(value.into());
2490        self
2491    }
2492}
2493
2494#[derive(Debug, Clone)]
2495pub struct GetMiscTimestampParams {
2496    pub ts_query: String,
2497    pub disable_cache: Option<bool>,
2498    pub _t: Option<String>,
2499}
2500
2501impl GetMiscTimestampParams {
2502    pub fn new(ts_query: impl Into<String>) -> Self {
2503        Self {
2504            ts_query: ts_query.into(),
2505            disable_cache: None,
2506            _t: None,
2507        }
2508    }
2509    pub fn disable_cache(mut self, value: bool) -> Self {
2510        self.disable_cache = Some(value);
2511        self
2512    }
2513    pub fn _t(mut self, value: impl Into<String>) -> Self {
2514        self._t = Some(value.into());
2515        self
2516    }
2517}
2518
2519
2520#[derive(Debug, Clone)]
2521pub struct GetMiscTrackingDetectParams {
2522    pub tracking_number_query: String,
2523    pub disable_cache: Option<bool>,
2524    pub _t: Option<String>,
2525}
2526
2527impl GetMiscTrackingDetectParams {
2528    pub fn new(tracking_number_query: impl Into<String>) -> Self {
2529        Self {
2530            tracking_number_query: tracking_number_query.into(),
2531            disable_cache: None,
2532            _t: None,
2533        }
2534    }
2535    pub fn disable_cache(mut self, value: bool) -> Self {
2536        self.disable_cache = Some(value);
2537        self
2538    }
2539    pub fn _t(mut self, value: impl Into<String>) -> Self {
2540        self._t = Some(value.into());
2541        self
2542    }
2543}
2544
2545#[derive(Debug, Clone)]
2546pub struct GetMiscTrackingQueryParams {
2547    pub tracking_number_query: String,
2548    pub carrier_code_query: Option<String>,
2549    pub phone_query: Option<String>,
2550    pub full_query: Option<String>,
2551    pub disable_cache: Option<bool>,
2552    pub _t: Option<String>,
2553}
2554
2555impl GetMiscTrackingQueryParams {
2556    pub fn new(tracking_number_query: impl Into<String>) -> Self {
2557        Self {
2558            tracking_number_query: tracking_number_query.into(),
2559            carrier_code_query: None,
2560            phone_query: None,
2561            full_query: None,
2562            disable_cache: None,
2563            _t: None,
2564        }
2565    }
2566    pub fn carrier_code_query(mut self, value: impl Into<String>) -> Self {
2567        self.carrier_code_query = Some(value.into());
2568        self
2569    }
2570    pub fn phone_query(mut self, value: impl Into<String>) -> Self {
2571        self.phone_query = Some(value.into());
2572        self
2573    }
2574    pub fn full_query(mut self, value: impl Into<String>) -> Self {
2575        self.full_query = Some(value.into());
2576        self
2577    }
2578    pub fn disable_cache(mut self, value: bool) -> Self {
2579        self.disable_cache = Some(value);
2580        self
2581    }
2582    pub fn _t(mut self, value: impl Into<String>) -> Self {
2583        self._t = Some(value.into());
2584        self
2585    }
2586}
2587
2588#[derive(Debug, Clone)]
2589pub struct GetMiscWeatherParams {
2590    pub city_query: Option<String>,
2591    pub adcode_query: Option<String>,
2592    pub extended_query: Option<String>,
2593    pub forecast_query: Option<String>,
2594    pub hourly_query: Option<String>,
2595    pub minutely_query: Option<String>,
2596    pub indices_query: Option<String>,
2597    pub lang_query: Option<String>,
2598    pub disable_cache: Option<bool>,
2599    pub _t: Option<String>,
2600}
2601
2602impl GetMiscWeatherParams {
2603    pub fn new() -> Self {
2604        Self {
2605            city_query: None,
2606            adcode_query: None,
2607            extended_query: None,
2608            forecast_query: None,
2609            hourly_query: None,
2610            minutely_query: None,
2611            indices_query: None,
2612            lang_query: None,
2613            disable_cache: None,
2614            _t: None,
2615        }
2616    }
2617    pub fn city_query(mut self, value: impl Into<String>) -> Self {
2618        self.city_query = Some(value.into());
2619        self
2620    }
2621    pub fn adcode_query(mut self, value: impl Into<String>) -> Self {
2622        self.adcode_query = Some(value.into());
2623        self
2624    }
2625    pub fn extended_query(mut self, value: impl Into<String>) -> Self {
2626        self.extended_query = Some(value.into());
2627        self
2628    }
2629    pub fn forecast_query(mut self, value: impl Into<String>) -> Self {
2630        self.forecast_query = Some(value.into());
2631        self
2632    }
2633    pub fn hourly_query(mut self, value: impl Into<String>) -> Self {
2634        self.hourly_query = Some(value.into());
2635        self
2636    }
2637    pub fn minutely_query(mut self, value: impl Into<String>) -> Self {
2638        self.minutely_query = Some(value.into());
2639        self
2640    }
2641    pub fn indices_query(mut self, value: impl Into<String>) -> Self {
2642        self.indices_query = Some(value.into());
2643        self
2644    }
2645    pub fn lang_query(mut self, value: impl Into<String>) -> Self {
2646        self.lang_query = Some(value.into());
2647        self
2648    }
2649    pub fn disable_cache(mut self, value: bool) -> Self {
2650        self.disable_cache = Some(value);
2651        self
2652    }
2653    pub fn _t(mut self, value: impl Into<String>) -> Self {
2654        self._t = Some(value.into());
2655        self
2656    }
2657}
2658
2659#[derive(Debug, Clone)]
2660pub struct GetMiscWorldtimeParams {
2661    pub city_query: String,
2662    pub disable_cache: Option<bool>,
2663    pub _t: Option<String>,
2664}
2665
2666impl GetMiscWorldtimeParams {
2667    pub fn new(city_query: impl Into<String>) -> Self {
2668        Self {
2669            city_query: city_query.into(),
2670            disable_cache: None,
2671            _t: None,
2672        }
2673    }
2674    pub fn disable_cache(mut self, value: bool) -> Self {
2675        self.disable_cache = Some(value);
2676        self
2677    }
2678    pub fn _t(mut self, value: impl Into<String>) -> Self {
2679        self._t = Some(value.into());
2680        self
2681    }
2682}
2683
2684#[derive(Debug, Clone)]
2685pub struct PostMiscDateDiffParams {
2686    pub body: Option<Value>,
2687    pub disable_cache: Option<bool>,
2688    pub _t: Option<String>,
2689}
2690
2691impl PostMiscDateDiffParams {
2692    pub fn new() -> Self {
2693        Self {
2694            body: None,
2695            disable_cache: None,
2696            _t: None,
2697        }
2698    }
2699    pub fn disable_cache(mut self, value: bool) -> Self {
2700        self.disable_cache = Some(value);
2701        self
2702    }
2703    pub fn _t(mut self, value: impl Into<String>) -> Self {
2704        self._t = Some(value.into());
2705        self
2706    }
2707    pub fn body(mut self, value: Value) -> Self {
2708        self.body = Some(value);
2709        self
2710    }
2711}
2712#[derive(Debug, Clone)]
2713pub struct NetworkService<'a> {
2714    pub(crate) client: &'a Client,
2715}
2716
2717impl<'a> NetworkService<'a> {
2718/// 执行DNS解析查询
2719    #[instrument(skip(self, params))]
2720    pub async fn get_network_dns(&self, params: GetNetworkDnsParams) -> Result<crate::models::GetNetworkDns200Response> {
2721        let mut path = "/api/v1/network/dns".to_string();
2722
2723        let mut query: Vec<(String, String)> = Vec::new();
2724        query.push(("domain".to_string(), params.domain_query.clone()));
2725        if let Some(value) = &params.type_query {
2726            query.push(("type".to_string(), value.clone()));
2727        }
2728        if let Some(value) = &params._t {
2729            query.push(("_t".to_string(), value.clone()));
2730        }
2731        let query = if query.is_empty() { None } else { Some(query) };
2732
2733        let mut extra_headers = HeaderMap::new();
2734        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2735        let body = None;
2736        self.client
2737            .request_json(
2738                Method::GET,
2739                &path,
2740                headers,
2741                query,
2742                body,
2743                params.disable_cache,
2744            )
2745            .await
2746    }
2747/// 查询域名ICP备案信息
2748    #[instrument(skip(self, params))]
2749    pub async fn get_network_icp(&self, params: GetNetworkIcpParams) -> Result<crate::models::GetNetworkIcp200Response> {
2750        let mut path = "/api/v1/network/icp".to_string();
2751
2752        let mut query: Vec<(String, String)> = Vec::new();
2753        query.push(("domain".to_string(), params.domain_query.clone()));
2754        if let Some(value) = &params._t {
2755            query.push(("_t".to_string(), value.clone()));
2756        }
2757        let query = if query.is_empty() { None } else { Some(query) };
2758
2759        let mut extra_headers = HeaderMap::new();
2760        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2761        let body = None;
2762        self.client
2763            .request_json(
2764                Method::GET,
2765                &path,
2766                headers,
2767                query,
2768                body,
2769                params.disable_cache,
2770            )
2771            .await
2772    }
2773/// 查询 IP
2774    #[instrument(skip(self, params))]
2775    pub async fn get_network_ipinfo(&self, params: GetNetworkIpinfoParams) -> Result<crate::models::GetNetworkIpinfo200Response> {
2776        let mut path = "/api/v1/network/ipinfo".to_string();
2777
2778        let mut query: Vec<(String, String)> = Vec::new();
2779        query.push(("ip".to_string(), params.ip_query.clone()));
2780        if let Some(value) = &params.source_query {
2781            query.push(("source".to_string(), value.clone()));
2782        }
2783        if let Some(value) = &params._t {
2784            query.push(("_t".to_string(), value.clone()));
2785        }
2786        let query = if query.is_empty() { None } else { Some(query) };
2787
2788        let mut extra_headers = HeaderMap::new();
2789        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2790        let body = None;
2791        self.client
2792            .request_json(
2793                Method::GET,
2794                &path,
2795                headers,
2796                query,
2797                body,
2798                params.disable_cache,
2799            )
2800            .await
2801    }
2802/// 查询我的 IP
2803    #[instrument(skip(self, params))]
2804    pub async fn get_network_myip(&self, params: GetNetworkMyipParams) -> Result<crate::models::GetNetworkMyip200Response> {
2805        let mut path = "/api/v1/network/myip".to_string();
2806
2807        let mut query: Vec<(String, String)> = Vec::new();
2808        if let Some(value) = &params.source_query {
2809            query.push(("source".to_string(), value.clone()));
2810        }
2811        if let Some(value) = &params._t {
2812            query.push(("_t".to_string(), value.clone()));
2813        }
2814        let query = if query.is_empty() { None } else { Some(query) };
2815
2816        let mut extra_headers = HeaderMap::new();
2817        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2818        let body = None;
2819        self.client
2820            .request_json(
2821                Method::GET,
2822                &path,
2823                headers,
2824                query,
2825                body,
2826                params.disable_cache,
2827            )
2828            .await
2829    }
2830/// Ping 主机
2831    #[instrument(skip(self, params))]
2832    pub async fn get_network_ping(&self, params: GetNetworkPingParams) -> Result<crate::models::GetNetworkPing200Response> {
2833        let mut path = "/api/v1/network/ping".to_string();
2834
2835        let mut query: Vec<(String, String)> = Vec::new();
2836        query.push(("host".to_string(), params.host_query.clone()));
2837        if let Some(value) = &params._t {
2838            query.push(("_t".to_string(), value.clone()));
2839        }
2840        let query = if query.is_empty() { None } else { Some(query) };
2841
2842        let mut extra_headers = HeaderMap::new();
2843        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2844        let body = None;
2845        self.client
2846            .request_json(
2847                Method::GET,
2848                &path,
2849                headers,
2850                query,
2851                body,
2852                params.disable_cache,
2853            )
2854            .await
2855    }
2856/// Ping 我的 IP
2857    #[instrument(skip(self))]
2858    pub async fn get_network_pingmyip(&self) -> Result<crate::models::GetNetworkPingmyip200Response> {
2859        let mut path = "/api/v1/network/pingmyip".to_string();
2860
2861        let mut query: Vec<(String, String)> = Vec::new();
2862        let query = if query.is_empty() { None } else { Some(query) };
2863
2864        let mut extra_headers = HeaderMap::new();
2865        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2866        let body = None;
2867        self.client
2868            .request_json(
2869                Method::GET,
2870                &path,
2871                headers,
2872                query,
2873                body,
2874                None,
2875            )
2876            .await
2877    }
2878/// 端口扫描
2879    #[instrument(skip(self, params))]
2880    pub async fn get_network_portscan(&self, params: GetNetworkPortscanParams) -> Result<crate::models::GetNetworkPortscan200Response> {
2881        let mut path = "/api/v1/network/portscan".to_string();
2882
2883        let mut query: Vec<(String, String)> = Vec::new();
2884        query.push(("host".to_string(), params.host_query.clone()));
2885        query.push(("port".to_string(), params.port_query.clone()));
2886        if let Some(value) = &params.protocol_query {
2887            query.push(("protocol".to_string(), value.clone()));
2888        }
2889        if let Some(value) = &params._t {
2890            query.push(("_t".to_string(), value.clone()));
2891        }
2892        let query = if query.is_empty() { None } else { Some(query) };
2893
2894        let mut extra_headers = HeaderMap::new();
2895        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2896        let body = None;
2897        self.client
2898            .request_json(
2899                Method::GET,
2900                &path,
2901                headers,
2902                query,
2903                body,
2904                params.disable_cache,
2905            )
2906            .await
2907    }
2908/// 检查URL的可访问性状态
2909    #[instrument(skip(self, params))]
2910    pub async fn get_network_urlstatus(&self, params: GetNetworkUrlstatusParams) -> Result<crate::models::GetNetworkUrlstatus200Response> {
2911        let mut path = "/api/v1/network/urlstatus".to_string();
2912
2913        let mut query: Vec<(String, String)> = Vec::new();
2914        query.push(("url".to_string(), params.url_query.clone()));
2915        if let Some(value) = &params._t {
2916            query.push(("_t".to_string(), value.clone()));
2917        }
2918        let query = if query.is_empty() { None } else { Some(query) };
2919
2920        let mut extra_headers = HeaderMap::new();
2921        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2922        let body = None;
2923        self.client
2924            .request_json(
2925                Method::GET,
2926                &path,
2927                headers,
2928                query,
2929                body,
2930                params.disable_cache,
2931            )
2932            .await
2933    }
2934/// 查询域名的WHOIS注册信息
2935    #[instrument(skip(self, params))]
2936    pub async fn get_network_whois(&self, params: GetNetworkWhoisParams) -> Result<crate::models::GetNetworkWhois200Response> {
2937        let mut path = "/api/v1/network/whois".to_string();
2938
2939        let mut query: Vec<(String, String)> = Vec::new();
2940        query.push(("domain".to_string(), params.domain_query.clone()));
2941        if let Some(value) = &params.format_query {
2942            query.push(("format".to_string(), value.clone()));
2943        }
2944        if let Some(value) = &params._t {
2945            query.push(("_t".to_string(), value.clone()));
2946        }
2947        let query = if query.is_empty() { None } else { Some(query) };
2948
2949        let mut extra_headers = HeaderMap::new();
2950        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2951        let body = None;
2952        self.client
2953            .request_json(
2954                Method::GET,
2955                &path,
2956                headers,
2957                query,
2958                body,
2959                params.disable_cache,
2960            )
2961            .await
2962    }
2963/// 检查域名在微信中的访问状态
2964    #[instrument(skip(self, params))]
2965    pub async fn get_network_wxdomain(&self, params: GetNetworkWxdomainParams) -> Result<crate::models::GetNetworkWxdomain200Response> {
2966        let mut path = "/api/v1/network/wxdomain".to_string();
2967
2968        let mut query: Vec<(String, String)> = Vec::new();
2969        query.push(("domain".to_string(), params.domain_query.clone()));
2970        if let Some(value) = &params._t {
2971            query.push(("_t".to_string(), value.clone()));
2972        }
2973        let query = if query.is_empty() { None } else { Some(query) };
2974
2975        let mut extra_headers = HeaderMap::new();
2976        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2977        let body = None;
2978        self.client
2979            .request_json(
2980                Method::GET,
2981                &path,
2982                headers,
2983                query,
2984                body,
2985                params.disable_cache,
2986            )
2987            .await
2988    }
2989}
2990
2991#[derive(Debug, Clone)]
2992pub struct GetNetworkDnsParams {
2993    pub domain_query: String,
2994    pub type_query: Option<String>,
2995    pub disable_cache: Option<bool>,
2996    pub _t: Option<String>,
2997}
2998
2999impl GetNetworkDnsParams {
3000    pub fn new(domain_query: impl Into<String>) -> Self {
3001        Self {
3002            domain_query: domain_query.into(),
3003            type_query: None,
3004            disable_cache: None,
3005            _t: None,
3006        }
3007    }
3008    pub fn type_query(mut self, value: impl Into<String>) -> Self {
3009        self.type_query = Some(value.into());
3010        self
3011    }
3012    pub fn disable_cache(mut self, value: bool) -> Self {
3013        self.disable_cache = Some(value);
3014        self
3015    }
3016    pub fn _t(mut self, value: impl Into<String>) -> Self {
3017        self._t = Some(value.into());
3018        self
3019    }
3020}
3021
3022#[derive(Debug, Clone)]
3023pub struct GetNetworkIcpParams {
3024    pub domain_query: String,
3025    pub disable_cache: Option<bool>,
3026    pub _t: Option<String>,
3027}
3028
3029impl GetNetworkIcpParams {
3030    pub fn new(domain_query: impl Into<String>) -> Self {
3031        Self {
3032            domain_query: domain_query.into(),
3033            disable_cache: None,
3034            _t: None,
3035        }
3036    }
3037    pub fn disable_cache(mut self, value: bool) -> Self {
3038        self.disable_cache = Some(value);
3039        self
3040    }
3041    pub fn _t(mut self, value: impl Into<String>) -> Self {
3042        self._t = Some(value.into());
3043        self
3044    }
3045}
3046
3047#[derive(Debug, Clone)]
3048pub struct GetNetworkIpinfoParams {
3049    pub ip_query: String,
3050    pub source_query: Option<String>,
3051    pub disable_cache: Option<bool>,
3052    pub _t: Option<String>,
3053}
3054
3055impl GetNetworkIpinfoParams {
3056    pub fn new(ip_query: impl Into<String>) -> Self {
3057        Self {
3058            ip_query: ip_query.into(),
3059            source_query: None,
3060            disable_cache: None,
3061            _t: None,
3062        }
3063    }
3064    pub fn source_query(mut self, value: impl Into<String>) -> Self {
3065        self.source_query = Some(value.into());
3066        self
3067    }
3068    pub fn disable_cache(mut self, value: bool) -> Self {
3069        self.disable_cache = Some(value);
3070        self
3071    }
3072    pub fn _t(mut self, value: impl Into<String>) -> Self {
3073        self._t = Some(value.into());
3074        self
3075    }
3076}
3077
3078#[derive(Debug, Clone)]
3079pub struct GetNetworkMyipParams {
3080    pub source_query: Option<String>,
3081    pub disable_cache: Option<bool>,
3082    pub _t: Option<String>,
3083}
3084
3085impl GetNetworkMyipParams {
3086    pub fn new() -> Self {
3087        Self {
3088            source_query: None,
3089            disable_cache: None,
3090            _t: None,
3091        }
3092    }
3093    pub fn source_query(mut self, value: impl Into<String>) -> Self {
3094        self.source_query = Some(value.into());
3095        self
3096    }
3097    pub fn disable_cache(mut self, value: bool) -> Self {
3098        self.disable_cache = Some(value);
3099        self
3100    }
3101    pub fn _t(mut self, value: impl Into<String>) -> Self {
3102        self._t = Some(value.into());
3103        self
3104    }
3105}
3106
3107#[derive(Debug, Clone)]
3108pub struct GetNetworkPingParams {
3109    pub host_query: String,
3110    pub disable_cache: Option<bool>,
3111    pub _t: Option<String>,
3112}
3113
3114impl GetNetworkPingParams {
3115    pub fn new(host_query: impl Into<String>) -> Self {
3116        Self {
3117            host_query: host_query.into(),
3118            disable_cache: None,
3119            _t: None,
3120        }
3121    }
3122    pub fn disable_cache(mut self, value: bool) -> Self {
3123        self.disable_cache = Some(value);
3124        self
3125    }
3126    pub fn _t(mut self, value: impl Into<String>) -> Self {
3127        self._t = Some(value.into());
3128        self
3129    }
3130}
3131
3132
3133#[derive(Debug, Clone)]
3134pub struct GetNetworkPortscanParams {
3135    pub host_query: String,
3136    pub port_query: String,
3137    pub protocol_query: Option<String>,
3138    pub disable_cache: Option<bool>,
3139    pub _t: Option<String>,
3140}
3141
3142impl GetNetworkPortscanParams {
3143    pub fn new(host_query: impl Into<String>, port_query: impl Into<String>) -> Self {
3144        Self {
3145            host_query: host_query.into(),
3146            port_query: port_query.into(),
3147            protocol_query: None,
3148            disable_cache: None,
3149            _t: None,
3150        }
3151    }
3152    pub fn protocol_query(mut self, value: impl Into<String>) -> Self {
3153        self.protocol_query = Some(value.into());
3154        self
3155    }
3156    pub fn disable_cache(mut self, value: bool) -> Self {
3157        self.disable_cache = Some(value);
3158        self
3159    }
3160    pub fn _t(mut self, value: impl Into<String>) -> Self {
3161        self._t = Some(value.into());
3162        self
3163    }
3164}
3165
3166#[derive(Debug, Clone)]
3167pub struct GetNetworkUrlstatusParams {
3168    pub url_query: String,
3169    pub disable_cache: Option<bool>,
3170    pub _t: Option<String>,
3171}
3172
3173impl GetNetworkUrlstatusParams {
3174    pub fn new(url_query: impl Into<String>) -> Self {
3175        Self {
3176            url_query: url_query.into(),
3177            disable_cache: None,
3178            _t: None,
3179        }
3180    }
3181    pub fn disable_cache(mut self, value: bool) -> Self {
3182        self.disable_cache = Some(value);
3183        self
3184    }
3185    pub fn _t(mut self, value: impl Into<String>) -> Self {
3186        self._t = Some(value.into());
3187        self
3188    }
3189}
3190
3191#[derive(Debug, Clone)]
3192pub struct GetNetworkWhoisParams {
3193    pub domain_query: String,
3194    pub format_query: Option<String>,
3195    pub disable_cache: Option<bool>,
3196    pub _t: Option<String>,
3197}
3198
3199impl GetNetworkWhoisParams {
3200    pub fn new(domain_query: impl Into<String>) -> Self {
3201        Self {
3202            domain_query: domain_query.into(),
3203            format_query: None,
3204            disable_cache: None,
3205            _t: None,
3206        }
3207    }
3208    pub fn format_query(mut self, value: impl Into<String>) -> Self {
3209        self.format_query = Some(value.into());
3210        self
3211    }
3212    pub fn disable_cache(mut self, value: bool) -> Self {
3213        self.disable_cache = Some(value);
3214        self
3215    }
3216    pub fn _t(mut self, value: impl Into<String>) -> Self {
3217        self._t = Some(value.into());
3218        self
3219    }
3220}
3221
3222#[derive(Debug, Clone)]
3223pub struct GetNetworkWxdomainParams {
3224    pub domain_query: String,
3225    pub disable_cache: Option<bool>,
3226    pub _t: Option<String>,
3227}
3228
3229impl GetNetworkWxdomainParams {
3230    pub fn new(domain_query: impl Into<String>) -> Self {
3231        Self {
3232            domain_query: domain_query.into(),
3233            disable_cache: None,
3234            _t: None,
3235        }
3236    }
3237    pub fn disable_cache(mut self, value: bool) -> Self {
3238        self.disable_cache = Some(value);
3239        self
3240    }
3241    pub fn _t(mut self, value: impl Into<String>) -> Self {
3242        self._t = Some(value.into());
3243        self
3244    }
3245}
3246#[derive(Debug, Clone)]
3247pub struct PoemService<'a> {
3248    pub(crate) client: &'a Client,
3249}
3250
3251impl<'a> PoemService<'a> {
3252/// 一言
3253    #[instrument(skip(self))]
3254    pub async fn get_saying(&self) -> Result<crate::models::GetSaying200Response> {
3255        let mut path = "/api/v1/saying".to_string();
3256
3257        let mut query: Vec<(String, String)> = Vec::new();
3258        let query = if query.is_empty() { None } else { Some(query) };
3259
3260        let mut extra_headers = HeaderMap::new();
3261        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3262        let body = None;
3263        self.client
3264            .request_json(
3265                Method::GET,
3266                &path,
3267                headers,
3268                query,
3269                body,
3270                None,
3271            )
3272            .await
3273    }
3274}
3275
3276#[derive(Debug, Clone)]
3277pub struct RandomService<'a> {
3278    pub(crate) client: &'a Client,
3279}
3280
3281impl<'a> RandomService<'a> {
3282/// 答案之书
3283    #[instrument(skip(self, params))]
3284    pub async fn get_answerbook_ask(&self, params: GetAnswerbookAskParams) -> Result<crate::models::GetAnswerbookAsk200Response> {
3285        let mut path = "/api/v1/answerbook/ask".to_string();
3286
3287        let mut query: Vec<(String, String)> = Vec::new();
3288        query.push(("question".to_string(), params.question_query.clone()));
3289        if let Some(value) = &params._t {
3290            query.push(("_t".to_string(), value.clone()));
3291        }
3292        let query = if query.is_empty() { None } else { Some(query) };
3293
3294        let mut extra_headers = HeaderMap::new();
3295        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3296        let body = None;
3297        self.client
3298            .request_json(
3299                Method::GET,
3300                &path,
3301                headers,
3302                query,
3303                body,
3304                params.disable_cache,
3305            )
3306            .await
3307    }
3308/// 随机图片
3309    #[instrument(skip(self, params))]
3310    pub async fn get_random_image(&self, params: GetRandomImageParams) -> Result<Vec<u8>> {
3311        let mut path = "/api/v1/random/image".to_string();
3312
3313        let mut query: Vec<(String, String)> = Vec::new();
3314        if let Some(value) = &params.category_query {
3315            query.push(("category".to_string(), value.clone()));
3316        }
3317        if let Some(value) = &params.type_query {
3318            query.push(("type".to_string(), value.clone()));
3319        }
3320        if let Some(value) = &params._t {
3321            query.push(("_t".to_string(), value.clone()));
3322        }
3323        let query = if query.is_empty() { None } else { Some(query) };
3324
3325        let mut extra_headers = HeaderMap::new();
3326        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3327        let body = None;
3328        self.client
3329            .request_bytes(
3330                Method::GET,
3331                &path,
3332                headers,
3333                query,
3334                body,
3335                params.disable_cache,
3336            )
3337            .await
3338    }
3339/// 随机字符串
3340    #[instrument(skip(self, params))]
3341    pub async fn get_random_string(&self, params: GetRandomStringParams) -> Result<crate::models::GetRandomString200Response> {
3342        let mut path = "/api/v1/random/string".to_string();
3343
3344        let mut query: Vec<(String, String)> = Vec::new();
3345        if let Some(value) = &params.length_query {
3346            query.push(("length".to_string(), value.clone()));
3347        }
3348        if let Some(value) = &params.type_query {
3349            query.push(("type".to_string(), value.clone()));
3350        }
3351        if let Some(value) = &params._t {
3352            query.push(("_t".to_string(), value.clone()));
3353        }
3354        let query = if query.is_empty() { None } else { Some(query) };
3355
3356        let mut extra_headers = HeaderMap::new();
3357        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3358        let body = None;
3359        self.client
3360            .request_json(
3361                Method::GET,
3362                &path,
3363                headers,
3364                query,
3365                body,
3366                params.disable_cache,
3367            )
3368            .await
3369    }
3370/// 答案之书 (POST)
3371    #[instrument(skip(self, params))]
3372    pub async fn post_answerbook_ask(&self, params: PostAnswerbookAskParams) -> Result<crate::models::PostAnswerbookAsk200Response> {
3373        let mut path = "/api/v1/answerbook/ask".to_string();
3374
3375        let mut query: Vec<(String, String)> = Vec::new();
3376        if let Some(value) = &params._t {
3377            query.push(("_t".to_string(), value.clone()));
3378        }
3379        let query = if query.is_empty() { None } else { Some(query) };
3380
3381        let mut extra_headers = HeaderMap::new();
3382        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3383        let body = params.body.clone();
3384        self.client
3385            .request_json(
3386                Method::POST,
3387                &path,
3388                headers,
3389                query,
3390                body,
3391                params.disable_cache,
3392            )
3393            .await
3394    }
3395}
3396
3397#[derive(Debug, Clone)]
3398pub struct GetAnswerbookAskParams {
3399    pub question_query: String,
3400    pub disable_cache: Option<bool>,
3401    pub _t: Option<String>,
3402}
3403
3404impl GetAnswerbookAskParams {
3405    pub fn new(question_query: impl Into<String>) -> Self {
3406        Self {
3407            question_query: question_query.into(),
3408            disable_cache: None,
3409            _t: None,
3410        }
3411    }
3412    pub fn disable_cache(mut self, value: bool) -> Self {
3413        self.disable_cache = Some(value);
3414        self
3415    }
3416    pub fn _t(mut self, value: impl Into<String>) -> Self {
3417        self._t = Some(value.into());
3418        self
3419    }
3420}
3421
3422#[derive(Debug, Clone)]
3423pub struct GetRandomImageParams {
3424    pub category_query: Option<String>,
3425    pub type_query: Option<String>,
3426    pub disable_cache: Option<bool>,
3427    pub _t: Option<String>,
3428}
3429
3430impl GetRandomImageParams {
3431    pub fn new() -> Self {
3432        Self {
3433            category_query: None,
3434            type_query: None,
3435            disable_cache: None,
3436            _t: None,
3437        }
3438    }
3439    pub fn category_query(mut self, value: impl Into<String>) -> Self {
3440        self.category_query = Some(value.into());
3441        self
3442    }
3443    pub fn type_query(mut self, value: impl Into<String>) -> Self {
3444        self.type_query = Some(value.into());
3445        self
3446    }
3447    pub fn disable_cache(mut self, value: bool) -> Self {
3448        self.disable_cache = Some(value);
3449        self
3450    }
3451    pub fn _t(mut self, value: impl Into<String>) -> Self {
3452        self._t = Some(value.into());
3453        self
3454    }
3455}
3456
3457#[derive(Debug, Clone)]
3458pub struct GetRandomStringParams {
3459    pub length_query: Option<String>,
3460    pub type_query: Option<String>,
3461    pub disable_cache: Option<bool>,
3462    pub _t: Option<String>,
3463}
3464
3465impl GetRandomStringParams {
3466    pub fn new() -> Self {
3467        Self {
3468            length_query: None,
3469            type_query: None,
3470            disable_cache: None,
3471            _t: None,
3472        }
3473    }
3474    pub fn length_query(mut self, value: impl Into<String>) -> Self {
3475        self.length_query = Some(value.into());
3476        self
3477    }
3478    pub fn type_query(mut self, value: impl Into<String>) -> Self {
3479        self.type_query = Some(value.into());
3480        self
3481    }
3482    pub fn disable_cache(mut self, value: bool) -> Self {
3483        self.disable_cache = Some(value);
3484        self
3485    }
3486    pub fn _t(mut self, value: impl Into<String>) -> Self {
3487        self._t = Some(value.into());
3488        self
3489    }
3490}
3491
3492#[derive(Debug, Clone)]
3493pub struct PostAnswerbookAskParams {
3494    pub body: Option<Value>,
3495    pub disable_cache: Option<bool>,
3496    pub _t: Option<String>,
3497}
3498
3499impl PostAnswerbookAskParams {
3500    pub fn new() -> Self {
3501        Self {
3502            body: None,
3503            disable_cache: None,
3504            _t: None,
3505        }
3506    }
3507    pub fn disable_cache(mut self, value: bool) -> Self {
3508        self.disable_cache = Some(value);
3509        self
3510    }
3511    pub fn _t(mut self, value: impl Into<String>) -> Self {
3512        self._t = Some(value.into());
3513        self
3514    }
3515    pub fn body(mut self, value: Value) -> Self {
3516        self.body = Some(value);
3517        self
3518    }
3519}
3520#[derive(Debug, Clone)]
3521pub struct SocialService<'a> {
3522    pub(crate) client: &'a Client,
3523}
3524
3525impl<'a> SocialService<'a> {
3526/// 查询 GitHub 仓库
3527    #[instrument(skip(self, params))]
3528    pub async fn get_github_repo(&self, params: GetGithubRepoParams) -> Result<crate::models::GetGithubRepo200Response> {
3529        let mut path = "/api/v1/github/repo".to_string();
3530
3531        let mut query: Vec<(String, String)> = Vec::new();
3532        query.push(("repo".to_string(), params.repo_query.clone()));
3533        if let Some(value) = &params._t {
3534            query.push(("_t".to_string(), value.clone()));
3535        }
3536        let query = if query.is_empty() { None } else { Some(query) };
3537
3538        let mut extra_headers = HeaderMap::new();
3539        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3540        let body = None;
3541        self.client
3542            .request_json(
3543                Method::GET,
3544                &path,
3545                headers,
3546                query,
3547                body,
3548                params.disable_cache,
3549            )
3550            .await
3551    }
3552/// 查询 GitHub 用户信息
3553    #[instrument(skip(self, params))]
3554    pub async fn get_github_user(&self, params: GetGithubUserParams) -> Result<crate::models::GetGithubUser200Response> {
3555        let mut path = "/api/v1/github/user".to_string();
3556
3557        let mut query: Vec<(String, String)> = Vec::new();
3558        query.push(("user".to_string(), params.user_query.clone()));
3559        if let Some(value) = &params.activity_query {
3560            query.push(("activity".to_string(), value.clone()));
3561        }
3562        if let Some(value) = &params.activity_scope_query {
3563            query.push(("activity_scope".to_string(), value.clone()));
3564        }
3565        if let Some(value) = &params.org_query {
3566            query.push(("org".to_string(), value.clone()));
3567        }
3568        if let Some(value) = &params._t {
3569            query.push(("_t".to_string(), value.clone()));
3570        }
3571        let query = if query.is_empty() { None } else { Some(query) };
3572
3573        let mut extra_headers = HeaderMap::new();
3574        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3575        let body = None;
3576        self.client
3577            .request_json(
3578                Method::GET,
3579                &path,
3580                headers,
3581                query,
3582                body,
3583                params.disable_cache,
3584            )
3585            .await
3586    }
3587/// 查询 B站投稿
3588    #[instrument(skip(self, params))]
3589    pub async fn get_social_bilibili_archives(&self, params: GetSocialBilibiliArchivesParams) -> Result<crate::models::GetSocialBilibiliArchives200Response> {
3590        let mut path = "/api/v1/social/bilibili/archives".to_string();
3591
3592        let mut query: Vec<(String, String)> = Vec::new();
3593        query.push(("mid".to_string(), params.mid_query.clone()));
3594        if let Some(value) = &params.keywords_query {
3595            query.push(("keywords".to_string(), value.clone()));
3596        }
3597        if let Some(value) = &params.orderby_query {
3598            query.push(("orderby".to_string(), value.clone()));
3599        }
3600        if let Some(value) = &params.ps_query {
3601            query.push(("ps".to_string(), value.clone()));
3602        }
3603        if let Some(value) = &params.pn_query {
3604            query.push(("pn".to_string(), value.clone()));
3605        }
3606        if let Some(value) = &params._t {
3607            query.push(("_t".to_string(), value.clone()));
3608        }
3609        let query = if query.is_empty() { None } else { Some(query) };
3610
3611        let mut extra_headers = HeaderMap::new();
3612        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3613        let body = None;
3614        self.client
3615            .request_json(
3616                Method::GET,
3617                &path,
3618                headers,
3619                query,
3620                body,
3621                params.disable_cache,
3622            )
3623            .await
3624    }
3625/// 查询 B站直播间
3626    #[instrument(skip(self, params))]
3627    pub async fn get_social_bilibili_liveroom(&self, params: GetSocialBilibiliLiveroomParams) -> Result<crate::models::GetSocialBilibiliLiveroom200Response> {
3628        let mut path = "/api/v1/social/bilibili/liveroom".to_string();
3629
3630        let mut query: Vec<(String, String)> = Vec::new();
3631        if let Some(value) = &params.mid_query {
3632            query.push(("mid".to_string(), value.clone()));
3633        }
3634        if let Some(value) = &params.room_id_query {
3635            query.push(("room_id".to_string(), value.clone()));
3636        }
3637        if let Some(value) = &params._t {
3638            query.push(("_t".to_string(), value.clone()));
3639        }
3640        let query = if query.is_empty() { None } else { Some(query) };
3641
3642        let mut extra_headers = HeaderMap::new();
3643        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3644        let body = None;
3645        self.client
3646            .request_json(
3647                Method::GET,
3648                &path,
3649                headers,
3650                query,
3651                body,
3652                params.disable_cache,
3653            )
3654            .await
3655    }
3656/// 查询 B站评论
3657    #[instrument(skip(self, params))]
3658    pub async fn get_social_bilibili_replies(&self, params: GetSocialBilibiliRepliesParams) -> Result<crate::models::GetSocialBilibiliReplies200Response> {
3659        let mut path = "/api/v1/social/bilibili/replies".to_string();
3660
3661        let mut query: Vec<(String, String)> = Vec::new();
3662        query.push(("oid".to_string(), params.oid_query.clone()));
3663        if let Some(value) = &params.sort_query {
3664            query.push(("sort".to_string(), value.clone()));
3665        }
3666        if let Some(value) = &params.ps_query {
3667            query.push(("ps".to_string(), value.clone()));
3668        }
3669        if let Some(value) = &params.pn_query {
3670            query.push(("pn".to_string(), value.clone()));
3671        }
3672        if let Some(value) = &params._t {
3673            query.push(("_t".to_string(), value.clone()));
3674        }
3675        let query = if query.is_empty() { None } else { Some(query) };
3676
3677        let mut extra_headers = HeaderMap::new();
3678        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3679        let body = None;
3680        self.client
3681            .request_json(
3682                Method::GET,
3683                &path,
3684                headers,
3685                query,
3686                body,
3687                params.disable_cache,
3688            )
3689            .await
3690    }
3691/// 查询 B站用户
3692    #[instrument(skip(self, params))]
3693    pub async fn get_social_bilibili_userinfo(&self, params: GetSocialBilibiliUserinfoParams) -> Result<crate::models::GetSocialBilibiliUserinfo200Response> {
3694        let mut path = "/api/v1/social/bilibili/userinfo".to_string();
3695
3696        let mut query: Vec<(String, String)> = Vec::new();
3697        query.push(("uid".to_string(), params.uid_query.clone()));
3698        if let Some(value) = &params._t {
3699            query.push(("_t".to_string(), value.clone()));
3700        }
3701        let query = if query.is_empty() { None } else { Some(query) };
3702
3703        let mut extra_headers = HeaderMap::new();
3704        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3705        let body = None;
3706        self.client
3707            .request_json(
3708                Method::GET,
3709                &path,
3710                headers,
3711                query,
3712                body,
3713                params.disable_cache,
3714            )
3715            .await
3716    }
3717/// 查询 B站视频
3718    #[instrument(skip(self, params))]
3719    pub async fn get_social_bilibili_videoinfo(&self, params: GetSocialBilibiliVideoinfoParams) -> Result<crate::models::GetSocialBilibiliVideoinfo200Response> {
3720        let mut path = "/api/v1/social/bilibili/videoinfo".to_string();
3721
3722        let mut query: Vec<(String, String)> = Vec::new();
3723        if let Some(value) = &params.aid_query {
3724            query.push(("aid".to_string(), value.clone()));
3725        }
3726        if let Some(value) = &params.bvid_query {
3727            query.push(("bvid".to_string(), value.clone()));
3728        }
3729        if let Some(value) = &params._t {
3730            query.push(("_t".to_string(), value.clone()));
3731        }
3732        let query = if query.is_empty() { None } else { Some(query) };
3733
3734        let mut extra_headers = HeaderMap::new();
3735        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3736        let body = None;
3737        self.client
3738            .request_json(
3739                Method::GET,
3740                &path,
3741                headers,
3742                query,
3743                body,
3744                params.disable_cache,
3745            )
3746            .await
3747    }
3748/// 查询 QQ 群信息
3749    #[instrument(skip(self, params))]
3750    pub async fn get_social_qq_groupinfo(&self, params: GetSocialQqGroupinfoParams) -> Result<crate::models::GetSocialQqGroupinfo200Response> {
3751        let mut path = "/api/v1/social/qq/groupinfo".to_string();
3752
3753        let mut query: Vec<(String, String)> = Vec::new();
3754        query.push(("group_id".to_string(), params.group_id_query.clone()));
3755        if let Some(value) = &params._t {
3756            query.push(("_t".to_string(), value.clone()));
3757        }
3758        let query = if query.is_empty() { None } else { Some(query) };
3759
3760        let mut extra_headers = HeaderMap::new();
3761        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3762        let body = None;
3763        self.client
3764            .request_json(
3765                Method::GET,
3766                &path,
3767                headers,
3768                query,
3769                body,
3770                params.disable_cache,
3771            )
3772            .await
3773    }
3774/// 查询 QQ 信息
3775    #[instrument(skip(self, params))]
3776    pub async fn get_social_qq_userinfo(&self, params: GetSocialQqUserinfoParams) -> Result<crate::models::GetSocialQqUserinfo200Response> {
3777        let mut path = "/api/v1/social/qq/userinfo".to_string();
3778
3779        let mut query: Vec<(String, String)> = Vec::new();
3780        query.push(("qq".to_string(), params.qq_query.clone()));
3781        if let Some(value) = &params._t {
3782            query.push(("_t".to_string(), value.clone()));
3783        }
3784        let query = if query.is_empty() { None } else { Some(query) };
3785
3786        let mut extra_headers = HeaderMap::new();
3787        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3788        let body = None;
3789        self.client
3790            .request_json(
3791                Method::GET,
3792                &path,
3793                headers,
3794                query,
3795                body,
3796                params.disable_cache,
3797            )
3798            .await
3799    }
3800}
3801
3802#[derive(Debug, Clone)]
3803pub struct GetGithubRepoParams {
3804    pub repo_query: String,
3805    pub disable_cache: Option<bool>,
3806    pub _t: Option<String>,
3807}
3808
3809impl GetGithubRepoParams {
3810    pub fn new(repo_query: impl Into<String>) -> Self {
3811        Self {
3812            repo_query: repo_query.into(),
3813            disable_cache: None,
3814            _t: None,
3815        }
3816    }
3817    pub fn disable_cache(mut self, value: bool) -> Self {
3818        self.disable_cache = Some(value);
3819        self
3820    }
3821    pub fn _t(mut self, value: impl Into<String>) -> Self {
3822        self._t = Some(value.into());
3823        self
3824    }
3825}
3826
3827#[derive(Debug, Clone)]
3828pub struct GetGithubUserParams {
3829    pub user_query: String,
3830    pub activity_query: Option<String>,
3831    pub activity_scope_query: Option<String>,
3832    pub org_query: Option<String>,
3833    pub disable_cache: Option<bool>,
3834    pub _t: Option<String>,
3835}
3836
3837impl GetGithubUserParams {
3838    pub fn new(user_query: impl Into<String>) -> Self {
3839        Self {
3840            user_query: user_query.into(),
3841            activity_query: None,
3842            activity_scope_query: None,
3843            org_query: None,
3844            disable_cache: None,
3845            _t: None,
3846        }
3847    }
3848    pub fn activity_query(mut self, value: impl Into<String>) -> Self {
3849        self.activity_query = Some(value.into());
3850        self
3851    }
3852    pub fn activity_scope_query(mut self, value: impl Into<String>) -> Self {
3853        self.activity_scope_query = Some(value.into());
3854        self
3855    }
3856    pub fn org_query(mut self, value: impl Into<String>) -> Self {
3857        self.org_query = Some(value.into());
3858        self
3859    }
3860    pub fn disable_cache(mut self, value: bool) -> Self {
3861        self.disable_cache = Some(value);
3862        self
3863    }
3864    pub fn _t(mut self, value: impl Into<String>) -> Self {
3865        self._t = Some(value.into());
3866        self
3867    }
3868}
3869
3870#[derive(Debug, Clone)]
3871pub struct GetSocialBilibiliArchivesParams {
3872    pub mid_query: String,
3873    pub keywords_query: Option<String>,
3874    pub orderby_query: Option<String>,
3875    pub ps_query: Option<String>,
3876    pub pn_query: Option<String>,
3877    pub disable_cache: Option<bool>,
3878    pub _t: Option<String>,
3879}
3880
3881impl GetSocialBilibiliArchivesParams {
3882    pub fn new(mid_query: impl Into<String>) -> Self {
3883        Self {
3884            mid_query: mid_query.into(),
3885            keywords_query: None,
3886            orderby_query: None,
3887            ps_query: None,
3888            pn_query: None,
3889            disable_cache: None,
3890            _t: None,
3891        }
3892    }
3893    pub fn keywords_query(mut self, value: impl Into<String>) -> Self {
3894        self.keywords_query = Some(value.into());
3895        self
3896    }
3897    pub fn orderby_query(mut self, value: impl Into<String>) -> Self {
3898        self.orderby_query = Some(value.into());
3899        self
3900    }
3901    pub fn ps_query(mut self, value: impl Into<String>) -> Self {
3902        self.ps_query = Some(value.into());
3903        self
3904    }
3905    pub fn pn_query(mut self, value: impl Into<String>) -> Self {
3906        self.pn_query = Some(value.into());
3907        self
3908    }
3909    pub fn disable_cache(mut self, value: bool) -> Self {
3910        self.disable_cache = Some(value);
3911        self
3912    }
3913    pub fn _t(mut self, value: impl Into<String>) -> Self {
3914        self._t = Some(value.into());
3915        self
3916    }
3917}
3918
3919#[derive(Debug, Clone)]
3920pub struct GetSocialBilibiliLiveroomParams {
3921    pub mid_query: Option<String>,
3922    pub room_id_query: Option<String>,
3923    pub disable_cache: Option<bool>,
3924    pub _t: Option<String>,
3925}
3926
3927impl GetSocialBilibiliLiveroomParams {
3928    pub fn new() -> Self {
3929        Self {
3930            mid_query: None,
3931            room_id_query: None,
3932            disable_cache: None,
3933            _t: None,
3934        }
3935    }
3936    pub fn mid_query(mut self, value: impl Into<String>) -> Self {
3937        self.mid_query = Some(value.into());
3938        self
3939    }
3940    pub fn room_id_query(mut self, value: impl Into<String>) -> Self {
3941        self.room_id_query = Some(value.into());
3942        self
3943    }
3944    pub fn disable_cache(mut self, value: bool) -> Self {
3945        self.disable_cache = Some(value);
3946        self
3947    }
3948    pub fn _t(mut self, value: impl Into<String>) -> Self {
3949        self._t = Some(value.into());
3950        self
3951    }
3952}
3953
3954#[derive(Debug, Clone)]
3955pub struct GetSocialBilibiliRepliesParams {
3956    pub oid_query: String,
3957    pub sort_query: Option<String>,
3958    pub ps_query: Option<String>,
3959    pub pn_query: Option<String>,
3960    pub disable_cache: Option<bool>,
3961    pub _t: Option<String>,
3962}
3963
3964impl GetSocialBilibiliRepliesParams {
3965    pub fn new(oid_query: impl Into<String>) -> Self {
3966        Self {
3967            oid_query: oid_query.into(),
3968            sort_query: None,
3969            ps_query: None,
3970            pn_query: None,
3971            disable_cache: None,
3972            _t: None,
3973        }
3974    }
3975    pub fn sort_query(mut self, value: impl Into<String>) -> Self {
3976        self.sort_query = Some(value.into());
3977        self
3978    }
3979    pub fn ps_query(mut self, value: impl Into<String>) -> Self {
3980        self.ps_query = Some(value.into());
3981        self
3982    }
3983    pub fn pn_query(mut self, value: impl Into<String>) -> Self {
3984        self.pn_query = Some(value.into());
3985        self
3986    }
3987    pub fn disable_cache(mut self, value: bool) -> Self {
3988        self.disable_cache = Some(value);
3989        self
3990    }
3991    pub fn _t(mut self, value: impl Into<String>) -> Self {
3992        self._t = Some(value.into());
3993        self
3994    }
3995}
3996
3997#[derive(Debug, Clone)]
3998pub struct GetSocialBilibiliUserinfoParams {
3999    pub uid_query: String,
4000    pub disable_cache: Option<bool>,
4001    pub _t: Option<String>,
4002}
4003
4004impl GetSocialBilibiliUserinfoParams {
4005    pub fn new(uid_query: impl Into<String>) -> Self {
4006        Self {
4007            uid_query: uid_query.into(),
4008            disable_cache: None,
4009            _t: None,
4010        }
4011    }
4012    pub fn disable_cache(mut self, value: bool) -> Self {
4013        self.disable_cache = Some(value);
4014        self
4015    }
4016    pub fn _t(mut self, value: impl Into<String>) -> Self {
4017        self._t = Some(value.into());
4018        self
4019    }
4020}
4021
4022#[derive(Debug, Clone)]
4023pub struct GetSocialBilibiliVideoinfoParams {
4024    pub aid_query: Option<String>,
4025    pub bvid_query: Option<String>,
4026    pub disable_cache: Option<bool>,
4027    pub _t: Option<String>,
4028}
4029
4030impl GetSocialBilibiliVideoinfoParams {
4031    pub fn new() -> Self {
4032        Self {
4033            aid_query: None,
4034            bvid_query: None,
4035            disable_cache: None,
4036            _t: None,
4037        }
4038    }
4039    pub fn aid_query(mut self, value: impl Into<String>) -> Self {
4040        self.aid_query = Some(value.into());
4041        self
4042    }
4043    pub fn bvid_query(mut self, value: impl Into<String>) -> Self {
4044        self.bvid_query = Some(value.into());
4045        self
4046    }
4047    pub fn disable_cache(mut self, value: bool) -> Self {
4048        self.disable_cache = Some(value);
4049        self
4050    }
4051    pub fn _t(mut self, value: impl Into<String>) -> Self {
4052        self._t = Some(value.into());
4053        self
4054    }
4055}
4056
4057#[derive(Debug, Clone)]
4058pub struct GetSocialQqGroupinfoParams {
4059    pub group_id_query: String,
4060    pub disable_cache: Option<bool>,
4061    pub _t: Option<String>,
4062}
4063
4064impl GetSocialQqGroupinfoParams {
4065    pub fn new(group_id_query: impl Into<String>) -> Self {
4066        Self {
4067            group_id_query: group_id_query.into(),
4068            disable_cache: None,
4069            _t: None,
4070        }
4071    }
4072    pub fn disable_cache(mut self, value: bool) -> Self {
4073        self.disable_cache = Some(value);
4074        self
4075    }
4076    pub fn _t(mut self, value: impl Into<String>) -> Self {
4077        self._t = Some(value.into());
4078        self
4079    }
4080}
4081
4082#[derive(Debug, Clone)]
4083pub struct GetSocialQqUserinfoParams {
4084    pub qq_query: String,
4085    pub disable_cache: Option<bool>,
4086    pub _t: Option<String>,
4087}
4088
4089impl GetSocialQqUserinfoParams {
4090    pub fn new(qq_query: impl Into<String>) -> Self {
4091        Self {
4092            qq_query: qq_query.into(),
4093            disable_cache: None,
4094            _t: None,
4095        }
4096    }
4097    pub fn disable_cache(mut self, value: bool) -> Self {
4098        self.disable_cache = Some(value);
4099        self
4100    }
4101    pub fn _t(mut self, value: impl Into<String>) -> Self {
4102        self._t = Some(value.into());
4103        self
4104    }
4105}
4106#[derive(Debug, Clone)]
4107pub struct StatusService<'a> {
4108    pub(crate) client: &'a Client,
4109}
4110
4111impl<'a> StatusService<'a> {
4112/// 限流状态
4113    #[instrument(skip(self, params))]
4114    pub async fn get_status_ratelimit(&self, params: GetStatusRatelimitParams) -> Result<crate::models::GetStatusRatelimit200Response> {
4115        let mut path = "/api/v1/status/ratelimit".to_string();
4116
4117        let mut query: Vec<(String, String)> = Vec::new();
4118        if let Some(value) = &params._t {
4119            query.push(("_t".to_string(), value.clone()));
4120        }
4121        let query = if query.is_empty() { None } else { Some(query) };
4122
4123        let mut extra_headers = HeaderMap::new();
4124        extra_headers.insert(
4125            "Authorization",
4126            HeaderValue::from_str(&params.authorization_header).map_err(|_| Error::InvalidHeader { name: "Authorization".into() })?,
4127        );
4128        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4129        let body = None;
4130        self.client
4131            .request_json(
4132                Method::GET,
4133                &path,
4134                headers,
4135                query,
4136                body,
4137                params.disable_cache,
4138            )
4139            .await
4140    }
4141/// 获取API端点使用统计
4142    #[instrument(skip(self, params))]
4143    pub async fn get_status_usage(&self, params: GetStatusUsageParams) -> Result<crate::models::GetStatusUsage200Response> {
4144        let mut path = "/api/v1/status/usage".to_string();
4145
4146        let mut query: Vec<(String, String)> = Vec::new();
4147        if let Some(value) = &params.path_query {
4148            query.push(("path".to_string(), value.clone()));
4149        }
4150        if let Some(value) = &params._t {
4151            query.push(("_t".to_string(), value.clone()));
4152        }
4153        let query = if query.is_empty() { None } else { Some(query) };
4154
4155        let mut extra_headers = HeaderMap::new();
4156        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4157        let body = None;
4158        self.client
4159            .request_json(
4160                Method::GET,
4161                &path,
4162                headers,
4163                query,
4164                body,
4165                params.disable_cache,
4166            )
4167            .await
4168    }
4169}
4170
4171#[derive(Debug, Clone)]
4172pub struct GetStatusRatelimitParams {
4173    pub authorization_header: String,
4174    pub disable_cache: Option<bool>,
4175    pub _t: Option<String>,
4176}
4177
4178impl GetStatusRatelimitParams {
4179    pub fn new(authorization_header: impl Into<String>) -> Self {
4180        Self {
4181            authorization_header: authorization_header.into(),
4182            disable_cache: None,
4183            _t: None,
4184        }
4185    }
4186    pub fn disable_cache(mut self, value: bool) -> Self {
4187        self.disable_cache = Some(value);
4188        self
4189    }
4190    pub fn _t(mut self, value: impl Into<String>) -> Self {
4191        self._t = Some(value.into());
4192        self
4193    }
4194}
4195
4196#[derive(Debug, Clone)]
4197pub struct GetStatusUsageParams {
4198    pub path_query: Option<String>,
4199    pub disable_cache: Option<bool>,
4200    pub _t: Option<String>,
4201}
4202
4203impl GetStatusUsageParams {
4204    pub fn new() -> Self {
4205        Self {
4206            path_query: None,
4207            disable_cache: None,
4208            _t: None,
4209        }
4210    }
4211    pub fn path_query(mut self, value: impl Into<String>) -> Self {
4212        self.path_query = Some(value.into());
4213        self
4214    }
4215    pub fn disable_cache(mut self, value: bool) -> Self {
4216        self.disable_cache = Some(value);
4217        self
4218    }
4219    pub fn _t(mut self, value: impl Into<String>) -> Self {
4220        self._t = Some(value.into());
4221        self
4222    }
4223}
4224#[derive(Debug, Clone)]
4225pub struct TextService<'a> {
4226    pub(crate) client: &'a Client,
4227}
4228
4229impl<'a> TextService<'a> {
4230/// MD5 哈希
4231    #[instrument(skip(self, params))]
4232    pub async fn get_text_md_5(&self, params: GetTextMd5Params) -> Result<crate::models::GetTextMd5200Response> {
4233        let mut path = "/api/v1/text/md5".to_string();
4234
4235        let mut query: Vec<(String, String)> = Vec::new();
4236        query.push(("text".to_string(), params.text_query.clone()));
4237        if let Some(value) = &params._t {
4238            query.push(("_t".to_string(), value.clone()));
4239        }
4240        let query = if query.is_empty() { None } else { Some(query) };
4241
4242        let mut extra_headers = HeaderMap::new();
4243        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4244        let body = None;
4245        self.client
4246            .request_json(
4247                Method::GET,
4248                &path,
4249                headers,
4250                query,
4251                body,
4252                params.disable_cache,
4253            )
4254            .await
4255    }
4256/// AES 解密
4257    #[instrument(skip(self, params))]
4258    pub async fn post_text_aes_decrypt(&self, params: PostTextAesDecryptParams) -> Result<crate::models::PostTextAesDecrypt200Response> {
4259        let mut path = "/api/v1/text/aes/decrypt".to_string();
4260
4261        let mut query: Vec<(String, String)> = Vec::new();
4262        if let Some(value) = &params._t {
4263            query.push(("_t".to_string(), value.clone()));
4264        }
4265        let query = if query.is_empty() { None } else { Some(query) };
4266
4267        let mut extra_headers = HeaderMap::new();
4268        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4269        let body = params.body.clone();
4270        self.client
4271            .request_json(
4272                Method::POST,
4273                &path,
4274                headers,
4275                query,
4276                body,
4277                params.disable_cache,
4278            )
4279            .await
4280    }
4281/// AES高级解密
4282    #[instrument(skip(self, params))]
4283    pub async fn post_text_aes_decrypt_advanced(&self, params: PostTextAesDecryptAdvancedParams) -> Result<crate::models::PostTextAesDecryptAdvanced200Response> {
4284        let mut path = "/api/v1/text/aes/decrypt-advanced".to_string();
4285
4286        let mut query: Vec<(String, String)> = Vec::new();
4287        if let Some(value) = &params._t {
4288            query.push(("_t".to_string(), value.clone()));
4289        }
4290        let query = if query.is_empty() { None } else { Some(query) };
4291
4292        let mut extra_headers = HeaderMap::new();
4293        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4294        let body = params.body.clone();
4295        self.client
4296            .request_json(
4297                Method::POST,
4298                &path,
4299                headers,
4300                query,
4301                body,
4302                params.disable_cache,
4303            )
4304            .await
4305    }
4306/// AES 加密
4307    #[instrument(skip(self, params))]
4308    pub async fn post_text_aes_encrypt(&self, params: PostTextAesEncryptParams) -> Result<crate::models::PostTextAesEncrypt200Response> {
4309        let mut path = "/api/v1/text/aes/encrypt".to_string();
4310
4311        let mut query: Vec<(String, String)> = Vec::new();
4312        if let Some(value) = &params._t {
4313            query.push(("_t".to_string(), value.clone()));
4314        }
4315        let query = if query.is_empty() { None } else { Some(query) };
4316
4317        let mut extra_headers = HeaderMap::new();
4318        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4319        let body = params.body.clone();
4320        self.client
4321            .request_json(
4322                Method::POST,
4323                &path,
4324                headers,
4325                query,
4326                body,
4327                params.disable_cache,
4328            )
4329            .await
4330    }
4331/// AES高级加密
4332    #[instrument(skip(self, params))]
4333    pub async fn post_text_aes_encrypt_advanced(&self, params: PostTextAesEncryptAdvancedParams) -> Result<crate::models::PostTextAesEncryptAdvanced200Response> {
4334        let mut path = "/api/v1/text/aes/encrypt-advanced".to_string();
4335
4336        let mut query: Vec<(String, String)> = Vec::new();
4337        if let Some(value) = &params._t {
4338            query.push(("_t".to_string(), value.clone()));
4339        }
4340        let query = if query.is_empty() { None } else { Some(query) };
4341
4342        let mut extra_headers = HeaderMap::new();
4343        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4344        let body = params.body.clone();
4345        self.client
4346            .request_json(
4347                Method::POST,
4348                &path,
4349                headers,
4350                query,
4351                body,
4352                params.disable_cache,
4353            )
4354            .await
4355    }
4356/// 文本分析
4357    #[instrument(skip(self, params))]
4358    pub async fn post_text_analyze(&self, params: PostTextAnalyzeParams) -> Result<crate::models::PostTextAnalyze200Response> {
4359        let mut path = "/api/v1/text/analyze".to_string();
4360
4361        let mut query: Vec<(String, String)> = Vec::new();
4362        if let Some(value) = &params._t {
4363            query.push(("_t".to_string(), value.clone()));
4364        }
4365        let query = if query.is_empty() { None } else { Some(query) };
4366
4367        let mut extra_headers = HeaderMap::new();
4368        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4369        let body = params.body.clone();
4370        self.client
4371            .request_json(
4372                Method::POST,
4373                &path,
4374                headers,
4375                query,
4376                body,
4377                params.disable_cache,
4378            )
4379            .await
4380    }
4381/// Base64 解码
4382    #[instrument(skip(self, params))]
4383    pub async fn post_text_base_64_decode(&self, params: PostTextBase64DecodeParams) -> Result<crate::models::PostTextBase64Decode200Response> {
4384        let mut path = "/api/v1/text/base64/decode".to_string();
4385
4386        let mut query: Vec<(String, String)> = Vec::new();
4387        if let Some(value) = &params._t {
4388            query.push(("_t".to_string(), value.clone()));
4389        }
4390        let query = if query.is_empty() { None } else { Some(query) };
4391
4392        let mut extra_headers = HeaderMap::new();
4393        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4394        let body = params.body.clone();
4395        self.client
4396            .request_json(
4397                Method::POST,
4398                &path,
4399                headers,
4400                query,
4401                body,
4402                params.disable_cache,
4403            )
4404            .await
4405    }
4406/// Base64 编码
4407    #[instrument(skip(self, params))]
4408    pub async fn post_text_base_64_encode(&self, params: PostTextBase64EncodeParams) -> Result<crate::models::PostTextBase64Encode200Response> {
4409        let mut path = "/api/v1/text/base64/encode".to_string();
4410
4411        let mut query: Vec<(String, String)> = Vec::new();
4412        if let Some(value) = &params._t {
4413            query.push(("_t".to_string(), value.clone()));
4414        }
4415        let query = if query.is_empty() { None } else { Some(query) };
4416
4417        let mut extra_headers = HeaderMap::new();
4418        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4419        let body = params.body.clone();
4420        self.client
4421            .request_json(
4422                Method::POST,
4423                &path,
4424                headers,
4425                query,
4426                body,
4427                params.disable_cache,
4428            )
4429            .await
4430    }
4431/// 格式转换
4432    #[instrument(skip(self, params))]
4433    pub async fn post_text_convert(&self, params: PostTextConvertParams) -> Result<crate::models::PostTextConvert200Response> {
4434        let mut path = "/api/v1/text/convert".to_string();
4435
4436        let mut query: Vec<(String, String)> = Vec::new();
4437        if let Some(value) = &params._t {
4438            query.push(("_t".to_string(), value.clone()));
4439        }
4440        let query = if query.is_empty() { None } else { Some(query) };
4441
4442        let mut extra_headers = HeaderMap::new();
4443        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4444        let body = params.body.clone();
4445        self.client
4446            .request_json(
4447                Method::POST,
4448                &path,
4449                headers,
4450                query,
4451                body,
4452                params.disable_cache,
4453            )
4454            .await
4455    }
4456/// Markdown 转 HTML
4457    #[instrument(skip(self, params))]
4458    pub async fn post_text_markdown_to_html(&self, params: PostTextMarkdownToHtmlParams) -> Result<crate::models::PostTextMarkdownToHtml200Response> {
4459        let mut path = "/api/v1/text/markdown-to-html".to_string();
4460
4461        let mut query: Vec<(String, String)> = Vec::new();
4462        if let Some(value) = &params._t {
4463            query.push(("_t".to_string(), value.clone()));
4464        }
4465        let query = if query.is_empty() { None } else { Some(query) };
4466
4467        let mut extra_headers = HeaderMap::new();
4468        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4469        let body = params.body.clone();
4470        self.client
4471            .request_json(
4472                Method::POST,
4473                &path,
4474                headers,
4475                query,
4476                body,
4477                params.disable_cache,
4478            )
4479            .await
4480    }
4481/// Markdown 转 PDF
4482    #[instrument(skip(self, params))]
4483    pub async fn post_text_markdown_to_pdf(&self, params: PostTextMarkdownToPdfParams) -> Result<Vec<u8>> {
4484        let mut path = "/api/v1/text/markdown-to-pdf".to_string();
4485
4486        let mut query: Vec<(String, String)> = Vec::new();
4487        if let Some(value) = &params._t {
4488            query.push(("_t".to_string(), value.clone()));
4489        }
4490        let query = if query.is_empty() { None } else { Some(query) };
4491
4492        let mut extra_headers = HeaderMap::new();
4493        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4494        let body = params.body.clone();
4495        self.client
4496            .request_bytes(
4497                Method::POST,
4498                &path,
4499                headers,
4500                query,
4501                body,
4502                params.disable_cache,
4503            )
4504            .await
4505    }
4506/// MD5 哈希 (POST)
4507    #[instrument(skip(self, params))]
4508    pub async fn post_text_md_5(&self, params: PostTextMd5Params) -> Result<crate::models::GetTextMd5200Response> {
4509        let mut path = "/api/v1/text/md5".to_string();
4510
4511        let mut query: Vec<(String, String)> = Vec::new();
4512        if let Some(value) = &params._t {
4513            query.push(("_t".to_string(), value.clone()));
4514        }
4515        let query = if query.is_empty() { None } else { Some(query) };
4516
4517        let mut extra_headers = HeaderMap::new();
4518        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4519        let body = params.body.clone();
4520        self.client
4521            .request_json(
4522                Method::POST,
4523                &path,
4524                headers,
4525                query,
4526                body,
4527                params.disable_cache,
4528            )
4529            .await
4530    }
4531/// MD5 校验
4532    #[instrument(skip(self, params))]
4533    pub async fn post_text_md_5_verify(&self, params: PostTextMd5VerifyParams) -> Result<crate::models::PostTextMd5Verify200Response> {
4534        let mut path = "/api/v1/text/md5/verify".to_string();
4535
4536        let mut query: Vec<(String, String)> = Vec::new();
4537        if let Some(value) = &params._t {
4538            query.push(("_t".to_string(), value.clone()));
4539        }
4540        let query = if query.is_empty() { None } else { Some(query) };
4541
4542        let mut extra_headers = HeaderMap::new();
4543        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4544        let body = params.body.clone();
4545        self.client
4546            .request_json(
4547                Method::POST,
4548                &path,
4549                headers,
4550                query,
4551                body,
4552                params.disable_cache,
4553            )
4554            .await
4555    }
4556}
4557
4558#[derive(Debug, Clone)]
4559pub struct GetTextMd5Params {
4560    pub text_query: String,
4561    pub disable_cache: Option<bool>,
4562    pub _t: Option<String>,
4563}
4564
4565impl GetTextMd5Params {
4566    pub fn new(text_query: impl Into<String>) -> Self {
4567        Self {
4568            text_query: text_query.into(),
4569            disable_cache: None,
4570            _t: None,
4571        }
4572    }
4573    pub fn disable_cache(mut self, value: bool) -> Self {
4574        self.disable_cache = Some(value);
4575        self
4576    }
4577    pub fn _t(mut self, value: impl Into<String>) -> Self {
4578        self._t = Some(value.into());
4579        self
4580    }
4581}
4582
4583#[derive(Debug, Clone)]
4584pub struct PostTextAesDecryptParams {
4585    pub body: Option<Value>,
4586    pub disable_cache: Option<bool>,
4587    pub _t: Option<String>,
4588}
4589
4590impl PostTextAesDecryptParams {
4591    pub fn new() -> Self {
4592        Self {
4593            body: None,
4594            disable_cache: None,
4595            _t: None,
4596        }
4597    }
4598    pub fn disable_cache(mut self, value: bool) -> Self {
4599        self.disable_cache = Some(value);
4600        self
4601    }
4602    pub fn _t(mut self, value: impl Into<String>) -> Self {
4603        self._t = Some(value.into());
4604        self
4605    }
4606    pub fn body(mut self, value: Value) -> Self {
4607        self.body = Some(value);
4608        self
4609    }
4610}
4611
4612#[derive(Debug, Clone)]
4613pub struct PostTextAesDecryptAdvancedParams {
4614    pub body: Option<Value>,
4615    pub disable_cache: Option<bool>,
4616    pub _t: Option<String>,
4617}
4618
4619impl PostTextAesDecryptAdvancedParams {
4620    pub fn new() -> Self {
4621        Self {
4622            body: None,
4623            disable_cache: None,
4624            _t: None,
4625        }
4626    }
4627    pub fn disable_cache(mut self, value: bool) -> Self {
4628        self.disable_cache = Some(value);
4629        self
4630    }
4631    pub fn _t(mut self, value: impl Into<String>) -> Self {
4632        self._t = Some(value.into());
4633        self
4634    }
4635    pub fn body(mut self, value: Value) -> Self {
4636        self.body = Some(value);
4637        self
4638    }
4639}
4640
4641#[derive(Debug, Clone)]
4642pub struct PostTextAesEncryptParams {
4643    pub body: Option<Value>,
4644    pub disable_cache: Option<bool>,
4645    pub _t: Option<String>,
4646}
4647
4648impl PostTextAesEncryptParams {
4649    pub fn new() -> Self {
4650        Self {
4651            body: None,
4652            disable_cache: None,
4653            _t: None,
4654        }
4655    }
4656    pub fn disable_cache(mut self, value: bool) -> Self {
4657        self.disable_cache = Some(value);
4658        self
4659    }
4660    pub fn _t(mut self, value: impl Into<String>) -> Self {
4661        self._t = Some(value.into());
4662        self
4663    }
4664    pub fn body(mut self, value: Value) -> Self {
4665        self.body = Some(value);
4666        self
4667    }
4668}
4669
4670#[derive(Debug, Clone)]
4671pub struct PostTextAesEncryptAdvancedParams {
4672    pub body: Option<Value>,
4673    pub disable_cache: Option<bool>,
4674    pub _t: Option<String>,
4675}
4676
4677impl PostTextAesEncryptAdvancedParams {
4678    pub fn new() -> Self {
4679        Self {
4680            body: None,
4681            disable_cache: None,
4682            _t: None,
4683        }
4684    }
4685    pub fn disable_cache(mut self, value: bool) -> Self {
4686        self.disable_cache = Some(value);
4687        self
4688    }
4689    pub fn _t(mut self, value: impl Into<String>) -> Self {
4690        self._t = Some(value.into());
4691        self
4692    }
4693    pub fn body(mut self, value: Value) -> Self {
4694        self.body = Some(value);
4695        self
4696    }
4697}
4698
4699#[derive(Debug, Clone)]
4700pub struct PostTextAnalyzeParams {
4701    pub body: Option<Value>,
4702    pub disable_cache: Option<bool>,
4703    pub _t: Option<String>,
4704}
4705
4706impl PostTextAnalyzeParams {
4707    pub fn new() -> Self {
4708        Self {
4709            body: None,
4710            disable_cache: None,
4711            _t: None,
4712        }
4713    }
4714    pub fn disable_cache(mut self, value: bool) -> Self {
4715        self.disable_cache = Some(value);
4716        self
4717    }
4718    pub fn _t(mut self, value: impl Into<String>) -> Self {
4719        self._t = Some(value.into());
4720        self
4721    }
4722    pub fn body(mut self, value: Value) -> Self {
4723        self.body = Some(value);
4724        self
4725    }
4726}
4727
4728#[derive(Debug, Clone)]
4729pub struct PostTextBase64DecodeParams {
4730    pub body: Option<Value>,
4731    pub disable_cache: Option<bool>,
4732    pub _t: Option<String>,
4733}
4734
4735impl PostTextBase64DecodeParams {
4736    pub fn new() -> Self {
4737        Self {
4738            body: None,
4739            disable_cache: None,
4740            _t: None,
4741        }
4742    }
4743    pub fn disable_cache(mut self, value: bool) -> Self {
4744        self.disable_cache = Some(value);
4745        self
4746    }
4747    pub fn _t(mut self, value: impl Into<String>) -> Self {
4748        self._t = Some(value.into());
4749        self
4750    }
4751    pub fn body(mut self, value: Value) -> Self {
4752        self.body = Some(value);
4753        self
4754    }
4755}
4756
4757#[derive(Debug, Clone)]
4758pub struct PostTextBase64EncodeParams {
4759    pub body: Option<Value>,
4760    pub disable_cache: Option<bool>,
4761    pub _t: Option<String>,
4762}
4763
4764impl PostTextBase64EncodeParams {
4765    pub fn new() -> Self {
4766        Self {
4767            body: None,
4768            disable_cache: None,
4769            _t: None,
4770        }
4771    }
4772    pub fn disable_cache(mut self, value: bool) -> Self {
4773        self.disable_cache = Some(value);
4774        self
4775    }
4776    pub fn _t(mut self, value: impl Into<String>) -> Self {
4777        self._t = Some(value.into());
4778        self
4779    }
4780    pub fn body(mut self, value: Value) -> Self {
4781        self.body = Some(value);
4782        self
4783    }
4784}
4785
4786#[derive(Debug, Clone)]
4787pub struct PostTextConvertParams {
4788    pub body: Option<Value>,
4789    pub disable_cache: Option<bool>,
4790    pub _t: Option<String>,
4791}
4792
4793impl PostTextConvertParams {
4794    pub fn new() -> Self {
4795        Self {
4796            body: None,
4797            disable_cache: None,
4798            _t: None,
4799        }
4800    }
4801    pub fn disable_cache(mut self, value: bool) -> Self {
4802        self.disable_cache = Some(value);
4803        self
4804    }
4805    pub fn _t(mut self, value: impl Into<String>) -> Self {
4806        self._t = Some(value.into());
4807        self
4808    }
4809    pub fn body(mut self, value: Value) -> Self {
4810        self.body = Some(value);
4811        self
4812    }
4813}
4814
4815#[derive(Debug, Clone)]
4816pub struct PostTextMarkdownToHtmlParams {
4817    pub body: Option<Value>,
4818    pub disable_cache: Option<bool>,
4819    pub _t: Option<String>,
4820}
4821
4822impl PostTextMarkdownToHtmlParams {
4823    pub fn new() -> Self {
4824        Self {
4825            body: None,
4826            disable_cache: None,
4827            _t: None,
4828        }
4829    }
4830    pub fn disable_cache(mut self, value: bool) -> Self {
4831        self.disable_cache = Some(value);
4832        self
4833    }
4834    pub fn _t(mut self, value: impl Into<String>) -> Self {
4835        self._t = Some(value.into());
4836        self
4837    }
4838    pub fn body(mut self, value: Value) -> Self {
4839        self.body = Some(value);
4840        self
4841    }
4842}
4843
4844#[derive(Debug, Clone)]
4845pub struct PostTextMarkdownToPdfParams {
4846    pub body: Option<Value>,
4847    pub disable_cache: Option<bool>,
4848    pub _t: Option<String>,
4849}
4850
4851impl PostTextMarkdownToPdfParams {
4852    pub fn new() -> Self {
4853        Self {
4854            body: None,
4855            disable_cache: None,
4856            _t: None,
4857        }
4858    }
4859    pub fn disable_cache(mut self, value: bool) -> Self {
4860        self.disable_cache = Some(value);
4861        self
4862    }
4863    pub fn _t(mut self, value: impl Into<String>) -> Self {
4864        self._t = Some(value.into());
4865        self
4866    }
4867    pub fn body(mut self, value: Value) -> Self {
4868        self.body = Some(value);
4869        self
4870    }
4871}
4872
4873#[derive(Debug, Clone)]
4874pub struct PostTextMd5Params {
4875    pub body: Option<Value>,
4876    pub disable_cache: Option<bool>,
4877    pub _t: Option<String>,
4878}
4879
4880impl PostTextMd5Params {
4881    pub fn new() -> Self {
4882        Self {
4883            body: None,
4884            disable_cache: None,
4885            _t: None,
4886        }
4887    }
4888    pub fn disable_cache(mut self, value: bool) -> Self {
4889        self.disable_cache = Some(value);
4890        self
4891    }
4892    pub fn _t(mut self, value: impl Into<String>) -> Self {
4893        self._t = Some(value.into());
4894        self
4895    }
4896    pub fn body(mut self, value: Value) -> Self {
4897        self.body = Some(value);
4898        self
4899    }
4900}
4901
4902#[derive(Debug, Clone)]
4903pub struct PostTextMd5VerifyParams {
4904    pub body: Option<Value>,
4905    pub disable_cache: Option<bool>,
4906    pub _t: Option<String>,
4907}
4908
4909impl PostTextMd5VerifyParams {
4910    pub fn new() -> Self {
4911        Self {
4912            body: None,
4913            disable_cache: None,
4914            _t: None,
4915        }
4916    }
4917    pub fn disable_cache(mut self, value: bool) -> Self {
4918        self.disable_cache = Some(value);
4919        self
4920    }
4921    pub fn _t(mut self, value: impl Into<String>) -> Self {
4922        self._t = Some(value.into());
4923        self
4924    }
4925    pub fn body(mut self, value: Value) -> Self {
4926        self.body = Some(value);
4927        self
4928    }
4929}
4930#[derive(Debug, Clone)]
4931pub struct TranslateService<'a> {
4932    pub(crate) client: &'a Client,
4933}
4934
4935impl<'a> TranslateService<'a> {
4936/// AI翻译配置
4937    #[instrument(skip(self))]
4938    pub async fn get_ai_translate_languages(&self) -> Result<crate::models::GetAiTranslateLanguages200Response> {
4939        let mut path = "/api/v1/ai/translate/languages".to_string();
4940
4941        let mut query: Vec<(String, String)> = Vec::new();
4942        let query = if query.is_empty() { None } else { Some(query) };
4943
4944        let mut extra_headers = HeaderMap::new();
4945        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4946        let body = None;
4947        self.client
4948            .request_json(
4949                Method::GET,
4950                &path,
4951                headers,
4952                query,
4953                body,
4954                None,
4955            )
4956            .await
4957    }
4958/// AI智能翻译
4959    #[instrument(skip(self, params))]
4960    pub async fn post_ai_translate(&self, params: PostAiTranslateParams) -> Result<crate::models::PostAiTranslate200Response> {
4961        let mut path = "/api/v1/ai/translate".to_string();
4962
4963        let mut query: Vec<(String, String)> = Vec::new();
4964        query.push(("target_lang".to_string(), params.target_lang_query.clone()));
4965        if let Some(value) = &params._t {
4966            query.push(("_t".to_string(), value.clone()));
4967        }
4968        let query = if query.is_empty() { None } else { Some(query) };
4969
4970        let mut extra_headers = HeaderMap::new();
4971        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4972        let body = params.body.clone();
4973        self.client
4974            .request_json(
4975                Method::POST,
4976                &path,
4977                headers,
4978                query,
4979                body,
4980                params.disable_cache,
4981            )
4982            .await
4983    }
4984/// 流式翻译(中英互译)
4985    #[instrument(skip(self, params))]
4986    pub async fn post_translate_stream(&self, params: PostTranslateStreamParams) -> Result<String> {
4987        let mut path = "/api/v1/translate/stream".to_string();
4988
4989        let mut query: Vec<(String, String)> = Vec::new();
4990        if let Some(value) = &params._t {
4991            query.push(("_t".to_string(), value.clone()));
4992        }
4993        let query = if query.is_empty() { None } else { Some(query) };
4994
4995        let mut extra_headers = HeaderMap::new();
4996        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4997        let body = params.body.clone();
4998        self.client
4999            .request_json(
5000                Method::POST,
5001                &path,
5002                headers,
5003                query,
5004                body,
5005                params.disable_cache,
5006            )
5007            .await
5008    }
5009/// 翻译
5010    #[instrument(skip(self, params))]
5011    pub async fn post_translate_text(&self, params: PostTranslateTextParams) -> Result<crate::models::PostTranslateText200Response> {
5012        let mut path = "/api/v1/translate/text".to_string();
5013
5014        let mut query: Vec<(String, String)> = Vec::new();
5015        query.push(("to_lang".to_string(), params.to_lang_query.clone()));
5016        if let Some(value) = &params._t {
5017            query.push(("_t".to_string(), value.clone()));
5018        }
5019        let query = if query.is_empty() { None } else { Some(query) };
5020
5021        let mut extra_headers = HeaderMap::new();
5022        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5023        let body = params.body.clone();
5024        self.client
5025            .request_json(
5026                Method::POST,
5027                &path,
5028                headers,
5029                query,
5030                body,
5031                params.disable_cache,
5032            )
5033            .await
5034    }
5035}
5036
5037
5038#[derive(Debug, Clone)]
5039pub struct PostAiTranslateParams {
5040    pub target_lang_query: String,
5041    pub body: Option<Value>,
5042    pub disable_cache: Option<bool>,
5043    pub _t: Option<String>,
5044}
5045
5046impl PostAiTranslateParams {
5047    pub fn new(target_lang_query: impl Into<String>) -> Self {
5048        Self {
5049            target_lang_query: target_lang_query.into(),
5050            body: None,
5051            disable_cache: None,
5052            _t: None,
5053        }
5054    }
5055    pub fn disable_cache(mut self, value: bool) -> Self {
5056        self.disable_cache = Some(value);
5057        self
5058    }
5059    pub fn _t(mut self, value: impl Into<String>) -> Self {
5060        self._t = Some(value.into());
5061        self
5062    }
5063    pub fn body(mut self, value: Value) -> Self {
5064        self.body = Some(value);
5065        self
5066    }
5067}
5068
5069#[derive(Debug, Clone)]
5070pub struct PostTranslateStreamParams {
5071    pub body: Option<Value>,
5072    pub disable_cache: Option<bool>,
5073    pub _t: Option<String>,
5074}
5075
5076impl PostTranslateStreamParams {
5077    pub fn new() -> Self {
5078        Self {
5079            body: None,
5080            disable_cache: None,
5081            _t: None,
5082        }
5083    }
5084    pub fn disable_cache(mut self, value: bool) -> Self {
5085        self.disable_cache = Some(value);
5086        self
5087    }
5088    pub fn _t(mut self, value: impl Into<String>) -> Self {
5089        self._t = Some(value.into());
5090        self
5091    }
5092    pub fn body(mut self, value: Value) -> Self {
5093        self.body = Some(value);
5094        self
5095    }
5096}
5097
5098#[derive(Debug, Clone)]
5099pub struct PostTranslateTextParams {
5100    pub to_lang_query: String,
5101    pub body: Option<Value>,
5102    pub disable_cache: Option<bool>,
5103    pub _t: Option<String>,
5104}
5105
5106impl PostTranslateTextParams {
5107    pub fn new(to_lang_query: impl Into<String>) -> Self {
5108        Self {
5109            to_lang_query: to_lang_query.into(),
5110            body: None,
5111            disable_cache: None,
5112            _t: None,
5113        }
5114    }
5115    pub fn disable_cache(mut self, value: bool) -> Self {
5116        self.disable_cache = Some(value);
5117        self
5118    }
5119    pub fn _t(mut self, value: impl Into<String>) -> Self {
5120        self._t = Some(value.into());
5121        self
5122    }
5123    pub fn body(mut self, value: Value) -> Self {
5124        self.body = Some(value);
5125        self
5126    }
5127}
5128#[derive(Debug, Clone)]
5129pub struct WebparseService<'a> {
5130    pub(crate) client: &'a Client,
5131}
5132
5133impl<'a> WebparseService<'a> {
5134/// 转换任务状态
5135    #[instrument(skip(self, params))]
5136    pub async fn get_web_tomarkdown_async_status(&self, params: GetWebTomarkdownAsyncStatusParams) -> Result<crate::models::GetWebTomarkdownAsyncStatus200Response> {
5137        let mut path = "/api/v1/web/tomarkdown/async/{task_id}".to_string();
5138        {
5139            let encoded = encode(&params.task_id_path).into_owned();
5140            path = path.replace("{task_id}", &encoded);
5141        }
5142
5143        let mut query: Vec<(String, String)> = Vec::new();
5144        if let Some(value) = &params._t {
5145            query.push(("_t".to_string(), value.clone()));
5146        }
5147        let query = if query.is_empty() { None } else { Some(query) };
5148
5149        let mut extra_headers = HeaderMap::new();
5150        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5151        let body = None;
5152        self.client
5153            .request_json(
5154                Method::GET,
5155                &path,
5156                headers,
5157                query,
5158                body,
5159                params.disable_cache,
5160            )
5161            .await
5162    }
5163/// 提取网页图片
5164    #[instrument(skip(self, params))]
5165    pub async fn get_webparse_extractimages(&self, params: GetWebparseExtractimagesParams) -> Result<crate::models::GetWebparseExtractimages200Response> {
5166        let mut path = "/api/v1/webparse/extractimages".to_string();
5167
5168        let mut query: Vec<(String, String)> = Vec::new();
5169        query.push(("url".to_string(), params.url_query.clone()));
5170        if let Some(value) = &params._t {
5171            query.push(("_t".to_string(), value.clone()));
5172        }
5173        let query = if query.is_empty() { None } else { Some(query) };
5174
5175        let mut extra_headers = HeaderMap::new();
5176        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5177        let body = None;
5178        self.client
5179            .request_json(
5180                Method::GET,
5181                &path,
5182                headers,
5183                query,
5184                body,
5185                params.disable_cache,
5186            )
5187            .await
5188    }
5189/// 提取网页元数据
5190    #[instrument(skip(self, params))]
5191    pub async fn get_webparse_metadata(&self, params: GetWebparseMetadataParams) -> Result<crate::models::GetWebparseMetadata200Response> {
5192        let mut path = "/api/v1/webparse/metadata".to_string();
5193
5194        let mut query: Vec<(String, String)> = Vec::new();
5195        query.push(("url".to_string(), params.url_query.clone()));
5196        if let Some(value) = &params._t {
5197            query.push(("_t".to_string(), value.clone()));
5198        }
5199        let query = if query.is_empty() { None } else { Some(query) };
5200
5201        let mut extra_headers = HeaderMap::new();
5202        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5203        let body = None;
5204        self.client
5205            .request_json(
5206                Method::GET,
5207                &path,
5208                headers,
5209                query,
5210                body,
5211                params.disable_cache,
5212            )
5213            .await
5214    }
5215/// 网页转 Markdown
5216    #[instrument(skip(self, params))]
5217    pub async fn post_web_tomarkdown_async(&self, params: PostWebTomarkdownAsyncParams) -> Result<crate::models::PostWebTomarkdownAsync202Response> {
5218        let mut path = "/api/v1/web/tomarkdown/async".to_string();
5219
5220        let mut query: Vec<(String, String)> = Vec::new();
5221        query.push(("url".to_string(), params.url_query.clone()));
5222        if let Some(value) = &params._t {
5223            query.push(("_t".to_string(), value.clone()));
5224        }
5225        let query = if query.is_empty() { None } else { Some(query) };
5226
5227        let mut extra_headers = HeaderMap::new();
5228        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5229        let body = None;
5230        self.client
5231            .request_json(
5232                Method::POST,
5233                &path,
5234                headers,
5235                query,
5236                body,
5237                params.disable_cache,
5238            )
5239            .await
5240    }
5241}
5242
5243#[derive(Debug, Clone)]
5244pub struct GetWebTomarkdownAsyncStatusParams {
5245    pub task_id_path: String,
5246    pub disable_cache: Option<bool>,
5247    pub _t: Option<String>,
5248}
5249
5250impl GetWebTomarkdownAsyncStatusParams {
5251    pub fn new(task_id_path: impl Into<String>) -> Self {
5252        Self {
5253            task_id_path: task_id_path.into(),
5254            disable_cache: None,
5255            _t: None,
5256        }
5257    }
5258    pub fn disable_cache(mut self, value: bool) -> Self {
5259        self.disable_cache = Some(value);
5260        self
5261    }
5262    pub fn _t(mut self, value: impl Into<String>) -> Self {
5263        self._t = Some(value.into());
5264        self
5265    }
5266}
5267
5268#[derive(Debug, Clone)]
5269pub struct GetWebparseExtractimagesParams {
5270    pub url_query: String,
5271    pub disable_cache: Option<bool>,
5272    pub _t: Option<String>,
5273}
5274
5275impl GetWebparseExtractimagesParams {
5276    pub fn new(url_query: impl Into<String>) -> Self {
5277        Self {
5278            url_query: url_query.into(),
5279            disable_cache: None,
5280            _t: None,
5281        }
5282    }
5283    pub fn disable_cache(mut self, value: bool) -> Self {
5284        self.disable_cache = Some(value);
5285        self
5286    }
5287    pub fn _t(mut self, value: impl Into<String>) -> Self {
5288        self._t = Some(value.into());
5289        self
5290    }
5291}
5292
5293#[derive(Debug, Clone)]
5294pub struct GetWebparseMetadataParams {
5295    pub url_query: String,
5296    pub disable_cache: Option<bool>,
5297    pub _t: Option<String>,
5298}
5299
5300impl GetWebparseMetadataParams {
5301    pub fn new(url_query: impl Into<String>) -> Self {
5302        Self {
5303            url_query: url_query.into(),
5304            disable_cache: None,
5305            _t: None,
5306        }
5307    }
5308    pub fn disable_cache(mut self, value: bool) -> Self {
5309        self.disable_cache = Some(value);
5310        self
5311    }
5312    pub fn _t(mut self, value: impl Into<String>) -> Self {
5313        self._t = Some(value.into());
5314        self
5315    }
5316}
5317
5318#[derive(Debug, Clone)]
5319pub struct PostWebTomarkdownAsyncParams {
5320    pub url_query: String,
5321    pub disable_cache: Option<bool>,
5322    pub _t: Option<String>,
5323}
5324
5325impl PostWebTomarkdownAsyncParams {
5326    pub fn new(url_query: impl Into<String>) -> Self {
5327        Self {
5328            url_query: url_query.into(),
5329            disable_cache: None,
5330            _t: None,
5331        }
5332    }
5333    pub fn disable_cache(mut self, value: bool) -> Self {
5334        self.disable_cache = Some(value);
5335        self
5336    }
5337    pub fn _t(mut self, value: impl Into<String>) -> Self {
5338        self._t = Some(value.into());
5339        self
5340    }
5341}
5342#[derive(Debug, Clone)]
5343pub struct MinGanCiShiBieService<'a> {
5344    pub(crate) client: &'a Client,
5345}
5346
5347impl<'a> MinGanCiShiBieService<'a> {
5348/// 敏感词分析 (GET)
5349    #[instrument(skip(self, params))]
5350    pub async fn get_sensitive_word_analyze_query(&self, params: GetSensitiveWordAnalyzeQueryParams) -> Result<crate::models::PostSensitiveWordAnalyze200Response> {
5351        let mut path = "/api/v1/sensitive-word/analyze-query".to_string();
5352
5353        let mut query: Vec<(String, String)> = Vec::new();
5354        query.push(("keyword".to_string(), params.keyword_query.clone()));
5355        if let Some(value) = &params._t {
5356            query.push(("_t".to_string(), value.clone()));
5357        }
5358        let query = if query.is_empty() { None } else { Some(query) };
5359
5360        let mut extra_headers = HeaderMap::new();
5361        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5362        let body = None;
5363        self.client
5364            .request_json(
5365                Method::GET,
5366                &path,
5367                headers,
5368                query,
5369                body,
5370                params.disable_cache,
5371            )
5372            .await
5373    }
5374/// 分析敏感词
5375    #[instrument(skip(self, params))]
5376    pub async fn post_sensitive_word_analyze(&self, params: PostSensitiveWordAnalyzeParams) -> Result<crate::models::PostSensitiveWordAnalyze200Response> {
5377        let mut path = "/api/v1/sensitive-word/analyze".to_string();
5378
5379        let mut query: Vec<(String, String)> = Vec::new();
5380        if let Some(value) = &params._t {
5381            query.push(("_t".to_string(), value.clone()));
5382        }
5383        let query = if query.is_empty() { None } else { Some(query) };
5384
5385        let mut extra_headers = HeaderMap::new();
5386        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5387        let body = params.body.clone();
5388        self.client
5389            .request_json(
5390                Method::POST,
5391                &path,
5392                headers,
5393                query,
5394                body,
5395                params.disable_cache,
5396            )
5397            .await
5398    }
5399/// 敏感词检测(快速)
5400    #[instrument(skip(self, params))]
5401    pub async fn post_sensitive_word_quick_check(&self, params: PostSensitiveWordQuickCheckParams) -> Result<crate::models::PostSensitiveWordQuickCheck200Response> {
5402        let mut path = "/api/v1/text/profanitycheck".to_string();
5403
5404        let mut query: Vec<(String, String)> = Vec::new();
5405        if let Some(value) = &params._t {
5406            query.push(("_t".to_string(), value.clone()));
5407        }
5408        let query = if query.is_empty() { None } else { Some(query) };
5409
5410        let mut extra_headers = HeaderMap::new();
5411        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5412        let body = params.body.clone();
5413        self.client
5414            .request_json(
5415                Method::POST,
5416                &path,
5417                headers,
5418                query,
5419                body,
5420                params.disable_cache,
5421            )
5422            .await
5423    }
5424}
5425
5426#[derive(Debug, Clone)]
5427pub struct GetSensitiveWordAnalyzeQueryParams {
5428    pub keyword_query: String,
5429    pub disable_cache: Option<bool>,
5430    pub _t: Option<String>,
5431}
5432
5433impl GetSensitiveWordAnalyzeQueryParams {
5434    pub fn new(keyword_query: impl Into<String>) -> Self {
5435        Self {
5436            keyword_query: keyword_query.into(),
5437            disable_cache: None,
5438            _t: None,
5439        }
5440    }
5441    pub fn disable_cache(mut self, value: bool) -> Self {
5442        self.disable_cache = Some(value);
5443        self
5444    }
5445    pub fn _t(mut self, value: impl Into<String>) -> Self {
5446        self._t = Some(value.into());
5447        self
5448    }
5449}
5450
5451#[derive(Debug, Clone)]
5452pub struct PostSensitiveWordAnalyzeParams {
5453    pub body: Option<Value>,
5454    pub disable_cache: Option<bool>,
5455    pub _t: Option<String>,
5456}
5457
5458impl PostSensitiveWordAnalyzeParams {
5459    pub fn new() -> Self {
5460        Self {
5461            body: None,
5462            disable_cache: None,
5463            _t: None,
5464        }
5465    }
5466    pub fn disable_cache(mut self, value: bool) -> Self {
5467        self.disable_cache = Some(value);
5468        self
5469    }
5470    pub fn _t(mut self, value: impl Into<String>) -> Self {
5471        self._t = Some(value.into());
5472        self
5473    }
5474    pub fn body(mut self, value: Value) -> Self {
5475        self.body = Some(value);
5476        self
5477    }
5478}
5479
5480#[derive(Debug, Clone)]
5481pub struct PostSensitiveWordQuickCheckParams {
5482    pub body: Option<Value>,
5483    pub disable_cache: Option<bool>,
5484    pub _t: Option<String>,
5485}
5486
5487impl PostSensitiveWordQuickCheckParams {
5488    pub fn new() -> Self {
5489        Self {
5490            body: None,
5491            disable_cache: None,
5492            _t: None,
5493        }
5494    }
5495    pub fn disable_cache(mut self, value: bool) -> Self {
5496        self.disable_cache = Some(value);
5497        self
5498    }
5499    pub fn _t(mut self, value: impl Into<String>) -> Self {
5500        self._t = Some(value.into());
5501        self
5502    }
5503    pub fn body(mut self, value: Value) -> Self {
5504        self.body = Some(value);
5505        self
5506    }
5507}
5508#[derive(Debug, Clone)]
5509pub struct ZhiNengSouSuoService<'a> {
5510    pub(crate) client: &'a Client,
5511}
5512
5513impl<'a> ZhiNengSouSuoService<'a> {
5514/// 搜索引擎配置
5515    #[instrument(skip(self))]
5516    pub async fn get_search_engines(&self) -> Result<crate::models::GetSearchEngines200Response> {
5517        let mut path = "/api/v1/search/engines".to_string();
5518
5519        let mut query: Vec<(String, String)> = Vec::new();
5520        let query = if query.is_empty() { None } else { Some(query) };
5521
5522        let mut extra_headers = HeaderMap::new();
5523        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5524        let body = None;
5525        self.client
5526            .request_json(
5527                Method::GET,
5528                &path,
5529                headers,
5530                query,
5531                body,
5532                None,
5533            )
5534            .await
5535    }
5536/// 智能搜索
5537    #[instrument(skip(self, params))]
5538    pub async fn post_search_aggregate(&self, params: PostSearchAggregateParams) -> Result<crate::models::PostSearchAggregate200Response> {
5539        let mut path = "/api/v1/search/aggregate".to_string();
5540
5541        let mut query: Vec<(String, String)> = Vec::new();
5542        if let Some(value) = &params._t {
5543            query.push(("_t".to_string(), value.clone()));
5544        }
5545        let query = if query.is_empty() { None } else { Some(query) };
5546
5547        let mut extra_headers = HeaderMap::new();
5548        let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5549        let body = params.body.clone();
5550        self.client
5551            .request_json(
5552                Method::POST,
5553                &path,
5554                headers,
5555                query,
5556                body,
5557                params.disable_cache,
5558            )
5559            .await
5560    }
5561}
5562
5563
5564#[derive(Debug, Clone)]
5565pub struct PostSearchAggregateParams {
5566    pub body: Option<Value>,
5567    pub disable_cache: Option<bool>,
5568    pub _t: Option<String>,
5569}
5570
5571impl PostSearchAggregateParams {
5572    pub fn new() -> Self {
5573        Self {
5574            body: None,
5575            disable_cache: None,
5576            _t: None,
5577        }
5578    }
5579    pub fn disable_cache(mut self, value: bool) -> Self {
5580        self.disable_cache = Some(value);
5581        self
5582    }
5583    pub fn _t(mut self, value: impl Into<String>) -> Self {
5584        self._t = Some(value.into());
5585        self
5586    }
5587    pub fn body(mut self, value: Value) -> Self {
5588        self.body = Some(value);
5589        self
5590    }
5591}