zsgf_client/apis/
user_api.rs

1/*
2 * 全部  API 文档
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`user`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum UserError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`user_clear`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum UserClearError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`user_common_interests`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum UserCommonInterestsError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`user_delete`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum UserDeleteError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`user_email_sign_in`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum UserEmailSignInError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`user_email_sign_up`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum UserEmailSignUpError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`user_export`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum UserExportError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`user_follow_user`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum UserFollowUserError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`user_follower_put`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum UserFollowerPutError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`user_followers`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum UserFollowersError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`user_following`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum UserFollowingError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`user_friends_near_by`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum UserFriendsNearByError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`user_import`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum UserImportError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`user_location`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum UserLocationError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`user_location_delete`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum UserLocationDeleteError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`user_location_post`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum UserLocationPostError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`user_location_put`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum UserLocationPutError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`user_locations`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum UserLocationsError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`user_mutual_followers`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum UserMutualFollowersError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`user_mutual_followings`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum UserMutualFollowingsError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`user_o_auth_account_bind`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum UserOAuthAccountBindError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`user_o_auth_account_sign_in`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum UserOAuthAccountSignInError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`user_o_auth_accounts`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum UserOAuthAccountsError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`user_o_auth_accounts_put_bind`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum UserOAuthAccountsPutBindError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`user_o_auth_accounts_un_bind`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum UserOAuthAccountsUnBindError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`user_phone_sign_in`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum UserPhoneSignInError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`user_phone_sign_up`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum UserPhoneSignUpError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`user_profile`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum UserProfileError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`user_put`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum UserPutError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`user_qr_code_pre_sign_in`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum UserQrCodePreSignInError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`user_qr_code_scan`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum UserQrCodeScanError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`user_qr_code_sign_in`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum UserQrCodeSignInError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`user_qr_code_sign_up`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum UserQrCodeSignUpError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`user_reset_pwd`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum UserResetPwdError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`user_send_email_code`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum UserSendEmailCodeError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`user_send_sms_code`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum UserSendSmsCodeError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`user_sign_in`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum UserSignInError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`user_sign_up`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum UserSignUpError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`user_two_factor_auth`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum UserTwoFactorAuthError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`user_unfollow_user`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum UserUnfollowUserError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`user_union_id_sign_in`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum UserUnionIdSignInError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`user_union_id_sign_up`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum UserUnionIdSignUpError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`user_update_profile`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum UserUpdateProfileError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`users`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum UsersError {
323    UnknownValue(serde_json::Value),
324}
325
326
327/// 根据用户ID获取用户详情
328pub async fn user(configuration: &configuration::Configuration, id: i64, app_key: &str) -> Result<models::UserApiResponse, Error<UserError>> {
329    // add a prefix to parameters to efficiently prevent name collisions
330    let p_id = id;
331    let p_app_key = app_key;
332
333    let uri_str = format!("{}/User/{appKey}/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
334    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
335
336    if let Some(ref user_agent) = configuration.user_agent {
337        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
338    }
339    if let Some(ref token) = configuration.bearer_access_token {
340        req_builder = req_builder.bearer_auth(token.to_owned());
341    };
342
343    let req = req_builder.build()?;
344    let resp = configuration.client.execute(req).await?;
345
346    let status = resp.status();
347    let content_type = resp
348        .headers()
349        .get("content-type")
350        .and_then(|v| v.to_str().ok())
351        .unwrap_or("application/octet-stream");
352    let content_type = super::ContentType::from(content_type);
353
354    if !status.is_client_error() && !status.is_server_error() {
355        let content = resp.text().await?;
356        match content_type {
357            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
358            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserApiResponse`"))),
359            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserApiResponse`")))),
360        }
361    } else {
362        let content = resp.text().await?;
363        let entity: Option<UserError> = serde_json::from_str(&content).ok();
364        Err(Error::ResponseError(ResponseContent { status, content, entity }))
365    }
366}
367
368/// 清空用户数据
369pub async fn user_clear(configuration: &configuration::Configuration, app_key: &str) -> Result<models::BooleanApiResponse, Error<UserClearError>> {
370    // add a prefix to parameters to efficiently prevent name collisions
371    let p_app_key = app_key;
372
373    let uri_str = format!("{}/User/{appKey}/Clear", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
374    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
375
376    if let Some(ref user_agent) = configuration.user_agent {
377        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
378    }
379    if let Some(ref token) = configuration.bearer_access_token {
380        req_builder = req_builder.bearer_auth(token.to_owned());
381    };
382
383    let req = req_builder.build()?;
384    let resp = configuration.client.execute(req).await?;
385
386    let status = resp.status();
387    let content_type = resp
388        .headers()
389        .get("content-type")
390        .and_then(|v| v.to_str().ok())
391        .unwrap_or("application/octet-stream");
392    let content_type = super::ContentType::from(content_type);
393
394    if !status.is_client_error() && !status.is_server_error() {
395        let content = resp.text().await?;
396        match content_type {
397            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
398            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
399            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
400        }
401    } else {
402        let content = resp.text().await?;
403        let entity: Option<UserClearError> = serde_json::from_str(&content).ok();
404        Err(Error::ResponseError(ResponseContent { status, content, entity }))
405    }
406}
407
408/// 推荐有共同爱好的用户
409pub async fn user_common_interests(configuration: &configuration::Configuration, app_key: &str, tag: Option<&str>, skip: Option<i32>, take: Option<i32>) -> Result<models::UserCommonInterestsResultApiResponse, Error<UserCommonInterestsError>> {
410    // add a prefix to parameters to efficiently prevent name collisions
411    let p_app_key = app_key;
412    let p_tag = tag;
413    let p_skip = skip;
414    let p_take = take;
415
416    let uri_str = format!("{}/User/{appKey}/Friends/CommonInterests", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
417    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
418
419    if let Some(ref param_value) = p_tag {
420        req_builder = req_builder.query(&[("tag", &param_value.to_string())]);
421    }
422    if let Some(ref param_value) = p_skip {
423        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
424    }
425    if let Some(ref param_value) = p_take {
426        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
427    }
428    if let Some(ref user_agent) = configuration.user_agent {
429        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
430    }
431    if let Some(ref token) = configuration.bearer_access_token {
432        req_builder = req_builder.bearer_auth(token.to_owned());
433    };
434
435    let req = req_builder.build()?;
436    let resp = configuration.client.execute(req).await?;
437
438    let status = resp.status();
439    let content_type = resp
440        .headers()
441        .get("content-type")
442        .and_then(|v| v.to_str().ok())
443        .unwrap_or("application/octet-stream");
444    let content_type = super::ContentType::from(content_type);
445
446    if !status.is_client_error() && !status.is_server_error() {
447        let content = resp.text().await?;
448        match content_type {
449            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
450            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserCommonInterestsResultApiResponse`"))),
451            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserCommonInterestsResultApiResponse`")))),
452        }
453    } else {
454        let content = resp.text().await?;
455        let entity: Option<UserCommonInterestsError> = serde_json::from_str(&content).ok();
456        Err(Error::ResponseError(ResponseContent { status, content, entity }))
457    }
458}
459
460/// 根据用户ID删除用户
461pub async fn user_delete(configuration: &configuration::Configuration, id: i64, app_key: &str) -> Result<models::BooleanApiResponse, Error<UserDeleteError>> {
462    // add a prefix to parameters to efficiently prevent name collisions
463    let p_id = id;
464    let p_app_key = app_key;
465
466    let uri_str = format!("{}/User/{appKey}/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
467    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
468
469    if let Some(ref user_agent) = configuration.user_agent {
470        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
471    }
472    if let Some(ref token) = configuration.bearer_access_token {
473        req_builder = req_builder.bearer_auth(token.to_owned());
474    };
475
476    let req = req_builder.build()?;
477    let resp = configuration.client.execute(req).await?;
478
479    let status = resp.status();
480    let content_type = resp
481        .headers()
482        .get("content-type")
483        .and_then(|v| v.to_str().ok())
484        .unwrap_or("application/octet-stream");
485    let content_type = super::ContentType::from(content_type);
486
487    if !status.is_client_error() && !status.is_server_error() {
488        let content = resp.text().await?;
489        match content_type {
490            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
491            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
492            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
493        }
494    } else {
495        let content = resp.text().await?;
496        let entity: Option<UserDeleteError> = serde_json::from_str(&content).ok();
497        Err(Error::ResponseError(ResponseContent { status, content, entity }))
498    }
499}
500
501/// 使用邮箱进行登录
502pub async fn user_email_sign_in(configuration: &configuration::Configuration, app_key: &str, email_sign_in_request: Option<models::EmailSignInRequest>) -> Result<models::TokenModelApiResponse, Error<UserEmailSignInError>> {
503    // add a prefix to parameters to efficiently prevent name collisions
504    let p_app_key = app_key;
505    let p_email_sign_in_request = email_sign_in_request;
506
507    let uri_str = format!("{}/User/{appKey}/EmailSignIn", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
508    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
509
510    if let Some(ref user_agent) = configuration.user_agent {
511        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
512    }
513    if let Some(ref token) = configuration.bearer_access_token {
514        req_builder = req_builder.bearer_auth(token.to_owned());
515    };
516    req_builder = req_builder.json(&p_email_sign_in_request);
517
518    let req = req_builder.build()?;
519    let resp = configuration.client.execute(req).await?;
520
521    let status = resp.status();
522    let content_type = resp
523        .headers()
524        .get("content-type")
525        .and_then(|v| v.to_str().ok())
526        .unwrap_or("application/octet-stream");
527    let content_type = super::ContentType::from(content_type);
528
529    if !status.is_client_error() && !status.is_server_error() {
530        let content = resp.text().await?;
531        match content_type {
532            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
533            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
534            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
535        }
536    } else {
537        let content = resp.text().await?;
538        let entity: Option<UserEmailSignInError> = serde_json::from_str(&content).ok();
539        Err(Error::ResponseError(ResponseContent { status, content, entity }))
540    }
541}
542
543/// 使用邮箱进行注册
544pub async fn user_email_sign_up(configuration: &configuration::Configuration, app_key: &str, email_sign_up_request: Option<models::EmailSignUpRequest>) -> Result<models::TokenModelApiResponse, Error<UserEmailSignUpError>> {
545    // add a prefix to parameters to efficiently prevent name collisions
546    let p_app_key = app_key;
547    let p_email_sign_up_request = email_sign_up_request;
548
549    let uri_str = format!("{}/User/{appKey}/EmailSignUp", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
550    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
551
552    if let Some(ref user_agent) = configuration.user_agent {
553        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
554    }
555    if let Some(ref token) = configuration.bearer_access_token {
556        req_builder = req_builder.bearer_auth(token.to_owned());
557    };
558    req_builder = req_builder.json(&p_email_sign_up_request);
559
560    let req = req_builder.build()?;
561    let resp = configuration.client.execute(req).await?;
562
563    let status = resp.status();
564    let content_type = resp
565        .headers()
566        .get("content-type")
567        .and_then(|v| v.to_str().ok())
568        .unwrap_or("application/octet-stream");
569    let content_type = super::ContentType::from(content_type);
570
571    if !status.is_client_error() && !status.is_server_error() {
572        let content = resp.text().await?;
573        match content_type {
574            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
575            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
576            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
577        }
578    } else {
579        let content = resp.text().await?;
580        let entity: Option<UserEmailSignUpError> = serde_json::from_str(&content).ok();
581        Err(Error::ResponseError(ResponseContent { status, content, entity }))
582    }
583}
584
585/// 导出所有用户数据为Excel文件
586pub async fn user_export(configuration: &configuration::Configuration, app_key: &str) -> Result<reqwest::Response, Error<UserExportError>> {
587    // add a prefix to parameters to efficiently prevent name collisions
588    let p_app_key = app_key;
589
590    let uri_str = format!("{}/User/{appKey}/Export", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
591    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
592
593    if let Some(ref user_agent) = configuration.user_agent {
594        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
595    }
596    if let Some(ref token) = configuration.bearer_access_token {
597        req_builder = req_builder.bearer_auth(token.to_owned());
598    };
599
600    let req = req_builder.build()?;
601    let resp = configuration.client.execute(req).await?;
602
603    let status = resp.status();
604
605    if !status.is_client_error() && !status.is_server_error() {
606        Ok(resp)
607    } else {
608        let content = resp.text().await?;
609        let entity: Option<UserExportError> = serde_json::from_str(&content).ok();
610        Err(Error::ResponseError(ResponseContent { status, content, entity }))
611    }
612}
613
614/// 关注指定用户
615pub async fn user_follow_user(configuration: &configuration::Configuration, user_id: i64, app_key: &str) -> Result<models::BooleanApiResponse, Error<UserFollowUserError>> {
616    // add a prefix to parameters to efficiently prevent name collisions
617    let p_user_id = user_id;
618    let p_app_key = app_key;
619
620    let uri_str = format!("{}/User/{appKey}/Follower/{userId}", configuration.base_path, userId=p_user_id, appKey=crate::apis::urlencode(p_app_key));
621    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
622
623    if let Some(ref user_agent) = configuration.user_agent {
624        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
625    }
626    if let Some(ref token) = configuration.bearer_access_token {
627        req_builder = req_builder.bearer_auth(token.to_owned());
628    };
629
630    let req = req_builder.build()?;
631    let resp = configuration.client.execute(req).await?;
632
633    let status = resp.status();
634    let content_type = resp
635        .headers()
636        .get("content-type")
637        .and_then(|v| v.to_str().ok())
638        .unwrap_or("application/octet-stream");
639    let content_type = super::ContentType::from(content_type);
640
641    if !status.is_client_error() && !status.is_server_error() {
642        let content = resp.text().await?;
643        match content_type {
644            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
645            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
646            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
647        }
648    } else {
649        let content = resp.text().await?;
650        let entity: Option<UserFollowUserError> = serde_json::from_str(&content).ok();
651        Err(Error::ResponseError(ResponseContent { status, content, entity }))
652    }
653}
654
655/// 根据粉丝ID更新粉丝信息
656pub async fn user_follower_put(configuration: &configuration::Configuration, id: i64, app_key: &str, follower_put_model: Option<models::FollowerPutModel>) -> Result<models::BooleanApiResponse, Error<UserFollowerPutError>> {
657    // add a prefix to parameters to efficiently prevent name collisions
658    let p_id = id;
659    let p_app_key = app_key;
660    let p_follower_put_model = follower_put_model;
661
662    let uri_str = format!("{}/User/{appKey}/Follower/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
663    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
664
665    if let Some(ref user_agent) = configuration.user_agent {
666        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
667    }
668    if let Some(ref token) = configuration.bearer_access_token {
669        req_builder = req_builder.bearer_auth(token.to_owned());
670    };
671    req_builder = req_builder.json(&p_follower_put_model);
672
673    let req = req_builder.build()?;
674    let resp = configuration.client.execute(req).await?;
675
676    let status = resp.status();
677    let content_type = resp
678        .headers()
679        .get("content-type")
680        .and_then(|v| v.to_str().ok())
681        .unwrap_or("application/octet-stream");
682    let content_type = super::ContentType::from(content_type);
683
684    if !status.is_client_error() && !status.is_server_error() {
685        let content = resp.text().await?;
686        match content_type {
687            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
688            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
689            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
690        }
691    } else {
692        let content = resp.text().await?;
693        let entity: Option<UserFollowerPutError> = serde_json::from_str(&content).ok();
694        Err(Error::ResponseError(ResponseContent { status, content, entity }))
695    }
696}
697
698/// 根据条件获取我的粉丝列表
699pub async fn user_followers(configuration: &configuration::Configuration, app_key: &str, tag: Option<&str>, status: Option<&str>, skip: Option<i32>, take: Option<i32>) -> Result<models::UserFollowersResultApiResponse, Error<UserFollowersError>> {
700    // add a prefix to parameters to efficiently prevent name collisions
701    let p_app_key = app_key;
702    let p_tag = tag;
703    let p_status = status;
704    let p_skip = skip;
705    let p_take = take;
706
707    let uri_str = format!("{}/User/{appKey}/Followers", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
708    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
709
710    if let Some(ref param_value) = p_tag {
711        req_builder = req_builder.query(&[("tag", &param_value.to_string())]);
712    }
713    if let Some(ref param_value) = p_status {
714        req_builder = req_builder.query(&[("status", &param_value.to_string())]);
715    }
716    if let Some(ref param_value) = p_skip {
717        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
718    }
719    if let Some(ref param_value) = p_take {
720        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
721    }
722    if let Some(ref user_agent) = configuration.user_agent {
723        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
724    }
725    if let Some(ref token) = configuration.bearer_access_token {
726        req_builder = req_builder.bearer_auth(token.to_owned());
727    };
728
729    let req = req_builder.build()?;
730    let resp = configuration.client.execute(req).await?;
731
732    let status = resp.status();
733    let content_type = resp
734        .headers()
735        .get("content-type")
736        .and_then(|v| v.to_str().ok())
737        .unwrap_or("application/octet-stream");
738    let content_type = super::ContentType::from(content_type);
739
740    if !status.is_client_error() && !status.is_server_error() {
741        let content = resp.text().await?;
742        match content_type {
743            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
744            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserFollowersResultApiResponse`"))),
745            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserFollowersResultApiResponse`")))),
746        }
747    } else {
748        let content = resp.text().await?;
749        let entity: Option<UserFollowersError> = serde_json::from_str(&content).ok();
750        Err(Error::ResponseError(ResponseContent { status, content, entity }))
751    }
752}
753
754/// 根据条件获取我的关注列表
755pub async fn user_following(configuration: &configuration::Configuration, app_key: &str, tag: Option<&str>, status: Option<&str>, skip: Option<i32>, take: Option<i32>) -> Result<models::UserFollowingResultApiResponse, Error<UserFollowingError>> {
756    // add a prefix to parameters to efficiently prevent name collisions
757    let p_app_key = app_key;
758    let p_tag = tag;
759    let p_status = status;
760    let p_skip = skip;
761    let p_take = take;
762
763    let uri_str = format!("{}/User/{appKey}/Following", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
764    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
765
766    if let Some(ref param_value) = p_tag {
767        req_builder = req_builder.query(&[("tag", &param_value.to_string())]);
768    }
769    if let Some(ref param_value) = p_status {
770        req_builder = req_builder.query(&[("status", &param_value.to_string())]);
771    }
772    if let Some(ref param_value) = p_skip {
773        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
774    }
775    if let Some(ref param_value) = p_take {
776        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
777    }
778    if let Some(ref user_agent) = configuration.user_agent {
779        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
780    }
781    if let Some(ref token) = configuration.bearer_access_token {
782        req_builder = req_builder.bearer_auth(token.to_owned());
783    };
784
785    let req = req_builder.build()?;
786    let resp = configuration.client.execute(req).await?;
787
788    let status = resp.status();
789    let content_type = resp
790        .headers()
791        .get("content-type")
792        .and_then(|v| v.to_str().ok())
793        .unwrap_or("application/octet-stream");
794    let content_type = super::ContentType::from(content_type);
795
796    if !status.is_client_error() && !status.is_server_error() {
797        let content = resp.text().await?;
798        match content_type {
799            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
800            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserFollowingResultApiResponse`"))),
801            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserFollowingResultApiResponse`")))),
802        }
803    } else {
804        let content = resp.text().await?;
805        let entity: Option<UserFollowingError> = serde_json::from_str(&content).ok();
806        Err(Error::ResponseError(ResponseContent { status, content, entity }))
807    }
808}
809
810/// 推荐附近的用户
811pub async fn user_friends_near_by(configuration: &configuration::Configuration, x: f64, y: f64, distance: i64, app_key: &str, gender: Option<&str>, age_s: Option<i32>, age_e: Option<i32>, tag: Option<&str>, r#type: Option<&str>, skip: Option<i32>, take: Option<i32>) -> Result<models::UserFriendsNearByResultApiResponse, Error<UserFriendsNearByError>> {
812    // add a prefix to parameters to efficiently prevent name collisions
813    let p_x = x;
814    let p_y = y;
815    let p_distance = distance;
816    let p_app_key = app_key;
817    let p_gender = gender;
818    let p_age_s = age_s;
819    let p_age_e = age_e;
820    let p_tag = tag;
821    let p_type = r#type;
822    let p_skip = skip;
823    let p_take = take;
824
825    let uri_str = format!("{}/User/{appKey}/Friends/NearBy", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
826    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
827
828    req_builder = req_builder.query(&[("x", &p_x.to_string())]);
829    req_builder = req_builder.query(&[("y", &p_y.to_string())]);
830    req_builder = req_builder.query(&[("distance", &p_distance.to_string())]);
831    if let Some(ref param_value) = p_gender {
832        req_builder = req_builder.query(&[("gender", &param_value.to_string())]);
833    }
834    if let Some(ref param_value) = p_age_s {
835        req_builder = req_builder.query(&[("ageS", &param_value.to_string())]);
836    }
837    if let Some(ref param_value) = p_age_e {
838        req_builder = req_builder.query(&[("ageE", &param_value.to_string())]);
839    }
840    if let Some(ref param_value) = p_tag {
841        req_builder = req_builder.query(&[("tag", &param_value.to_string())]);
842    }
843    if let Some(ref param_value) = p_type {
844        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
845    }
846    if let Some(ref param_value) = p_skip {
847        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
848    }
849    if let Some(ref param_value) = p_take {
850        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
851    }
852    if let Some(ref user_agent) = configuration.user_agent {
853        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
854    }
855    if let Some(ref token) = configuration.bearer_access_token {
856        req_builder = req_builder.bearer_auth(token.to_owned());
857    };
858
859    let req = req_builder.build()?;
860    let resp = configuration.client.execute(req).await?;
861
862    let status = resp.status();
863    let content_type = resp
864        .headers()
865        .get("content-type")
866        .and_then(|v| v.to_str().ok())
867        .unwrap_or("application/octet-stream");
868    let content_type = super::ContentType::from(content_type);
869
870    if !status.is_client_error() && !status.is_server_error() {
871        let content = resp.text().await?;
872        match content_type {
873            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
874            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserFriendsNearByResultApiResponse`"))),
875            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserFriendsNearByResultApiResponse`")))),
876        }
877    } else {
878        let content = resp.text().await?;
879        let entity: Option<UserFriendsNearByError> = serde_json::from_str(&content).ok();
880        Err(Error::ResponseError(ResponseContent { status, content, entity }))
881    }
882}
883
884/// 导入用户数据
885pub async fn user_import(configuration: &configuration::Configuration, app_key: &str, check: Option<bool>, file: Option<std::path::PathBuf>) -> Result<models::BooleanApiResponse, Error<UserImportError>> {
886    // add a prefix to parameters to efficiently prevent name collisions
887    let p_app_key = app_key;
888    let p_check = check;
889    let p_file = file;
890
891    let uri_str = format!("{}/User/{appKey}/Import", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
892    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
893
894    if let Some(ref param_value) = p_check {
895        req_builder = req_builder.query(&[("check", &param_value.to_string())]);
896    }
897    if let Some(ref user_agent) = configuration.user_agent {
898        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
899    }
900    if let Some(ref token) = configuration.bearer_access_token {
901        req_builder = req_builder.bearer_auth(token.to_owned());
902    };
903    let mut multipart_form = reqwest::multipart::Form::new();
904    // TODO: support file upload for 'file' parameter
905    req_builder = req_builder.multipart(multipart_form);
906
907    let req = req_builder.build()?;
908    let resp = configuration.client.execute(req).await?;
909
910    let status = resp.status();
911    let content_type = resp
912        .headers()
913        .get("content-type")
914        .and_then(|v| v.to_str().ok())
915        .unwrap_or("application/octet-stream");
916    let content_type = super::ContentType::from(content_type);
917
918    if !status.is_client_error() && !status.is_server_error() {
919        let content = resp.text().await?;
920        match content_type {
921            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
922            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
923            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
924        }
925    } else {
926        let content = resp.text().await?;
927        let entity: Option<UserImportError> = serde_json::from_str(&content).ok();
928        Err(Error::ResponseError(ResponseContent { status, content, entity }))
929    }
930}
931
932/// 根据位置ID获取位置详情
933pub async fn user_location(configuration: &configuration::Configuration, id: i64, app_key: &str) -> Result<models::GeoLocationModelApiResponse, Error<UserLocationError>> {
934    // add a prefix to parameters to efficiently prevent name collisions
935    let p_id = id;
936    let p_app_key = app_key;
937
938    let uri_str = format!("{}/User/{appKey}/Location/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
939    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
940
941    if let Some(ref user_agent) = configuration.user_agent {
942        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
943    }
944    if let Some(ref token) = configuration.bearer_access_token {
945        req_builder = req_builder.bearer_auth(token.to_owned());
946    };
947
948    let req = req_builder.build()?;
949    let resp = configuration.client.execute(req).await?;
950
951    let status = resp.status();
952    let content_type = resp
953        .headers()
954        .get("content-type")
955        .and_then(|v| v.to_str().ok())
956        .unwrap_or("application/octet-stream");
957    let content_type = super::ContentType::from(content_type);
958
959    if !status.is_client_error() && !status.is_server_error() {
960        let content = resp.text().await?;
961        match content_type {
962            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
963            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeoLocationModelApiResponse`"))),
964            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GeoLocationModelApiResponse`")))),
965        }
966    } else {
967        let content = resp.text().await?;
968        let entity: Option<UserLocationError> = serde_json::from_str(&content).ok();
969        Err(Error::ResponseError(ResponseContent { status, content, entity }))
970    }
971}
972
973/// 根据位置ID删除位置信息
974pub async fn user_location_delete(configuration: &configuration::Configuration, id: i64, app_key: &str) -> Result<models::BooleanApiResponse, Error<UserLocationDeleteError>> {
975    // add a prefix to parameters to efficiently prevent name collisions
976    let p_id = id;
977    let p_app_key = app_key;
978
979    let uri_str = format!("{}/User/{appKey}/Location/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
980    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
981
982    if let Some(ref user_agent) = configuration.user_agent {
983        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
984    }
985    if let Some(ref token) = configuration.bearer_access_token {
986        req_builder = req_builder.bearer_auth(token.to_owned());
987    };
988
989    let req = req_builder.build()?;
990    let resp = configuration.client.execute(req).await?;
991
992    let status = resp.status();
993    let content_type = resp
994        .headers()
995        .get("content-type")
996        .and_then(|v| v.to_str().ok())
997        .unwrap_or("application/octet-stream");
998    let content_type = super::ContentType::from(content_type);
999
1000    if !status.is_client_error() && !status.is_server_error() {
1001        let content = resp.text().await?;
1002        match content_type {
1003            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1004            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1005            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1006        }
1007    } else {
1008        let content = resp.text().await?;
1009        let entity: Option<UserLocationDeleteError> = serde_json::from_str(&content).ok();
1010        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1011    }
1012}
1013
1014/// 添加新的位置信息
1015pub async fn user_location_post(configuration: &configuration::Configuration, app_key: &str, geo_location_model: Option<models::GeoLocationModel>) -> Result<models::UserLocationPostResultApiResponse, Error<UserLocationPostError>> {
1016    // add a prefix to parameters to efficiently prevent name collisions
1017    let p_app_key = app_key;
1018    let p_geo_location_model = geo_location_model;
1019
1020    let uri_str = format!("{}/User/{appKey}/Location", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1021    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1022
1023    if let Some(ref user_agent) = configuration.user_agent {
1024        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1025    }
1026    if let Some(ref token) = configuration.bearer_access_token {
1027        req_builder = req_builder.bearer_auth(token.to_owned());
1028    };
1029    req_builder = req_builder.json(&p_geo_location_model);
1030
1031    let req = req_builder.build()?;
1032    let resp = configuration.client.execute(req).await?;
1033
1034    let status = resp.status();
1035    let content_type = resp
1036        .headers()
1037        .get("content-type")
1038        .and_then(|v| v.to_str().ok())
1039        .unwrap_or("application/octet-stream");
1040    let content_type = super::ContentType::from(content_type);
1041
1042    if !status.is_client_error() && !status.is_server_error() {
1043        let content = resp.text().await?;
1044        match content_type {
1045            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1046            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLocationPostResultApiResponse`"))),
1047            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLocationPostResultApiResponse`")))),
1048        }
1049    } else {
1050        let content = resp.text().await?;
1051        let entity: Option<UserLocationPostError> = serde_json::from_str(&content).ok();
1052        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1053    }
1054}
1055
1056/// 根据位置ID更新位置信息
1057pub async fn user_location_put(configuration: &configuration::Configuration, id: i64, app_key: &str, geo_location_model: Option<models::GeoLocationModel>) -> Result<models::BooleanApiResponse, Error<UserLocationPutError>> {
1058    // add a prefix to parameters to efficiently prevent name collisions
1059    let p_id = id;
1060    let p_app_key = app_key;
1061    let p_geo_location_model = geo_location_model;
1062
1063    let uri_str = format!("{}/User/{appKey}/Location/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
1064    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1065
1066    if let Some(ref user_agent) = configuration.user_agent {
1067        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1068    }
1069    if let Some(ref token) = configuration.bearer_access_token {
1070        req_builder = req_builder.bearer_auth(token.to_owned());
1071    };
1072    req_builder = req_builder.json(&p_geo_location_model);
1073
1074    let req = req_builder.build()?;
1075    let resp = configuration.client.execute(req).await?;
1076
1077    let status = resp.status();
1078    let content_type = resp
1079        .headers()
1080        .get("content-type")
1081        .and_then(|v| v.to_str().ok())
1082        .unwrap_or("application/octet-stream");
1083    let content_type = super::ContentType::from(content_type);
1084
1085    if !status.is_client_error() && !status.is_server_error() {
1086        let content = resp.text().await?;
1087        match content_type {
1088            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1089            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1090            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1091        }
1092    } else {
1093        let content = resp.text().await?;
1094        let entity: Option<UserLocationPutError> = serde_json::from_str(&content).ok();
1095        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1096    }
1097}
1098
1099/// 根据条件获取位置列表
1100pub async fn user_locations(configuration: &configuration::Configuration, app_key: &str, tag: Option<&str>, r#type: Option<&str>, x: Option<f64>, y: Option<f64>, sphere: Option<i64>, skip: Option<i32>, take: Option<i32>) -> Result<models::UserLocationsResultApiResponse, Error<UserLocationsError>> {
1101    // add a prefix to parameters to efficiently prevent name collisions
1102    let p_app_key = app_key;
1103    let p_tag = tag;
1104    let p_type = r#type;
1105    let p_x = x;
1106    let p_y = y;
1107    let p_sphere = sphere;
1108    let p_skip = skip;
1109    let p_take = take;
1110
1111    let uri_str = format!("{}/User/{appKey}/Locations", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1112    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1113
1114    if let Some(ref param_value) = p_tag {
1115        req_builder = req_builder.query(&[("tag", &param_value.to_string())]);
1116    }
1117    if let Some(ref param_value) = p_type {
1118        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
1119    }
1120    if let Some(ref param_value) = p_x {
1121        req_builder = req_builder.query(&[("x", &param_value.to_string())]);
1122    }
1123    if let Some(ref param_value) = p_y {
1124        req_builder = req_builder.query(&[("y", &param_value.to_string())]);
1125    }
1126    if let Some(ref param_value) = p_sphere {
1127        req_builder = req_builder.query(&[("sphere", &param_value.to_string())]);
1128    }
1129    if let Some(ref param_value) = p_skip {
1130        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
1131    }
1132    if let Some(ref param_value) = p_take {
1133        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
1134    }
1135    if let Some(ref user_agent) = configuration.user_agent {
1136        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1137    }
1138    if let Some(ref token) = configuration.bearer_access_token {
1139        req_builder = req_builder.bearer_auth(token.to_owned());
1140    };
1141
1142    let req = req_builder.build()?;
1143    let resp = configuration.client.execute(req).await?;
1144
1145    let status = resp.status();
1146    let content_type = resp
1147        .headers()
1148        .get("content-type")
1149        .and_then(|v| v.to_str().ok())
1150        .unwrap_or("application/octet-stream");
1151    let content_type = super::ContentType::from(content_type);
1152
1153    if !status.is_client_error() && !status.is_server_error() {
1154        let content = resp.text().await?;
1155        match content_type {
1156            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1157            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLocationsResultApiResponse`"))),
1158            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLocationsResultApiResponse`")))),
1159        }
1160    } else {
1161        let content = resp.text().await?;
1162        let entity: Option<UserLocationsError> = serde_json::from_str(&content).ok();
1163        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1164    }
1165}
1166
1167/// 推荐有共同粉丝的用户
1168pub async fn user_mutual_followers(configuration: &configuration::Configuration, app_key: &str, skip: Option<i32>, take: Option<i32>) -> Result<models::UserMutualFollowersResultApiResponse, Error<UserMutualFollowersError>> {
1169    // add a prefix to parameters to efficiently prevent name collisions
1170    let p_app_key = app_key;
1171    let p_skip = skip;
1172    let p_take = take;
1173
1174    let uri_str = format!("{}/User/{appKey}/Friends/MutualFollowers", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1175    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1176
1177    if let Some(ref param_value) = p_skip {
1178        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
1179    }
1180    if let Some(ref param_value) = p_take {
1181        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
1182    }
1183    if let Some(ref user_agent) = configuration.user_agent {
1184        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1185    }
1186    if let Some(ref token) = configuration.bearer_access_token {
1187        req_builder = req_builder.bearer_auth(token.to_owned());
1188    };
1189
1190    let req = req_builder.build()?;
1191    let resp = configuration.client.execute(req).await?;
1192
1193    let status = resp.status();
1194    let content_type = resp
1195        .headers()
1196        .get("content-type")
1197        .and_then(|v| v.to_str().ok())
1198        .unwrap_or("application/octet-stream");
1199    let content_type = super::ContentType::from(content_type);
1200
1201    if !status.is_client_error() && !status.is_server_error() {
1202        let content = resp.text().await?;
1203        match content_type {
1204            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1205            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserMutualFollowersResultApiResponse`"))),
1206            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserMutualFollowersResultApiResponse`")))),
1207        }
1208    } else {
1209        let content = resp.text().await?;
1210        let entity: Option<UserMutualFollowersError> = serde_json::from_str(&content).ok();
1211        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1212    }
1213}
1214
1215/// 推荐有共同关注的用户
1216pub async fn user_mutual_followings(configuration: &configuration::Configuration, app_key: &str, skip: Option<i32>, take: Option<i32>) -> Result<models::UserMutualFollowingsResultApiResponse, Error<UserMutualFollowingsError>> {
1217    // add a prefix to parameters to efficiently prevent name collisions
1218    let p_app_key = app_key;
1219    let p_skip = skip;
1220    let p_take = take;
1221
1222    let uri_str = format!("{}/User/{appKey}/Friends/MutualFollowings", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1223    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1224
1225    if let Some(ref param_value) = p_skip {
1226        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
1227    }
1228    if let Some(ref param_value) = p_take {
1229        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
1230    }
1231    if let Some(ref user_agent) = configuration.user_agent {
1232        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1233    }
1234    if let Some(ref token) = configuration.bearer_access_token {
1235        req_builder = req_builder.bearer_auth(token.to_owned());
1236    };
1237
1238    let req = req_builder.build()?;
1239    let resp = configuration.client.execute(req).await?;
1240
1241    let status = resp.status();
1242    let content_type = resp
1243        .headers()
1244        .get("content-type")
1245        .and_then(|v| v.to_str().ok())
1246        .unwrap_or("application/octet-stream");
1247    let content_type = super::ContentType::from(content_type);
1248
1249    if !status.is_client_error() && !status.is_server_error() {
1250        let content = resp.text().await?;
1251        match content_type {
1252            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1253            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserMutualFollowingsResultApiResponse`"))),
1254            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserMutualFollowingsResultApiResponse`")))),
1255        }
1256    } else {
1257        let content = resp.text().await?;
1258        let entity: Option<UserMutualFollowingsError> = serde_json::from_str(&content).ok();
1259        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1260    }
1261}
1262
1263/// 绑定外部账号
1264pub async fn user_o_auth_account_bind(configuration: &configuration::Configuration, app_key: &str, o_auth_account_bind_request: Option<models::OAuthAccountBindRequest>) -> Result<models::BooleanApiResponse, Error<UserOAuthAccountBindError>> {
1265    // add a prefix to parameters to efficiently prevent name collisions
1266    let p_app_key = app_key;
1267    let p_o_auth_account_bind_request = o_auth_account_bind_request;
1268
1269    let uri_str = format!("{}/User/{appKey}/OAuthAccountBind", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1270    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1271
1272    if let Some(ref user_agent) = configuration.user_agent {
1273        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1274    }
1275    if let Some(ref token) = configuration.bearer_access_token {
1276        req_builder = req_builder.bearer_auth(token.to_owned());
1277    };
1278    req_builder = req_builder.json(&p_o_auth_account_bind_request);
1279
1280    let req = req_builder.build()?;
1281    let resp = configuration.client.execute(req).await?;
1282
1283    let status = resp.status();
1284    let content_type = resp
1285        .headers()
1286        .get("content-type")
1287        .and_then(|v| v.to_str().ok())
1288        .unwrap_or("application/octet-stream");
1289    let content_type = super::ContentType::from(content_type);
1290
1291    if !status.is_client_error() && !status.is_server_error() {
1292        let content = resp.text().await?;
1293        match content_type {
1294            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1295            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1296            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1297        }
1298    } else {
1299        let content = resp.text().await?;
1300        let entity: Option<UserOAuthAccountBindError> = serde_json::from_str(&content).ok();
1301        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1302    }
1303}
1304
1305/// 使用外部账号进行登录
1306pub async fn user_o_auth_account_sign_in(configuration: &configuration::Configuration, app_key: &str, o_auth_account_sign_in_request: Option<models::OAuthAccountSignInRequest>) -> Result<models::TokenModelApiResponse, Error<UserOAuthAccountSignInError>> {
1307    // add a prefix to parameters to efficiently prevent name collisions
1308    let p_app_key = app_key;
1309    let p_o_auth_account_sign_in_request = o_auth_account_sign_in_request;
1310
1311    let uri_str = format!("{}/User/{appKey}/OAuthAccountSignIn", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1312    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1313
1314    if let Some(ref user_agent) = configuration.user_agent {
1315        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1316    }
1317    if let Some(ref token) = configuration.bearer_access_token {
1318        req_builder = req_builder.bearer_auth(token.to_owned());
1319    };
1320    req_builder = req_builder.json(&p_o_auth_account_sign_in_request);
1321
1322    let req = req_builder.build()?;
1323    let resp = configuration.client.execute(req).await?;
1324
1325    let status = resp.status();
1326    let content_type = resp
1327        .headers()
1328        .get("content-type")
1329        .and_then(|v| v.to_str().ok())
1330        .unwrap_or("application/octet-stream");
1331    let content_type = super::ContentType::from(content_type);
1332
1333    if !status.is_client_error() && !status.is_server_error() {
1334        let content = resp.text().await?;
1335        match content_type {
1336            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1337            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
1338            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
1339        }
1340    } else {
1341        let content = resp.text().await?;
1342        let entity: Option<UserOAuthAccountSignInError> = serde_json::from_str(&content).ok();
1343        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1344    }
1345}
1346
1347/// 获取外部账号绑定列表
1348pub async fn user_o_auth_accounts(configuration: &configuration::Configuration, app_key: &str) -> Result<models::UserLoginsListApiResponse, Error<UserOAuthAccountsError>> {
1349    // add a prefix to parameters to efficiently prevent name collisions
1350    let p_app_key = app_key;
1351
1352    let uri_str = format!("{}/User/{appKey}/OAuthAccounts", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1353    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1354
1355    if let Some(ref user_agent) = configuration.user_agent {
1356        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1357    }
1358    if let Some(ref token) = configuration.bearer_access_token {
1359        req_builder = req_builder.bearer_auth(token.to_owned());
1360    };
1361
1362    let req = req_builder.build()?;
1363    let resp = configuration.client.execute(req).await?;
1364
1365    let status = resp.status();
1366    let content_type = resp
1367        .headers()
1368        .get("content-type")
1369        .and_then(|v| v.to_str().ok())
1370        .unwrap_or("application/octet-stream");
1371    let content_type = super::ContentType::from(content_type);
1372
1373    if !status.is_client_error() && !status.is_server_error() {
1374        let content = resp.text().await?;
1375        match content_type {
1376            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1377            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserLoginsListApiResponse`"))),
1378            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserLoginsListApiResponse`")))),
1379        }
1380    } else {
1381        let content = resp.text().await?;
1382        let entity: Option<UserOAuthAccountsError> = serde_json::from_str(&content).ok();
1383        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1384    }
1385}
1386
1387/// 更新外部账号绑定信息
1388pub async fn user_o_auth_accounts_put_bind(configuration: &configuration::Configuration, id: i64, app_key: &str, o_auth_account_put_bind_request: Option<models::OAuthAccountPutBindRequest>) -> Result<models::BooleanApiResponse, Error<UserOAuthAccountsPutBindError>> {
1389    // add a prefix to parameters to efficiently prevent name collisions
1390    let p_id = id;
1391    let p_app_key = app_key;
1392    let p_o_auth_account_put_bind_request = o_auth_account_put_bind_request;
1393
1394    let uri_str = format!("{}/User/{appKey}/OAuthAccounts/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
1395    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1396
1397    if let Some(ref user_agent) = configuration.user_agent {
1398        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1399    }
1400    if let Some(ref token) = configuration.bearer_access_token {
1401        req_builder = req_builder.bearer_auth(token.to_owned());
1402    };
1403    req_builder = req_builder.json(&p_o_auth_account_put_bind_request);
1404
1405    let req = req_builder.build()?;
1406    let resp = configuration.client.execute(req).await?;
1407
1408    let status = resp.status();
1409    let content_type = resp
1410        .headers()
1411        .get("content-type")
1412        .and_then(|v| v.to_str().ok())
1413        .unwrap_or("application/octet-stream");
1414    let content_type = super::ContentType::from(content_type);
1415
1416    if !status.is_client_error() && !status.is_server_error() {
1417        let content = resp.text().await?;
1418        match content_type {
1419            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1420            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1421            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1422        }
1423    } else {
1424        let content = resp.text().await?;
1425        let entity: Option<UserOAuthAccountsPutBindError> = serde_json::from_str(&content).ok();
1426        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1427    }
1428}
1429
1430/// 删除外部账号绑定
1431pub async fn user_o_auth_accounts_un_bind(configuration: &configuration::Configuration, id: i64, app_key: &str) -> Result<models::BooleanApiResponse, Error<UserOAuthAccountsUnBindError>> {
1432    // add a prefix to parameters to efficiently prevent name collisions
1433    let p_id = id;
1434    let p_app_key = app_key;
1435
1436    let uri_str = format!("{}/User/{appKey}/OAuthAccounts/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
1437    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1438
1439    if let Some(ref user_agent) = configuration.user_agent {
1440        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1441    }
1442    if let Some(ref token) = configuration.bearer_access_token {
1443        req_builder = req_builder.bearer_auth(token.to_owned());
1444    };
1445
1446    let req = req_builder.build()?;
1447    let resp = configuration.client.execute(req).await?;
1448
1449    let status = resp.status();
1450    let content_type = resp
1451        .headers()
1452        .get("content-type")
1453        .and_then(|v| v.to_str().ok())
1454        .unwrap_or("application/octet-stream");
1455    let content_type = super::ContentType::from(content_type);
1456
1457    if !status.is_client_error() && !status.is_server_error() {
1458        let content = resp.text().await?;
1459        match content_type {
1460            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1461            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1462            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1463        }
1464    } else {
1465        let content = resp.text().await?;
1466        let entity: Option<UserOAuthAccountsUnBindError> = serde_json::from_str(&content).ok();
1467        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1468    }
1469}
1470
1471/// 使用手机号码进行登录
1472pub async fn user_phone_sign_in(configuration: &configuration::Configuration, app_key: &str, phone_sign_in_request: Option<models::PhoneSignInRequest>) -> Result<models::TokenModelApiResponse, Error<UserPhoneSignInError>> {
1473    // add a prefix to parameters to efficiently prevent name collisions
1474    let p_app_key = app_key;
1475    let p_phone_sign_in_request = phone_sign_in_request;
1476
1477    let uri_str = format!("{}/User/{appKey}/PhoneSignIn", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1478    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1479
1480    if let Some(ref user_agent) = configuration.user_agent {
1481        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1482    }
1483    if let Some(ref token) = configuration.bearer_access_token {
1484        req_builder = req_builder.bearer_auth(token.to_owned());
1485    };
1486    req_builder = req_builder.json(&p_phone_sign_in_request);
1487
1488    let req = req_builder.build()?;
1489    let resp = configuration.client.execute(req).await?;
1490
1491    let status = resp.status();
1492    let content_type = resp
1493        .headers()
1494        .get("content-type")
1495        .and_then(|v| v.to_str().ok())
1496        .unwrap_or("application/octet-stream");
1497    let content_type = super::ContentType::from(content_type);
1498
1499    if !status.is_client_error() && !status.is_server_error() {
1500        let content = resp.text().await?;
1501        match content_type {
1502            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1503            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
1504            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
1505        }
1506    } else {
1507        let content = resp.text().await?;
1508        let entity: Option<UserPhoneSignInError> = serde_json::from_str(&content).ok();
1509        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1510    }
1511}
1512
1513/// 使用手机号码进行注册
1514pub async fn user_phone_sign_up(configuration: &configuration::Configuration, app_key: &str, phone_sign_up_request: Option<models::PhoneSignUpRequest>) -> Result<models::TokenModelApiResponse, Error<UserPhoneSignUpError>> {
1515    // add a prefix to parameters to efficiently prevent name collisions
1516    let p_app_key = app_key;
1517    let p_phone_sign_up_request = phone_sign_up_request;
1518
1519    let uri_str = format!("{}/User/{appKey}/PhoneSignUp", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1520    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1521
1522    if let Some(ref user_agent) = configuration.user_agent {
1523        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1524    }
1525    if let Some(ref token) = configuration.bearer_access_token {
1526        req_builder = req_builder.bearer_auth(token.to_owned());
1527    };
1528    req_builder = req_builder.json(&p_phone_sign_up_request);
1529
1530    let req = req_builder.build()?;
1531    let resp = configuration.client.execute(req).await?;
1532
1533    let status = resp.status();
1534    let content_type = resp
1535        .headers()
1536        .get("content-type")
1537        .and_then(|v| v.to_str().ok())
1538        .unwrap_or("application/octet-stream");
1539    let content_type = super::ContentType::from(content_type);
1540
1541    if !status.is_client_error() && !status.is_server_error() {
1542        let content = resp.text().await?;
1543        match content_type {
1544            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1545            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
1546            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
1547        }
1548    } else {
1549        let content = resp.text().await?;
1550        let entity: Option<UserPhoneSignUpError> = serde_json::from_str(&content).ok();
1551        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1552    }
1553}
1554
1555/// 获取当前用户的个人资料
1556pub async fn user_profile(configuration: &configuration::Configuration, app_key: &str) -> Result<models::UserProfileResultApiResponse, Error<UserProfileError>> {
1557    // add a prefix to parameters to efficiently prevent name collisions
1558    let p_app_key = app_key;
1559
1560    let uri_str = format!("{}/User/{appKey}/Profile", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1561    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1562
1563    if let Some(ref user_agent) = configuration.user_agent {
1564        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1565    }
1566    if let Some(ref token) = configuration.bearer_access_token {
1567        req_builder = req_builder.bearer_auth(token.to_owned());
1568    };
1569
1570    let req = req_builder.build()?;
1571    let resp = configuration.client.execute(req).await?;
1572
1573    let status = resp.status();
1574    let content_type = resp
1575        .headers()
1576        .get("content-type")
1577        .and_then(|v| v.to_str().ok())
1578        .unwrap_or("application/octet-stream");
1579    let content_type = super::ContentType::from(content_type);
1580
1581    if !status.is_client_error() && !status.is_server_error() {
1582        let content = resp.text().await?;
1583        match content_type {
1584            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1585            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserProfileResultApiResponse`"))),
1586            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserProfileResultApiResponse`")))),
1587        }
1588    } else {
1589        let content = resp.text().await?;
1590        let entity: Option<UserProfileError> = serde_json::from_str(&content).ok();
1591        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1592    }
1593}
1594
1595/// 根据用户ID更新用户信息
1596pub async fn user_put(configuration: &configuration::Configuration, id: i64, app_key: &str, user: Option<models::User>) -> Result<models::BooleanApiResponse, Error<UserPutError>> {
1597    // add a prefix to parameters to efficiently prevent name collisions
1598    let p_id = id;
1599    let p_app_key = app_key;
1600    let p_user = user;
1601
1602    let uri_str = format!("{}/User/{appKey}/{id}", configuration.base_path, id=p_id, appKey=crate::apis::urlencode(p_app_key));
1603    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1604
1605    if let Some(ref user_agent) = configuration.user_agent {
1606        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1607    }
1608    if let Some(ref token) = configuration.bearer_access_token {
1609        req_builder = req_builder.bearer_auth(token.to_owned());
1610    };
1611    req_builder = req_builder.json(&p_user);
1612
1613    let req = req_builder.build()?;
1614    let resp = configuration.client.execute(req).await?;
1615
1616    let status = resp.status();
1617    let content_type = resp
1618        .headers()
1619        .get("content-type")
1620        .and_then(|v| v.to_str().ok())
1621        .unwrap_or("application/octet-stream");
1622    let content_type = super::ContentType::from(content_type);
1623
1624    if !status.is_client_error() && !status.is_server_error() {
1625        let content = resp.text().await?;
1626        match content_type {
1627            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1628            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1629            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1630        }
1631    } else {
1632        let content = resp.text().await?;
1633        let entity: Option<UserPutError> = serde_json::from_str(&content).ok();
1634        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1635    }
1636}
1637
1638/// 使用微信小程序二维码进行预登陆
1639pub async fn user_qr_code_pre_sign_in(configuration: &configuration::Configuration, app_key: &str, qr_code_pre_sign_in_request: Option<models::QrCodePreSignInRequest>) -> Result<models::Int64ApiResponse, Error<UserQrCodePreSignInError>> {
1640    // add a prefix to parameters to efficiently prevent name collisions
1641    let p_app_key = app_key;
1642    let p_qr_code_pre_sign_in_request = qr_code_pre_sign_in_request;
1643
1644    let uri_str = format!("{}/User/{appKey}/QRCodePreSignIn", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1645    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1646
1647    if let Some(ref user_agent) = configuration.user_agent {
1648        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1649    }
1650    if let Some(ref token) = configuration.bearer_access_token {
1651        req_builder = req_builder.bearer_auth(token.to_owned());
1652    };
1653    req_builder = req_builder.json(&p_qr_code_pre_sign_in_request);
1654
1655    let req = req_builder.build()?;
1656    let resp = configuration.client.execute(req).await?;
1657
1658    let status = resp.status();
1659    let content_type = resp
1660        .headers()
1661        .get("content-type")
1662        .and_then(|v| v.to_str().ok())
1663        .unwrap_or("application/octet-stream");
1664    let content_type = super::ContentType::from(content_type);
1665
1666    if !status.is_client_error() && !status.is_server_error() {
1667        let content = resp.text().await?;
1668        match content_type {
1669            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1670            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Int64ApiResponse`"))),
1671            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Int64ApiResponse`")))),
1672        }
1673    } else {
1674        let content = resp.text().await?;
1675        let entity: Option<UserQrCodePreSignInError> = serde_json::from_str(&content).ok();
1676        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1677    }
1678}
1679
1680/// 使用微信小程序二维码进行扫码
1681pub async fn user_qr_code_scan(configuration: &configuration::Configuration, app_key: &str, qr_code_scan_request: Option<models::QrCodeScanRequest>) -> Result<models::UserQrCodeScanResultApiResponse, Error<UserQrCodeScanError>> {
1682    // add a prefix to parameters to efficiently prevent name collisions
1683    let p_app_key = app_key;
1684    let p_qr_code_scan_request = qr_code_scan_request;
1685
1686    let uri_str = format!("{}/User/{appKey}/QRCodeScan", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1687    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1688
1689    if let Some(ref user_agent) = configuration.user_agent {
1690        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1691    }
1692    if let Some(ref token) = configuration.bearer_access_token {
1693        req_builder = req_builder.bearer_auth(token.to_owned());
1694    };
1695    req_builder = req_builder.json(&p_qr_code_scan_request);
1696
1697    let req = req_builder.build()?;
1698    let resp = configuration.client.execute(req).await?;
1699
1700    let status = resp.status();
1701    let content_type = resp
1702        .headers()
1703        .get("content-type")
1704        .and_then(|v| v.to_str().ok())
1705        .unwrap_or("application/octet-stream");
1706    let content_type = super::ContentType::from(content_type);
1707
1708    if !status.is_client_error() && !status.is_server_error() {
1709        let content = resp.text().await?;
1710        match content_type {
1711            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1712            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserQrCodeScanResultApiResponse`"))),
1713            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserQrCodeScanResultApiResponse`")))),
1714        }
1715    } else {
1716        let content = resp.text().await?;
1717        let entity: Option<UserQrCodeScanError> = serde_json::from_str(&content).ok();
1718        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1719    }
1720}
1721
1722/// 使用微信小程序二维码进行网页登录
1723pub async fn user_qr_code_sign_in(configuration: &configuration::Configuration, app_key: &str, qr_code_sign_in_request: Option<models::QrCodeSignInRequest>) -> Result<models::TokenModelApiResponse, Error<UserQrCodeSignInError>> {
1724    // add a prefix to parameters to efficiently prevent name collisions
1725    let p_app_key = app_key;
1726    let p_qr_code_sign_in_request = qr_code_sign_in_request;
1727
1728    let uri_str = format!("{}/User/{appKey}/QRCodeSignIn", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1729    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1730
1731    if let Some(ref user_agent) = configuration.user_agent {
1732        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1733    }
1734    if let Some(ref token) = configuration.bearer_access_token {
1735        req_builder = req_builder.bearer_auth(token.to_owned());
1736    };
1737    req_builder = req_builder.json(&p_qr_code_sign_in_request);
1738
1739    let req = req_builder.build()?;
1740    let resp = configuration.client.execute(req).await?;
1741
1742    let status = resp.status();
1743    let content_type = resp
1744        .headers()
1745        .get("content-type")
1746        .and_then(|v| v.to_str().ok())
1747        .unwrap_or("application/octet-stream");
1748    let content_type = super::ContentType::from(content_type);
1749
1750    if !status.is_client_error() && !status.is_server_error() {
1751        let content = resp.text().await?;
1752        match content_type {
1753            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1754            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
1755            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
1756        }
1757    } else {
1758        let content = resp.text().await?;
1759        let entity: Option<UserQrCodeSignInError> = serde_json::from_str(&content).ok();
1760        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1761    }
1762}
1763
1764/// 使用微信小程序二维码进行注册
1765pub async fn user_qr_code_sign_up(configuration: &configuration::Configuration, app_key: &str, qr_code_sign_up_request: Option<models::QrCodeSignUpRequest>) -> Result<models::TokenModelApiResponse, Error<UserQrCodeSignUpError>> {
1766    // add a prefix to parameters to efficiently prevent name collisions
1767    let p_app_key = app_key;
1768    let p_qr_code_sign_up_request = qr_code_sign_up_request;
1769
1770    let uri_str = format!("{}/User/{appKey}/QRCodeSignUp", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1771    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1772
1773    if let Some(ref user_agent) = configuration.user_agent {
1774        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1775    }
1776    if let Some(ref token) = configuration.bearer_access_token {
1777        req_builder = req_builder.bearer_auth(token.to_owned());
1778    };
1779    req_builder = req_builder.json(&p_qr_code_sign_up_request);
1780
1781    let req = req_builder.build()?;
1782    let resp = configuration.client.execute(req).await?;
1783
1784    let status = resp.status();
1785    let content_type = resp
1786        .headers()
1787        .get("content-type")
1788        .and_then(|v| v.to_str().ok())
1789        .unwrap_or("application/octet-stream");
1790    let content_type = super::ContentType::from(content_type);
1791
1792    if !status.is_client_error() && !status.is_server_error() {
1793        let content = resp.text().await?;
1794        match content_type {
1795            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1796            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
1797            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
1798        }
1799    } else {
1800        let content = resp.text().await?;
1801        let entity: Option<UserQrCodeSignUpError> = serde_json::from_str(&content).ok();
1802        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1803    }
1804}
1805
1806/// 通过手机号或邮箱重置密码
1807pub async fn user_reset_pwd(configuration: &configuration::Configuration, app_key: &str, app_user_reset_pwd_request: Option<models::AppUserResetPwdRequest>) -> Result<models::BooleanApiResponse, Error<UserResetPwdError>> {
1808    // add a prefix to parameters to efficiently prevent name collisions
1809    let p_app_key = app_key;
1810    let p_app_user_reset_pwd_request = app_user_reset_pwd_request;
1811
1812    let uri_str = format!("{}/User/{appKey}/ResetPwd", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1813    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1814
1815    if let Some(ref user_agent) = configuration.user_agent {
1816        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1817    }
1818    if let Some(ref token) = configuration.bearer_access_token {
1819        req_builder = req_builder.bearer_auth(token.to_owned());
1820    };
1821    req_builder = req_builder.json(&p_app_user_reset_pwd_request);
1822
1823    let req = req_builder.build()?;
1824    let resp = configuration.client.execute(req).await?;
1825
1826    let status = resp.status();
1827    let content_type = resp
1828        .headers()
1829        .get("content-type")
1830        .and_then(|v| v.to_str().ok())
1831        .unwrap_or("application/octet-stream");
1832    let content_type = super::ContentType::from(content_type);
1833
1834    if !status.is_client_error() && !status.is_server_error() {
1835        let content = resp.text().await?;
1836        match content_type {
1837            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1838            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1839            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1840        }
1841    } else {
1842        let content = resp.text().await?;
1843        let entity: Option<UserResetPwdError> = serde_json::from_str(&content).ok();
1844        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1845    }
1846}
1847
1848/// 发送邮箱验证码用于注册或找回密码
1849pub async fn user_send_email_code(configuration: &configuration::Configuration, app_key: &str, send_email_code_request: Option<models::SendEmailCodeRequest>) -> Result<models::BooleanApiResponse, Error<UserSendEmailCodeError>> {
1850    // add a prefix to parameters to efficiently prevent name collisions
1851    let p_app_key = app_key;
1852    let p_send_email_code_request = send_email_code_request;
1853
1854    let uri_str = format!("{}/User/{appKey}/SendEmailCode", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1855    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1856
1857    if let Some(ref user_agent) = configuration.user_agent {
1858        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1859    }
1860    if let Some(ref token) = configuration.bearer_access_token {
1861        req_builder = req_builder.bearer_auth(token.to_owned());
1862    };
1863    req_builder = req_builder.json(&p_send_email_code_request);
1864
1865    let req = req_builder.build()?;
1866    let resp = configuration.client.execute(req).await?;
1867
1868    let status = resp.status();
1869    let content_type = resp
1870        .headers()
1871        .get("content-type")
1872        .and_then(|v| v.to_str().ok())
1873        .unwrap_or("application/octet-stream");
1874    let content_type = super::ContentType::from(content_type);
1875
1876    if !status.is_client_error() && !status.is_server_error() {
1877        let content = resp.text().await?;
1878        match content_type {
1879            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1880            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1881            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1882        }
1883    } else {
1884        let content = resp.text().await?;
1885        let entity: Option<UserSendEmailCodeError> = serde_json::from_str(&content).ok();
1886        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1887    }
1888}
1889
1890/// 发送手机验证码用于注册或找回密码
1891pub async fn user_send_sms_code(configuration: &configuration::Configuration, app_key: &str, send_sms_code_request: Option<models::SendSmsCodeRequest>) -> Result<models::BooleanApiResponse, Error<UserSendSmsCodeError>> {
1892    // add a prefix to parameters to efficiently prevent name collisions
1893    let p_app_key = app_key;
1894    let p_send_sms_code_request = send_sms_code_request;
1895
1896    let uri_str = format!("{}/User/{appKey}/SendSMSCode", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1897    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1898
1899    if let Some(ref user_agent) = configuration.user_agent {
1900        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1901    }
1902    if let Some(ref token) = configuration.bearer_access_token {
1903        req_builder = req_builder.bearer_auth(token.to_owned());
1904    };
1905    req_builder = req_builder.json(&p_send_sms_code_request);
1906
1907    let req = req_builder.build()?;
1908    let resp = configuration.client.execute(req).await?;
1909
1910    let status = resp.status();
1911    let content_type = resp
1912        .headers()
1913        .get("content-type")
1914        .and_then(|v| v.to_str().ok())
1915        .unwrap_or("application/octet-stream");
1916    let content_type = super::ContentType::from(content_type);
1917
1918    if !status.is_client_error() && !status.is_server_error() {
1919        let content = resp.text().await?;
1920        match content_type {
1921            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1922            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
1923            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
1924        }
1925    } else {
1926        let content = resp.text().await?;
1927        let entity: Option<UserSendSmsCodeError> = serde_json::from_str(&content).ok();
1928        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1929    }
1930}
1931
1932/// 使用账号密码进行登录
1933pub async fn user_sign_in(configuration: &configuration::Configuration, app_key: &str, sign_in_request: Option<models::SignInRequest>) -> Result<models::TokenModelApiResponse, Error<UserSignInError>> {
1934    // add a prefix to parameters to efficiently prevent name collisions
1935    let p_app_key = app_key;
1936    let p_sign_in_request = sign_in_request;
1937
1938    let uri_str = format!("{}/User/{appKey}/SignIn", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1939    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1940
1941    if let Some(ref user_agent) = configuration.user_agent {
1942        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1943    }
1944    if let Some(ref token) = configuration.bearer_access_token {
1945        req_builder = req_builder.bearer_auth(token.to_owned());
1946    };
1947    req_builder = req_builder.json(&p_sign_in_request);
1948
1949    let req = req_builder.build()?;
1950    let resp = configuration.client.execute(req).await?;
1951
1952    let status = resp.status();
1953    let content_type = resp
1954        .headers()
1955        .get("content-type")
1956        .and_then(|v| v.to_str().ok())
1957        .unwrap_or("application/octet-stream");
1958    let content_type = super::ContentType::from(content_type);
1959
1960    if !status.is_client_error() && !status.is_server_error() {
1961        let content = resp.text().await?;
1962        match content_type {
1963            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1964            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
1965            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
1966        }
1967    } else {
1968        let content = resp.text().await?;
1969        let entity: Option<UserSignInError> = serde_json::from_str(&content).ok();
1970        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1971    }
1972}
1973
1974/// 使用账号密码进行注册
1975pub async fn user_sign_up(configuration: &configuration::Configuration, app_key: &str, sign_up_request: Option<models::SignUpRequest>) -> Result<models::TokenModelApiResponse, Error<UserSignUpError>> {
1976    // add a prefix to parameters to efficiently prevent name collisions
1977    let p_app_key = app_key;
1978    let p_sign_up_request = sign_up_request;
1979
1980    let uri_str = format!("{}/User/{appKey}/SignUp", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
1981    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1982
1983    if let Some(ref user_agent) = configuration.user_agent {
1984        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1985    }
1986    if let Some(ref token) = configuration.bearer_access_token {
1987        req_builder = req_builder.bearer_auth(token.to_owned());
1988    };
1989    req_builder = req_builder.json(&p_sign_up_request);
1990
1991    let req = req_builder.build()?;
1992    let resp = configuration.client.execute(req).await?;
1993
1994    let status = resp.status();
1995    let content_type = resp
1996        .headers()
1997        .get("content-type")
1998        .and_then(|v| v.to_str().ok())
1999        .unwrap_or("application/octet-stream");
2000    let content_type = super::ContentType::from(content_type);
2001
2002    if !status.is_client_error() && !status.is_server_error() {
2003        let content = resp.text().await?;
2004        match content_type {
2005            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2006            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
2007            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
2008        }
2009    } else {
2010        let content = resp.text().await?;
2011        let entity: Option<UserSignUpError> = serde_json::from_str(&content).ok();
2012        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2013    }
2014}
2015
2016/// 获取双因素验证的设置信息
2017pub async fn user_two_factor_auth(configuration: &configuration::Configuration, app_key: &str) -> Result<models::SetupCodeApiResponse, Error<UserTwoFactorAuthError>> {
2018    // add a prefix to parameters to efficiently prevent name collisions
2019    let p_app_key = app_key;
2020
2021    let uri_str = format!("{}/User/{appKey}/TwoFactorAuth", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
2022    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2023
2024    if let Some(ref user_agent) = configuration.user_agent {
2025        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2026    }
2027    if let Some(ref token) = configuration.bearer_access_token {
2028        req_builder = req_builder.bearer_auth(token.to_owned());
2029    };
2030
2031    let req = req_builder.build()?;
2032    let resp = configuration.client.execute(req).await?;
2033
2034    let status = resp.status();
2035    let content_type = resp
2036        .headers()
2037        .get("content-type")
2038        .and_then(|v| v.to_str().ok())
2039        .unwrap_or("application/octet-stream");
2040    let content_type = super::ContentType::from(content_type);
2041
2042    if !status.is_client_error() && !status.is_server_error() {
2043        let content = resp.text().await?;
2044        match content_type {
2045            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2046            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SetupCodeApiResponse`"))),
2047            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SetupCodeApiResponse`")))),
2048        }
2049    } else {
2050        let content = resp.text().await?;
2051        let entity: Option<UserTwoFactorAuthError> = serde_json::from_str(&content).ok();
2052        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2053    }
2054}
2055
2056/// 取消关注指定用户
2057pub async fn user_unfollow_user(configuration: &configuration::Configuration, user_id: i64, app_key: &str) -> Result<models::BooleanApiResponse, Error<UserUnfollowUserError>> {
2058    // add a prefix to parameters to efficiently prevent name collisions
2059    let p_user_id = user_id;
2060    let p_app_key = app_key;
2061
2062    let uri_str = format!("{}/User/{appKey}/Follower/{userId}", configuration.base_path, userId=p_user_id, appKey=crate::apis::urlencode(p_app_key));
2063    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2064
2065    if let Some(ref user_agent) = configuration.user_agent {
2066        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2067    }
2068    if let Some(ref token) = configuration.bearer_access_token {
2069        req_builder = req_builder.bearer_auth(token.to_owned());
2070    };
2071
2072    let req = req_builder.build()?;
2073    let resp = configuration.client.execute(req).await?;
2074
2075    let status = resp.status();
2076    let content_type = resp
2077        .headers()
2078        .get("content-type")
2079        .and_then(|v| v.to_str().ok())
2080        .unwrap_or("application/octet-stream");
2081    let content_type = super::ContentType::from(content_type);
2082
2083    if !status.is_client_error() && !status.is_server_error() {
2084        let content = resp.text().await?;
2085        match content_type {
2086            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2087            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
2088            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
2089        }
2090    } else {
2091        let content = resp.text().await?;
2092        let entity: Option<UserUnfollowUserError> = serde_json::from_str(&content).ok();
2093        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2094    }
2095}
2096
2097/// 使用UnionID进行登录
2098pub async fn user_union_id_sign_in(configuration: &configuration::Configuration, app_key: &str, union_id_sign_in_request: Option<models::UnionIdSignInRequest>) -> Result<models::TokenModelApiResponse, Error<UserUnionIdSignInError>> {
2099    // add a prefix to parameters to efficiently prevent name collisions
2100    let p_app_key = app_key;
2101    let p_union_id_sign_in_request = union_id_sign_in_request;
2102
2103    let uri_str = format!("{}/User/{appKey}/UnionIDSignIn", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
2104    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2105
2106    if let Some(ref user_agent) = configuration.user_agent {
2107        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2108    }
2109    if let Some(ref token) = configuration.bearer_access_token {
2110        req_builder = req_builder.bearer_auth(token.to_owned());
2111    };
2112    req_builder = req_builder.json(&p_union_id_sign_in_request);
2113
2114    let req = req_builder.build()?;
2115    let resp = configuration.client.execute(req).await?;
2116
2117    let status = resp.status();
2118    let content_type = resp
2119        .headers()
2120        .get("content-type")
2121        .and_then(|v| v.to_str().ok())
2122        .unwrap_or("application/octet-stream");
2123    let content_type = super::ContentType::from(content_type);
2124
2125    if !status.is_client_error() && !status.is_server_error() {
2126        let content = resp.text().await?;
2127        match content_type {
2128            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2129            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
2130            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
2131        }
2132    } else {
2133        let content = resp.text().await?;
2134        let entity: Option<UserUnionIdSignInError> = serde_json::from_str(&content).ok();
2135        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2136    }
2137}
2138
2139/// 使用UnionID进行注册
2140pub async fn user_union_id_sign_up(configuration: &configuration::Configuration, app_key: &str, union_id_sign_up_request: Option<models::UnionIdSignUpRequest>) -> Result<models::TokenModelApiResponse, Error<UserUnionIdSignUpError>> {
2141    // add a prefix to parameters to efficiently prevent name collisions
2142    let p_app_key = app_key;
2143    let p_union_id_sign_up_request = union_id_sign_up_request;
2144
2145    let uri_str = format!("{}/User/{appKey}/UnionIDSignUp", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
2146    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2147
2148    if let Some(ref user_agent) = configuration.user_agent {
2149        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2150    }
2151    if let Some(ref token) = configuration.bearer_access_token {
2152        req_builder = req_builder.bearer_auth(token.to_owned());
2153    };
2154    req_builder = req_builder.json(&p_union_id_sign_up_request);
2155
2156    let req = req_builder.build()?;
2157    let resp = configuration.client.execute(req).await?;
2158
2159    let status = resp.status();
2160    let content_type = resp
2161        .headers()
2162        .get("content-type")
2163        .and_then(|v| v.to_str().ok())
2164        .unwrap_or("application/octet-stream");
2165    let content_type = super::ContentType::from(content_type);
2166
2167    if !status.is_client_error() && !status.is_server_error() {
2168        let content = resp.text().await?;
2169        match content_type {
2170            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2171            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TokenModelApiResponse`"))),
2172            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TokenModelApiResponse`")))),
2173        }
2174    } else {
2175        let content = resp.text().await?;
2176        let entity: Option<UserUnionIdSignUpError> = serde_json::from_str(&content).ok();
2177        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2178    }
2179}
2180
2181/// 更新当前用户的个人资料
2182pub async fn user_update_profile(configuration: &configuration::Configuration, app_key: &str, update_profile_request: Option<models::UpdateProfileRequest>) -> Result<models::BooleanApiResponse, Error<UserUpdateProfileError>> {
2183    // add a prefix to parameters to efficiently prevent name collisions
2184    let p_app_key = app_key;
2185    let p_update_profile_request = update_profile_request;
2186
2187    let uri_str = format!("{}/User/{appKey}/Profile", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
2188    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2189
2190    if let Some(ref user_agent) = configuration.user_agent {
2191        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2192    }
2193    if let Some(ref token) = configuration.bearer_access_token {
2194        req_builder = req_builder.bearer_auth(token.to_owned());
2195    };
2196    req_builder = req_builder.json(&p_update_profile_request);
2197
2198    let req = req_builder.build()?;
2199    let resp = configuration.client.execute(req).await?;
2200
2201    let status = resp.status();
2202    let content_type = resp
2203        .headers()
2204        .get("content-type")
2205        .and_then(|v| v.to_str().ok())
2206        .unwrap_or("application/octet-stream");
2207    let content_type = super::ContentType::from(content_type);
2208
2209    if !status.is_client_error() && !status.is_server_error() {
2210        let content = resp.text().await?;
2211        match content_type {
2212            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2213            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
2214            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
2215        }
2216    } else {
2217        let content = resp.text().await?;
2218        let entity: Option<UserUpdateProfileError> = serde_json::from_str(&content).ok();
2219        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2220    }
2221}
2222
2223/// 根据条件获取用户列表
2224pub async fn users(configuration: &configuration::Configuration, app_key: &str, user_name: Option<&str>, email: Option<&str>, phone: Option<&str>, platform: Option<&str>, union_id: Option<&str>, role: Option<&str>, skip: Option<i32>, take: Option<i32>) -> Result<models::UserListResultApiResponse, Error<UsersError>> {
2225    // add a prefix to parameters to efficiently prevent name collisions
2226    let p_app_key = app_key;
2227    let p_user_name = user_name;
2228    let p_email = email;
2229    let p_phone = phone;
2230    let p_platform = platform;
2231    let p_union_id = union_id;
2232    let p_role = role;
2233    let p_skip = skip;
2234    let p_take = take;
2235
2236    let uri_str = format!("{}/User/{appKey}", configuration.base_path, appKey=crate::apis::urlencode(p_app_key));
2237    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2238
2239    if let Some(ref param_value) = p_user_name {
2240        req_builder = req_builder.query(&[("userName", &param_value.to_string())]);
2241    }
2242    if let Some(ref param_value) = p_email {
2243        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
2244    }
2245    if let Some(ref param_value) = p_phone {
2246        req_builder = req_builder.query(&[("phone", &param_value.to_string())]);
2247    }
2248    if let Some(ref param_value) = p_platform {
2249        req_builder = req_builder.query(&[("platform", &param_value.to_string())]);
2250    }
2251    if let Some(ref param_value) = p_union_id {
2252        req_builder = req_builder.query(&[("unionId", &param_value.to_string())]);
2253    }
2254    if let Some(ref param_value) = p_role {
2255        req_builder = req_builder.query(&[("role", &param_value.to_string())]);
2256    }
2257    if let Some(ref param_value) = p_skip {
2258        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
2259    }
2260    if let Some(ref param_value) = p_take {
2261        req_builder = req_builder.query(&[("take", &param_value.to_string())]);
2262    }
2263    if let Some(ref user_agent) = configuration.user_agent {
2264        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2265    }
2266    if let Some(ref token) = configuration.bearer_access_token {
2267        req_builder = req_builder.bearer_auth(token.to_owned());
2268    };
2269
2270    let req = req_builder.build()?;
2271    let resp = configuration.client.execute(req).await?;
2272
2273    let status = resp.status();
2274    let content_type = resp
2275        .headers()
2276        .get("content-type")
2277        .and_then(|v| v.to_str().ok())
2278        .unwrap_or("application/octet-stream");
2279    let content_type = super::ContentType::from(content_type);
2280
2281    if !status.is_client_error() && !status.is_server_error() {
2282        let content = resp.text().await?;
2283        match content_type {
2284            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2285            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserListResultApiResponse`"))),
2286            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserListResultApiResponse`")))),
2287        }
2288    } else {
2289        let content = resp.text().await?;
2290        let entity: Option<UsersError> = serde_json::from_str(&content).ok();
2291        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2292    }
2293}
2294