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