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#[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) = ¶ms._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#[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(¶ms.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) = ¶ms._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#[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) = ¶ms._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#[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) = ¶ms._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#[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) = ¶ms._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#[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#[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#[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) = ¶ms.name_query {
362 query.push(("name".to_string(), value.clone()));
363 }
364 if let Some(value) = ¶ms.uuid_query {
365 query.push(("uuid".to_string(), value.clone()));
366 }
367 if let Some(value) = ¶ms._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#[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) = ¶ms._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#[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) = ¶ms._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#[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) = ¶ms.steamid_query {
448 query.push(("steamid".to_string(), value.clone()));
449 }
450 if let Some(value) = ¶ms.id_query {
451 query.push(("id".to_string(), value.clone()));
452 }
453 if let Some(value) = ¶ms.id_3_query {
454 query.push(("id3".to_string(), value.clone()));
455 }
456 if let Some(value) = ¶ms.key_query {
457 query.push(("key".to_string(), value.clone()));
458 }
459 if let Some(value) = ¶ms._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#[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) = ¶ms.email_query {
626 query.push(("email".to_string(), value.clone()));
627 }
628 if let Some(value) = ¶ms.hash_query {
629 query.push(("hash".to_string(), value.clone()));
630 }
631 if let Some(value) = ¶ms.s_query {
632 query.push(("s".to_string(), value.clone()));
633 }
634 if let Some(value) = ¶ms.d_query {
635 query.push(("d".to_string(), value.clone()));
636 }
637 if let Some(value) = ¶ms.r_query {
638 query.push(("r".to_string(), value.clone()));
639 }
640 if let Some(value) = ¶ms._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#[instrument(skip(self))]
662 pub async fn get_image_bing_daily(&self) -> Result<Vec<u8>> {
663 let mut path = "/api/v1/image/bing-daily".to_string();
664
665 let mut query: Vec<(String, String)> = Vec::new();
666 let query = if query.is_empty() { None } else { Some(query) };
667
668 let mut extra_headers = HeaderMap::new();
669 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
670 let body = None;
671
672 self.client
673 .request_json(
674 Method::GET,
675 &path,
676 headers,
677 query,
678 body,
679 None,
680 )
681 .await
682 }
683#[instrument(skip(self, params))]
685 pub async fn get_image_motou(&self, params: GetImageMotouParams) -> Result<Vec<u8>> {
686 let mut path = "/api/v1/image/motou".to_string();
687
688 let mut query: Vec<(String, String)> = Vec::new();
689 query.push(("qq".to_string(), params.qq_query.clone()));
690 if let Some(value) = ¶ms.bg_color_query {
691 query.push(("bg_color".to_string(), value.clone()));
692 }
693 if let Some(value) = ¶ms._t {
694 query.push(("_t".to_string(), value.clone()));
695 }
696 let query = if query.is_empty() { None } else { Some(query) };
697
698 let mut extra_headers = HeaderMap::new();
699 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
700 let body = None;
701
702 self.client
703 .request_json(
704 Method::GET,
705 &path,
706 headers,
707 query,
708 body,
709 params.disable_cache,
710 )
711 .await
712 }
713#[instrument(skip(self, params))]
715 pub async fn get_image_qrcode(&self, params: GetImageQrcodeParams) -> Result<crate::models::GetImageQrcode200Response> {
716 let mut path = "/api/v1/image/qrcode".to_string();
717
718 let mut query: Vec<(String, String)> = Vec::new();
719 query.push(("text".to_string(), params.text_query.clone()));
720 if let Some(value) = ¶ms.size_query {
721 query.push(("size".to_string(), value.clone()));
722 }
723 if let Some(value) = ¶ms.format_query {
724 query.push(("format".to_string(), value.clone()));
725 }
726 if let Some(value) = ¶ms.transparent_query {
727 query.push(("transparent".to_string(), value.clone()));
728 }
729 if let Some(value) = ¶ms.fgcolor_query {
730 query.push(("fgcolor".to_string(), value.clone()));
731 }
732 if let Some(value) = ¶ms.bgcolor_query {
733 query.push(("bgcolor".to_string(), value.clone()));
734 }
735 if let Some(value) = ¶ms._t {
736 query.push(("_t".to_string(), value.clone()));
737 }
738 let query = if query.is_empty() { None } else { Some(query) };
739
740 let mut extra_headers = HeaderMap::new();
741 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
742 let body = None;
743
744 self.client
745 .request_json(
746 Method::GET,
747 &path,
748 headers,
749 query,
750 body,
751 params.disable_cache,
752 )
753 .await
754 }
755#[instrument(skip(self, params))]
757 pub async fn get_image_tobase_64(&self, params: GetImageTobase64Params) -> Result<crate::models::GetImageTobase64200Response> {
758 let mut path = "/api/v1/image/tobase64".to_string();
759
760 let mut query: Vec<(String, String)> = Vec::new();
761 query.push(("url".to_string(), params.url_query.clone()));
762 if let Some(value) = ¶ms._t {
763 query.push(("_t".to_string(), value.clone()));
764 }
765 let query = if query.is_empty() { None } else { Some(query) };
766
767 let mut extra_headers = HeaderMap::new();
768 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
769 let body = None;
770
771 self.client
772 .request_json(
773 Method::GET,
774 &path,
775 headers,
776 query,
777 body,
778 params.disable_cache,
779 )
780 .await
781 }
782#[instrument(skip(self, params))]
784 pub async fn post_image_compress(&self, params: PostImageCompressParams) -> Result<Vec<u8>> {
785 let mut path = "/api/v1/image/compress".to_string();
786
787 let mut query: Vec<(String, String)> = Vec::new();
788 if let Some(value) = ¶ms.level_query {
789 query.push(("level".to_string(), value.clone()));
790 }
791 if let Some(value) = ¶ms.format_query {
792 query.push(("format".to_string(), value.clone()));
793 }
794 if let Some(value) = ¶ms._t {
795 query.push(("_t".to_string(), value.clone()));
796 }
797 let query = if query.is_empty() { None } else { Some(query) };
798
799 let mut extra_headers = HeaderMap::new();
800 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
801 let body = params.body.clone();
802
803 self.client
804 .request_json(
805 Method::POST,
806 &path,
807 headers,
808 query,
809 body,
810 params.disable_cache,
811 )
812 .await
813 }
814#[instrument(skip(self, params))]
816 pub async fn post_image_frombase_64(&self, params: PostImageFrombase64Params) -> Result<crate::models::PostImageFrombase64200Response> {
817 let mut path = "/api/v1/image/frombase64".to_string();
818
819 let mut query: Vec<(String, String)> = Vec::new();
820 if let Some(value) = ¶ms._t {
821 query.push(("_t".to_string(), value.clone()));
822 }
823 let query = if query.is_empty() { None } else { Some(query) };
824
825 let mut extra_headers = HeaderMap::new();
826 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
827 let body = params.body.clone();
828
829 self.client
830 .request_json(
831 Method::POST,
832 &path,
833 headers,
834 query,
835 body,
836 params.disable_cache,
837 )
838 .await
839 }
840#[instrument(skip(self, params))]
842 pub async fn post_image_motou(&self, params: PostImageMotouParams) -> Result<Vec<u8>> {
843 let mut path = "/api/v1/image/motou".to_string();
844
845 let mut query: Vec<(String, String)> = Vec::new();
846 if let Some(value) = ¶ms._t {
847 query.push(("_t".to_string(), value.clone()));
848 }
849 let query = if query.is_empty() { None } else { Some(query) };
850
851 let mut extra_headers = HeaderMap::new();
852 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
853 let body = params.body.clone();
854
855 self.client
856 .request_json(
857 Method::POST,
858 &path,
859 headers,
860 query,
861 body,
862 params.disable_cache,
863 )
864 .await
865 }
866#[instrument(skip(self, params))]
868 pub async fn post_image_nsfw(&self, params: PostImageNsfwParams) -> Result<crate::models::PostImageNsfw200Response> {
869 let mut path = "/api/v1/image/nsfw".to_string();
870
871 let mut query: Vec<(String, String)> = Vec::new();
872 if let Some(value) = ¶ms._t {
873 query.push(("_t".to_string(), value.clone()));
874 }
875 let query = if query.is_empty() { None } else { Some(query) };
876
877 let mut extra_headers = HeaderMap::new();
878 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
879 let body = params.body.clone();
880
881 self.client
882 .request_json(
883 Method::POST,
884 &path,
885 headers,
886 query,
887 body,
888 params.disable_cache,
889 )
890 .await
891 }
892#[instrument(skip(self, params))]
894 pub async fn post_image_speechless(&self, params: PostImageSpeechlessParams) -> Result<Vec<u8>> {
895 let mut path = "/api/v1/image/speechless".to_string();
896
897 let mut query: Vec<(String, String)> = Vec::new();
898 if let Some(value) = ¶ms._t {
899 query.push(("_t".to_string(), value.clone()));
900 }
901 let query = if query.is_empty() { None } else { Some(query) };
902
903 let mut extra_headers = HeaderMap::new();
904 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
905 let body = params.body.clone();
906
907 self.client
908 .request_json(
909 Method::POST,
910 &path,
911 headers,
912 query,
913 body,
914 params.disable_cache,
915 )
916 .await
917 }
918#[instrument(skip(self, params))]
920 pub async fn post_image_svg(&self, params: PostImageSvgParams) -> Result<Vec<u8>> {
921 let mut path = "/api/v1/image/svg".to_string();
922
923 let mut query: Vec<(String, String)> = Vec::new();
924 if let Some(value) = ¶ms.format_query {
925 query.push(("format".to_string(), value.clone()));
926 }
927 if let Some(value) = ¶ms.width_query {
928 query.push(("width".to_string(), value.clone()));
929 }
930 if let Some(value) = ¶ms.height_query {
931 query.push(("height".to_string(), value.clone()));
932 }
933 if let Some(value) = ¶ms.quality_query {
934 query.push(("quality".to_string(), value.clone()));
935 }
936 if let Some(value) = ¶ms._t {
937 query.push(("_t".to_string(), value.clone()));
938 }
939 let query = if query.is_empty() { None } else { Some(query) };
940
941 let mut extra_headers = HeaderMap::new();
942 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
943 let body = params.body.clone();
944
945 self.client
946 .request_json(
947 Method::POST,
948 &path,
949 headers,
950 query,
951 body,
952 params.disable_cache,
953 )
954 .await
955 }
956}
957
958#[derive(Debug, Clone)]
959pub struct GetAvatarGravatarParams {
960 pub email_query: Option<String>,
961 pub hash_query: Option<String>,
962 pub s_query: Option<String>,
963 pub d_query: Option<String>,
964 pub r_query: Option<String>,
965 pub disable_cache: Option<bool>,
966 pub _t: Option<String>,
967}
968
969impl GetAvatarGravatarParams {
970 pub fn new() -> Self {
971 Self {
972 email_query: None,
973 hash_query: None,
974 s_query: None,
975 d_query: None,
976 r_query: None,
977 disable_cache: None,
978 _t: None,
979 }
980 }
981 pub fn email_query(mut self, value: impl Into<String>) -> Self {
982 self.email_query = Some(value.into());
983 self
984 }
985 pub fn hash_query(mut self, value: impl Into<String>) -> Self {
986 self.hash_query = Some(value.into());
987 self
988 }
989 pub fn s_query(mut self, value: impl Into<String>) -> Self {
990 self.s_query = Some(value.into());
991 self
992 }
993 pub fn d_query(mut self, value: impl Into<String>) -> Self {
994 self.d_query = Some(value.into());
995 self
996 }
997 pub fn r_query(mut self, value: impl Into<String>) -> Self {
998 self.r_query = Some(value.into());
999 self
1000 }
1001 pub fn disable_cache(mut self, value: bool) -> Self {
1002 self.disable_cache = Some(value);
1003 self
1004 }
1005 pub fn _t(mut self, value: impl Into<String>) -> Self {
1006 self._t = Some(value.into());
1007 self
1008 }
1009}
1010
1011
1012#[derive(Debug, Clone)]
1013pub struct GetImageMotouParams {
1014 pub qq_query: String,
1015 pub bg_color_query: Option<String>,
1016 pub disable_cache: Option<bool>,
1017 pub _t: Option<String>,
1018}
1019
1020impl GetImageMotouParams {
1021 pub fn new(qq_query: impl Into<String>) -> Self {
1022 Self {
1023 qq_query: qq_query.into(),
1024 bg_color_query: None,
1025 disable_cache: None,
1026 _t: None,
1027 }
1028 }
1029 pub fn bg_color_query(mut self, value: impl Into<String>) -> Self {
1030 self.bg_color_query = Some(value.into());
1031 self
1032 }
1033 pub fn disable_cache(mut self, value: bool) -> Self {
1034 self.disable_cache = Some(value);
1035 self
1036 }
1037 pub fn _t(mut self, value: impl Into<String>) -> Self {
1038 self._t = Some(value.into());
1039 self
1040 }
1041}
1042
1043#[derive(Debug, Clone)]
1044pub struct GetImageQrcodeParams {
1045 pub text_query: String,
1046 pub size_query: Option<String>,
1047 pub format_query: Option<String>,
1048 pub transparent_query: Option<String>,
1049 pub fgcolor_query: Option<String>,
1050 pub bgcolor_query: Option<String>,
1051 pub disable_cache: Option<bool>,
1052 pub _t: Option<String>,
1053}
1054
1055impl GetImageQrcodeParams {
1056 pub fn new(text_query: impl Into<String>) -> Self {
1057 Self {
1058 text_query: text_query.into(),
1059 size_query: None,
1060 format_query: None,
1061 transparent_query: None,
1062 fgcolor_query: None,
1063 bgcolor_query: None,
1064 disable_cache: None,
1065 _t: None,
1066 }
1067 }
1068 pub fn size_query(mut self, value: impl Into<String>) -> Self {
1069 self.size_query = Some(value.into());
1070 self
1071 }
1072 pub fn format_query(mut self, value: impl Into<String>) -> Self {
1073 self.format_query = Some(value.into());
1074 self
1075 }
1076 pub fn transparent_query(mut self, value: impl Into<String>) -> Self {
1077 self.transparent_query = Some(value.into());
1078 self
1079 }
1080 pub fn fgcolor_query(mut self, value: impl Into<String>) -> Self {
1081 self.fgcolor_query = Some(value.into());
1082 self
1083 }
1084 pub fn bgcolor_query(mut self, value: impl Into<String>) -> Self {
1085 self.bgcolor_query = Some(value.into());
1086 self
1087 }
1088 pub fn disable_cache(mut self, value: bool) -> Self {
1089 self.disable_cache = Some(value);
1090 self
1091 }
1092 pub fn _t(mut self, value: impl Into<String>) -> Self {
1093 self._t = Some(value.into());
1094 self
1095 }
1096}
1097
1098#[derive(Debug, Clone)]
1099pub struct GetImageTobase64Params {
1100 pub url_query: String,
1101 pub disable_cache: Option<bool>,
1102 pub _t: Option<String>,
1103}
1104
1105impl GetImageTobase64Params {
1106 pub fn new(url_query: impl Into<String>) -> Self {
1107 Self {
1108 url_query: url_query.into(),
1109 disable_cache: None,
1110 _t: None,
1111 }
1112 }
1113 pub fn disable_cache(mut self, value: bool) -> Self {
1114 self.disable_cache = Some(value);
1115 self
1116 }
1117 pub fn _t(mut self, value: impl Into<String>) -> Self {
1118 self._t = Some(value.into());
1119 self
1120 }
1121}
1122
1123#[derive(Debug, Clone)]
1124pub struct PostImageCompressParams {
1125 pub level_query: Option<String>,
1126 pub format_query: Option<String>,
1127 pub body: Option<Value>,
1128 pub disable_cache: Option<bool>,
1129 pub _t: Option<String>,
1130}
1131
1132impl PostImageCompressParams {
1133 pub fn new() -> Self {
1134 Self {
1135 level_query: None,
1136 format_query: None,
1137 body: None,
1138 disable_cache: None,
1139 _t: None,
1140 }
1141 }
1142 pub fn level_query(mut self, value: impl Into<String>) -> Self {
1143 self.level_query = Some(value.into());
1144 self
1145 }
1146 pub fn format_query(mut self, value: impl Into<String>) -> Self {
1147 self.format_query = Some(value.into());
1148 self
1149 }
1150 pub fn disable_cache(mut self, value: bool) -> Self {
1151 self.disable_cache = Some(value);
1152 self
1153 }
1154 pub fn _t(mut self, value: impl Into<String>) -> Self {
1155 self._t = Some(value.into());
1156 self
1157 }
1158 pub fn body(mut self, value: Value) -> Self {
1159 self.body = Some(value);
1160 self
1161 }
1162}
1163
1164#[derive(Debug, Clone)]
1165pub struct PostImageFrombase64Params {
1166 pub body: Option<Value>,
1167 pub disable_cache: Option<bool>,
1168 pub _t: Option<String>,
1169}
1170
1171impl PostImageFrombase64Params {
1172 pub fn new() -> Self {
1173 Self {
1174 body: None,
1175 disable_cache: None,
1176 _t: None,
1177 }
1178 }
1179 pub fn disable_cache(mut self, value: bool) -> Self {
1180 self.disable_cache = Some(value);
1181 self
1182 }
1183 pub fn _t(mut self, value: impl Into<String>) -> Self {
1184 self._t = Some(value.into());
1185 self
1186 }
1187 pub fn body(mut self, value: Value) -> Self {
1188 self.body = Some(value);
1189 self
1190 }
1191}
1192
1193#[derive(Debug, Clone)]
1194pub struct PostImageMotouParams {
1195 pub body: Option<Value>,
1196 pub disable_cache: Option<bool>,
1197 pub _t: Option<String>,
1198}
1199
1200impl PostImageMotouParams {
1201 pub fn new() -> Self {
1202 Self {
1203 body: None,
1204 disable_cache: None,
1205 _t: None,
1206 }
1207 }
1208 pub fn disable_cache(mut self, value: bool) -> Self {
1209 self.disable_cache = Some(value);
1210 self
1211 }
1212 pub fn _t(mut self, value: impl Into<String>) -> Self {
1213 self._t = Some(value.into());
1214 self
1215 }
1216 pub fn body(mut self, value: Value) -> Self {
1217 self.body = Some(value);
1218 self
1219 }
1220}
1221
1222#[derive(Debug, Clone)]
1223pub struct PostImageNsfwParams {
1224 pub body: Option<Value>,
1225 pub disable_cache: Option<bool>,
1226 pub _t: Option<String>,
1227}
1228
1229impl PostImageNsfwParams {
1230 pub fn new() -> Self {
1231 Self {
1232 body: None,
1233 disable_cache: None,
1234 _t: None,
1235 }
1236 }
1237 pub fn disable_cache(mut self, value: bool) -> Self {
1238 self.disable_cache = Some(value);
1239 self
1240 }
1241 pub fn _t(mut self, value: impl Into<String>) -> Self {
1242 self._t = Some(value.into());
1243 self
1244 }
1245 pub fn body(mut self, value: Value) -> Self {
1246 self.body = Some(value);
1247 self
1248 }
1249}
1250
1251#[derive(Debug, Clone)]
1252pub struct PostImageSpeechlessParams {
1253 pub body: Option<Value>,
1254 pub disable_cache: Option<bool>,
1255 pub _t: Option<String>,
1256}
1257
1258impl PostImageSpeechlessParams {
1259 pub fn new() -> Self {
1260 Self {
1261 body: None,
1262 disable_cache: None,
1263 _t: None,
1264 }
1265 }
1266 pub fn disable_cache(mut self, value: bool) -> Self {
1267 self.disable_cache = Some(value);
1268 self
1269 }
1270 pub fn _t(mut self, value: impl Into<String>) -> Self {
1271 self._t = Some(value.into());
1272 self
1273 }
1274 pub fn body(mut self, value: Value) -> Self {
1275 self.body = Some(value);
1276 self
1277 }
1278}
1279
1280#[derive(Debug, Clone)]
1281pub struct PostImageSvgParams {
1282 pub format_query: Option<String>,
1283 pub width_query: Option<String>,
1284 pub height_query: Option<String>,
1285 pub quality_query: Option<String>,
1286 pub body: Option<Value>,
1287 pub disable_cache: Option<bool>,
1288 pub _t: Option<String>,
1289}
1290
1291impl PostImageSvgParams {
1292 pub fn new() -> Self {
1293 Self {
1294 format_query: None,
1295 width_query: None,
1296 height_query: None,
1297 quality_query: None,
1298 body: None,
1299 disable_cache: None,
1300 _t: None,
1301 }
1302 }
1303 pub fn format_query(mut self, value: impl Into<String>) -> Self {
1304 self.format_query = Some(value.into());
1305 self
1306 }
1307 pub fn width_query(mut self, value: impl Into<String>) -> Self {
1308 self.width_query = Some(value.into());
1309 self
1310 }
1311 pub fn height_query(mut self, value: impl Into<String>) -> Self {
1312 self.height_query = Some(value.into());
1313 self
1314 }
1315 pub fn quality_query(mut self, value: impl Into<String>) -> Self {
1316 self.quality_query = Some(value.into());
1317 self
1318 }
1319 pub fn disable_cache(mut self, value: bool) -> Self {
1320 self.disable_cache = Some(value);
1321 self
1322 }
1323 pub fn _t(mut self, value: impl Into<String>) -> Self {
1324 self._t = Some(value.into());
1325 self
1326 }
1327 pub fn body(mut self, value: Value) -> Self {
1328 self.body = Some(value);
1329 self
1330 }
1331}
1332#[derive(Debug, Clone)]
1333pub struct MiscService<'a> {
1334 pub(crate) client: &'a Client,
1335}
1336
1337impl<'a> MiscService<'a> {
1338#[instrument(skip(self, params))]
1340 pub async fn get_history_programmer(&self, params: GetHistoryProgrammerParams) -> Result<crate::models::GetHistoryProgrammer200Response> {
1341 let mut path = "/api/v1/history/programmer".to_string();
1342
1343 let mut query: Vec<(String, String)> = Vec::new();
1344 query.push(("month".to_string(), params.month_query.clone()));
1345 query.push(("day".to_string(), params.day_query.clone()));
1346 if let Some(value) = ¶ms._t {
1347 query.push(("_t".to_string(), value.clone()));
1348 }
1349 let query = if query.is_empty() { None } else { Some(query) };
1350
1351 let mut extra_headers = HeaderMap::new();
1352 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1353 let body = None;
1354
1355 self.client
1356 .request_json(
1357 Method::GET,
1358 &path,
1359 headers,
1360 query,
1361 body,
1362 params.disable_cache,
1363 )
1364 .await
1365 }
1366#[instrument(skip(self))]
1368 pub async fn get_history_programmer_today(&self) -> Result<crate::models::GetHistoryProgrammerToday200Response> {
1369 let mut path = "/api/v1/history/programmer/today".to_string();
1370
1371 let mut query: Vec<(String, String)> = Vec::new();
1372 let query = if query.is_empty() { None } else { Some(query) };
1373
1374 let mut extra_headers = HeaderMap::new();
1375 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1376 let body = None;
1377
1378 self.client
1379 .request_json(
1380 Method::GET,
1381 &path,
1382 headers,
1383 query,
1384 body,
1385 None,
1386 )
1387 .await
1388 }
1389#[instrument(skip(self, params))]
1391 pub async fn get_misc_district(&self, params: GetMiscDistrictParams) -> Result<crate::models::GetMiscDistrict200Response> {
1392 let mut path = "/api/v1/misc/district".to_string();
1393
1394 let mut query: Vec<(String, String)> = Vec::new();
1395 if let Some(value) = ¶ms.keywords_query {
1396 query.push(("keywords".to_string(), value.clone()));
1397 }
1398 if let Some(value) = ¶ms.adcode_query {
1399 query.push(("adcode".to_string(), value.clone()));
1400 }
1401 if let Some(value) = ¶ms.lat_query {
1402 query.push(("lat".to_string(), value.clone()));
1403 }
1404 if let Some(value) = ¶ms.lng_query {
1405 query.push(("lng".to_string(), value.clone()));
1406 }
1407 if let Some(value) = ¶ms.level_query {
1408 query.push(("level".to_string(), value.clone()));
1409 }
1410 if let Some(value) = ¶ms.country_query {
1411 query.push(("country".to_string(), value.clone()));
1412 }
1413 if let Some(value) = ¶ms.limit_query {
1414 query.push(("limit".to_string(), value.clone()));
1415 }
1416 if let Some(value) = ¶ms._t {
1417 query.push(("_t".to_string(), value.clone()));
1418 }
1419 let query = if query.is_empty() { None } else { Some(query) };
1420
1421 let mut extra_headers = HeaderMap::new();
1422 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1423 let body = None;
1424
1425 self.client
1426 .request_json(
1427 Method::GET,
1428 &path,
1429 headers,
1430 query,
1431 body,
1432 params.disable_cache,
1433 )
1434 .await
1435 }
1436#[instrument(skip(self, params))]
1438 pub async fn get_misc_holiday_calendar(&self, params: GetMiscHolidayCalendarParams) -> Result<crate::models::GetMiscHolidayCalendar200Response> {
1439 let mut path = "/api/v1/misc/holiday-calendar".to_string();
1440
1441 let mut query: Vec<(String, String)> = Vec::new();
1442 if let Some(value) = ¶ms.date_query {
1443 query.push(("date".to_string(), value.clone()));
1444 }
1445 if let Some(value) = ¶ms.month_query {
1446 query.push(("month".to_string(), value.clone()));
1447 }
1448 if let Some(value) = ¶ms.year_query {
1449 query.push(("year".to_string(), value.clone()));
1450 }
1451 if let Some(value) = ¶ms.timezone_query {
1452 query.push(("timezone".to_string(), value.clone()));
1453 }
1454 if let Some(value) = ¶ms.holiday_type_query {
1455 query.push(("holiday_type".to_string(), value.clone()));
1456 }
1457 if let Some(value) = ¶ms.include_nearby_query {
1458 query.push(("include_nearby".to_string(), value.clone()));
1459 }
1460 if let Some(value) = ¶ms.nearby_limit_query {
1461 query.push(("nearby_limit".to_string(), value.clone()));
1462 }
1463 if let Some(value) = ¶ms._t {
1464 query.push(("_t".to_string(), value.clone()));
1465 }
1466 let query = if query.is_empty() { None } else { Some(query) };
1467
1468 let mut extra_headers = HeaderMap::new();
1469 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1470 let body = None;
1471
1472 self.client
1473 .request_json(
1474 Method::GET,
1475 &path,
1476 headers,
1477 query,
1478 body,
1479 params.disable_cache,
1480 )
1481 .await
1482 }
1483#[instrument(skip(self, params))]
1485 pub async fn get_misc_hotboard(&self, params: GetMiscHotboardParams) -> Result<crate::models::GetMiscHotboard200Response> {
1486 let mut path = "/api/v1/misc/hotboard".to_string();
1487
1488 let mut query: Vec<(String, String)> = Vec::new();
1489 query.push(("type".to_string(), params.type_query.clone()));
1490 if let Some(value) = ¶ms.time_query {
1491 query.push(("time".to_string(), value.clone()));
1492 }
1493 if let Some(value) = ¶ms.keyword_query {
1494 query.push(("keyword".to_string(), value.clone()));
1495 }
1496 if let Some(value) = ¶ms.time_start_query {
1497 query.push(("time_start".to_string(), value.clone()));
1498 }
1499 if let Some(value) = ¶ms.time_end_query {
1500 query.push(("time_end".to_string(), value.clone()));
1501 }
1502 if let Some(value) = ¶ms.limit_query {
1503 query.push(("limit".to_string(), value.clone()));
1504 }
1505 if let Some(value) = ¶ms.sources_query {
1506 query.push(("sources".to_string(), value.clone()));
1507 }
1508 if let Some(value) = ¶ms._t {
1509 query.push(("_t".to_string(), value.clone()));
1510 }
1511 let query = if query.is_empty() { None } else { Some(query) };
1512
1513 let mut extra_headers = HeaderMap::new();
1514 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1515 let body = None;
1516
1517 self.client
1518 .request_json(
1519 Method::GET,
1520 &path,
1521 headers,
1522 query,
1523 body,
1524 params.disable_cache,
1525 )
1526 .await
1527 }
1528#[instrument(skip(self, params))]
1530 pub async fn get_misc_lunartime(&self, params: GetMiscLunartimeParams) -> Result<crate::models::GetMiscLunartime200Response> {
1531 let mut path = "/api/v1/misc/lunartime".to_string();
1532
1533 let mut query: Vec<(String, String)> = Vec::new();
1534 if let Some(value) = ¶ms.ts_query {
1535 query.push(("ts".to_string(), value.clone()));
1536 }
1537 if let Some(value) = ¶ms.timezone_query {
1538 query.push(("timezone".to_string(), value.clone()));
1539 }
1540 if let Some(value) = ¶ms._t {
1541 query.push(("_t".to_string(), value.clone()));
1542 }
1543 let query = if query.is_empty() { None } else { Some(query) };
1544
1545 let mut extra_headers = HeaderMap::new();
1546 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1547 let body = None;
1548
1549 self.client
1550 .request_json(
1551 Method::GET,
1552 &path,
1553 headers,
1554 query,
1555 body,
1556 params.disable_cache,
1557 )
1558 .await
1559 }
1560#[instrument(skip(self, params))]
1562 pub async fn get_misc_phoneinfo(&self, params: GetMiscPhoneinfoParams) -> Result<crate::models::GetMiscPhoneinfo200Response> {
1563 let mut path = "/api/v1/misc/phoneinfo".to_string();
1564
1565 let mut query: Vec<(String, String)> = Vec::new();
1566 query.push(("phone".to_string(), params.phone_query.clone()));
1567 if let Some(value) = ¶ms._t {
1568 query.push(("_t".to_string(), value.clone()));
1569 }
1570 let query = if query.is_empty() { None } else { Some(query) };
1571
1572 let mut extra_headers = HeaderMap::new();
1573 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1574 let body = None;
1575
1576 self.client
1577 .request_json(
1578 Method::GET,
1579 &path,
1580 headers,
1581 query,
1582 body,
1583 params.disable_cache,
1584 )
1585 .await
1586 }
1587#[instrument(skip(self, params))]
1589 pub async fn get_misc_randomnumber(&self, params: GetMiscRandomnumberParams) -> Result<crate::models::GetMiscRandomnumber200Response> {
1590 let mut path = "/api/v1/misc/randomnumber".to_string();
1591
1592 let mut query: Vec<(String, String)> = Vec::new();
1593 if let Some(value) = ¶ms.min_query {
1594 query.push(("min".to_string(), value.clone()));
1595 }
1596 if let Some(value) = ¶ms.max_query {
1597 query.push(("max".to_string(), value.clone()));
1598 }
1599 if let Some(value) = ¶ms.count_query {
1600 query.push(("count".to_string(), value.clone()));
1601 }
1602 if let Some(value) = ¶ms.allow_repeat_query {
1603 query.push(("allow_repeat".to_string(), value.clone()));
1604 }
1605 if let Some(value) = ¶ms.allow_decimal_query {
1606 query.push(("allow_decimal".to_string(), value.clone()));
1607 }
1608 if let Some(value) = ¶ms.decimal_places_query {
1609 query.push(("decimal_places".to_string(), value.clone()));
1610 }
1611 if let Some(value) = ¶ms._t {
1612 query.push(("_t".to_string(), value.clone()));
1613 }
1614 let query = if query.is_empty() { None } else { Some(query) };
1615
1616 let mut extra_headers = HeaderMap::new();
1617 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1618 let body = None;
1619
1620 self.client
1621 .request_json(
1622 Method::GET,
1623 &path,
1624 headers,
1625 query,
1626 body,
1627 params.disable_cache,
1628 )
1629 .await
1630 }
1631#[instrument(skip(self, params))]
1633 pub async fn get_misc_timestamp(&self, params: GetMiscTimestampParams) -> Result<crate::models::GetMiscTimestamp200Response> {
1634 let mut path = "/api/v1/misc/timestamp".to_string();
1635
1636 let mut query: Vec<(String, String)> = Vec::new();
1637 query.push(("ts".to_string(), params.ts_query.clone()));
1638 if let Some(value) = ¶ms._t {
1639 query.push(("_t".to_string(), value.clone()));
1640 }
1641 let query = if query.is_empty() { None } else { Some(query) };
1642
1643 let mut extra_headers = HeaderMap::new();
1644 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1645 let body = None;
1646
1647 self.client
1648 .request_json(
1649 Method::GET,
1650 &path,
1651 headers,
1652 query,
1653 body,
1654 params.disable_cache,
1655 )
1656 .await
1657 }
1658#[instrument(skip(self))]
1660 pub async fn get_misc_tracking_carriers(&self) -> Result<crate::models::GetMiscTrackingCarriers200Response> {
1661 let mut path = "/api/v1/misc/tracking/carriers".to_string();
1662
1663 let mut query: Vec<(String, String)> = Vec::new();
1664 let query = if query.is_empty() { None } else { Some(query) };
1665
1666 let mut extra_headers = HeaderMap::new();
1667 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1668 let body = None;
1669
1670 self.client
1671 .request_json(
1672 Method::GET,
1673 &path,
1674 headers,
1675 query,
1676 body,
1677 None,
1678 )
1679 .await
1680 }
1681#[instrument(skip(self, params))]
1683 pub async fn get_misc_tracking_detect(&self, params: GetMiscTrackingDetectParams) -> Result<crate::models::GetMiscTrackingDetect200Response> {
1684 let mut path = "/api/v1/misc/tracking/detect".to_string();
1685
1686 let mut query: Vec<(String, String)> = Vec::new();
1687 query.push(("tracking_number".to_string(), params.tracking_number_query.clone()));
1688 if let Some(value) = ¶ms._t {
1689 query.push(("_t".to_string(), value.clone()));
1690 }
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 params.disable_cache,
1705 )
1706 .await
1707 }
1708#[instrument(skip(self, params))]
1710 pub async fn get_misc_tracking_query(&self, params: GetMiscTrackingQueryParams) -> Result<crate::models::GetMiscTrackingQuery200Response> {
1711 let mut path = "/api/v1/misc/tracking/query".to_string();
1712
1713 let mut query: Vec<(String, String)> = Vec::new();
1714 query.push(("tracking_number".to_string(), params.tracking_number_query.clone()));
1715 if let Some(value) = ¶ms.carrier_code_query {
1716 query.push(("carrier_code".to_string(), value.clone()));
1717 }
1718 if let Some(value) = ¶ms.phone_query {
1719 query.push(("phone".to_string(), value.clone()));
1720 }
1721 if let Some(value) = ¶ms._t {
1722 query.push(("_t".to_string(), value.clone()));
1723 }
1724 let query = if query.is_empty() { None } else { Some(query) };
1725
1726 let mut extra_headers = HeaderMap::new();
1727 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1728 let body = None;
1729
1730 self.client
1731 .request_json(
1732 Method::GET,
1733 &path,
1734 headers,
1735 query,
1736 body,
1737 params.disable_cache,
1738 )
1739 .await
1740 }
1741#[instrument(skip(self, params))]
1743 pub async fn get_misc_weather(&self, params: GetMiscWeatherParams) -> Result<crate::models::GetMiscWeather200Response> {
1744 let mut path = "/api/v1/misc/weather".to_string();
1745
1746 let mut query: Vec<(String, String)> = Vec::new();
1747 if let Some(value) = ¶ms.city_query {
1748 query.push(("city".to_string(), value.clone()));
1749 }
1750 if let Some(value) = ¶ms.adcode_query {
1751 query.push(("adcode".to_string(), value.clone()));
1752 }
1753 if let Some(value) = ¶ms.extended_query {
1754 query.push(("extended".to_string(), value.clone()));
1755 }
1756 if let Some(value) = ¶ms.forecast_query {
1757 query.push(("forecast".to_string(), value.clone()));
1758 }
1759 if let Some(value) = ¶ms.hourly_query {
1760 query.push(("hourly".to_string(), value.clone()));
1761 }
1762 if let Some(value) = ¶ms.minutely_query {
1763 query.push(("minutely".to_string(), value.clone()));
1764 }
1765 if let Some(value) = ¶ms.indices_query {
1766 query.push(("indices".to_string(), value.clone()));
1767 }
1768 if let Some(value) = ¶ms.lang_query {
1769 query.push(("lang".to_string(), value.clone()));
1770 }
1771 if let Some(value) = ¶ms._t {
1772 query.push(("_t".to_string(), value.clone()));
1773 }
1774 let query = if query.is_empty() { None } else { Some(query) };
1775
1776 let mut extra_headers = HeaderMap::new();
1777 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1778 let body = None;
1779
1780 self.client
1781 .request_json(
1782 Method::GET,
1783 &path,
1784 headers,
1785 query,
1786 body,
1787 params.disable_cache,
1788 )
1789 .await
1790 }
1791#[instrument(skip(self, params))]
1793 pub async fn get_misc_worldtime(&self, params: GetMiscWorldtimeParams) -> Result<crate::models::GetMiscWorldtime200Response> {
1794 let mut path = "/api/v1/misc/worldtime".to_string();
1795
1796 let mut query: Vec<(String, String)> = Vec::new();
1797 query.push(("city".to_string(), params.city_query.clone()));
1798 if let Some(value) = ¶ms._t {
1799 query.push(("_t".to_string(), value.clone()));
1800 }
1801 let query = if query.is_empty() { None } else { Some(query) };
1802
1803 let mut extra_headers = HeaderMap::new();
1804 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1805 let body = None;
1806
1807 self.client
1808 .request_json(
1809 Method::GET,
1810 &path,
1811 headers,
1812 query,
1813 body,
1814 params.disable_cache,
1815 )
1816 .await
1817 }
1818#[instrument(skip(self, params))]
1820 pub async fn post_misc_date_diff(&self, params: PostMiscDateDiffParams) -> Result<crate::models::PostMiscDateDiff200Response> {
1821 let mut path = "/api/v1/misc/date-diff".to_string();
1822
1823 let mut query: Vec<(String, String)> = Vec::new();
1824 if let Some(value) = ¶ms._t {
1825 query.push(("_t".to_string(), value.clone()));
1826 }
1827 let query = if query.is_empty() { None } else { Some(query) };
1828
1829 let mut extra_headers = HeaderMap::new();
1830 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
1831 let body = params.body.clone();
1832
1833 self.client
1834 .request_json(
1835 Method::POST,
1836 &path,
1837 headers,
1838 query,
1839 body,
1840 params.disable_cache,
1841 )
1842 .await
1843 }
1844}
1845
1846#[derive(Debug, Clone)]
1847pub struct GetHistoryProgrammerParams {
1848 pub month_query: String,
1849 pub day_query: String,
1850 pub disable_cache: Option<bool>,
1851 pub _t: Option<String>,
1852}
1853
1854impl GetHistoryProgrammerParams {
1855 pub fn new(month_query: impl Into<String>, day_query: impl Into<String>) -> Self {
1856 Self {
1857 month_query: month_query.into(),
1858 day_query: day_query.into(),
1859 disable_cache: None,
1860 _t: None,
1861 }
1862 }
1863 pub fn disable_cache(mut self, value: bool) -> Self {
1864 self.disable_cache = Some(value);
1865 self
1866 }
1867 pub fn _t(mut self, value: impl Into<String>) -> Self {
1868 self._t = Some(value.into());
1869 self
1870 }
1871}
1872
1873
1874#[derive(Debug, Clone)]
1875pub struct GetMiscDistrictParams {
1876 pub keywords_query: Option<String>,
1877 pub adcode_query: Option<String>,
1878 pub lat_query: Option<String>,
1879 pub lng_query: Option<String>,
1880 pub level_query: Option<String>,
1881 pub country_query: Option<String>,
1882 pub limit_query: Option<String>,
1883 pub disable_cache: Option<bool>,
1884 pub _t: Option<String>,
1885}
1886
1887impl GetMiscDistrictParams {
1888 pub fn new() -> Self {
1889 Self {
1890 keywords_query: None,
1891 adcode_query: None,
1892 lat_query: None,
1893 lng_query: None,
1894 level_query: None,
1895 country_query: None,
1896 limit_query: None,
1897 disable_cache: None,
1898 _t: None,
1899 }
1900 }
1901 pub fn keywords_query(mut self, value: impl Into<String>) -> Self {
1902 self.keywords_query = Some(value.into());
1903 self
1904 }
1905 pub fn adcode_query(mut self, value: impl Into<String>) -> Self {
1906 self.adcode_query = Some(value.into());
1907 self
1908 }
1909 pub fn lat_query(mut self, value: impl Into<String>) -> Self {
1910 self.lat_query = Some(value.into());
1911 self
1912 }
1913 pub fn lng_query(mut self, value: impl Into<String>) -> Self {
1914 self.lng_query = Some(value.into());
1915 self
1916 }
1917 pub fn level_query(mut self, value: impl Into<String>) -> Self {
1918 self.level_query = Some(value.into());
1919 self
1920 }
1921 pub fn country_query(mut self, value: impl Into<String>) -> Self {
1922 self.country_query = Some(value.into());
1923 self
1924 }
1925 pub fn limit_query(mut self, value: impl Into<String>) -> Self {
1926 self.limit_query = Some(value.into());
1927 self
1928 }
1929 pub fn disable_cache(mut self, value: bool) -> Self {
1930 self.disable_cache = Some(value);
1931 self
1932 }
1933 pub fn _t(mut self, value: impl Into<String>) -> Self {
1934 self._t = Some(value.into());
1935 self
1936 }
1937}
1938
1939#[derive(Debug, Clone)]
1940pub struct GetMiscHolidayCalendarParams {
1941 pub date_query: Option<String>,
1942 pub month_query: Option<String>,
1943 pub year_query: Option<String>,
1944 pub timezone_query: Option<String>,
1945 pub holiday_type_query: Option<String>,
1946 pub include_nearby_query: Option<String>,
1947 pub nearby_limit_query: Option<String>,
1948 pub disable_cache: Option<bool>,
1949 pub _t: Option<String>,
1950}
1951
1952impl GetMiscHolidayCalendarParams {
1953 pub fn new() -> Self {
1954 Self {
1955 date_query: None,
1956 month_query: None,
1957 year_query: None,
1958 timezone_query: None,
1959 holiday_type_query: None,
1960 include_nearby_query: None,
1961 nearby_limit_query: None,
1962 disable_cache: None,
1963 _t: None,
1964 }
1965 }
1966 pub fn date_query(mut self, value: impl Into<String>) -> Self {
1967 self.date_query = Some(value.into());
1968 self
1969 }
1970 pub fn month_query(mut self, value: impl Into<String>) -> Self {
1971 self.month_query = Some(value.into());
1972 self
1973 }
1974 pub fn year_query(mut self, value: impl Into<String>) -> Self {
1975 self.year_query = Some(value.into());
1976 self
1977 }
1978 pub fn timezone_query(mut self, value: impl Into<String>) -> Self {
1979 self.timezone_query = Some(value.into());
1980 self
1981 }
1982 pub fn holiday_type_query(mut self, value: impl Into<String>) -> Self {
1983 self.holiday_type_query = Some(value.into());
1984 self
1985 }
1986 pub fn include_nearby_query(mut self, value: impl Into<String>) -> Self {
1987 self.include_nearby_query = Some(value.into());
1988 self
1989 }
1990 pub fn nearby_limit_query(mut self, value: impl Into<String>) -> Self {
1991 self.nearby_limit_query = Some(value.into());
1992 self
1993 }
1994 pub fn disable_cache(mut self, value: bool) -> Self {
1995 self.disable_cache = Some(value);
1996 self
1997 }
1998 pub fn _t(mut self, value: impl Into<String>) -> Self {
1999 self._t = Some(value.into());
2000 self
2001 }
2002}
2003
2004#[derive(Debug, Clone)]
2005pub struct GetMiscHotboardParams {
2006 pub type_query: String,
2007 pub time_query: Option<String>,
2008 pub keyword_query: Option<String>,
2009 pub time_start_query: Option<String>,
2010 pub time_end_query: Option<String>,
2011 pub limit_query: Option<String>,
2012 pub sources_query: Option<String>,
2013 pub disable_cache: Option<bool>,
2014 pub _t: Option<String>,
2015}
2016
2017impl GetMiscHotboardParams {
2018 pub fn new(type_query: impl Into<String>) -> Self {
2019 Self {
2020 type_query: type_query.into(),
2021 time_query: None,
2022 keyword_query: None,
2023 time_start_query: None,
2024 time_end_query: None,
2025 limit_query: None,
2026 sources_query: None,
2027 disable_cache: None,
2028 _t: None,
2029 }
2030 }
2031 pub fn time_query(mut self, value: impl Into<String>) -> Self {
2032 self.time_query = Some(value.into());
2033 self
2034 }
2035 pub fn keyword_query(mut self, value: impl Into<String>) -> Self {
2036 self.keyword_query = Some(value.into());
2037 self
2038 }
2039 pub fn time_start_query(mut self, value: impl Into<String>) -> Self {
2040 self.time_start_query = Some(value.into());
2041 self
2042 }
2043 pub fn time_end_query(mut self, value: impl Into<String>) -> Self {
2044 self.time_end_query = Some(value.into());
2045 self
2046 }
2047 pub fn limit_query(mut self, value: impl Into<String>) -> Self {
2048 self.limit_query = Some(value.into());
2049 self
2050 }
2051 pub fn sources_query(mut self, value: impl Into<String>) -> Self {
2052 self.sources_query = Some(value.into());
2053 self
2054 }
2055 pub fn disable_cache(mut self, value: bool) -> Self {
2056 self.disable_cache = Some(value);
2057 self
2058 }
2059 pub fn _t(mut self, value: impl Into<String>) -> Self {
2060 self._t = Some(value.into());
2061 self
2062 }
2063}
2064
2065#[derive(Debug, Clone)]
2066pub struct GetMiscLunartimeParams {
2067 pub ts_query: Option<String>,
2068 pub timezone_query: Option<String>,
2069 pub disable_cache: Option<bool>,
2070 pub _t: Option<String>,
2071}
2072
2073impl GetMiscLunartimeParams {
2074 pub fn new() -> Self {
2075 Self {
2076 ts_query: None,
2077 timezone_query: None,
2078 disable_cache: None,
2079 _t: None,
2080 }
2081 }
2082 pub fn ts_query(mut self, value: impl Into<String>) -> Self {
2083 self.ts_query = Some(value.into());
2084 self
2085 }
2086 pub fn timezone_query(mut self, value: impl Into<String>) -> Self {
2087 self.timezone_query = Some(value.into());
2088 self
2089 }
2090 pub fn disable_cache(mut self, value: bool) -> Self {
2091 self.disable_cache = Some(value);
2092 self
2093 }
2094 pub fn _t(mut self, value: impl Into<String>) -> Self {
2095 self._t = Some(value.into());
2096 self
2097 }
2098}
2099
2100#[derive(Debug, Clone)]
2101pub struct GetMiscPhoneinfoParams {
2102 pub phone_query: String,
2103 pub disable_cache: Option<bool>,
2104 pub _t: Option<String>,
2105}
2106
2107impl GetMiscPhoneinfoParams {
2108 pub fn new(phone_query: impl Into<String>) -> Self {
2109 Self {
2110 phone_query: phone_query.into(),
2111 disable_cache: None,
2112 _t: None,
2113 }
2114 }
2115 pub fn disable_cache(mut self, value: bool) -> Self {
2116 self.disable_cache = Some(value);
2117 self
2118 }
2119 pub fn _t(mut self, value: impl Into<String>) -> Self {
2120 self._t = Some(value.into());
2121 self
2122 }
2123}
2124
2125#[derive(Debug, Clone)]
2126pub struct GetMiscRandomnumberParams {
2127 pub min_query: Option<String>,
2128 pub max_query: Option<String>,
2129 pub count_query: Option<String>,
2130 pub allow_repeat_query: Option<String>,
2131 pub allow_decimal_query: Option<String>,
2132 pub decimal_places_query: Option<String>,
2133 pub disable_cache: Option<bool>,
2134 pub _t: Option<String>,
2135}
2136
2137impl GetMiscRandomnumberParams {
2138 pub fn new() -> Self {
2139 Self {
2140 min_query: None,
2141 max_query: None,
2142 count_query: None,
2143 allow_repeat_query: None,
2144 allow_decimal_query: None,
2145 decimal_places_query: None,
2146 disable_cache: None,
2147 _t: None,
2148 }
2149 }
2150 pub fn min_query(mut self, value: impl Into<String>) -> Self {
2151 self.min_query = Some(value.into());
2152 self
2153 }
2154 pub fn max_query(mut self, value: impl Into<String>) -> Self {
2155 self.max_query = Some(value.into());
2156 self
2157 }
2158 pub fn count_query(mut self, value: impl Into<String>) -> Self {
2159 self.count_query = Some(value.into());
2160 self
2161 }
2162 pub fn allow_repeat_query(mut self, value: impl Into<String>) -> Self {
2163 self.allow_repeat_query = Some(value.into());
2164 self
2165 }
2166 pub fn allow_decimal_query(mut self, value: impl Into<String>) -> Self {
2167 self.allow_decimal_query = Some(value.into());
2168 self
2169 }
2170 pub fn decimal_places_query(mut self, value: impl Into<String>) -> Self {
2171 self.decimal_places_query = Some(value.into());
2172 self
2173 }
2174 pub fn disable_cache(mut self, value: bool) -> Self {
2175 self.disable_cache = Some(value);
2176 self
2177 }
2178 pub fn _t(mut self, value: impl Into<String>) -> Self {
2179 self._t = Some(value.into());
2180 self
2181 }
2182}
2183
2184#[derive(Debug, Clone)]
2185pub struct GetMiscTimestampParams {
2186 pub ts_query: String,
2187 pub disable_cache: Option<bool>,
2188 pub _t: Option<String>,
2189}
2190
2191impl GetMiscTimestampParams {
2192 pub fn new(ts_query: impl Into<String>) -> Self {
2193 Self {
2194 ts_query: ts_query.into(),
2195 disable_cache: None,
2196 _t: None,
2197 }
2198 }
2199 pub fn disable_cache(mut self, value: bool) -> Self {
2200 self.disable_cache = Some(value);
2201 self
2202 }
2203 pub fn _t(mut self, value: impl Into<String>) -> Self {
2204 self._t = Some(value.into());
2205 self
2206 }
2207}
2208
2209
2210#[derive(Debug, Clone)]
2211pub struct GetMiscTrackingDetectParams {
2212 pub tracking_number_query: String,
2213 pub disable_cache: Option<bool>,
2214 pub _t: Option<String>,
2215}
2216
2217impl GetMiscTrackingDetectParams {
2218 pub fn new(tracking_number_query: impl Into<String>) -> Self {
2219 Self {
2220 tracking_number_query: tracking_number_query.into(),
2221 disable_cache: None,
2222 _t: None,
2223 }
2224 }
2225 pub fn disable_cache(mut self, value: bool) -> Self {
2226 self.disable_cache = Some(value);
2227 self
2228 }
2229 pub fn _t(mut self, value: impl Into<String>) -> Self {
2230 self._t = Some(value.into());
2231 self
2232 }
2233}
2234
2235#[derive(Debug, Clone)]
2236pub struct GetMiscTrackingQueryParams {
2237 pub tracking_number_query: String,
2238 pub carrier_code_query: Option<String>,
2239 pub phone_query: Option<String>,
2240 pub disable_cache: Option<bool>,
2241 pub _t: Option<String>,
2242}
2243
2244impl GetMiscTrackingQueryParams {
2245 pub fn new(tracking_number_query: impl Into<String>) -> Self {
2246 Self {
2247 tracking_number_query: tracking_number_query.into(),
2248 carrier_code_query: None,
2249 phone_query: None,
2250 disable_cache: None,
2251 _t: None,
2252 }
2253 }
2254 pub fn carrier_code_query(mut self, value: impl Into<String>) -> Self {
2255 self.carrier_code_query = Some(value.into());
2256 self
2257 }
2258 pub fn phone_query(mut self, value: impl Into<String>) -> Self {
2259 self.phone_query = Some(value.into());
2260 self
2261 }
2262 pub fn disable_cache(mut self, value: bool) -> Self {
2263 self.disable_cache = Some(value);
2264 self
2265 }
2266 pub fn _t(mut self, value: impl Into<String>) -> Self {
2267 self._t = Some(value.into());
2268 self
2269 }
2270}
2271
2272#[derive(Debug, Clone)]
2273pub struct GetMiscWeatherParams {
2274 pub city_query: Option<String>,
2275 pub adcode_query: Option<String>,
2276 pub extended_query: Option<String>,
2277 pub forecast_query: Option<String>,
2278 pub hourly_query: Option<String>,
2279 pub minutely_query: Option<String>,
2280 pub indices_query: Option<String>,
2281 pub lang_query: Option<String>,
2282 pub disable_cache: Option<bool>,
2283 pub _t: Option<String>,
2284}
2285
2286impl GetMiscWeatherParams {
2287 pub fn new() -> Self {
2288 Self {
2289 city_query: None,
2290 adcode_query: None,
2291 extended_query: None,
2292 forecast_query: None,
2293 hourly_query: None,
2294 minutely_query: None,
2295 indices_query: None,
2296 lang_query: None,
2297 disable_cache: None,
2298 _t: None,
2299 }
2300 }
2301 pub fn city_query(mut self, value: impl Into<String>) -> Self {
2302 self.city_query = Some(value.into());
2303 self
2304 }
2305 pub fn adcode_query(mut self, value: impl Into<String>) -> Self {
2306 self.adcode_query = Some(value.into());
2307 self
2308 }
2309 pub fn extended_query(mut self, value: impl Into<String>) -> Self {
2310 self.extended_query = Some(value.into());
2311 self
2312 }
2313 pub fn forecast_query(mut self, value: impl Into<String>) -> Self {
2314 self.forecast_query = Some(value.into());
2315 self
2316 }
2317 pub fn hourly_query(mut self, value: impl Into<String>) -> Self {
2318 self.hourly_query = Some(value.into());
2319 self
2320 }
2321 pub fn minutely_query(mut self, value: impl Into<String>) -> Self {
2322 self.minutely_query = Some(value.into());
2323 self
2324 }
2325 pub fn indices_query(mut self, value: impl Into<String>) -> Self {
2326 self.indices_query = Some(value.into());
2327 self
2328 }
2329 pub fn lang_query(mut self, value: impl Into<String>) -> Self {
2330 self.lang_query = Some(value.into());
2331 self
2332 }
2333 pub fn disable_cache(mut self, value: bool) -> Self {
2334 self.disable_cache = Some(value);
2335 self
2336 }
2337 pub fn _t(mut self, value: impl Into<String>) -> Self {
2338 self._t = Some(value.into());
2339 self
2340 }
2341}
2342
2343#[derive(Debug, Clone)]
2344pub struct GetMiscWorldtimeParams {
2345 pub city_query: String,
2346 pub disable_cache: Option<bool>,
2347 pub _t: Option<String>,
2348}
2349
2350impl GetMiscWorldtimeParams {
2351 pub fn new(city_query: impl Into<String>) -> Self {
2352 Self {
2353 city_query: city_query.into(),
2354 disable_cache: None,
2355 _t: None,
2356 }
2357 }
2358 pub fn disable_cache(mut self, value: bool) -> Self {
2359 self.disable_cache = Some(value);
2360 self
2361 }
2362 pub fn _t(mut self, value: impl Into<String>) -> Self {
2363 self._t = Some(value.into());
2364 self
2365 }
2366}
2367
2368#[derive(Debug, Clone)]
2369pub struct PostMiscDateDiffParams {
2370 pub body: Option<Value>,
2371 pub disable_cache: Option<bool>,
2372 pub _t: Option<String>,
2373}
2374
2375impl PostMiscDateDiffParams {
2376 pub fn new() -> Self {
2377 Self {
2378 body: None,
2379 disable_cache: None,
2380 _t: None,
2381 }
2382 }
2383 pub fn disable_cache(mut self, value: bool) -> Self {
2384 self.disable_cache = Some(value);
2385 self
2386 }
2387 pub fn _t(mut self, value: impl Into<String>) -> Self {
2388 self._t = Some(value.into());
2389 self
2390 }
2391 pub fn body(mut self, value: Value) -> Self {
2392 self.body = Some(value);
2393 self
2394 }
2395}
2396#[derive(Debug, Clone)]
2397pub struct NetworkService<'a> {
2398 pub(crate) client: &'a Client,
2399}
2400
2401impl<'a> NetworkService<'a> {
2402#[instrument(skip(self, params))]
2404 pub async fn get_network_dns(&self, params: GetNetworkDnsParams) -> Result<crate::models::GetNetworkDns200Response> {
2405 let mut path = "/api/v1/network/dns".to_string();
2406
2407 let mut query: Vec<(String, String)> = Vec::new();
2408 query.push(("domain".to_string(), params.domain_query.clone()));
2409 if let Some(value) = ¶ms.type_query {
2410 query.push(("type".to_string(), value.clone()));
2411 }
2412 if let Some(value) = ¶ms._t {
2413 query.push(("_t".to_string(), value.clone()));
2414 }
2415 let query = if query.is_empty() { None } else { Some(query) };
2416
2417 let mut extra_headers = HeaderMap::new();
2418 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2419 let body = None;
2420
2421 self.client
2422 .request_json(
2423 Method::GET,
2424 &path,
2425 headers,
2426 query,
2427 body,
2428 params.disable_cache,
2429 )
2430 .await
2431 }
2432#[instrument(skip(self, params))]
2434 pub async fn get_network_icp(&self, params: GetNetworkIcpParams) -> Result<crate::models::GetNetworkIcp200Response> {
2435 let mut path = "/api/v1/network/icp".to_string();
2436
2437 let mut query: Vec<(String, String)> = Vec::new();
2438 query.push(("domain".to_string(), params.domain_query.clone()));
2439 if let Some(value) = ¶ms._t {
2440 query.push(("_t".to_string(), value.clone()));
2441 }
2442 let query = if query.is_empty() { None } else { Some(query) };
2443
2444 let mut extra_headers = HeaderMap::new();
2445 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2446 let body = None;
2447
2448 self.client
2449 .request_json(
2450 Method::GET,
2451 &path,
2452 headers,
2453 query,
2454 body,
2455 params.disable_cache,
2456 )
2457 .await
2458 }
2459#[instrument(skip(self, params))]
2461 pub async fn get_network_ipinfo(&self, params: GetNetworkIpinfoParams) -> Result<crate::models::GetNetworkIpinfo200Response> {
2462 let mut path = "/api/v1/network/ipinfo".to_string();
2463
2464 let mut query: Vec<(String, String)> = Vec::new();
2465 query.push(("ip".to_string(), params.ip_query.clone()));
2466 if let Some(value) = ¶ms.source_query {
2467 query.push(("source".to_string(), value.clone()));
2468 }
2469 if let Some(value) = ¶ms._t {
2470 query.push(("_t".to_string(), value.clone()));
2471 }
2472 let query = if query.is_empty() { None } else { Some(query) };
2473
2474 let mut extra_headers = HeaderMap::new();
2475 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2476 let body = None;
2477
2478 self.client
2479 .request_json(
2480 Method::GET,
2481 &path,
2482 headers,
2483 query,
2484 body,
2485 params.disable_cache,
2486 )
2487 .await
2488 }
2489#[instrument(skip(self, params))]
2491 pub async fn get_network_myip(&self, params: GetNetworkMyipParams) -> Result<crate::models::GetNetworkMyip200Response> {
2492 let mut path = "/api/v1/network/myip".to_string();
2493
2494 let mut query: Vec<(String, String)> = Vec::new();
2495 if let Some(value) = ¶ms.source_query {
2496 query.push(("source".to_string(), value.clone()));
2497 }
2498 if let Some(value) = ¶ms._t {
2499 query.push(("_t".to_string(), value.clone()));
2500 }
2501 let query = if query.is_empty() { None } else { Some(query) };
2502
2503 let mut extra_headers = HeaderMap::new();
2504 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2505 let body = None;
2506
2507 self.client
2508 .request_json(
2509 Method::GET,
2510 &path,
2511 headers,
2512 query,
2513 body,
2514 params.disable_cache,
2515 )
2516 .await
2517 }
2518#[instrument(skip(self, params))]
2520 pub async fn get_network_ping(&self, params: GetNetworkPingParams) -> Result<crate::models::GetNetworkPing200Response> {
2521 let mut path = "/api/v1/network/ping".to_string();
2522
2523 let mut query: Vec<(String, String)> = Vec::new();
2524 query.push(("host".to_string(), params.host_query.clone()));
2525 if let Some(value) = ¶ms._t {
2526 query.push(("_t".to_string(), value.clone()));
2527 }
2528 let query = if query.is_empty() { None } else { Some(query) };
2529
2530 let mut extra_headers = HeaderMap::new();
2531 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2532 let body = None;
2533
2534 self.client
2535 .request_json(
2536 Method::GET,
2537 &path,
2538 headers,
2539 query,
2540 body,
2541 params.disable_cache,
2542 )
2543 .await
2544 }
2545#[instrument(skip(self))]
2547 pub async fn get_network_pingmyip(&self) -> Result<crate::models::GetNetworkPingmyip200Response> {
2548 let mut path = "/api/v1/network/pingmyip".to_string();
2549
2550 let mut query: Vec<(String, String)> = Vec::new();
2551 let query = if query.is_empty() { None } else { Some(query) };
2552
2553 let mut extra_headers = HeaderMap::new();
2554 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2555 let body = None;
2556
2557 self.client
2558 .request_json(
2559 Method::GET,
2560 &path,
2561 headers,
2562 query,
2563 body,
2564 None,
2565 )
2566 .await
2567 }
2568#[instrument(skip(self, params))]
2570 pub async fn get_network_portscan(&self, params: GetNetworkPortscanParams) -> Result<crate::models::GetNetworkPortscan200Response> {
2571 let mut path = "/api/v1/network/portscan".to_string();
2572
2573 let mut query: Vec<(String, String)> = Vec::new();
2574 query.push(("host".to_string(), params.host_query.clone()));
2575 query.push(("port".to_string(), params.port_query.clone()));
2576 if let Some(value) = ¶ms.protocol_query {
2577 query.push(("protocol".to_string(), value.clone()));
2578 }
2579 if let Some(value) = ¶ms._t {
2580 query.push(("_t".to_string(), value.clone()));
2581 }
2582 let query = if query.is_empty() { None } else { Some(query) };
2583
2584 let mut extra_headers = HeaderMap::new();
2585 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2586 let body = None;
2587
2588 self.client
2589 .request_json(
2590 Method::GET,
2591 &path,
2592 headers,
2593 query,
2594 body,
2595 params.disable_cache,
2596 )
2597 .await
2598 }
2599#[instrument(skip(self, params))]
2601 pub async fn get_network_urlstatus(&self, params: GetNetworkUrlstatusParams) -> Result<crate::models::GetNetworkUrlstatus200Response> {
2602 let mut path = "/api/v1/network/urlstatus".to_string();
2603
2604 let mut query: Vec<(String, String)> = Vec::new();
2605 query.push(("url".to_string(), params.url_query.clone()));
2606 if let Some(value) = ¶ms._t {
2607 query.push(("_t".to_string(), value.clone()));
2608 }
2609 let query = if query.is_empty() { None } else { Some(query) };
2610
2611 let mut extra_headers = HeaderMap::new();
2612 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2613 let body = None;
2614
2615 self.client
2616 .request_json(
2617 Method::GET,
2618 &path,
2619 headers,
2620 query,
2621 body,
2622 params.disable_cache,
2623 )
2624 .await
2625 }
2626#[instrument(skip(self, params))]
2628 pub async fn get_network_whois(&self, params: GetNetworkWhoisParams) -> Result<crate::models::GetNetworkWhois200Response> {
2629 let mut path = "/api/v1/network/whois".to_string();
2630
2631 let mut query: Vec<(String, String)> = Vec::new();
2632 query.push(("domain".to_string(), params.domain_query.clone()));
2633 if let Some(value) = ¶ms.format_query {
2634 query.push(("format".to_string(), value.clone()));
2635 }
2636 if let Some(value) = ¶ms._t {
2637 query.push(("_t".to_string(), value.clone()));
2638 }
2639 let query = if query.is_empty() { None } else { Some(query) };
2640
2641 let mut extra_headers = HeaderMap::new();
2642 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2643 let body = None;
2644
2645 self.client
2646 .request_json(
2647 Method::GET,
2648 &path,
2649 headers,
2650 query,
2651 body,
2652 params.disable_cache,
2653 )
2654 .await
2655 }
2656#[instrument(skip(self, params))]
2658 pub async fn get_network_wxdomain(&self, params: GetNetworkWxdomainParams) -> Result<crate::models::GetNetworkWxdomain200Response> {
2659 let mut path = "/api/v1/network/wxdomain".to_string();
2660
2661 let mut query: Vec<(String, String)> = Vec::new();
2662 query.push(("domain".to_string(), params.domain_query.clone()));
2663 if let Some(value) = ¶ms._t {
2664 query.push(("_t".to_string(), value.clone()));
2665 }
2666 let query = if query.is_empty() { None } else { Some(query) };
2667
2668 let mut extra_headers = HeaderMap::new();
2669 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2670 let body = None;
2671
2672 self.client
2673 .request_json(
2674 Method::GET,
2675 &path,
2676 headers,
2677 query,
2678 body,
2679 params.disable_cache,
2680 )
2681 .await
2682 }
2683}
2684
2685#[derive(Debug, Clone)]
2686pub struct GetNetworkDnsParams {
2687 pub domain_query: String,
2688 pub type_query: Option<String>,
2689 pub disable_cache: Option<bool>,
2690 pub _t: Option<String>,
2691}
2692
2693impl GetNetworkDnsParams {
2694 pub fn new(domain_query: impl Into<String>) -> Self {
2695 Self {
2696 domain_query: domain_query.into(),
2697 type_query: None,
2698 disable_cache: None,
2699 _t: None,
2700 }
2701 }
2702 pub fn type_query(mut self, value: impl Into<String>) -> Self {
2703 self.type_query = Some(value.into());
2704 self
2705 }
2706 pub fn disable_cache(mut self, value: bool) -> Self {
2707 self.disable_cache = Some(value);
2708 self
2709 }
2710 pub fn _t(mut self, value: impl Into<String>) -> Self {
2711 self._t = Some(value.into());
2712 self
2713 }
2714}
2715
2716#[derive(Debug, Clone)]
2717pub struct GetNetworkIcpParams {
2718 pub domain_query: String,
2719 pub disable_cache: Option<bool>,
2720 pub _t: Option<String>,
2721}
2722
2723impl GetNetworkIcpParams {
2724 pub fn new(domain_query: impl Into<String>) -> Self {
2725 Self {
2726 domain_query: domain_query.into(),
2727 disable_cache: None,
2728 _t: None,
2729 }
2730 }
2731 pub fn disable_cache(mut self, value: bool) -> Self {
2732 self.disable_cache = Some(value);
2733 self
2734 }
2735 pub fn _t(mut self, value: impl Into<String>) -> Self {
2736 self._t = Some(value.into());
2737 self
2738 }
2739}
2740
2741#[derive(Debug, Clone)]
2742pub struct GetNetworkIpinfoParams {
2743 pub ip_query: String,
2744 pub source_query: Option<String>,
2745 pub disable_cache: Option<bool>,
2746 pub _t: Option<String>,
2747}
2748
2749impl GetNetworkIpinfoParams {
2750 pub fn new(ip_query: impl Into<String>) -> Self {
2751 Self {
2752 ip_query: ip_query.into(),
2753 source_query: None,
2754 disable_cache: None,
2755 _t: None,
2756 }
2757 }
2758 pub fn source_query(mut self, value: impl Into<String>) -> Self {
2759 self.source_query = Some(value.into());
2760 self
2761 }
2762 pub fn disable_cache(mut self, value: bool) -> Self {
2763 self.disable_cache = Some(value);
2764 self
2765 }
2766 pub fn _t(mut self, value: impl Into<String>) -> Self {
2767 self._t = Some(value.into());
2768 self
2769 }
2770}
2771
2772#[derive(Debug, Clone)]
2773pub struct GetNetworkMyipParams {
2774 pub source_query: Option<String>,
2775 pub disable_cache: Option<bool>,
2776 pub _t: Option<String>,
2777}
2778
2779impl GetNetworkMyipParams {
2780 pub fn new() -> Self {
2781 Self {
2782 source_query: None,
2783 disable_cache: None,
2784 _t: None,
2785 }
2786 }
2787 pub fn source_query(mut self, value: impl Into<String>) -> Self {
2788 self.source_query = Some(value.into());
2789 self
2790 }
2791 pub fn disable_cache(mut self, value: bool) -> Self {
2792 self.disable_cache = Some(value);
2793 self
2794 }
2795 pub fn _t(mut self, value: impl Into<String>) -> Self {
2796 self._t = Some(value.into());
2797 self
2798 }
2799}
2800
2801#[derive(Debug, Clone)]
2802pub struct GetNetworkPingParams {
2803 pub host_query: String,
2804 pub disable_cache: Option<bool>,
2805 pub _t: Option<String>,
2806}
2807
2808impl GetNetworkPingParams {
2809 pub fn new(host_query: impl Into<String>) -> Self {
2810 Self {
2811 host_query: host_query.into(),
2812 disable_cache: None,
2813 _t: None,
2814 }
2815 }
2816 pub fn disable_cache(mut self, value: bool) -> Self {
2817 self.disable_cache = Some(value);
2818 self
2819 }
2820 pub fn _t(mut self, value: impl Into<String>) -> Self {
2821 self._t = Some(value.into());
2822 self
2823 }
2824}
2825
2826
2827#[derive(Debug, Clone)]
2828pub struct GetNetworkPortscanParams {
2829 pub host_query: String,
2830 pub port_query: String,
2831 pub protocol_query: Option<String>,
2832 pub disable_cache: Option<bool>,
2833 pub _t: Option<String>,
2834}
2835
2836impl GetNetworkPortscanParams {
2837 pub fn new(host_query: impl Into<String>, port_query: impl Into<String>) -> Self {
2838 Self {
2839 host_query: host_query.into(),
2840 port_query: port_query.into(),
2841 protocol_query: None,
2842 disable_cache: None,
2843 _t: None,
2844 }
2845 }
2846 pub fn protocol_query(mut self, value: impl Into<String>) -> Self {
2847 self.protocol_query = Some(value.into());
2848 self
2849 }
2850 pub fn disable_cache(mut self, value: bool) -> Self {
2851 self.disable_cache = Some(value);
2852 self
2853 }
2854 pub fn _t(mut self, value: impl Into<String>) -> Self {
2855 self._t = Some(value.into());
2856 self
2857 }
2858}
2859
2860#[derive(Debug, Clone)]
2861pub struct GetNetworkUrlstatusParams {
2862 pub url_query: String,
2863 pub disable_cache: Option<bool>,
2864 pub _t: Option<String>,
2865}
2866
2867impl GetNetworkUrlstatusParams {
2868 pub fn new(url_query: impl Into<String>) -> Self {
2869 Self {
2870 url_query: url_query.into(),
2871 disable_cache: None,
2872 _t: None,
2873 }
2874 }
2875 pub fn disable_cache(mut self, value: bool) -> Self {
2876 self.disable_cache = Some(value);
2877 self
2878 }
2879 pub fn _t(mut self, value: impl Into<String>) -> Self {
2880 self._t = Some(value.into());
2881 self
2882 }
2883}
2884
2885#[derive(Debug, Clone)]
2886pub struct GetNetworkWhoisParams {
2887 pub domain_query: String,
2888 pub format_query: Option<String>,
2889 pub disable_cache: Option<bool>,
2890 pub _t: Option<String>,
2891}
2892
2893impl GetNetworkWhoisParams {
2894 pub fn new(domain_query: impl Into<String>) -> Self {
2895 Self {
2896 domain_query: domain_query.into(),
2897 format_query: None,
2898 disable_cache: None,
2899 _t: None,
2900 }
2901 }
2902 pub fn format_query(mut self, value: impl Into<String>) -> Self {
2903 self.format_query = Some(value.into());
2904 self
2905 }
2906 pub fn disable_cache(mut self, value: bool) -> Self {
2907 self.disable_cache = Some(value);
2908 self
2909 }
2910 pub fn _t(mut self, value: impl Into<String>) -> Self {
2911 self._t = Some(value.into());
2912 self
2913 }
2914}
2915
2916#[derive(Debug, Clone)]
2917pub struct GetNetworkWxdomainParams {
2918 pub domain_query: String,
2919 pub disable_cache: Option<bool>,
2920 pub _t: Option<String>,
2921}
2922
2923impl GetNetworkWxdomainParams {
2924 pub fn new(domain_query: impl Into<String>) -> Self {
2925 Self {
2926 domain_query: domain_query.into(),
2927 disable_cache: None,
2928 _t: None,
2929 }
2930 }
2931 pub fn disable_cache(mut self, value: bool) -> Self {
2932 self.disable_cache = Some(value);
2933 self
2934 }
2935 pub fn _t(mut self, value: impl Into<String>) -> Self {
2936 self._t = Some(value.into());
2937 self
2938 }
2939}
2940#[derive(Debug, Clone)]
2941pub struct PoemService<'a> {
2942 pub(crate) client: &'a Client,
2943}
2944
2945impl<'a> PoemService<'a> {
2946#[instrument(skip(self))]
2948 pub async fn get_saying(&self) -> Result<crate::models::GetSaying200Response> {
2949 let mut path = "/api/v1/saying".to_string();
2950
2951 let mut query: Vec<(String, String)> = Vec::new();
2952 let query = if query.is_empty() { None } else { Some(query) };
2953
2954 let mut extra_headers = HeaderMap::new();
2955 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2956 let body = None;
2957
2958 self.client
2959 .request_json(
2960 Method::GET,
2961 &path,
2962 headers,
2963 query,
2964 body,
2965 None,
2966 )
2967 .await
2968 }
2969}
2970
2971#[derive(Debug, Clone)]
2972pub struct RandomService<'a> {
2973 pub(crate) client: &'a Client,
2974}
2975
2976impl<'a> RandomService<'a> {
2977#[instrument(skip(self, params))]
2979 pub async fn get_answerbook_ask(&self, params: GetAnswerbookAskParams) -> Result<crate::models::GetAnswerbookAsk200Response> {
2980 let mut path = "/api/v1/answerbook/ask".to_string();
2981
2982 let mut query: Vec<(String, String)> = Vec::new();
2983 query.push(("question".to_string(), params.question_query.clone()));
2984 if let Some(value) = ¶ms._t {
2985 query.push(("_t".to_string(), value.clone()));
2986 }
2987 let query = if query.is_empty() { None } else { Some(query) };
2988
2989 let mut extra_headers = HeaderMap::new();
2990 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
2991 let body = None;
2992
2993 self.client
2994 .request_json(
2995 Method::GET,
2996 &path,
2997 headers,
2998 query,
2999 body,
3000 params.disable_cache,
3001 )
3002 .await
3003 }
3004#[instrument(skip(self, params))]
3006 pub async fn get_random_image(&self, params: GetRandomImageParams) -> Result<Vec<u8>> {
3007 let mut path = "/api/v1/random/image".to_string();
3008
3009 let mut query: Vec<(String, String)> = Vec::new();
3010 if let Some(value) = ¶ms.category_query {
3011 query.push(("category".to_string(), value.clone()));
3012 }
3013 if let Some(value) = ¶ms.type_query {
3014 query.push(("type".to_string(), value.clone()));
3015 }
3016 if let Some(value) = ¶ms._t {
3017 query.push(("_t".to_string(), value.clone()));
3018 }
3019 let query = if query.is_empty() { None } else { Some(query) };
3020
3021 let mut extra_headers = HeaderMap::new();
3022 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3023 let body = None;
3024
3025 self.client
3026 .request_json(
3027 Method::GET,
3028 &path,
3029 headers,
3030 query,
3031 body,
3032 params.disable_cache,
3033 )
3034 .await
3035 }
3036#[instrument(skip(self, params))]
3038 pub async fn get_random_string(&self, params: GetRandomStringParams) -> Result<crate::models::GetRandomString200Response> {
3039 let mut path = "/api/v1/random/string".to_string();
3040
3041 let mut query: Vec<(String, String)> = Vec::new();
3042 if let Some(value) = ¶ms.length_query {
3043 query.push(("length".to_string(), value.clone()));
3044 }
3045 if let Some(value) = ¶ms.type_query {
3046 query.push(("type".to_string(), value.clone()));
3047 }
3048 if let Some(value) = ¶ms._t {
3049 query.push(("_t".to_string(), value.clone()));
3050 }
3051 let query = if query.is_empty() { None } else { Some(query) };
3052
3053 let mut extra_headers = HeaderMap::new();
3054 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3055 let body = None;
3056
3057 self.client
3058 .request_json(
3059 Method::GET,
3060 &path,
3061 headers,
3062 query,
3063 body,
3064 params.disable_cache,
3065 )
3066 .await
3067 }
3068#[instrument(skip(self, params))]
3070 pub async fn post_answerbook_ask(&self, params: PostAnswerbookAskParams) -> Result<crate::models::PostAnswerbookAsk200Response> {
3071 let mut path = "/api/v1/answerbook/ask".to_string();
3072
3073 let mut query: Vec<(String, String)> = Vec::new();
3074 if let Some(value) = ¶ms._t {
3075 query.push(("_t".to_string(), value.clone()));
3076 }
3077 let query = if query.is_empty() { None } else { Some(query) };
3078
3079 let mut extra_headers = HeaderMap::new();
3080 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3081 let body = params.body.clone();
3082
3083 self.client
3084 .request_json(
3085 Method::POST,
3086 &path,
3087 headers,
3088 query,
3089 body,
3090 params.disable_cache,
3091 )
3092 .await
3093 }
3094}
3095
3096#[derive(Debug, Clone)]
3097pub struct GetAnswerbookAskParams {
3098 pub question_query: String,
3099 pub disable_cache: Option<bool>,
3100 pub _t: Option<String>,
3101}
3102
3103impl GetAnswerbookAskParams {
3104 pub fn new(question_query: impl Into<String>) -> Self {
3105 Self {
3106 question_query: question_query.into(),
3107 disable_cache: None,
3108 _t: None,
3109 }
3110 }
3111 pub fn disable_cache(mut self, value: bool) -> Self {
3112 self.disable_cache = Some(value);
3113 self
3114 }
3115 pub fn _t(mut self, value: impl Into<String>) -> Self {
3116 self._t = Some(value.into());
3117 self
3118 }
3119}
3120
3121#[derive(Debug, Clone)]
3122pub struct GetRandomImageParams {
3123 pub category_query: Option<String>,
3124 pub type_query: Option<String>,
3125 pub disable_cache: Option<bool>,
3126 pub _t: Option<String>,
3127}
3128
3129impl GetRandomImageParams {
3130 pub fn new() -> Self {
3131 Self {
3132 category_query: None,
3133 type_query: None,
3134 disable_cache: None,
3135 _t: None,
3136 }
3137 }
3138 pub fn category_query(mut self, value: impl Into<String>) -> Self {
3139 self.category_query = Some(value.into());
3140 self
3141 }
3142 pub fn type_query(mut self, value: impl Into<String>) -> Self {
3143 self.type_query = Some(value.into());
3144 self
3145 }
3146 pub fn disable_cache(mut self, value: bool) -> Self {
3147 self.disable_cache = Some(value);
3148 self
3149 }
3150 pub fn _t(mut self, value: impl Into<String>) -> Self {
3151 self._t = Some(value.into());
3152 self
3153 }
3154}
3155
3156#[derive(Debug, Clone)]
3157pub struct GetRandomStringParams {
3158 pub length_query: Option<String>,
3159 pub type_query: Option<String>,
3160 pub disable_cache: Option<bool>,
3161 pub _t: Option<String>,
3162}
3163
3164impl GetRandomStringParams {
3165 pub fn new() -> Self {
3166 Self {
3167 length_query: None,
3168 type_query: None,
3169 disable_cache: None,
3170 _t: None,
3171 }
3172 }
3173 pub fn length_query(mut self, value: impl Into<String>) -> Self {
3174 self.length_query = Some(value.into());
3175 self
3176 }
3177 pub fn type_query(mut self, value: impl Into<String>) -> Self {
3178 self.type_query = Some(value.into());
3179 self
3180 }
3181 pub fn disable_cache(mut self, value: bool) -> Self {
3182 self.disable_cache = Some(value);
3183 self
3184 }
3185 pub fn _t(mut self, value: impl Into<String>) -> Self {
3186 self._t = Some(value.into());
3187 self
3188 }
3189}
3190
3191#[derive(Debug, Clone)]
3192pub struct PostAnswerbookAskParams {
3193 pub body: Option<Value>,
3194 pub disable_cache: Option<bool>,
3195 pub _t: Option<String>,
3196}
3197
3198impl PostAnswerbookAskParams {
3199 pub fn new() -> Self {
3200 Self {
3201 body: None,
3202 disable_cache: None,
3203 _t: None,
3204 }
3205 }
3206 pub fn disable_cache(mut self, value: bool) -> Self {
3207 self.disable_cache = Some(value);
3208 self
3209 }
3210 pub fn _t(mut self, value: impl Into<String>) -> Self {
3211 self._t = Some(value.into());
3212 self
3213 }
3214 pub fn body(mut self, value: Value) -> Self {
3215 self.body = Some(value);
3216 self
3217 }
3218}
3219#[derive(Debug, Clone)]
3220pub struct SocialService<'a> {
3221 pub(crate) client: &'a Client,
3222}
3223
3224impl<'a> SocialService<'a> {
3225#[instrument(skip(self, params))]
3227 pub async fn get_github_repo(&self, params: GetGithubRepoParams) -> Result<crate::models::GetGithubRepo200Response> {
3228 let mut path = "/api/v1/github/repo".to_string();
3229
3230 let mut query: Vec<(String, String)> = Vec::new();
3231 query.push(("repo".to_string(), params.repo_query.clone()));
3232 if let Some(value) = ¶ms._t {
3233 query.push(("_t".to_string(), value.clone()));
3234 }
3235 let query = if query.is_empty() { None } else { Some(query) };
3236
3237 let mut extra_headers = HeaderMap::new();
3238 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3239 let body = None;
3240
3241 self.client
3242 .request_json(
3243 Method::GET,
3244 &path,
3245 headers,
3246 query,
3247 body,
3248 params.disable_cache,
3249 )
3250 .await
3251 }
3252#[instrument(skip(self, params))]
3254 pub async fn get_social_bilibili_archives(&self, params: GetSocialBilibiliArchivesParams) -> Result<crate::models::GetSocialBilibiliArchives200Response> {
3255 let mut path = "/api/v1/social/bilibili/archives".to_string();
3256
3257 let mut query: Vec<(String, String)> = Vec::new();
3258 query.push(("mid".to_string(), params.mid_query.clone()));
3259 if let Some(value) = ¶ms.keywords_query {
3260 query.push(("keywords".to_string(), value.clone()));
3261 }
3262 if let Some(value) = ¶ms.orderby_query {
3263 query.push(("orderby".to_string(), value.clone()));
3264 }
3265 if let Some(value) = ¶ms.ps_query {
3266 query.push(("ps".to_string(), value.clone()));
3267 }
3268 if let Some(value) = ¶ms.pn_query {
3269 query.push(("pn".to_string(), value.clone()));
3270 }
3271 if let Some(value) = ¶ms._t {
3272 query.push(("_t".to_string(), value.clone()));
3273 }
3274 let query = if query.is_empty() { None } else { Some(query) };
3275
3276 let mut extra_headers = HeaderMap::new();
3277 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3278 let body = None;
3279
3280 self.client
3281 .request_json(
3282 Method::GET,
3283 &path,
3284 headers,
3285 query,
3286 body,
3287 params.disable_cache,
3288 )
3289 .await
3290 }
3291#[instrument(skip(self, params))]
3293 pub async fn get_social_bilibili_liveroom(&self, params: GetSocialBilibiliLiveroomParams) -> Result<crate::models::GetSocialBilibiliLiveroom200Response> {
3294 let mut path = "/api/v1/social/bilibili/liveroom".to_string();
3295
3296 let mut query: Vec<(String, String)> = Vec::new();
3297 if let Some(value) = ¶ms.mid_query {
3298 query.push(("mid".to_string(), value.clone()));
3299 }
3300 if let Some(value) = ¶ms.room_id_query {
3301 query.push(("room_id".to_string(), value.clone()));
3302 }
3303 if let Some(value) = ¶ms._t {
3304 query.push(("_t".to_string(), value.clone()));
3305 }
3306 let query = if query.is_empty() { None } else { Some(query) };
3307
3308 let mut extra_headers = HeaderMap::new();
3309 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3310 let body = None;
3311
3312 self.client
3313 .request_json(
3314 Method::GET,
3315 &path,
3316 headers,
3317 query,
3318 body,
3319 params.disable_cache,
3320 )
3321 .await
3322 }
3323#[instrument(skip(self, params))]
3325 pub async fn get_social_bilibili_replies(&self, params: GetSocialBilibiliRepliesParams) -> Result<crate::models::GetSocialBilibiliReplies200Response> {
3326 let mut path = "/api/v1/social/bilibili/replies".to_string();
3327
3328 let mut query: Vec<(String, String)> = Vec::new();
3329 query.push(("oid".to_string(), params.oid_query.clone()));
3330 if let Some(value) = ¶ms.sort_query {
3331 query.push(("sort".to_string(), value.clone()));
3332 }
3333 if let Some(value) = ¶ms.ps_query {
3334 query.push(("ps".to_string(), value.clone()));
3335 }
3336 if let Some(value) = ¶ms.pn_query {
3337 query.push(("pn".to_string(), value.clone()));
3338 }
3339 if let Some(value) = ¶ms._t {
3340 query.push(("_t".to_string(), value.clone()));
3341 }
3342 let query = if query.is_empty() { None } else { Some(query) };
3343
3344 let mut extra_headers = HeaderMap::new();
3345 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3346 let body = None;
3347
3348 self.client
3349 .request_json(
3350 Method::GET,
3351 &path,
3352 headers,
3353 query,
3354 body,
3355 params.disable_cache,
3356 )
3357 .await
3358 }
3359#[instrument(skip(self, params))]
3361 pub async fn get_social_bilibili_userinfo(&self, params: GetSocialBilibiliUserinfoParams) -> Result<crate::models::GetSocialBilibiliUserinfo200Response> {
3362 let mut path = "/api/v1/social/bilibili/userinfo".to_string();
3363
3364 let mut query: Vec<(String, String)> = Vec::new();
3365 query.push(("uid".to_string(), params.uid_query.clone()));
3366 if let Some(value) = ¶ms._t {
3367 query.push(("_t".to_string(), value.clone()));
3368 }
3369 let query = if query.is_empty() { None } else { Some(query) };
3370
3371 let mut extra_headers = HeaderMap::new();
3372 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3373 let body = None;
3374
3375 self.client
3376 .request_json(
3377 Method::GET,
3378 &path,
3379 headers,
3380 query,
3381 body,
3382 params.disable_cache,
3383 )
3384 .await
3385 }
3386#[instrument(skip(self, params))]
3388 pub async fn get_social_bilibili_videoinfo(&self, params: GetSocialBilibiliVideoinfoParams) -> Result<crate::models::GetSocialBilibiliVideoinfo200Response> {
3389 let mut path = "/api/v1/social/bilibili/videoinfo".to_string();
3390
3391 let mut query: Vec<(String, String)> = Vec::new();
3392 if let Some(value) = ¶ms.aid_query {
3393 query.push(("aid".to_string(), value.clone()));
3394 }
3395 if let Some(value) = ¶ms.bvid_query {
3396 query.push(("bvid".to_string(), value.clone()));
3397 }
3398 if let Some(value) = ¶ms._t {
3399 query.push(("_t".to_string(), value.clone()));
3400 }
3401 let query = if query.is_empty() { None } else { Some(query) };
3402
3403 let mut extra_headers = HeaderMap::new();
3404 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3405 let body = None;
3406
3407 self.client
3408 .request_json(
3409 Method::GET,
3410 &path,
3411 headers,
3412 query,
3413 body,
3414 params.disable_cache,
3415 )
3416 .await
3417 }
3418#[instrument(skip(self, params))]
3420 pub async fn get_social_qq_groupinfo(&self, params: GetSocialQqGroupinfoParams) -> Result<crate::models::GetSocialQqGroupinfo200Response> {
3421 let mut path = "/api/v1/social/qq/groupinfo".to_string();
3422
3423 let mut query: Vec<(String, String)> = Vec::new();
3424 query.push(("group_id".to_string(), params.group_id_query.clone()));
3425 if let Some(value) = ¶ms._t {
3426 query.push(("_t".to_string(), value.clone()));
3427 }
3428 let query = if query.is_empty() { None } else { Some(query) };
3429
3430 let mut extra_headers = HeaderMap::new();
3431 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3432 let body = None;
3433
3434 self.client
3435 .request_json(
3436 Method::GET,
3437 &path,
3438 headers,
3439 query,
3440 body,
3441 params.disable_cache,
3442 )
3443 .await
3444 }
3445#[instrument(skip(self, params))]
3447 pub async fn get_social_qq_userinfo(&self, params: GetSocialQqUserinfoParams) -> Result<crate::models::GetSocialQqUserinfo200Response> {
3448 let mut path = "/api/v1/social/qq/userinfo".to_string();
3449
3450 let mut query: Vec<(String, String)> = Vec::new();
3451 query.push(("qq".to_string(), params.qq_query.clone()));
3452 if let Some(value) = ¶ms._t {
3453 query.push(("_t".to_string(), value.clone()));
3454 }
3455 let query = if query.is_empty() { None } else { Some(query) };
3456
3457 let mut extra_headers = HeaderMap::new();
3458 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3459 let body = None;
3460
3461 self.client
3462 .request_json(
3463 Method::GET,
3464 &path,
3465 headers,
3466 query,
3467 body,
3468 params.disable_cache,
3469 )
3470 .await
3471 }
3472}
3473
3474#[derive(Debug, Clone)]
3475pub struct GetGithubRepoParams {
3476 pub repo_query: String,
3477 pub disable_cache: Option<bool>,
3478 pub _t: Option<String>,
3479}
3480
3481impl GetGithubRepoParams {
3482 pub fn new(repo_query: impl Into<String>) -> Self {
3483 Self {
3484 repo_query: repo_query.into(),
3485 disable_cache: None,
3486 _t: None,
3487 }
3488 }
3489 pub fn disable_cache(mut self, value: bool) -> Self {
3490 self.disable_cache = Some(value);
3491 self
3492 }
3493 pub fn _t(mut self, value: impl Into<String>) -> Self {
3494 self._t = Some(value.into());
3495 self
3496 }
3497}
3498
3499#[derive(Debug, Clone)]
3500pub struct GetSocialBilibiliArchivesParams {
3501 pub mid_query: String,
3502 pub keywords_query: Option<String>,
3503 pub orderby_query: Option<String>,
3504 pub ps_query: Option<String>,
3505 pub pn_query: Option<String>,
3506 pub disable_cache: Option<bool>,
3507 pub _t: Option<String>,
3508}
3509
3510impl GetSocialBilibiliArchivesParams {
3511 pub fn new(mid_query: impl Into<String>) -> Self {
3512 Self {
3513 mid_query: mid_query.into(),
3514 keywords_query: None,
3515 orderby_query: None,
3516 ps_query: None,
3517 pn_query: None,
3518 disable_cache: None,
3519 _t: None,
3520 }
3521 }
3522 pub fn keywords_query(mut self, value: impl Into<String>) -> Self {
3523 self.keywords_query = Some(value.into());
3524 self
3525 }
3526 pub fn orderby_query(mut self, value: impl Into<String>) -> Self {
3527 self.orderby_query = Some(value.into());
3528 self
3529 }
3530 pub fn ps_query(mut self, value: impl Into<String>) -> Self {
3531 self.ps_query = Some(value.into());
3532 self
3533 }
3534 pub fn pn_query(mut self, value: impl Into<String>) -> Self {
3535 self.pn_query = Some(value.into());
3536 self
3537 }
3538 pub fn disable_cache(mut self, value: bool) -> Self {
3539 self.disable_cache = Some(value);
3540 self
3541 }
3542 pub fn _t(mut self, value: impl Into<String>) -> Self {
3543 self._t = Some(value.into());
3544 self
3545 }
3546}
3547
3548#[derive(Debug, Clone)]
3549pub struct GetSocialBilibiliLiveroomParams {
3550 pub mid_query: Option<String>,
3551 pub room_id_query: Option<String>,
3552 pub disable_cache: Option<bool>,
3553 pub _t: Option<String>,
3554}
3555
3556impl GetSocialBilibiliLiveroomParams {
3557 pub fn new() -> Self {
3558 Self {
3559 mid_query: None,
3560 room_id_query: None,
3561 disable_cache: None,
3562 _t: None,
3563 }
3564 }
3565 pub fn mid_query(mut self, value: impl Into<String>) -> Self {
3566 self.mid_query = Some(value.into());
3567 self
3568 }
3569 pub fn room_id_query(mut self, value: impl Into<String>) -> Self {
3570 self.room_id_query = Some(value.into());
3571 self
3572 }
3573 pub fn disable_cache(mut self, value: bool) -> Self {
3574 self.disable_cache = Some(value);
3575 self
3576 }
3577 pub fn _t(mut self, value: impl Into<String>) -> Self {
3578 self._t = Some(value.into());
3579 self
3580 }
3581}
3582
3583#[derive(Debug, Clone)]
3584pub struct GetSocialBilibiliRepliesParams {
3585 pub oid_query: String,
3586 pub sort_query: Option<String>,
3587 pub ps_query: Option<String>,
3588 pub pn_query: Option<String>,
3589 pub disable_cache: Option<bool>,
3590 pub _t: Option<String>,
3591}
3592
3593impl GetSocialBilibiliRepliesParams {
3594 pub fn new(oid_query: impl Into<String>) -> Self {
3595 Self {
3596 oid_query: oid_query.into(),
3597 sort_query: None,
3598 ps_query: None,
3599 pn_query: None,
3600 disable_cache: None,
3601 _t: None,
3602 }
3603 }
3604 pub fn sort_query(mut self, value: impl Into<String>) -> Self {
3605 self.sort_query = Some(value.into());
3606 self
3607 }
3608 pub fn ps_query(mut self, value: impl Into<String>) -> Self {
3609 self.ps_query = Some(value.into());
3610 self
3611 }
3612 pub fn pn_query(mut self, value: impl Into<String>) -> Self {
3613 self.pn_query = Some(value.into());
3614 self
3615 }
3616 pub fn disable_cache(mut self, value: bool) -> Self {
3617 self.disable_cache = Some(value);
3618 self
3619 }
3620 pub fn _t(mut self, value: impl Into<String>) -> Self {
3621 self._t = Some(value.into());
3622 self
3623 }
3624}
3625
3626#[derive(Debug, Clone)]
3627pub struct GetSocialBilibiliUserinfoParams {
3628 pub uid_query: String,
3629 pub disable_cache: Option<bool>,
3630 pub _t: Option<String>,
3631}
3632
3633impl GetSocialBilibiliUserinfoParams {
3634 pub fn new(uid_query: impl Into<String>) -> Self {
3635 Self {
3636 uid_query: uid_query.into(),
3637 disable_cache: None,
3638 _t: None,
3639 }
3640 }
3641 pub fn disable_cache(mut self, value: bool) -> Self {
3642 self.disable_cache = Some(value);
3643 self
3644 }
3645 pub fn _t(mut self, value: impl Into<String>) -> Self {
3646 self._t = Some(value.into());
3647 self
3648 }
3649}
3650
3651#[derive(Debug, Clone)]
3652pub struct GetSocialBilibiliVideoinfoParams {
3653 pub aid_query: Option<String>,
3654 pub bvid_query: Option<String>,
3655 pub disable_cache: Option<bool>,
3656 pub _t: Option<String>,
3657}
3658
3659impl GetSocialBilibiliVideoinfoParams {
3660 pub fn new() -> Self {
3661 Self {
3662 aid_query: None,
3663 bvid_query: None,
3664 disable_cache: None,
3665 _t: None,
3666 }
3667 }
3668 pub fn aid_query(mut self, value: impl Into<String>) -> Self {
3669 self.aid_query = Some(value.into());
3670 self
3671 }
3672 pub fn bvid_query(mut self, value: impl Into<String>) -> Self {
3673 self.bvid_query = Some(value.into());
3674 self
3675 }
3676 pub fn disable_cache(mut self, value: bool) -> Self {
3677 self.disable_cache = Some(value);
3678 self
3679 }
3680 pub fn _t(mut self, value: impl Into<String>) -> Self {
3681 self._t = Some(value.into());
3682 self
3683 }
3684}
3685
3686#[derive(Debug, Clone)]
3687pub struct GetSocialQqGroupinfoParams {
3688 pub group_id_query: String,
3689 pub disable_cache: Option<bool>,
3690 pub _t: Option<String>,
3691}
3692
3693impl GetSocialQqGroupinfoParams {
3694 pub fn new(group_id_query: impl Into<String>) -> Self {
3695 Self {
3696 group_id_query: group_id_query.into(),
3697 disable_cache: None,
3698 _t: None,
3699 }
3700 }
3701 pub fn disable_cache(mut self, value: bool) -> Self {
3702 self.disable_cache = Some(value);
3703 self
3704 }
3705 pub fn _t(mut self, value: impl Into<String>) -> Self {
3706 self._t = Some(value.into());
3707 self
3708 }
3709}
3710
3711#[derive(Debug, Clone)]
3712pub struct GetSocialQqUserinfoParams {
3713 pub qq_query: String,
3714 pub disable_cache: Option<bool>,
3715 pub _t: Option<String>,
3716}
3717
3718impl GetSocialQqUserinfoParams {
3719 pub fn new(qq_query: impl Into<String>) -> Self {
3720 Self {
3721 qq_query: qq_query.into(),
3722 disable_cache: None,
3723 _t: None,
3724 }
3725 }
3726 pub fn disable_cache(mut self, value: bool) -> Self {
3727 self.disable_cache = Some(value);
3728 self
3729 }
3730 pub fn _t(mut self, value: impl Into<String>) -> Self {
3731 self._t = Some(value.into());
3732 self
3733 }
3734}
3735#[derive(Debug, Clone)]
3736pub struct StatusService<'a> {
3737 pub(crate) client: &'a Client,
3738}
3739
3740impl<'a> StatusService<'a> {
3741#[instrument(skip(self, params))]
3743 pub async fn get_status_ratelimit(&self, params: GetStatusRatelimitParams) -> Result<crate::models::GetStatusRatelimit200Response> {
3744 let mut path = "/api/v1/status/ratelimit".to_string();
3745
3746 let mut query: Vec<(String, String)> = Vec::new();
3747 if let Some(value) = ¶ms._t {
3748 query.push(("_t".to_string(), value.clone()));
3749 }
3750 let query = if query.is_empty() { None } else { Some(query) };
3751
3752 let mut extra_headers = HeaderMap::new();
3753 extra_headers.insert(
3754 "Authorization",
3755 HeaderValue::from_str(¶ms.authorization_header).map_err(|_| Error::InvalidHeader { name: "Authorization".into() })?,
3756 );
3757 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3758 let body = None;
3759
3760 self.client
3761 .request_json(
3762 Method::GET,
3763 &path,
3764 headers,
3765 query,
3766 body,
3767 params.disable_cache,
3768 )
3769 .await
3770 }
3771#[instrument(skip(self, params))]
3773 pub async fn get_status_usage(&self, params: GetStatusUsageParams) -> Result<crate::models::GetStatusUsage200Response> {
3774 let mut path = "/api/v1/status/usage".to_string();
3775
3776 let mut query: Vec<(String, String)> = Vec::new();
3777 if let Some(value) = ¶ms.path_query {
3778 query.push(("path".to_string(), value.clone()));
3779 }
3780 if let Some(value) = ¶ms._t {
3781 query.push(("_t".to_string(), value.clone()));
3782 }
3783 let query = if query.is_empty() { None } else { Some(query) };
3784
3785 let mut extra_headers = HeaderMap::new();
3786 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3787 let body = None;
3788
3789 self.client
3790 .request_json(
3791 Method::GET,
3792 &path,
3793 headers,
3794 query,
3795 body,
3796 params.disable_cache,
3797 )
3798 .await
3799 }
3800}
3801
3802#[derive(Debug, Clone)]
3803pub struct GetStatusRatelimitParams {
3804 pub authorization_header: String,
3805 pub disable_cache: Option<bool>,
3806 pub _t: Option<String>,
3807}
3808
3809impl GetStatusRatelimitParams {
3810 pub fn new(authorization_header: impl Into<String>) -> Self {
3811 Self {
3812 authorization_header: authorization_header.into(),
3813 disable_cache: None,
3814 _t: None,
3815 }
3816 }
3817 pub fn disable_cache(mut self, value: bool) -> Self {
3818 self.disable_cache = Some(value);
3819 self
3820 }
3821 pub fn _t(mut self, value: impl Into<String>) -> Self {
3822 self._t = Some(value.into());
3823 self
3824 }
3825}
3826
3827#[derive(Debug, Clone)]
3828pub struct GetStatusUsageParams {
3829 pub path_query: Option<String>,
3830 pub disable_cache: Option<bool>,
3831 pub _t: Option<String>,
3832}
3833
3834impl GetStatusUsageParams {
3835 pub fn new() -> Self {
3836 Self {
3837 path_query: None,
3838 disable_cache: None,
3839 _t: None,
3840 }
3841 }
3842 pub fn path_query(mut self, value: impl Into<String>) -> Self {
3843 self.path_query = Some(value.into());
3844 self
3845 }
3846 pub fn disable_cache(mut self, value: bool) -> Self {
3847 self.disable_cache = Some(value);
3848 self
3849 }
3850 pub fn _t(mut self, value: impl Into<String>) -> Self {
3851 self._t = Some(value.into());
3852 self
3853 }
3854}
3855#[derive(Debug, Clone)]
3856pub struct TextService<'a> {
3857 pub(crate) client: &'a Client,
3858}
3859
3860impl<'a> TextService<'a> {
3861#[instrument(skip(self, params))]
3863 pub async fn get_text_md_5(&self, params: GetTextMd5Params) -> Result<crate::models::GetTextMd5200Response> {
3864 let mut path = "/api/v1/text/md5".to_string();
3865
3866 let mut query: Vec<(String, String)> = Vec::new();
3867 query.push(("text".to_string(), params.text_query.clone()));
3868 if let Some(value) = ¶ms._t {
3869 query.push(("_t".to_string(), value.clone()));
3870 }
3871 let query = if query.is_empty() { None } else { Some(query) };
3872
3873 let mut extra_headers = HeaderMap::new();
3874 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3875 let body = None;
3876
3877 self.client
3878 .request_json(
3879 Method::GET,
3880 &path,
3881 headers,
3882 query,
3883 body,
3884 params.disable_cache,
3885 )
3886 .await
3887 }
3888#[instrument(skip(self, params))]
3890 pub async fn post_text_aes_decrypt(&self, params: PostTextAesDecryptParams) -> Result<crate::models::PostTextAesDecrypt200Response> {
3891 let mut path = "/api/v1/text/aes/decrypt".to_string();
3892
3893 let mut query: Vec<(String, String)> = Vec::new();
3894 if let Some(value) = ¶ms._t {
3895 query.push(("_t".to_string(), value.clone()));
3896 }
3897 let query = if query.is_empty() { None } else { Some(query) };
3898
3899 let mut extra_headers = HeaderMap::new();
3900 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3901 let body = params.body.clone();
3902
3903 self.client
3904 .request_json(
3905 Method::POST,
3906 &path,
3907 headers,
3908 query,
3909 body,
3910 params.disable_cache,
3911 )
3912 .await
3913 }
3914#[instrument(skip(self, params))]
3916 pub async fn post_text_aes_decrypt_advanced(&self, params: PostTextAesDecryptAdvancedParams) -> Result<crate::models::PostTextAesDecryptAdvanced200Response> {
3917 let mut path = "/api/v1/text/aes/decrypt-advanced".to_string();
3918
3919 let mut query: Vec<(String, String)> = Vec::new();
3920 if let Some(value) = ¶ms._t {
3921 query.push(("_t".to_string(), value.clone()));
3922 }
3923 let query = if query.is_empty() { None } else { Some(query) };
3924
3925 let mut extra_headers = HeaderMap::new();
3926 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3927 let body = params.body.clone();
3928
3929 self.client
3930 .request_json(
3931 Method::POST,
3932 &path,
3933 headers,
3934 query,
3935 body,
3936 params.disable_cache,
3937 )
3938 .await
3939 }
3940#[instrument(skip(self, params))]
3942 pub async fn post_text_aes_encrypt(&self, params: PostTextAesEncryptParams) -> Result<crate::models::PostTextAesEncrypt200Response> {
3943 let mut path = "/api/v1/text/aes/encrypt".to_string();
3944
3945 let mut query: Vec<(String, String)> = Vec::new();
3946 if let Some(value) = ¶ms._t {
3947 query.push(("_t".to_string(), value.clone()));
3948 }
3949 let query = if query.is_empty() { None } else { Some(query) };
3950
3951 let mut extra_headers = HeaderMap::new();
3952 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3953 let body = params.body.clone();
3954
3955 self.client
3956 .request_json(
3957 Method::POST,
3958 &path,
3959 headers,
3960 query,
3961 body,
3962 params.disable_cache,
3963 )
3964 .await
3965 }
3966#[instrument(skip(self, params))]
3968 pub async fn post_text_aes_encrypt_advanced(&self, params: PostTextAesEncryptAdvancedParams) -> Result<crate::models::PostTextAesEncryptAdvanced200Response> {
3969 let mut path = "/api/v1/text/aes/encrypt-advanced".to_string();
3970
3971 let mut query: Vec<(String, String)> = Vec::new();
3972 if let Some(value) = ¶ms._t {
3973 query.push(("_t".to_string(), value.clone()));
3974 }
3975 let query = if query.is_empty() { None } else { Some(query) };
3976
3977 let mut extra_headers = HeaderMap::new();
3978 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
3979 let body = params.body.clone();
3980
3981 self.client
3982 .request_json(
3983 Method::POST,
3984 &path,
3985 headers,
3986 query,
3987 body,
3988 params.disable_cache,
3989 )
3990 .await
3991 }
3992#[instrument(skip(self, params))]
3994 pub async fn post_text_analyze(&self, params: PostTextAnalyzeParams) -> Result<crate::models::PostTextAnalyze200Response> {
3995 let mut path = "/api/v1/text/analyze".to_string();
3996
3997 let mut query: Vec<(String, String)> = Vec::new();
3998 if let Some(value) = ¶ms._t {
3999 query.push(("_t".to_string(), value.clone()));
4000 }
4001 let query = if query.is_empty() { None } else { Some(query) };
4002
4003 let mut extra_headers = HeaderMap::new();
4004 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4005 let body = params.body.clone();
4006
4007 self.client
4008 .request_json(
4009 Method::POST,
4010 &path,
4011 headers,
4012 query,
4013 body,
4014 params.disable_cache,
4015 )
4016 .await
4017 }
4018#[instrument(skip(self, params))]
4020 pub async fn post_text_base_64_decode(&self, params: PostTextBase64DecodeParams) -> Result<crate::models::PostTextBase64Decode200Response> {
4021 let mut path = "/api/v1/text/base64/decode".to_string();
4022
4023 let mut query: Vec<(String, String)> = Vec::new();
4024 if let Some(value) = ¶ms._t {
4025 query.push(("_t".to_string(), value.clone()));
4026 }
4027 let query = if query.is_empty() { None } else { Some(query) };
4028
4029 let mut extra_headers = HeaderMap::new();
4030 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4031 let body = params.body.clone();
4032
4033 self.client
4034 .request_json(
4035 Method::POST,
4036 &path,
4037 headers,
4038 query,
4039 body,
4040 params.disable_cache,
4041 )
4042 .await
4043 }
4044#[instrument(skip(self, params))]
4046 pub async fn post_text_base_64_encode(&self, params: PostTextBase64EncodeParams) -> Result<crate::models::PostTextBase64Encode200Response> {
4047 let mut path = "/api/v1/text/base64/encode".to_string();
4048
4049 let mut query: Vec<(String, String)> = Vec::new();
4050 if let Some(value) = ¶ms._t {
4051 query.push(("_t".to_string(), value.clone()));
4052 }
4053 let query = if query.is_empty() { None } else { Some(query) };
4054
4055 let mut extra_headers = HeaderMap::new();
4056 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4057 let body = params.body.clone();
4058
4059 self.client
4060 .request_json(
4061 Method::POST,
4062 &path,
4063 headers,
4064 query,
4065 body,
4066 params.disable_cache,
4067 )
4068 .await
4069 }
4070#[instrument(skip(self, params))]
4072 pub async fn post_text_convert(&self, params: PostTextConvertParams) -> Result<crate::models::PostTextConvert200Response> {
4073 let mut path = "/api/v1/text/convert".to_string();
4074
4075 let mut query: Vec<(String, String)> = Vec::new();
4076 if let Some(value) = ¶ms._t {
4077 query.push(("_t".to_string(), value.clone()));
4078 }
4079 let query = if query.is_empty() { None } else { Some(query) };
4080
4081 let mut extra_headers = HeaderMap::new();
4082 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4083 let body = params.body.clone();
4084
4085 self.client
4086 .request_json(
4087 Method::POST,
4088 &path,
4089 headers,
4090 query,
4091 body,
4092 params.disable_cache,
4093 )
4094 .await
4095 }
4096#[instrument(skip(self, params))]
4098 pub async fn post_text_md_5(&self, params: PostTextMd5Params) -> Result<crate::models::GetTextMd5200Response> {
4099 let mut path = "/api/v1/text/md5".to_string();
4100
4101 let mut query: Vec<(String, String)> = Vec::new();
4102 if let Some(value) = ¶ms._t {
4103 query.push(("_t".to_string(), value.clone()));
4104 }
4105 let query = if query.is_empty() { None } else { Some(query) };
4106
4107 let mut extra_headers = HeaderMap::new();
4108 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4109 let body = params.body.clone();
4110
4111 self.client
4112 .request_json(
4113 Method::POST,
4114 &path,
4115 headers,
4116 query,
4117 body,
4118 params.disable_cache,
4119 )
4120 .await
4121 }
4122#[instrument(skip(self, params))]
4124 pub async fn post_text_md_5_verify(&self, params: PostTextMd5VerifyParams) -> Result<crate::models::PostTextMd5Verify200Response> {
4125 let mut path = "/api/v1/text/md5/verify".to_string();
4126
4127 let mut query: Vec<(String, String)> = Vec::new();
4128 if let Some(value) = ¶ms._t {
4129 query.push(("_t".to_string(), value.clone()));
4130 }
4131 let query = if query.is_empty() { None } else { Some(query) };
4132
4133 let mut extra_headers = HeaderMap::new();
4134 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4135 let body = params.body.clone();
4136
4137 self.client
4138 .request_json(
4139 Method::POST,
4140 &path,
4141 headers,
4142 query,
4143 body,
4144 params.disable_cache,
4145 )
4146 .await
4147 }
4148}
4149
4150#[derive(Debug, Clone)]
4151pub struct GetTextMd5Params {
4152 pub text_query: String,
4153 pub disable_cache: Option<bool>,
4154 pub _t: Option<String>,
4155}
4156
4157impl GetTextMd5Params {
4158 pub fn new(text_query: impl Into<String>) -> Self {
4159 Self {
4160 text_query: text_query.into(),
4161 disable_cache: None,
4162 _t: None,
4163 }
4164 }
4165 pub fn disable_cache(mut self, value: bool) -> Self {
4166 self.disable_cache = Some(value);
4167 self
4168 }
4169 pub fn _t(mut self, value: impl Into<String>) -> Self {
4170 self._t = Some(value.into());
4171 self
4172 }
4173}
4174
4175#[derive(Debug, Clone)]
4176pub struct PostTextAesDecryptParams {
4177 pub body: Option<Value>,
4178 pub disable_cache: Option<bool>,
4179 pub _t: Option<String>,
4180}
4181
4182impl PostTextAesDecryptParams {
4183 pub fn new() -> Self {
4184 Self {
4185 body: None,
4186 disable_cache: None,
4187 _t: None,
4188 }
4189 }
4190 pub fn disable_cache(mut self, value: bool) -> Self {
4191 self.disable_cache = Some(value);
4192 self
4193 }
4194 pub fn _t(mut self, value: impl Into<String>) -> Self {
4195 self._t = Some(value.into());
4196 self
4197 }
4198 pub fn body(mut self, value: Value) -> Self {
4199 self.body = Some(value);
4200 self
4201 }
4202}
4203
4204#[derive(Debug, Clone)]
4205pub struct PostTextAesDecryptAdvancedParams {
4206 pub body: Option<Value>,
4207 pub disable_cache: Option<bool>,
4208 pub _t: Option<String>,
4209}
4210
4211impl PostTextAesDecryptAdvancedParams {
4212 pub fn new() -> Self {
4213 Self {
4214 body: None,
4215 disable_cache: None,
4216 _t: None,
4217 }
4218 }
4219 pub fn disable_cache(mut self, value: bool) -> Self {
4220 self.disable_cache = Some(value);
4221 self
4222 }
4223 pub fn _t(mut self, value: impl Into<String>) -> Self {
4224 self._t = Some(value.into());
4225 self
4226 }
4227 pub fn body(mut self, value: Value) -> Self {
4228 self.body = Some(value);
4229 self
4230 }
4231}
4232
4233#[derive(Debug, Clone)]
4234pub struct PostTextAesEncryptParams {
4235 pub body: Option<Value>,
4236 pub disable_cache: Option<bool>,
4237 pub _t: Option<String>,
4238}
4239
4240impl PostTextAesEncryptParams {
4241 pub fn new() -> Self {
4242 Self {
4243 body: None,
4244 disable_cache: None,
4245 _t: None,
4246 }
4247 }
4248 pub fn disable_cache(mut self, value: bool) -> Self {
4249 self.disable_cache = Some(value);
4250 self
4251 }
4252 pub fn _t(mut self, value: impl Into<String>) -> Self {
4253 self._t = Some(value.into());
4254 self
4255 }
4256 pub fn body(mut self, value: Value) -> Self {
4257 self.body = Some(value);
4258 self
4259 }
4260}
4261
4262#[derive(Debug, Clone)]
4263pub struct PostTextAesEncryptAdvancedParams {
4264 pub body: Option<Value>,
4265 pub disable_cache: Option<bool>,
4266 pub _t: Option<String>,
4267}
4268
4269impl PostTextAesEncryptAdvancedParams {
4270 pub fn new() -> Self {
4271 Self {
4272 body: None,
4273 disable_cache: None,
4274 _t: None,
4275 }
4276 }
4277 pub fn disable_cache(mut self, value: bool) -> Self {
4278 self.disable_cache = Some(value);
4279 self
4280 }
4281 pub fn _t(mut self, value: impl Into<String>) -> Self {
4282 self._t = Some(value.into());
4283 self
4284 }
4285 pub fn body(mut self, value: Value) -> Self {
4286 self.body = Some(value);
4287 self
4288 }
4289}
4290
4291#[derive(Debug, Clone)]
4292pub struct PostTextAnalyzeParams {
4293 pub body: Option<Value>,
4294 pub disable_cache: Option<bool>,
4295 pub _t: Option<String>,
4296}
4297
4298impl PostTextAnalyzeParams {
4299 pub fn new() -> Self {
4300 Self {
4301 body: None,
4302 disable_cache: None,
4303 _t: None,
4304 }
4305 }
4306 pub fn disable_cache(mut self, value: bool) -> Self {
4307 self.disable_cache = Some(value);
4308 self
4309 }
4310 pub fn _t(mut self, value: impl Into<String>) -> Self {
4311 self._t = Some(value.into());
4312 self
4313 }
4314 pub fn body(mut self, value: Value) -> Self {
4315 self.body = Some(value);
4316 self
4317 }
4318}
4319
4320#[derive(Debug, Clone)]
4321pub struct PostTextBase64DecodeParams {
4322 pub body: Option<Value>,
4323 pub disable_cache: Option<bool>,
4324 pub _t: Option<String>,
4325}
4326
4327impl PostTextBase64DecodeParams {
4328 pub fn new() -> Self {
4329 Self {
4330 body: None,
4331 disable_cache: None,
4332 _t: None,
4333 }
4334 }
4335 pub fn disable_cache(mut self, value: bool) -> Self {
4336 self.disable_cache = Some(value);
4337 self
4338 }
4339 pub fn _t(mut self, value: impl Into<String>) -> Self {
4340 self._t = Some(value.into());
4341 self
4342 }
4343 pub fn body(mut self, value: Value) -> Self {
4344 self.body = Some(value);
4345 self
4346 }
4347}
4348
4349#[derive(Debug, Clone)]
4350pub struct PostTextBase64EncodeParams {
4351 pub body: Option<Value>,
4352 pub disable_cache: Option<bool>,
4353 pub _t: Option<String>,
4354}
4355
4356impl PostTextBase64EncodeParams {
4357 pub fn new() -> Self {
4358 Self {
4359 body: None,
4360 disable_cache: None,
4361 _t: None,
4362 }
4363 }
4364 pub fn disable_cache(mut self, value: bool) -> Self {
4365 self.disable_cache = Some(value);
4366 self
4367 }
4368 pub fn _t(mut self, value: impl Into<String>) -> Self {
4369 self._t = Some(value.into());
4370 self
4371 }
4372 pub fn body(mut self, value: Value) -> Self {
4373 self.body = Some(value);
4374 self
4375 }
4376}
4377
4378#[derive(Debug, Clone)]
4379pub struct PostTextConvertParams {
4380 pub body: Option<Value>,
4381 pub disable_cache: Option<bool>,
4382 pub _t: Option<String>,
4383}
4384
4385impl PostTextConvertParams {
4386 pub fn new() -> Self {
4387 Self {
4388 body: None,
4389 disable_cache: None,
4390 _t: None,
4391 }
4392 }
4393 pub fn disable_cache(mut self, value: bool) -> Self {
4394 self.disable_cache = Some(value);
4395 self
4396 }
4397 pub fn _t(mut self, value: impl Into<String>) -> Self {
4398 self._t = Some(value.into());
4399 self
4400 }
4401 pub fn body(mut self, value: Value) -> Self {
4402 self.body = Some(value);
4403 self
4404 }
4405}
4406
4407#[derive(Debug, Clone)]
4408pub struct PostTextMd5Params {
4409 pub body: Option<Value>,
4410 pub disable_cache: Option<bool>,
4411 pub _t: Option<String>,
4412}
4413
4414impl PostTextMd5Params {
4415 pub fn new() -> Self {
4416 Self {
4417 body: None,
4418 disable_cache: None,
4419 _t: None,
4420 }
4421 }
4422 pub fn disable_cache(mut self, value: bool) -> Self {
4423 self.disable_cache = Some(value);
4424 self
4425 }
4426 pub fn _t(mut self, value: impl Into<String>) -> Self {
4427 self._t = Some(value.into());
4428 self
4429 }
4430 pub fn body(mut self, value: Value) -> Self {
4431 self.body = Some(value);
4432 self
4433 }
4434}
4435
4436#[derive(Debug, Clone)]
4437pub struct PostTextMd5VerifyParams {
4438 pub body: Option<Value>,
4439 pub disable_cache: Option<bool>,
4440 pub _t: Option<String>,
4441}
4442
4443impl PostTextMd5VerifyParams {
4444 pub fn new() -> Self {
4445 Self {
4446 body: None,
4447 disable_cache: None,
4448 _t: None,
4449 }
4450 }
4451 pub fn disable_cache(mut self, value: bool) -> Self {
4452 self.disable_cache = Some(value);
4453 self
4454 }
4455 pub fn _t(mut self, value: impl Into<String>) -> Self {
4456 self._t = Some(value.into());
4457 self
4458 }
4459 pub fn body(mut self, value: Value) -> Self {
4460 self.body = Some(value);
4461 self
4462 }
4463}
4464#[derive(Debug, Clone)]
4465pub struct TranslateService<'a> {
4466 pub(crate) client: &'a Client,
4467}
4468
4469impl<'a> TranslateService<'a> {
4470#[instrument(skip(self))]
4472 pub async fn get_ai_translate_languages(&self) -> Result<crate::models::GetAiTranslateLanguages200Response> {
4473 let mut path = "/api/v1/ai/translate/languages".to_string();
4474
4475 let mut query: Vec<(String, String)> = Vec::new();
4476 let query = if query.is_empty() { None } else { Some(query) };
4477
4478 let mut extra_headers = HeaderMap::new();
4479 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4480 let body = None;
4481
4482 self.client
4483 .request_json(
4484 Method::GET,
4485 &path,
4486 headers,
4487 query,
4488 body,
4489 None,
4490 )
4491 .await
4492 }
4493#[instrument(skip(self, params))]
4495 pub async fn post_ai_translate(&self, params: PostAiTranslateParams) -> Result<crate::models::PostAiTranslate200Response> {
4496 let mut path = "/api/v1/ai/translate".to_string();
4497
4498 let mut query: Vec<(String, String)> = Vec::new();
4499 query.push(("target_lang".to_string(), params.target_lang_query.clone()));
4500 if let Some(value) = ¶ms._t {
4501 query.push(("_t".to_string(), value.clone()));
4502 }
4503 let query = if query.is_empty() { None } else { Some(query) };
4504
4505 let mut extra_headers = HeaderMap::new();
4506 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4507 let body = params.body.clone();
4508
4509 self.client
4510 .request_json(
4511 Method::POST,
4512 &path,
4513 headers,
4514 query,
4515 body,
4516 params.disable_cache,
4517 )
4518 .await
4519 }
4520#[instrument(skip(self, params))]
4522 pub async fn post_translate_stream(&self, params: PostTranslateStreamParams) -> Result<String> {
4523 let mut path = "/api/v1/translate/stream".to_string();
4524
4525 let mut query: Vec<(String, String)> = Vec::new();
4526 if let Some(value) = ¶ms._t {
4527 query.push(("_t".to_string(), value.clone()));
4528 }
4529 let query = if query.is_empty() { None } else { Some(query) };
4530
4531 let mut extra_headers = HeaderMap::new();
4532 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4533 let body = params.body.clone();
4534
4535 self.client
4536 .request_json(
4537 Method::POST,
4538 &path,
4539 headers,
4540 query,
4541 body,
4542 params.disable_cache,
4543 )
4544 .await
4545 }
4546#[instrument(skip(self, params))]
4548 pub async fn post_translate_text(&self, params: PostTranslateTextParams) -> Result<crate::models::PostTranslateText200Response> {
4549 let mut path = "/api/v1/translate/text".to_string();
4550
4551 let mut query: Vec<(String, String)> = Vec::new();
4552 query.push(("to_lang".to_string(), params.to_lang_query.clone()));
4553 if let Some(value) = ¶ms._t {
4554 query.push(("_t".to_string(), value.clone()));
4555 }
4556 let query = if query.is_empty() { None } else { Some(query) };
4557
4558 let mut extra_headers = HeaderMap::new();
4559 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4560 let body = params.body.clone();
4561
4562 self.client
4563 .request_json(
4564 Method::POST,
4565 &path,
4566 headers,
4567 query,
4568 body,
4569 params.disable_cache,
4570 )
4571 .await
4572 }
4573}
4574
4575
4576#[derive(Debug, Clone)]
4577pub struct PostAiTranslateParams {
4578 pub target_lang_query: String,
4579 pub body: Option<Value>,
4580 pub disable_cache: Option<bool>,
4581 pub _t: Option<String>,
4582}
4583
4584impl PostAiTranslateParams {
4585 pub fn new(target_lang_query: impl Into<String>) -> Self {
4586 Self {
4587 target_lang_query: target_lang_query.into(),
4588 body: None,
4589 disable_cache: None,
4590 _t: None,
4591 }
4592 }
4593 pub fn disable_cache(mut self, value: bool) -> Self {
4594 self.disable_cache = Some(value);
4595 self
4596 }
4597 pub fn _t(mut self, value: impl Into<String>) -> Self {
4598 self._t = Some(value.into());
4599 self
4600 }
4601 pub fn body(mut self, value: Value) -> Self {
4602 self.body = Some(value);
4603 self
4604 }
4605}
4606
4607#[derive(Debug, Clone)]
4608pub struct PostTranslateStreamParams {
4609 pub body: Option<Value>,
4610 pub disable_cache: Option<bool>,
4611 pub _t: Option<String>,
4612}
4613
4614impl PostTranslateStreamParams {
4615 pub fn new() -> Self {
4616 Self {
4617 body: None,
4618 disable_cache: None,
4619 _t: None,
4620 }
4621 }
4622 pub fn disable_cache(mut self, value: bool) -> Self {
4623 self.disable_cache = Some(value);
4624 self
4625 }
4626 pub fn _t(mut self, value: impl Into<String>) -> Self {
4627 self._t = Some(value.into());
4628 self
4629 }
4630 pub fn body(mut self, value: Value) -> Self {
4631 self.body = Some(value);
4632 self
4633 }
4634}
4635
4636#[derive(Debug, Clone)]
4637pub struct PostTranslateTextParams {
4638 pub to_lang_query: String,
4639 pub body: Option<Value>,
4640 pub disable_cache: Option<bool>,
4641 pub _t: Option<String>,
4642}
4643
4644impl PostTranslateTextParams {
4645 pub fn new(to_lang_query: impl Into<String>) -> Self {
4646 Self {
4647 to_lang_query: to_lang_query.into(),
4648 body: None,
4649 disable_cache: None,
4650 _t: None,
4651 }
4652 }
4653 pub fn disable_cache(mut self, value: bool) -> Self {
4654 self.disable_cache = Some(value);
4655 self
4656 }
4657 pub fn _t(mut self, value: impl Into<String>) -> Self {
4658 self._t = Some(value.into());
4659 self
4660 }
4661 pub fn body(mut self, value: Value) -> Self {
4662 self.body = Some(value);
4663 self
4664 }
4665}
4666#[derive(Debug, Clone)]
4667pub struct WebparseService<'a> {
4668 pub(crate) client: &'a Client,
4669}
4670
4671impl<'a> WebparseService<'a> {
4672#[instrument(skip(self, params))]
4674 pub async fn get_web_tomarkdown_async_status(&self, params: GetWebTomarkdownAsyncStatusParams) -> Result<crate::models::GetWebTomarkdownAsyncStatus200Response> {
4675 let mut path = "/api/v1/web/tomarkdown/async/{task_id}".to_string();
4676 {
4677 let encoded = encode(¶ms.task_id_path).into_owned();
4678 path = path.replace("{task_id}", &encoded);
4679 }
4680
4681 let mut query: Vec<(String, String)> = Vec::new();
4682 if let Some(value) = ¶ms._t {
4683 query.push(("_t".to_string(), value.clone()));
4684 }
4685 let query = if query.is_empty() { None } else { Some(query) };
4686
4687 let mut extra_headers = HeaderMap::new();
4688 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4689 let body = None;
4690
4691 self.client
4692 .request_json(
4693 Method::GET,
4694 &path,
4695 headers,
4696 query,
4697 body,
4698 params.disable_cache,
4699 )
4700 .await
4701 }
4702#[instrument(skip(self, params))]
4704 pub async fn get_webparse_extractimages(&self, params: GetWebparseExtractimagesParams) -> Result<crate::models::GetWebparseExtractimages200Response> {
4705 let mut path = "/api/v1/webparse/extractimages".to_string();
4706
4707 let mut query: Vec<(String, String)> = Vec::new();
4708 query.push(("url".to_string(), params.url_query.clone()));
4709 if let Some(value) = ¶ms._t {
4710 query.push(("_t".to_string(), value.clone()));
4711 }
4712 let query = if query.is_empty() { None } else { Some(query) };
4713
4714 let mut extra_headers = HeaderMap::new();
4715 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4716 let body = None;
4717
4718 self.client
4719 .request_json(
4720 Method::GET,
4721 &path,
4722 headers,
4723 query,
4724 body,
4725 params.disable_cache,
4726 )
4727 .await
4728 }
4729#[instrument(skip(self, params))]
4731 pub async fn get_webparse_metadata(&self, params: GetWebparseMetadataParams) -> Result<crate::models::GetWebparseMetadata200Response> {
4732 let mut path = "/api/v1/webparse/metadata".to_string();
4733
4734 let mut query: Vec<(String, String)> = Vec::new();
4735 query.push(("url".to_string(), params.url_query.clone()));
4736 if let Some(value) = ¶ms._t {
4737 query.push(("_t".to_string(), value.clone()));
4738 }
4739 let query = if query.is_empty() { None } else { Some(query) };
4740
4741 let mut extra_headers = HeaderMap::new();
4742 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4743 let body = None;
4744
4745 self.client
4746 .request_json(
4747 Method::GET,
4748 &path,
4749 headers,
4750 query,
4751 body,
4752 params.disable_cache,
4753 )
4754 .await
4755 }
4756#[instrument(skip(self, params))]
4758 pub async fn post_web_tomarkdown_async(&self, params: PostWebTomarkdownAsyncParams) -> Result<crate::models::PostWebTomarkdownAsync202Response> {
4759 let mut path = "/api/v1/web/tomarkdown/async".to_string();
4760
4761 let mut query: Vec<(String, String)> = Vec::new();
4762 query.push(("url".to_string(), params.url_query.clone()));
4763 if let Some(value) = ¶ms._t {
4764 query.push(("_t".to_string(), value.clone()));
4765 }
4766 let query = if query.is_empty() { None } else { Some(query) };
4767
4768 let mut extra_headers = HeaderMap::new();
4769 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4770 let body = None;
4771
4772 self.client
4773 .request_json(
4774 Method::POST,
4775 &path,
4776 headers,
4777 query,
4778 body,
4779 params.disable_cache,
4780 )
4781 .await
4782 }
4783}
4784
4785#[derive(Debug, Clone)]
4786pub struct GetWebTomarkdownAsyncStatusParams {
4787 pub task_id_path: String,
4788 pub disable_cache: Option<bool>,
4789 pub _t: Option<String>,
4790}
4791
4792impl GetWebTomarkdownAsyncStatusParams {
4793 pub fn new(task_id_path: impl Into<String>) -> Self {
4794 Self {
4795 task_id_path: task_id_path.into(),
4796 disable_cache: None,
4797 _t: None,
4798 }
4799 }
4800 pub fn disable_cache(mut self, value: bool) -> Self {
4801 self.disable_cache = Some(value);
4802 self
4803 }
4804 pub fn _t(mut self, value: impl Into<String>) -> Self {
4805 self._t = Some(value.into());
4806 self
4807 }
4808}
4809
4810#[derive(Debug, Clone)]
4811pub struct GetWebparseExtractimagesParams {
4812 pub url_query: String,
4813 pub disable_cache: Option<bool>,
4814 pub _t: Option<String>,
4815}
4816
4817impl GetWebparseExtractimagesParams {
4818 pub fn new(url_query: impl Into<String>) -> Self {
4819 Self {
4820 url_query: url_query.into(),
4821 disable_cache: None,
4822 _t: None,
4823 }
4824 }
4825 pub fn disable_cache(mut self, value: bool) -> Self {
4826 self.disable_cache = Some(value);
4827 self
4828 }
4829 pub fn _t(mut self, value: impl Into<String>) -> Self {
4830 self._t = Some(value.into());
4831 self
4832 }
4833}
4834
4835#[derive(Debug, Clone)]
4836pub struct GetWebparseMetadataParams {
4837 pub url_query: String,
4838 pub disable_cache: Option<bool>,
4839 pub _t: Option<String>,
4840}
4841
4842impl GetWebparseMetadataParams {
4843 pub fn new(url_query: impl Into<String>) -> Self {
4844 Self {
4845 url_query: url_query.into(),
4846 disable_cache: None,
4847 _t: None,
4848 }
4849 }
4850 pub fn disable_cache(mut self, value: bool) -> Self {
4851 self.disable_cache = Some(value);
4852 self
4853 }
4854 pub fn _t(mut self, value: impl Into<String>) -> Self {
4855 self._t = Some(value.into());
4856 self
4857 }
4858}
4859
4860#[derive(Debug, Clone)]
4861pub struct PostWebTomarkdownAsyncParams {
4862 pub url_query: String,
4863 pub disable_cache: Option<bool>,
4864 pub _t: Option<String>,
4865}
4866
4867impl PostWebTomarkdownAsyncParams {
4868 pub fn new(url_query: impl Into<String>) -> Self {
4869 Self {
4870 url_query: url_query.into(),
4871 disable_cache: None,
4872 _t: None,
4873 }
4874 }
4875 pub fn disable_cache(mut self, value: bool) -> Self {
4876 self.disable_cache = Some(value);
4877 self
4878 }
4879 pub fn _t(mut self, value: impl Into<String>) -> Self {
4880 self._t = Some(value.into());
4881 self
4882 }
4883}
4884#[derive(Debug, Clone)]
4885pub struct MinGanCiShiBieService<'a> {
4886 pub(crate) client: &'a Client,
4887}
4888
4889impl<'a> MinGanCiShiBieService<'a> {
4890#[instrument(skip(self, params))]
4892 pub async fn get_sensitive_word_analyze_query(&self, params: GetSensitiveWordAnalyzeQueryParams) -> Result<crate::models::PostSensitiveWordAnalyze200Response> {
4893 let mut path = "/api/v1/sensitive-word/analyze-query".to_string();
4894
4895 let mut query: Vec<(String, String)> = Vec::new();
4896 query.push(("keyword".to_string(), params.keyword_query.clone()));
4897 if let Some(value) = ¶ms._t {
4898 query.push(("_t".to_string(), value.clone()));
4899 }
4900 let query = if query.is_empty() { None } else { Some(query) };
4901
4902 let mut extra_headers = HeaderMap::new();
4903 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4904 let body = None;
4905
4906 self.client
4907 .request_json(
4908 Method::GET,
4909 &path,
4910 headers,
4911 query,
4912 body,
4913 params.disable_cache,
4914 )
4915 .await
4916 }
4917#[instrument(skip(self, params))]
4919 pub async fn post_sensitive_word_analyze(&self, params: PostSensitiveWordAnalyzeParams) -> Result<crate::models::PostSensitiveWordAnalyze200Response> {
4920 let mut path = "/api/v1/sensitive-word/analyze".to_string();
4921
4922 let mut query: Vec<(String, String)> = Vec::new();
4923 if let Some(value) = ¶ms._t {
4924 query.push(("_t".to_string(), value.clone()));
4925 }
4926 let query = if query.is_empty() { None } else { Some(query) };
4927
4928 let mut extra_headers = HeaderMap::new();
4929 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4930 let body = params.body.clone();
4931
4932 self.client
4933 .request_json(
4934 Method::POST,
4935 &path,
4936 headers,
4937 query,
4938 body,
4939 params.disable_cache,
4940 )
4941 .await
4942 }
4943#[instrument(skip(self, params))]
4945 pub async fn post_sensitive_word_quick_check(&self, params: PostSensitiveWordQuickCheckParams) -> Result<crate::models::PostSensitiveWordQuickCheck200Response> {
4946 let mut path = "/api/v1/text/profanitycheck".to_string();
4947
4948 let mut query: Vec<(String, String)> = Vec::new();
4949 if let Some(value) = ¶ms._t {
4950 query.push(("_t".to_string(), value.clone()));
4951 }
4952 let query = if query.is_empty() { None } else { Some(query) };
4953
4954 let mut extra_headers = HeaderMap::new();
4955 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
4956 let body = params.body.clone();
4957
4958 self.client
4959 .request_json(
4960 Method::POST,
4961 &path,
4962 headers,
4963 query,
4964 body,
4965 params.disable_cache,
4966 )
4967 .await
4968 }
4969}
4970
4971#[derive(Debug, Clone)]
4972pub struct GetSensitiveWordAnalyzeQueryParams {
4973 pub keyword_query: String,
4974 pub disable_cache: Option<bool>,
4975 pub _t: Option<String>,
4976}
4977
4978impl GetSensitiveWordAnalyzeQueryParams {
4979 pub fn new(keyword_query: impl Into<String>) -> Self {
4980 Self {
4981 keyword_query: keyword_query.into(),
4982 disable_cache: None,
4983 _t: None,
4984 }
4985 }
4986 pub fn disable_cache(mut self, value: bool) -> Self {
4987 self.disable_cache = Some(value);
4988 self
4989 }
4990 pub fn _t(mut self, value: impl Into<String>) -> Self {
4991 self._t = Some(value.into());
4992 self
4993 }
4994}
4995
4996#[derive(Debug, Clone)]
4997pub struct PostSensitiveWordAnalyzeParams {
4998 pub body: Option<Value>,
4999 pub disable_cache: Option<bool>,
5000 pub _t: Option<String>,
5001}
5002
5003impl PostSensitiveWordAnalyzeParams {
5004 pub fn new() -> Self {
5005 Self {
5006 body: None,
5007 disable_cache: None,
5008 _t: None,
5009 }
5010 }
5011 pub fn disable_cache(mut self, value: bool) -> Self {
5012 self.disable_cache = Some(value);
5013 self
5014 }
5015 pub fn _t(mut self, value: impl Into<String>) -> Self {
5016 self._t = Some(value.into());
5017 self
5018 }
5019 pub fn body(mut self, value: Value) -> Self {
5020 self.body = Some(value);
5021 self
5022 }
5023}
5024
5025#[derive(Debug, Clone)]
5026pub struct PostSensitiveWordQuickCheckParams {
5027 pub body: Option<Value>,
5028 pub disable_cache: Option<bool>,
5029 pub _t: Option<String>,
5030}
5031
5032impl PostSensitiveWordQuickCheckParams {
5033 pub fn new() -> Self {
5034 Self {
5035 body: None,
5036 disable_cache: None,
5037 _t: None,
5038 }
5039 }
5040 pub fn disable_cache(mut self, value: bool) -> Self {
5041 self.disable_cache = Some(value);
5042 self
5043 }
5044 pub fn _t(mut self, value: impl Into<String>) -> Self {
5045 self._t = Some(value.into());
5046 self
5047 }
5048 pub fn body(mut self, value: Value) -> Self {
5049 self.body = Some(value);
5050 self
5051 }
5052}
5053#[derive(Debug, Clone)]
5054pub struct ZhiNengSouSuoService<'a> {
5055 pub(crate) client: &'a Client,
5056}
5057
5058impl<'a> ZhiNengSouSuoService<'a> {
5059#[instrument(skip(self))]
5061 pub async fn get_search_engines(&self) -> Result<crate::models::GetSearchEngines200Response> {
5062 let mut path = "/api/v1/search/engines".to_string();
5063
5064 let mut query: Vec<(String, String)> = Vec::new();
5065 let query = if query.is_empty() { None } else { Some(query) };
5066
5067 let mut extra_headers = HeaderMap::new();
5068 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5069 let body = None;
5070
5071 self.client
5072 .request_json(
5073 Method::GET,
5074 &path,
5075 headers,
5076 query,
5077 body,
5078 None,
5079 )
5080 .await
5081 }
5082#[instrument(skip(self, params))]
5084 pub async fn post_search_aggregate(&self, params: PostSearchAggregateParams) -> Result<crate::models::PostSearchAggregate200Response> {
5085 let mut path = "/api/v1/search/aggregate".to_string();
5086
5087 let mut query: Vec<(String, String)> = Vec::new();
5088 if let Some(value) = ¶ms._t {
5089 query.push(("_t".to_string(), value.clone()));
5090 }
5091 let query = if query.is_empty() { None } else { Some(query) };
5092
5093 let mut extra_headers = HeaderMap::new();
5094 let headers = if extra_headers.is_empty() { None } else { Some(extra_headers) };
5095 let body = params.body.clone();
5096
5097 self.client
5098 .request_json(
5099 Method::POST,
5100 &path,
5101 headers,
5102 query,
5103 body,
5104 params.disable_cache,
5105 )
5106 .await
5107 }
5108}
5109
5110
5111#[derive(Debug, Clone)]
5112pub struct PostSearchAggregateParams {
5113 pub body: Option<Value>,
5114 pub disable_cache: Option<bool>,
5115 pub _t: Option<String>,
5116}
5117
5118impl PostSearchAggregateParams {
5119 pub fn new() -> Self {
5120 Self {
5121 body: None,
5122 disable_cache: None,
5123 _t: None,
5124 }
5125 }
5126 pub fn disable_cache(mut self, value: bool) -> Self {
5127 self.disable_cache = Some(value);
5128 self
5129 }
5130 pub fn _t(mut self, value: impl Into<String>) -> Self {
5131 self._t = Some(value.into());
5132 self
5133 }
5134 pub fn body(mut self, value: Value) -> Self {
5135 self.body = Some(value);
5136 self
5137 }
5138}