ory_client_client/apis/
default_api.rs

1/*
2 * Ory APIs
3 *
4 * Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. 
5 *
6 * The version of the OpenAPI document: v0.0.1-alpha.1
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14use crate::apis::ResponseContent;
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method `create_identity_admin`
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CreateIdentityAdminError {
22    Status400(crate::models::JsonError),
23    Status401(crate::models::JsonError),
24    Status403(crate::models::JsonError),
25    Status409(crate::models::JsonError),
26    Status500(crate::models::JsonError),
27    UnknownValue(serde_json::Value),
28}
29
30/// struct for typed errors of method `create_recovery_link_admin`
31#[derive(Debug, Clone, Serialize, Deserialize)]
32#[serde(untagged)]
33pub enum CreateRecoveryLinkAdminError {
34    Status400(crate::models::JsonError),
35    Status404(crate::models::JsonError),
36    Status500(crate::models::JsonError),
37    UnknownValue(serde_json::Value),
38}
39
40/// struct for typed errors of method `delete_identity_admin`
41#[derive(Debug, Clone, Serialize, Deserialize)]
42#[serde(untagged)]
43pub enum DeleteIdentityAdminError {
44    Status401(crate::models::JsonError),
45    Status403(crate::models::JsonError),
46    Status404(crate::models::JsonError),
47    Status500(crate::models::JsonError),
48    UnknownValue(serde_json::Value),
49}
50
51/// struct for typed errors of method `get_identity_admin`
52#[derive(Debug, Clone, Serialize, Deserialize)]
53#[serde(untagged)]
54pub enum GetIdentityAdminError {
55    Status400(crate::models::JsonError),
56    Status401(crate::models::JsonError),
57    Status403(crate::models::JsonError),
58    Status404(crate::models::JsonError),
59    Status500(crate::models::JsonError),
60    UnknownValue(serde_json::Value),
61}
62
63/// struct for typed errors of method `get_schema`
64#[derive(Debug, Clone, Serialize, Deserialize)]
65#[serde(untagged)]
66pub enum GetSchemaError {
67    Status404(crate::models::JsonError),
68    Status500(crate::models::JsonError),
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method `get_schema_admin`
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum GetSchemaAdminError {
76    Status404(crate::models::JsonError),
77    Status500(crate::models::JsonError),
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method `get_self_service_error`
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetSelfServiceErrorError {
85    Status403(crate::models::JsonError),
86    Status404(crate::models::JsonError),
87    Status500(crate::models::JsonError),
88    UnknownValue(serde_json::Value),
89}
90
91/// struct for typed errors of method `get_self_service_error_admin`
92#[derive(Debug, Clone, Serialize, Deserialize)]
93#[serde(untagged)]
94pub enum GetSelfServiceErrorAdminError {
95    Status403(crate::models::JsonError),
96    Status404(crate::models::JsonError),
97    Status500(crate::models::JsonError),
98    UnknownValue(serde_json::Value),
99}
100
101/// struct for typed errors of method `get_self_service_login_flow`
102#[derive(Debug, Clone, Serialize, Deserialize)]
103#[serde(untagged)]
104pub enum GetSelfServiceLoginFlowError {
105    Status403(crate::models::JsonError),
106    Status404(crate::models::JsonError),
107    Status410(crate::models::JsonError),
108    Status500(crate::models::JsonError),
109    UnknownValue(serde_json::Value),
110}
111
112/// struct for typed errors of method `get_self_service_login_flow_admin`
113#[derive(Debug, Clone, Serialize, Deserialize)]
114#[serde(untagged)]
115pub enum GetSelfServiceLoginFlowAdminError {
116    Status403(crate::models::JsonError),
117    Status404(crate::models::JsonError),
118    Status410(crate::models::JsonError),
119    Status500(crate::models::JsonError),
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method `get_self_service_recovery_flow`
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetSelfServiceRecoveryFlowError {
127    Status404(crate::models::JsonError),
128    Status410(crate::models::JsonError),
129    Status500(crate::models::JsonError),
130    UnknownValue(serde_json::Value),
131}
132
133/// struct for typed errors of method `get_self_service_recovery_flow_admin`
134#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum GetSelfServiceRecoveryFlowAdminError {
137    Status404(crate::models::JsonError),
138    Status410(crate::models::JsonError),
139    Status500(crate::models::JsonError),
140    UnknownValue(serde_json::Value),
141}
142
143/// struct for typed errors of method `get_self_service_registration_flow`
144#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum GetSelfServiceRegistrationFlowError {
147    Status403(crate::models::JsonError),
148    Status404(crate::models::JsonError),
149    Status410(crate::models::JsonError),
150    Status500(crate::models::JsonError),
151    UnknownValue(serde_json::Value),
152}
153
154/// struct for typed errors of method `get_self_service_registration_flow_admin`
155#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum GetSelfServiceRegistrationFlowAdminError {
158    Status403(crate::models::JsonError),
159    Status404(crate::models::JsonError),
160    Status410(crate::models::JsonError),
161    Status500(crate::models::JsonError),
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method `get_self_service_settings_flow`
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetSelfServiceSettingsFlowError {
169    Status403(crate::models::JsonError),
170    Status404(crate::models::JsonError),
171    Status410(crate::models::JsonError),
172    Status500(crate::models::JsonError),
173    UnknownValue(serde_json::Value),
174}
175
176/// struct for typed errors of method `get_self_service_settings_flow_admin`
177#[derive(Debug, Clone, Serialize, Deserialize)]
178#[serde(untagged)]
179pub enum GetSelfServiceSettingsFlowAdminError {
180    Status403(crate::models::JsonError),
181    Status404(crate::models::JsonError),
182    Status410(crate::models::JsonError),
183    Status500(crate::models::JsonError),
184    UnknownValue(serde_json::Value),
185}
186
187/// struct for typed errors of method `get_self_service_verification_flow`
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum GetSelfServiceVerificationFlowError {
191    Status403(crate::models::JsonError),
192    Status404(crate::models::JsonError),
193    Status500(crate::models::JsonError),
194    UnknownValue(serde_json::Value),
195}
196
197/// struct for typed errors of method `get_self_service_verification_flow_admin`
198#[derive(Debug, Clone, Serialize, Deserialize)]
199#[serde(untagged)]
200pub enum GetSelfServiceVerificationFlowAdminError {
201    Status403(crate::models::JsonError),
202    Status404(crate::models::JsonError),
203    Status500(crate::models::JsonError),
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method `get_version_admin`
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetVersionAdminError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method `initialize_self_service_browser_logout_flow`
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum InitializeSelfServiceBrowserLogoutFlowError {
218    Status500(crate::models::JsonError),
219    UnknownValue(serde_json::Value),
220}
221
222/// struct for typed errors of method `initialize_self_service_login_via_api_flow`
223#[derive(Debug, Clone, Serialize, Deserialize)]
224#[serde(untagged)]
225pub enum InitializeSelfServiceLoginViaApiFlowError {
226    Status400(crate::models::JsonError),
227    Status500(crate::models::JsonError),
228    UnknownValue(serde_json::Value),
229}
230
231/// struct for typed errors of method `initialize_self_service_login_via_browser_flow`
232#[derive(Debug, Clone, Serialize, Deserialize)]
233#[serde(untagged)]
234pub enum InitializeSelfServiceLoginViaBrowserFlowError {
235    Status500(crate::models::JsonError),
236    UnknownValue(serde_json::Value),
237}
238
239/// struct for typed errors of method `initialize_self_service_recovery_via_api_flow`
240#[derive(Debug, Clone, Serialize, Deserialize)]
241#[serde(untagged)]
242pub enum InitializeSelfServiceRecoveryViaApiFlowError {
243    Status400(crate::models::JsonError),
244    Status500(crate::models::JsonError),
245    UnknownValue(serde_json::Value),
246}
247
248/// struct for typed errors of method `initialize_self_service_recovery_via_browser_flow`
249#[derive(Debug, Clone, Serialize, Deserialize)]
250#[serde(untagged)]
251pub enum InitializeSelfServiceRecoveryViaBrowserFlowError {
252    Status500(crate::models::JsonError),
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method `initialize_self_service_registration`
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum InitializeSelfServiceRegistrationError {
260    Status400(crate::models::JsonError),
261    Status500(crate::models::JsonError),
262    UnknownValue(serde_json::Value),
263}
264
265/// struct for typed errors of method `initialize_self_service_registration_for_browsers`
266#[derive(Debug, Clone, Serialize, Deserialize)]
267#[serde(untagged)]
268pub enum InitializeSelfServiceRegistrationForBrowsersError {
269    Status500(crate::models::JsonError),
270    UnknownValue(serde_json::Value),
271}
272
273/// struct for typed errors of method `initialize_self_service_settings_via_api_flow`
274#[derive(Debug, Clone, Serialize, Deserialize)]
275#[serde(untagged)]
276pub enum InitializeSelfServiceSettingsViaApiFlowError {
277    Status400(crate::models::JsonError),
278    Status500(crate::models::JsonError),
279    UnknownValue(serde_json::Value),
280}
281
282/// struct for typed errors of method `initialize_self_service_settings_via_browser_flow`
283#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum InitializeSelfServiceSettingsViaBrowserFlowError {
286    Status500(crate::models::JsonError),
287    UnknownValue(serde_json::Value),
288}
289
290/// struct for typed errors of method `initialize_self_service_verification_via_api_flow`
291#[derive(Debug, Clone, Serialize, Deserialize)]
292#[serde(untagged)]
293pub enum InitializeSelfServiceVerificationViaApiFlowError {
294    Status400(crate::models::JsonError),
295    Status500(crate::models::JsonError),
296    UnknownValue(serde_json::Value),
297}
298
299/// struct for typed errors of method `initialize_self_service_verification_via_browser_flow`
300#[derive(Debug, Clone, Serialize, Deserialize)]
301#[serde(untagged)]
302pub enum InitializeSelfServiceVerificationViaBrowserFlowError {
303    Status500(crate::models::JsonError),
304    UnknownValue(serde_json::Value),
305}
306
307/// struct for typed errors of method `is_alive_admin`
308#[derive(Debug, Clone, Serialize, Deserialize)]
309#[serde(untagged)]
310pub enum IsAliveAdminError {
311    Status500(crate::models::GenericError),
312    UnknownValue(serde_json::Value),
313}
314
315/// struct for typed errors of method `is_ready_admin`
316#[derive(Debug, Clone, Serialize, Deserialize)]
317#[serde(untagged)]
318pub enum IsReadyAdminError {
319    Status503(crate::models::InlineResponse503),
320    UnknownValue(serde_json::Value),
321}
322
323/// struct for typed errors of method `list_identities_admin`
324#[derive(Debug, Clone, Serialize, Deserialize)]
325#[serde(untagged)]
326pub enum ListIdentitiesAdminError {
327    Status401(crate::models::JsonError),
328    Status403(crate::models::JsonError),
329    Status500(crate::models::JsonError),
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method `prometheus_admin`
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum PrometheusAdminError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method `revoke_session`
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum RevokeSessionError {
344    Status400(crate::models::JsonError),
345    Status500(crate::models::JsonError),
346    UnknownValue(serde_json::Value),
347}
348
349/// struct for typed errors of method `submit_self_service_login_flow`
350#[derive(Debug, Clone, Serialize, Deserialize)]
351#[serde(untagged)]
352pub enum SubmitSelfServiceLoginFlowError {
353    Status400(crate::models::LoginFlow),
354    Status500(crate::models::JsonError),
355    UnknownValue(serde_json::Value),
356}
357
358/// struct for typed errors of method `submit_self_service_recovery_flow`
359#[derive(Debug, Clone, Serialize, Deserialize)]
360#[serde(untagged)]
361pub enum SubmitSelfServiceRecoveryFlowError {
362    Status400(crate::models::RecoveryFlow),
363    Status500(crate::models::JsonError),
364    UnknownValue(serde_json::Value),
365}
366
367/// struct for typed errors of method `submit_self_service_recovery_flow_with_link_method`
368#[derive(Debug, Clone, Serialize, Deserialize)]
369#[serde(untagged)]
370pub enum SubmitSelfServiceRecoveryFlowWithLinkMethodError {
371    Status400(crate::models::RecoveryFlow),
372    Status500(crate::models::JsonError),
373    UnknownValue(serde_json::Value),
374}
375
376/// struct for typed errors of method `submit_self_service_registration_flow`
377#[derive(Debug, Clone, Serialize, Deserialize)]
378#[serde(untagged)]
379pub enum SubmitSelfServiceRegistrationFlowError {
380    Status400(crate::models::RegistrationFlow),
381    Status500(crate::models::JsonError),
382    UnknownValue(serde_json::Value),
383}
384
385/// struct for typed errors of method `submit_self_service_settings_flow`
386#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum SubmitSelfServiceSettingsFlowError {
389    Status400(crate::models::SettingsFlow),
390    Status401(crate::models::JsonError),
391    Status403(crate::models::JsonError),
392    Status500(crate::models::JsonError),
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method `submit_self_service_verification_flow`
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum SubmitSelfServiceVerificationFlowError {
400    Status400(crate::models::VerificationFlow),
401    Status500(crate::models::JsonError),
402    UnknownValue(serde_json::Value),
403}
404
405/// struct for typed errors of method `to_session`
406#[derive(Debug, Clone, Serialize, Deserialize)]
407#[serde(untagged)]
408pub enum ToSessionError {
409    Status401(crate::models::JsonError),
410    Status500(crate::models::JsonError),
411    UnknownValue(serde_json::Value),
412}
413
414/// struct for typed errors of method `update_identity_admin`
415#[derive(Debug, Clone, Serialize, Deserialize)]
416#[serde(untagged)]
417pub enum UpdateIdentityAdminError {
418    Status400(crate::models::JsonError),
419    Status401(crate::models::JsonError),
420    Status403(crate::models::JsonError),
421    Status404(crate::models::JsonError),
422    Status500(crate::models::JsonError),
423    UnknownValue(serde_json::Value),
424}
425
426
427/// This endpoint creates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
428pub async fn create_identity_admin(configuration: &configuration::Configuration, create_identity: Option<crate::models::CreateIdentity>) -> Result<crate::models::Identity, Error<CreateIdentityAdminError>> {
429
430    let local_var_client = &configuration.client;
431
432    let local_var_uri_str = format!("{}/api/kratos/admin/identities", configuration.base_path);
433    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
434
435    if let Some(ref local_var_user_agent) = configuration.user_agent {
436        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
437    }
438    if let Some(ref local_var_token) = configuration.bearer_access_token {
439        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
440    };
441    local_var_req_builder = local_var_req_builder.json(&create_identity);
442
443    let local_var_req = local_var_req_builder.build()?;
444    let local_var_resp = local_var_client.execute(local_var_req).await?;
445
446    let local_var_status = local_var_resp.status();
447    let local_var_content = local_var_resp.text().await?;
448
449    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
450        serde_json::from_str(&local_var_content).map_err(Error::from)
451    } else {
452        let local_var_entity: Option<CreateIdentityAdminError> = serde_json::from_str(&local_var_content).ok();
453        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
454        Err(Error::ResponseError(local_var_error))
455    }
456}
457
458/// This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.
459pub async fn create_recovery_link_admin(configuration: &configuration::Configuration, create_recovery_link: Option<crate::models::CreateRecoveryLink>) -> Result<crate::models::RecoveryLink, Error<CreateRecoveryLinkAdminError>> {
460
461    let local_var_client = &configuration.client;
462
463    let local_var_uri_str = format!("{}/api/kratos/admin/recovery/link", configuration.base_path);
464    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
465
466    if let Some(ref local_var_user_agent) = configuration.user_agent {
467        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
468    }
469    if let Some(ref local_var_token) = configuration.bearer_access_token {
470        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
471    };
472    local_var_req_builder = local_var_req_builder.json(&create_recovery_link);
473
474    let local_var_req = local_var_req_builder.build()?;
475    let local_var_resp = local_var_client.execute(local_var_req).await?;
476
477    let local_var_status = local_var_resp.status();
478    let local_var_content = local_var_resp.text().await?;
479
480    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
481        serde_json::from_str(&local_var_content).map_err(Error::from)
482    } else {
483        let local_var_entity: Option<CreateRecoveryLinkAdminError> = serde_json::from_str(&local_var_content).ok();
484        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
485        Err(Error::ResponseError(local_var_error))
486    }
487}
488
489/// Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
490pub async fn delete_identity_admin(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteIdentityAdminError>> {
491
492    let local_var_client = &configuration.client;
493
494    let local_var_uri_str = format!("{}/api/kratos/admin/identities/{id}", configuration.base_path, id=crate::apis::urlencode(id));
495    let mut local_var_req_builder = local_var_client.delete(local_var_uri_str.as_str());
496
497    if let Some(ref local_var_user_agent) = configuration.user_agent {
498        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
499    }
500    if let Some(ref local_var_token) = configuration.bearer_access_token {
501        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
502    };
503
504    let local_var_req = local_var_req_builder.build()?;
505    let local_var_resp = local_var_client.execute(local_var_req).await?;
506
507    let local_var_status = local_var_resp.status();
508    let local_var_content = local_var_resp.text().await?;
509
510    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
511        Ok(())
512    } else {
513        let local_var_entity: Option<DeleteIdentityAdminError> = serde_json::from_str(&local_var_content).ok();
514        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
515        Err(Error::ResponseError(local_var_error))
516    }
517}
518
519/// Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
520pub async fn get_identity_admin(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::Identity, Error<GetIdentityAdminError>> {
521
522    let local_var_client = &configuration.client;
523
524    let local_var_uri_str = format!("{}/api/kratos/admin/identities/{id}", configuration.base_path, id=crate::apis::urlencode(id));
525    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
526
527    if let Some(ref local_var_user_agent) = configuration.user_agent {
528        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
529    }
530    if let Some(ref local_var_token) = configuration.bearer_access_token {
531        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
532    };
533
534    let local_var_req = local_var_req_builder.build()?;
535    let local_var_resp = local_var_client.execute(local_var_req).await?;
536
537    let local_var_status = local_var_resp.status();
538    let local_var_content = local_var_resp.text().await?;
539
540    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
541        serde_json::from_str(&local_var_content).map_err(Error::from)
542    } else {
543        let local_var_entity: Option<GetIdentityAdminError> = serde_json::from_str(&local_var_content).ok();
544        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
545        Err(Error::ResponseError(local_var_error))
546    }
547}
548
549/// Get a Traits Schema Definition
550pub async fn get_schema(configuration: &configuration::Configuration, id: &str) -> Result<serde_json::Value, Error<GetSchemaError>> {
551
552    let local_var_client = &configuration.client;
553
554    let local_var_uri_str = format!("{}/api/kratos/public/schemas/{id}", configuration.base_path, id=crate::apis::urlencode(id));
555    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
556
557    if let Some(ref local_var_user_agent) = configuration.user_agent {
558        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
559    }
560
561    let local_var_req = local_var_req_builder.build()?;
562    let local_var_resp = local_var_client.execute(local_var_req).await?;
563
564    let local_var_status = local_var_resp.status();
565    let local_var_content = local_var_resp.text().await?;
566
567    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
568        serde_json::from_str(&local_var_content).map_err(Error::from)
569    } else {
570        let local_var_entity: Option<GetSchemaError> = serde_json::from_str(&local_var_content).ok();
571        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
572        Err(Error::ResponseError(local_var_error))
573    }
574}
575
576/// Get a Traits Schema Definition
577pub async fn get_schema_admin(configuration: &configuration::Configuration, id: &str) -> Result<serde_json::Value, Error<GetSchemaAdminError>> {
578
579    let local_var_client = &configuration.client;
580
581    let local_var_uri_str = format!("{}/api/kratos/admin/schemas/{id}", configuration.base_path, id=crate::apis::urlencode(id));
582    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
583
584    if let Some(ref local_var_user_agent) = configuration.user_agent {
585        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
586    }
587    if let Some(ref local_var_token) = configuration.bearer_access_token {
588        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
589    };
590
591    let local_var_req = local_var_req_builder.build()?;
592    let local_var_resp = local_var_client.execute(local_var_req).await?;
593
594    let local_var_status = local_var_resp.status();
595    let local_var_content = local_var_resp.text().await?;
596
597    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
598        serde_json::from_str(&local_var_content).map_err(Error::from)
599    } else {
600        let local_var_entity: Option<GetSchemaAdminError> = serde_json::from_str(&local_var_content).ok();
601        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
602        Err(Error::ResponseError(local_var_error))
603    }
604}
605
606/// This endpoint returns the error associated with a user-facing self service errors.  This endpoint supports stub values to help you implement the error UI:  `?error=stub:500` - returns a stub 500 (Internal Server Error) error.  More information can be found at [Ory Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
607pub async fn get_self_service_error(configuration: &configuration::Configuration, error: &str) -> Result<crate::models::ErrorContainer, Error<GetSelfServiceErrorError>> {
608
609    let local_var_client = &configuration.client;
610
611    let local_var_uri_str = format!("{}/api/kratos/public/self-service/errors", configuration.base_path);
612    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
613
614    local_var_req_builder = local_var_req_builder.query(&[("error", &error.to_string())]);
615    if let Some(ref local_var_user_agent) = configuration.user_agent {
616        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
617    }
618
619    let local_var_req = local_var_req_builder.build()?;
620    let local_var_resp = local_var_client.execute(local_var_req).await?;
621
622    let local_var_status = local_var_resp.status();
623    let local_var_content = local_var_resp.text().await?;
624
625    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
626        serde_json::from_str(&local_var_content).map_err(Error::from)
627    } else {
628        let local_var_entity: Option<GetSelfServiceErrorError> = serde_json::from_str(&local_var_content).ok();
629        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
630        Err(Error::ResponseError(local_var_error))
631    }
632}
633
634/// This endpoint returns the error associated with a user-facing self service errors.  This endpoint supports stub values to help you implement the error UI:  `?error=stub:500` - returns a stub 500 (Internal Server Error) error.  More information can be found at [Ory Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
635pub async fn get_self_service_error_admin(configuration: &configuration::Configuration, error: &str) -> Result<crate::models::ErrorContainer, Error<GetSelfServiceErrorAdminError>> {
636
637    let local_var_client = &configuration.client;
638
639    let local_var_uri_str = format!("{}/api/kratos/admin/self-service/errors", configuration.base_path);
640    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
641
642    local_var_req_builder = local_var_req_builder.query(&[("error", &error.to_string())]);
643    if let Some(ref local_var_user_agent) = configuration.user_agent {
644        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
645    }
646    if let Some(ref local_var_token) = configuration.bearer_access_token {
647        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
648    };
649
650    let local_var_req = local_var_req_builder.build()?;
651    let local_var_resp = local_var_client.execute(local_var_req).await?;
652
653    let local_var_status = local_var_resp.status();
654    let local_var_content = local_var_resp.text().await?;
655
656    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
657        serde_json::from_str(&local_var_content).map_err(Error::from)
658    } else {
659        let local_var_entity: Option<GetSelfServiceErrorAdminError> = serde_json::from_str(&local_var_content).ok();
660        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
661        Err(Error::ResponseError(local_var_error))
662    }
663}
664
665/// This endpoint returns a login flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
666pub async fn get_self_service_login_flow(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::LoginFlow, Error<GetSelfServiceLoginFlowError>> {
667
668    let local_var_client = &configuration.client;
669
670    let local_var_uri_str = format!("{}/api/kratos/public/self-service/login/flows", configuration.base_path);
671    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
672
673    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
674    if let Some(ref local_var_user_agent) = configuration.user_agent {
675        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
676    }
677
678    let local_var_req = local_var_req_builder.build()?;
679    let local_var_resp = local_var_client.execute(local_var_req).await?;
680
681    let local_var_status = local_var_resp.status();
682    let local_var_content = local_var_resp.text().await?;
683
684    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
685        serde_json::from_str(&local_var_content).map_err(Error::from)
686    } else {
687        let local_var_entity: Option<GetSelfServiceLoginFlowError> = serde_json::from_str(&local_var_content).ok();
688        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
689        Err(Error::ResponseError(local_var_error))
690    }
691}
692
693/// This endpoint returns a login flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
694pub async fn get_self_service_login_flow_admin(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::LoginFlow, Error<GetSelfServiceLoginFlowAdminError>> {
695
696    let local_var_client = &configuration.client;
697
698    let local_var_uri_str = format!("{}/api/kratos/admin/self-service/login/flows", configuration.base_path);
699    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
700
701    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
702    if let Some(ref local_var_user_agent) = configuration.user_agent {
703        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
704    }
705    if let Some(ref local_var_token) = configuration.bearer_access_token {
706        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
707    };
708
709    let local_var_req = local_var_req_builder.build()?;
710    let local_var_resp = local_var_client.execute(local_var_req).await?;
711
712    let local_var_status = local_var_resp.status();
713    let local_var_content = local_var_resp.text().await?;
714
715    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
716        serde_json::from_str(&local_var_content).map_err(Error::from)
717    } else {
718        let local_var_entity: Option<GetSelfServiceLoginFlowAdminError> = serde_json::from_str(&local_var_content).ok();
719        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
720        Err(Error::ResponseError(local_var_error))
721    }
722}
723
724/// This endpoint returns a recovery flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
725pub async fn get_self_service_recovery_flow(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::RecoveryFlow, Error<GetSelfServiceRecoveryFlowError>> {
726
727    let local_var_client = &configuration.client;
728
729    let local_var_uri_str = format!("{}/api/kratos/public/self-service/recovery/flows", configuration.base_path);
730    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
731
732    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
733    if let Some(ref local_var_user_agent) = configuration.user_agent {
734        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
735    }
736
737    let local_var_req = local_var_req_builder.build()?;
738    let local_var_resp = local_var_client.execute(local_var_req).await?;
739
740    let local_var_status = local_var_resp.status();
741    let local_var_content = local_var_resp.text().await?;
742
743    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
744        serde_json::from_str(&local_var_content).map_err(Error::from)
745    } else {
746        let local_var_entity: Option<GetSelfServiceRecoveryFlowError> = serde_json::from_str(&local_var_content).ok();
747        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
748        Err(Error::ResponseError(local_var_error))
749    }
750}
751
752/// This endpoint returns a recovery flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
753pub async fn get_self_service_recovery_flow_admin(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::RecoveryFlow, Error<GetSelfServiceRecoveryFlowAdminError>> {
754
755    let local_var_client = &configuration.client;
756
757    let local_var_uri_str = format!("{}/api/kratos/admin/self-service/recovery/flows", configuration.base_path);
758    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
759
760    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
761    if let Some(ref local_var_user_agent) = configuration.user_agent {
762        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
763    }
764    if let Some(ref local_var_token) = configuration.bearer_access_token {
765        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
766    };
767
768    let local_var_req = local_var_req_builder.build()?;
769    let local_var_resp = local_var_client.execute(local_var_req).await?;
770
771    let local_var_status = local_var_resp.status();
772    let local_var_content = local_var_resp.text().await?;
773
774    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
775        serde_json::from_str(&local_var_content).map_err(Error::from)
776    } else {
777        let local_var_entity: Option<GetSelfServiceRecoveryFlowAdminError> = serde_json::from_str(&local_var_content).ok();
778        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
779        Err(Error::ResponseError(local_var_error))
780    }
781}
782
783/// This endpoint returns a registration flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
784pub async fn get_self_service_registration_flow(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::RegistrationFlow, Error<GetSelfServiceRegistrationFlowError>> {
785
786    let local_var_client = &configuration.client;
787
788    let local_var_uri_str = format!("{}/api/kratos/public/self-service/registration/flows", configuration.base_path);
789    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
790
791    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
792    if let Some(ref local_var_user_agent) = configuration.user_agent {
793        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
794    }
795
796    let local_var_req = local_var_req_builder.build()?;
797    let local_var_resp = local_var_client.execute(local_var_req).await?;
798
799    let local_var_status = local_var_resp.status();
800    let local_var_content = local_var_resp.text().await?;
801
802    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
803        serde_json::from_str(&local_var_content).map_err(Error::from)
804    } else {
805        let local_var_entity: Option<GetSelfServiceRegistrationFlowError> = serde_json::from_str(&local_var_content).ok();
806        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
807        Err(Error::ResponseError(local_var_error))
808    }
809}
810
811/// This endpoint returns a registration flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
812pub async fn get_self_service_registration_flow_admin(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::RegistrationFlow, Error<GetSelfServiceRegistrationFlowAdminError>> {
813
814    let local_var_client = &configuration.client;
815
816    let local_var_uri_str = format!("{}/api/kratos/admin/self-service/registration/flows", configuration.base_path);
817    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
818
819    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
820    if let Some(ref local_var_user_agent) = configuration.user_agent {
821        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
822    }
823    if let Some(ref local_var_token) = configuration.bearer_access_token {
824        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
825    };
826
827    let local_var_req = local_var_req_builder.build()?;
828    let local_var_resp = local_var_client.execute(local_var_req).await?;
829
830    let local_var_status = local_var_resp.status();
831    let local_var_content = local_var_resp.text().await?;
832
833    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
834        serde_json::from_str(&local_var_content).map_err(Error::from)
835    } else {
836        let local_var_entity: Option<GetSelfServiceRegistrationFlowAdminError> = serde_json::from_str(&local_var_content).ok();
837        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
838        Err(Error::ResponseError(local_var_error))
839    }
840}
841
842/// When accessing this endpoint through Ory Kratos' Public API you must ensure that either the Ory Kratos Session Cookie or the Ory Kratos Session Token are set. The public endpoint does not return 404 status codes but instead 403 or 500 to improve data privacy.  You can access this endpoint without credentials when using Ory Kratos' Admin API.  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
843pub async fn get_self_service_settings_flow(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::SettingsFlow, Error<GetSelfServiceSettingsFlowError>> {
844
845    let local_var_client = &configuration.client;
846
847    let local_var_uri_str = format!("{}/api/kratos/public/self-service/settings/flows", configuration.base_path);
848    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
849
850    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
851    if let Some(ref local_var_user_agent) = configuration.user_agent {
852        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
853    }
854    if let Some(ref local_var_token) = configuration.bearer_access_token {
855        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
856    };
857
858    let local_var_req = local_var_req_builder.build()?;
859    let local_var_resp = local_var_client.execute(local_var_req).await?;
860
861    let local_var_status = local_var_resp.status();
862    let local_var_content = local_var_resp.text().await?;
863
864    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
865        serde_json::from_str(&local_var_content).map_err(Error::from)
866    } else {
867        let local_var_entity: Option<GetSelfServiceSettingsFlowError> = serde_json::from_str(&local_var_content).ok();
868        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
869        Err(Error::ResponseError(local_var_error))
870    }
871}
872
873/// When accessing this endpoint through Ory Kratos' Public API you must ensure that either the Ory Kratos Session Cookie or the Ory Kratos Session Token are set. The public endpoint does not return 404 status codes but instead 403 or 500 to improve data privacy.  You can access this endpoint without credentials when using Ory Kratos' Admin API.  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
874pub async fn get_self_service_settings_flow_admin(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::SettingsFlow, Error<GetSelfServiceSettingsFlowAdminError>> {
875
876    let local_var_client = &configuration.client;
877
878    let local_var_uri_str = format!("{}/api/kratos/admin/self-service/settings/flows", configuration.base_path);
879    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
880
881    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
882    if let Some(ref local_var_user_agent) = configuration.user_agent {
883        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
884    }
885    if let Some(ref local_var_token) = configuration.bearer_access_token {
886        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
887    };
888
889    let local_var_req = local_var_req_builder.build()?;
890    let local_var_resp = local_var_client.execute(local_var_req).await?;
891
892    let local_var_status = local_var_resp.status();
893    let local_var_content = local_var_resp.text().await?;
894
895    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
896        serde_json::from_str(&local_var_content).map_err(Error::from)
897    } else {
898        let local_var_entity: Option<GetSelfServiceSettingsFlowAdminError> = serde_json::from_str(&local_var_content).ok();
899        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
900        Err(Error::ResponseError(local_var_error))
901    }
902}
903
904/// This endpoint returns a verification flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
905pub async fn get_self_service_verification_flow(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::VerificationFlow, Error<GetSelfServiceVerificationFlowError>> {
906
907    let local_var_client = &configuration.client;
908
909    let local_var_uri_str = format!("{}/api/kratos/public/self-service/verification/flows", configuration.base_path);
910    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
911
912    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
913    if let Some(ref local_var_user_agent) = configuration.user_agent {
914        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
915    }
916
917    let local_var_req = local_var_req_builder.build()?;
918    let local_var_resp = local_var_client.execute(local_var_req).await?;
919
920    let local_var_status = local_var_resp.status();
921    let local_var_content = local_var_resp.text().await?;
922
923    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
924        serde_json::from_str(&local_var_content).map_err(Error::from)
925    } else {
926        let local_var_entity: Option<GetSelfServiceVerificationFlowError> = serde_json::from_str(&local_var_content).ok();
927        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
928        Err(Error::ResponseError(local_var_error))
929    }
930}
931
932/// This endpoint returns a verification flow's context with, for example, error details and other information.  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
933pub async fn get_self_service_verification_flow_admin(configuration: &configuration::Configuration, id: &str) -> Result<crate::models::VerificationFlow, Error<GetSelfServiceVerificationFlowAdminError>> {
934
935    let local_var_client = &configuration.client;
936
937    let local_var_uri_str = format!("{}/api/kratos/admin/self-service/verification/flows", configuration.base_path);
938    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
939
940    local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
941    if let Some(ref local_var_user_agent) = configuration.user_agent {
942        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
943    }
944    if let Some(ref local_var_token) = configuration.bearer_access_token {
945        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
946    };
947
948    let local_var_req = local_var_req_builder.build()?;
949    let local_var_resp = local_var_client.execute(local_var_req).await?;
950
951    let local_var_status = local_var_resp.status();
952    let local_var_content = local_var_resp.text().await?;
953
954    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
955        serde_json::from_str(&local_var_content).map_err(Error::from)
956    } else {
957        let local_var_entity: Option<GetSelfServiceVerificationFlowAdminError> = serde_json::from_str(&local_var_content).ok();
958        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
959        Err(Error::ResponseError(local_var_error))
960    }
961}
962
963/// This endpoint returns the version of Ory Kratos.  If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set.  Be aware that if you are running multiple nodes of this service, the version will never refer to the cluster state, only to a single instance.
964pub async fn get_version_admin(configuration: &configuration::Configuration, ) -> Result<crate::models::InlineResponse2001, Error<GetVersionAdminError>> {
965
966    let local_var_client = &configuration.client;
967
968    let local_var_uri_str = format!("{}/api/kratos/admin/version", configuration.base_path);
969    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
970
971    if let Some(ref local_var_user_agent) = configuration.user_agent {
972        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
973    }
974    if let Some(ref local_var_token) = configuration.bearer_access_token {
975        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
976    };
977
978    let local_var_req = local_var_req_builder.build()?;
979    let local_var_resp = local_var_client.execute(local_var_req).await?;
980
981    let local_var_status = local_var_resp.status();
982    let local_var_content = local_var_resp.text().await?;
983
984    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
985        serde_json::from_str(&local_var_content).map_err(Error::from)
986    } else {
987        let local_var_entity: Option<GetVersionAdminError> = serde_json::from_str(&local_var_content).ok();
988        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
989        Err(Error::ResponseError(local_var_error))
990    }
991}
992
993/// This endpoint initializes a logout flow.  > This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  On successful logout, the browser will be redirected (HTTP 302 Found) to the `return_to` parameter of the initial request or fall back to `urls.default_return_to`.  More information can be found at [Ory Kratos User Logout Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-logout).
994pub async fn initialize_self_service_browser_logout_flow(configuration: &configuration::Configuration, ) -> Result<(), Error<InitializeSelfServiceBrowserLogoutFlowError>> {
995
996    let local_var_client = &configuration.client;
997
998    let local_var_uri_str = format!("{}/api/kratos/public/self-service/browser/flows/logout", configuration.base_path);
999    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1000
1001    if let Some(ref local_var_user_agent) = configuration.user_agent {
1002        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1003    }
1004
1005    let local_var_req = local_var_req_builder.build()?;
1006    let local_var_resp = local_var_client.execute(local_var_req).await?;
1007
1008    let local_var_status = local_var_resp.status();
1009    let local_var_content = local_var_resp.text().await?;
1010
1011    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1012        Ok(())
1013    } else {
1014        let local_var_entity: Option<InitializeSelfServiceBrowserLogoutFlowError> = serde_json::from_str(&local_var_content).ok();
1015        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1016        Err(Error::ResponseError(local_var_error))
1017    }
1018}
1019
1020/// This endpoint initiates a login flow for API clients such as mobile devices, smart TVs, and so on.  If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set.  To fetch an existing login flow call `/self-service/login/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1021pub async fn initialize_self_service_login_via_api_flow(configuration: &configuration::Configuration, refresh: Option<bool>) -> Result<crate::models::LoginFlow, Error<InitializeSelfServiceLoginViaApiFlowError>> {
1022
1023    let local_var_client = &configuration.client;
1024
1025    let local_var_uri_str = format!("{}/api/kratos/public/self-service/login/api", configuration.base_path);
1026    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1027
1028    if let Some(ref local_var_str) = refresh {
1029        local_var_req_builder = local_var_req_builder.query(&[("refresh", &local_var_str.to_string())]);
1030    }
1031    if let Some(ref local_var_user_agent) = configuration.user_agent {
1032        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1033    }
1034
1035    let local_var_req = local_var_req_builder.build()?;
1036    let local_var_resp = local_var_client.execute(local_var_req).await?;
1037
1038    let local_var_status = local_var_resp.status();
1039    let local_var_content = local_var_resp.text().await?;
1040
1041    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1042        serde_json::from_str(&local_var_content).map_err(Error::from)
1043    } else {
1044        let local_var_entity: Option<InitializeSelfServiceLoginViaApiFlowError> = serde_json::from_str(&local_var_content).ok();
1045        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1046        Err(Error::ResponseError(local_var_error))
1047    }
1048}
1049
1050/// This endpoint initializes a browser-based user login flow. Once initialized, the browser will be redirected to `selfservice.flows.login.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set.  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1051pub async fn initialize_self_service_login_via_browser_flow(configuration: &configuration::Configuration, ) -> Result<(), Error<InitializeSelfServiceLoginViaBrowserFlowError>> {
1052
1053    let local_var_client = &configuration.client;
1054
1055    let local_var_uri_str = format!("{}/api/kratos/public/self-service/login/browser", configuration.base_path);
1056    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1057
1058    if let Some(ref local_var_user_agent) = configuration.user_agent {
1059        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1060    }
1061
1062    let local_var_req = local_var_req_builder.build()?;
1063    let local_var_resp = local_var_client.execute(local_var_req).await?;
1064
1065    let local_var_status = local_var_resp.status();
1066    let local_var_content = local_var_resp.text().await?;
1067
1068    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1069        Ok(())
1070    } else {
1071        let local_var_entity: Option<InitializeSelfServiceLoginViaBrowserFlowError> = serde_json::from_str(&local_var_content).ok();
1072        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1073        Err(Error::ResponseError(local_var_error))
1074    }
1075}
1076
1077/// This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on.  If a valid provided session cookie or session token is provided, a 400 Bad Request error.  To fetch an existing recovery flow call `/self-service/recovery/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1078pub async fn initialize_self_service_recovery_via_api_flow(configuration: &configuration::Configuration, ) -> Result<crate::models::RecoveryFlow, Error<InitializeSelfServiceRecoveryViaApiFlowError>> {
1079
1080    let local_var_client = &configuration.client;
1081
1082    let local_var_uri_str = format!("{}/api/kratos/public/self-service/recovery/api", configuration.base_path);
1083    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1084
1085    if let Some(ref local_var_user_agent) = configuration.user_agent {
1086        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1087    }
1088
1089    let local_var_req = local_var_req_builder.build()?;
1090    let local_var_resp = local_var_client.execute(local_var_req).await?;
1091
1092    let local_var_status = local_var_resp.status();
1093    let local_var_content = local_var_resp.text().await?;
1094
1095    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1096        serde_json::from_str(&local_var_content).map_err(Error::from)
1097    } else {
1098        let local_var_entity: Option<InitializeSelfServiceRecoveryViaApiFlowError> = serde_json::from_str(&local_var_content).ok();
1099        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1100        Err(Error::ResponseError(local_var_error))
1101    }
1102}
1103
1104/// This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to `selfservice.flows.recovery.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists, the browser is returned to the configured return URL.  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1105pub async fn initialize_self_service_recovery_via_browser_flow(configuration: &configuration::Configuration, ) -> Result<(), Error<InitializeSelfServiceRecoveryViaBrowserFlowError>> {
1106
1107    let local_var_client = &configuration.client;
1108
1109    let local_var_uri_str = format!("{}/api/kratos/public/self-service/recovery/browser", configuration.base_path);
1110    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1111
1112    if let Some(ref local_var_user_agent) = configuration.user_agent {
1113        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1114    }
1115
1116    let local_var_req = local_var_req_builder.build()?;
1117    let local_var_resp = local_var_client.execute(local_var_req).await?;
1118
1119    let local_var_status = local_var_resp.status();
1120    let local_var_content = local_var_resp.text().await?;
1121
1122    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1123        Ok(())
1124    } else {
1125        let local_var_entity: Option<InitializeSelfServiceRecoveryViaBrowserFlowError> = serde_json::from_str(&local_var_content).ok();
1126        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1127        Err(Error::ResponseError(local_var_error))
1128    }
1129}
1130
1131/// This endpoint initiates a registration flow for API clients such as mobile devices, smart TVs, and so on.  If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set.  To fetch an existing registration flow call `/self-service/registration/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1132pub async fn initialize_self_service_registration(configuration: &configuration::Configuration, ) -> Result<crate::models::RegistrationFlow, Error<InitializeSelfServiceRegistrationError>> {
1133
1134    let local_var_client = &configuration.client;
1135
1136    let local_var_uri_str = format!("{}/api/kratos/public/self-service/registration/api", configuration.base_path);
1137    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1138
1139    if let Some(ref local_var_user_agent) = configuration.user_agent {
1140        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1141    }
1142
1143    let local_var_req = local_var_req_builder.build()?;
1144    let local_var_resp = local_var_client.execute(local_var_req).await?;
1145
1146    let local_var_status = local_var_resp.status();
1147    let local_var_content = local_var_resp.text().await?;
1148
1149    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1150        serde_json::from_str(&local_var_content).map_err(Error::from)
1151    } else {
1152        let local_var_entity: Option<InitializeSelfServiceRegistrationError> = serde_json::from_str(&local_var_content).ok();
1153        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1154        Err(Error::ResponseError(local_var_error))
1155    }
1156}
1157
1158/// This endpoint initializes a browser-based user registration flow. Once initialized, the browser will be redirected to `selfservice.flows.registration.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set.  :::note  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  :::  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1159pub async fn initialize_self_service_registration_for_browsers(configuration: &configuration::Configuration, ) -> Result<(), Error<InitializeSelfServiceRegistrationForBrowsersError>> {
1160
1161    let local_var_client = &configuration.client;
1162
1163    let local_var_uri_str = format!("{}/api/kratos/public/self-service/registration/browser", configuration.base_path);
1164    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1165
1166    if let Some(ref local_var_user_agent) = configuration.user_agent {
1167        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1168    }
1169
1170    let local_var_req = local_var_req_builder.build()?;
1171    let local_var_resp = local_var_client.execute(local_var_req).await?;
1172
1173    let local_var_status = local_var_resp.status();
1174    let local_var_content = local_var_resp.text().await?;
1175
1176    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1177        Ok(())
1178    } else {
1179        let local_var_entity: Option<InitializeSelfServiceRegistrationForBrowsersError> = serde_json::from_str(&local_var_content).ok();
1180        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1181        Err(Error::ResponseError(local_var_error))
1182    }
1183}
1184
1185/// This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK.  To fetch an existing settings flow call `/self-service/settings/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
1186pub async fn initialize_self_service_settings_via_api_flow(configuration: &configuration::Configuration, ) -> Result<crate::models::SettingsFlow, Error<InitializeSelfServiceSettingsViaApiFlowError>> {
1187
1188    let local_var_client = &configuration.client;
1189
1190    let local_var_uri_str = format!("{}/api/kratos/public/self-service/settings/api", configuration.base_path);
1191    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1192
1193    if let Some(ref local_var_user_agent) = configuration.user_agent {
1194        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1195    }
1196    if let Some(ref local_var_token) = configuration.bearer_access_token {
1197        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1198    };
1199
1200    let local_var_req = local_var_req_builder.build()?;
1201    let local_var_resp = local_var_client.execute(local_var_req).await?;
1202
1203    let local_var_status = local_var_resp.status();
1204    let local_var_content = local_var_resp.text().await?;
1205
1206    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1207        serde_json::from_str(&local_var_content).map_err(Error::from)
1208    } else {
1209        let local_var_entity: Option<InitializeSelfServiceSettingsViaApiFlowError> = serde_json::from_str(&local_var_content).ok();
1210        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1211        Err(Error::ResponseError(local_var_error))
1212    }
1213}
1214
1215/// This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid Ory Kratos Session Cookie is included in the request, a login flow will be initialized.  :::note  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  :::  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
1216pub async fn initialize_self_service_settings_via_browser_flow(configuration: &configuration::Configuration, ) -> Result<(), Error<InitializeSelfServiceSettingsViaBrowserFlowError>> {
1217
1218    let local_var_client = &configuration.client;
1219
1220    let local_var_uri_str = format!("{}/api/kratos/public/self-service/settings/browser", configuration.base_path);
1221    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1222
1223    if let Some(ref local_var_user_agent) = configuration.user_agent {
1224        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1225    }
1226    if let Some(ref local_var_token) = configuration.bearer_access_token {
1227        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1228    };
1229
1230    let local_var_req = local_var_req_builder.build()?;
1231    let local_var_resp = local_var_client.execute(local_var_req).await?;
1232
1233    let local_var_status = local_var_resp.status();
1234    let local_var_content = local_var_resp.text().await?;
1235
1236    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1237        Ok(())
1238    } else {
1239        let local_var_entity: Option<InitializeSelfServiceSettingsViaBrowserFlowError> = serde_json::from_str(&local_var_content).ok();
1240        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1241        Err(Error::ResponseError(local_var_error))
1242    }
1243}
1244
1245/// This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on.  To fetch an existing verification flow call `/self-service/verification/flows?flow=<flow_id>`.  :::warning  You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.  This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).  :::  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1246pub async fn initialize_self_service_verification_via_api_flow(configuration: &configuration::Configuration, ) -> Result<crate::models::VerificationFlow, Error<InitializeSelfServiceVerificationViaApiFlowError>> {
1247
1248    let local_var_client = &configuration.client;
1249
1250    let local_var_uri_str = format!("{}/api/kratos/public/self-service/verification/api", configuration.base_path);
1251    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1252
1253    if let Some(ref local_var_user_agent) = configuration.user_agent {
1254        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1255    }
1256
1257    let local_var_req = local_var_req_builder.build()?;
1258    let local_var_resp = local_var_client.execute(local_var_req).await?;
1259
1260    let local_var_status = local_var_resp.status();
1261    let local_var_content = local_var_resp.text().await?;
1262
1263    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1264        serde_json::from_str(&local_var_content).map_err(Error::from)
1265    } else {
1266        let local_var_entity: Option<InitializeSelfServiceVerificationViaApiFlowError> = serde_json::from_str(&local_var_content).ok();
1267        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1268        Err(Error::ResponseError(local_var_error))
1269    }
1270}
1271
1272/// This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to `selfservice.flows.verification.ui_url` with the flow ID set as the query parameter `?flow=`.  This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1273pub async fn initialize_self_service_verification_via_browser_flow(configuration: &configuration::Configuration, ) -> Result<(), Error<InitializeSelfServiceVerificationViaBrowserFlowError>> {
1274
1275    let local_var_client = &configuration.client;
1276
1277    let local_var_uri_str = format!("{}/api/kratos/public/self-service/verification/browser", configuration.base_path);
1278    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1279
1280    if let Some(ref local_var_user_agent) = configuration.user_agent {
1281        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1282    }
1283
1284    let local_var_req = local_var_req_builder.build()?;
1285    let local_var_resp = local_var_client.execute(local_var_req).await?;
1286
1287    let local_var_status = local_var_resp.status();
1288    let local_var_content = local_var_resp.text().await?;
1289
1290    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1291        Ok(())
1292    } else {
1293        let local_var_entity: Option<InitializeSelfServiceVerificationViaBrowserFlowError> = serde_json::from_str(&local_var_content).ok();
1294        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1295        Err(Error::ResponseError(local_var_error))
1296    }
1297}
1298
1299/// This endpoint returns a HTTP 200 status code when Ory Kratos is accepting incoming HTTP requests. This status does currently not include checks whether the database connection is working.  If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
1300pub async fn is_alive_admin(configuration: &configuration::Configuration, ) -> Result<crate::models::InlineResponse200, Error<IsAliveAdminError>> {
1301
1302    let local_var_client = &configuration.client;
1303
1304    let local_var_uri_str = format!("{}/api/kratos/admin/health/alive", configuration.base_path);
1305    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1306
1307    if let Some(ref local_var_user_agent) = configuration.user_agent {
1308        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1309    }
1310    if let Some(ref local_var_token) = configuration.bearer_access_token {
1311        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1312    };
1313
1314    let local_var_req = local_var_req_builder.build()?;
1315    let local_var_resp = local_var_client.execute(local_var_req).await?;
1316
1317    let local_var_status = local_var_resp.status();
1318    let local_var_content = local_var_resp.text().await?;
1319
1320    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1321        serde_json::from_str(&local_var_content).map_err(Error::from)
1322    } else {
1323        let local_var_entity: Option<IsAliveAdminError> = serde_json::from_str(&local_var_content).ok();
1324        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1325        Err(Error::ResponseError(local_var_error))
1326    }
1327}
1328
1329/// This endpoint returns a HTTP 200 status code when Ory Kratos is up running and the environment dependencies (e.g. the database) are responsive as well.  If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set.  Be aware that if you are running multiple nodes of Ory Kratos, the health status will never refer to the cluster state, only to a single instance.
1330pub async fn is_ready_admin(configuration: &configuration::Configuration, ) -> Result<crate::models::InlineResponse200, Error<IsReadyAdminError>> {
1331
1332    let local_var_client = &configuration.client;
1333
1334    let local_var_uri_str = format!("{}/api/kratos/admin/health/ready", configuration.base_path);
1335    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1336
1337    if let Some(ref local_var_user_agent) = configuration.user_agent {
1338        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1339    }
1340    if let Some(ref local_var_token) = configuration.bearer_access_token {
1341        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1342    };
1343
1344    let local_var_req = local_var_req_builder.build()?;
1345    let local_var_resp = local_var_client.execute(local_var_req).await?;
1346
1347    let local_var_status = local_var_resp.status();
1348    let local_var_content = local_var_resp.text().await?;
1349
1350    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1351        serde_json::from_str(&local_var_content).map_err(Error::from)
1352    } else {
1353        let local_var_entity: Option<IsReadyAdminError> = serde_json::from_str(&local_var_content).ok();
1354        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1355        Err(Error::ResponseError(local_var_error))
1356    }
1357}
1358
1359/// Lists all identities. Does not support search at the moment.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
1360pub async fn list_identities_admin(configuration: &configuration::Configuration, per_page: Option<i64>, page: Option<i64>) -> Result<Vec<crate::models::Identity>, Error<ListIdentitiesAdminError>> {
1361
1362    let local_var_client = &configuration.client;
1363
1364    let local_var_uri_str = format!("{}/api/kratos/admin/identities", configuration.base_path);
1365    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1366
1367    if let Some(ref local_var_str) = per_page {
1368        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1369    }
1370    if let Some(ref local_var_str) = page {
1371        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1372    }
1373    if let Some(ref local_var_user_agent) = configuration.user_agent {
1374        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1375    }
1376    if let Some(ref local_var_token) = configuration.bearer_access_token {
1377        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1378    };
1379
1380    let local_var_req = local_var_req_builder.build()?;
1381    let local_var_resp = local_var_client.execute(local_var_req).await?;
1382
1383    let local_var_status = local_var_resp.status();
1384    let local_var_content = local_var_resp.text().await?;
1385
1386    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1387        serde_json::from_str(&local_var_content).map_err(Error::from)
1388    } else {
1389        let local_var_entity: Option<ListIdentitiesAdminError> = serde_json::from_str(&local_var_content).ok();
1390        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1391        Err(Error::ResponseError(local_var_error))
1392    }
1393}
1394
1395/// ``` metadata: annotations: prometheus.io/port: \"4434\" prometheus.io/path: \"/metrics/prometheus\" ```
1396pub async fn prometheus_admin(configuration: &configuration::Configuration, ) -> Result<(), Error<PrometheusAdminError>> {
1397
1398    let local_var_client = &configuration.client;
1399
1400    let local_var_uri_str = format!("{}/api/kratos/admin/metrics/prometheus", configuration.base_path);
1401    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1402
1403    if let Some(ref local_var_user_agent) = configuration.user_agent {
1404        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1405    }
1406    if let Some(ref local_var_token) = configuration.bearer_access_token {
1407        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1408    };
1409
1410    let local_var_req = local_var_req_builder.build()?;
1411    let local_var_resp = local_var_client.execute(local_var_req).await?;
1412
1413    let local_var_status = local_var_resp.status();
1414    let local_var_content = local_var_resp.text().await?;
1415
1416    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1417        Ok(())
1418    } else {
1419        let local_var_entity: Option<PrometheusAdminError> = serde_json::from_str(&local_var_content).ok();
1420        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1421        Err(Error::ResponseError(local_var_error))
1422    }
1423}
1424
1425/// Use this endpoint to revoke a session using its token. This endpoint is particularly useful for API clients such as mobile apps to log the user out of the system and invalidate the session.  This endpoint does not remove any HTTP Cookies - use the Browser-Based Self-Service Logout Flow instead.
1426pub async fn revoke_session(configuration: &configuration::Configuration, revoke_session: crate::models::RevokeSession) -> Result<(), Error<RevokeSessionError>> {
1427
1428    let local_var_client = &configuration.client;
1429
1430    let local_var_uri_str = format!("{}/api/kratos/public/sessions", configuration.base_path);
1431    let mut local_var_req_builder = local_var_client.delete(local_var_uri_str.as_str());
1432
1433    if let Some(ref local_var_user_agent) = configuration.user_agent {
1434        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1435    }
1436    local_var_req_builder = local_var_req_builder.json(&revoke_session);
1437
1438    let local_var_req = local_var_req_builder.build()?;
1439    let local_var_resp = local_var_client.execute(local_var_req).await?;
1440
1441    let local_var_status = local_var_resp.status();
1442    let local_var_content = local_var_resp.text().await?;
1443
1444    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1445        Ok(())
1446    } else {
1447        let local_var_entity: Option<RevokeSessionError> = serde_json::from_str(&local_var_content).ok();
1448        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1449        Err(Error::ResponseError(local_var_error))
1450    }
1451}
1452
1453/// Use this endpoint to complete a login flow. This endpoint behaves differently for API and browser flows.  API flows expect `application/json` to be sent in the body and responds with HTTP 200 and a application/json body with the session token on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors.  Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with a HTTP 302 redirect to the post/after login URL or the `return_to` value if it was set and if the login succeeded; a HTTP 302 redirect to the login UI URL with the flow ID containing the validation errors otherwise.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1454pub async fn submit_self_service_login_flow(configuration: &configuration::Configuration, flow: &str, submit_self_service_login_flow: Option<crate::models::SubmitSelfServiceLoginFlow>) -> Result<crate::models::LoginViaApiResponse, Error<SubmitSelfServiceLoginFlowError>> {
1455
1456    let local_var_client = &configuration.client;
1457
1458    let local_var_uri_str = format!("{}/api/kratos/public/self-service/login", configuration.base_path);
1459    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
1460
1461    local_var_req_builder = local_var_req_builder.query(&[("flow", &flow.to_string())]);
1462    if let Some(ref local_var_user_agent) = configuration.user_agent {
1463        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1464    }
1465    local_var_req_builder = local_var_req_builder.json(&submit_self_service_login_flow);
1466
1467    let local_var_req = local_var_req_builder.build()?;
1468    let local_var_resp = local_var_client.execute(local_var_req).await?;
1469
1470    let local_var_status = local_var_resp.status();
1471    let local_var_content = local_var_resp.text().await?;
1472
1473    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1474        serde_json::from_str(&local_var_content).map_err(Error::from)
1475    } else {
1476        let local_var_entity: Option<SubmitSelfServiceLoginFlowError> = serde_json::from_str(&local_var_content).ok();
1477        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1478        Err(Error::ResponseError(local_var_error))
1479    }
1480}
1481
1482/// Use this endpoint to complete a recovery flow. This endpoint behaves differently for API and browser flows and has several states:  `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). For Browser clients it returns a HTTP 302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. `sent_email` is the success state after `choose_method` for the `link` method and allows the user to request another recovery email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a recovery link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with a new Recovery Flow ID which contains an error message that the recovery link was invalid.  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1483pub async fn submit_self_service_recovery_flow(configuration: &configuration::Configuration, flow: &str, body: Option<serde_json::Value>) -> Result<(), Error<SubmitSelfServiceRecoveryFlowError>> {
1484
1485    let local_var_client = &configuration.client;
1486
1487    let local_var_uri_str = format!("{}/api/kratos/public/self-service/recovery", configuration.base_path);
1488    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
1489
1490    local_var_req_builder = local_var_req_builder.query(&[("flow", &flow.to_string())]);
1491    if let Some(ref local_var_user_agent) = configuration.user_agent {
1492        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1493    }
1494    local_var_req_builder = local_var_req_builder.json(&body);
1495
1496    let local_var_req = local_var_req_builder.build()?;
1497    let local_var_resp = local_var_client.execute(local_var_req).await?;
1498
1499    let local_var_status = local_var_resp.status();
1500    let local_var_content = local_var_resp.text().await?;
1501
1502    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1503        Ok(())
1504    } else {
1505        let local_var_entity: Option<SubmitSelfServiceRecoveryFlowError> = serde_json::from_str(&local_var_content).ok();
1506        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1507        Err(Error::ResponseError(local_var_error))
1508    }
1509}
1510
1511/// Use this endpoint to complete a recovery flow using the link method. This endpoint behaves differently for API and browser flows and has several states:  `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). For Browser clients it returns a HTTP 302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. `sent_email` is the success state after `choose_method` and allows the user to request another recovery email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a recovery link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with a new Recovery Flow ID which contains an error message that the recovery link was invalid.  More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1512pub async fn submit_self_service_recovery_flow_with_link_method(configuration: &configuration::Configuration, token: Option<&str>, flow: Option<&str>, submit_self_service_recovery_flow_with_link_method: Option<crate::models::SubmitSelfServiceRecoveryFlowWithLinkMethod>) -> Result<(), Error<SubmitSelfServiceRecoveryFlowWithLinkMethodError>> {
1513
1514    let local_var_client = &configuration.client;
1515
1516    let local_var_uri_str = format!("{}/api/kratos/public/self-service/recovery/methods/link", configuration.base_path);
1517    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
1518
1519    if let Some(ref local_var_str) = token {
1520        local_var_req_builder = local_var_req_builder.query(&[("token", &local_var_str.to_string())]);
1521    }
1522    if let Some(ref local_var_str) = flow {
1523        local_var_req_builder = local_var_req_builder.query(&[("flow", &local_var_str.to_string())]);
1524    }
1525    if let Some(ref local_var_user_agent) = configuration.user_agent {
1526        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1527    }
1528    local_var_req_builder = local_var_req_builder.json(&submit_self_service_recovery_flow_with_link_method);
1529
1530    let local_var_req = local_var_req_builder.build()?;
1531    let local_var_resp = local_var_client.execute(local_var_req).await?;
1532
1533    let local_var_status = local_var_resp.status();
1534    let local_var_content = local_var_resp.text().await?;
1535
1536    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1537        Ok(())
1538    } else {
1539        let local_var_entity: Option<SubmitSelfServiceRecoveryFlowWithLinkMethodError> = serde_json::from_str(&local_var_content).ok();
1540        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1541        Err(Error::ResponseError(local_var_error))
1542    }
1543}
1544
1545/// Use this endpoint to complete a registration flow by sending an identity's traits and password. This endpoint behaves differently for API and browser flows.  API flows expect `application/json` to be sent in the body and respond with HTTP 200 and a application/json body with the created identity success - if the session hook is configured the `session` and `session_token` will also be included; HTTP 302 redirect to a fresh registration flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors.  Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with a HTTP 302 redirect to the post/after registration URL or the `return_to` value if it was set and if the registration succeeded; a HTTP 302 redirect to the registration UI URL with the flow ID containing the validation errors otherwise.  More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1546pub async fn submit_self_service_registration_flow(configuration: &configuration::Configuration, flow: &str, submit_self_service_registration_flow: Option<crate::models::SubmitSelfServiceRegistrationFlow>) -> Result<crate::models::RegistrationViaApiResponse, Error<SubmitSelfServiceRegistrationFlowError>> {
1547
1548    let local_var_client = &configuration.client;
1549
1550    let local_var_uri_str = format!("{}/api/kratos/public/self-service/registration", configuration.base_path);
1551    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
1552
1553    local_var_req_builder = local_var_req_builder.query(&[("flow", &flow.to_string())]);
1554    if let Some(ref local_var_user_agent) = configuration.user_agent {
1555        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1556    }
1557    local_var_req_builder = local_var_req_builder.json(&submit_self_service_registration_flow);
1558
1559    let local_var_req = local_var_req_builder.build()?;
1560    let local_var_resp = local_var_client.execute(local_var_req).await?;
1561
1562    let local_var_status = local_var_resp.status();
1563    let local_var_content = local_var_resp.text().await?;
1564
1565    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1566        serde_json::from_str(&local_var_content).map_err(Error::from)
1567    } else {
1568        let local_var_entity: Option<SubmitSelfServiceRegistrationFlowError> = serde_json::from_str(&local_var_content).ok();
1569        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1570        Err(Error::ResponseError(local_var_error))
1571    }
1572}
1573
1574/// Use this endpoint to complete a settings flow by sending an identity's updated password. This endpoint behaves differently for API and browser flows.  API-initiated flows expect `application/json` to be sent in the body and respond with HTTP 200 and an application/json body with the session token on success; HTTP 302 redirect to a fresh settings flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. HTTP 401 when the endpoint is called without a valid session token. HTTP 403 when `selfservice.flows.settings.privileged_session_max_age` was reached. Implies that the user needs to re-authenticate.  Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with a HTTP 302 redirect to the post/after settings URL or the `return_to` value if it was set and if the flow succeeded; a HTTP 302 redirect to the Settings UI URL with the flow ID containing the validation errors otherwise. a HTTP 302 redirect to the login endpoint when `selfservice.flows.settings.privileged_session_max_age` was reached.  More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
1575pub async fn submit_self_service_settings_flow(configuration: &configuration::Configuration, flow: &str, submit_self_service_settings_flow: Option<crate::models::SubmitSelfServiceSettingsFlow>) -> Result<crate::models::SettingsViaApiResponse, Error<SubmitSelfServiceSettingsFlowError>> {
1576
1577    let local_var_client = &configuration.client;
1578
1579    let local_var_uri_str = format!("{}/api/kratos/public/self-service/settings", configuration.base_path);
1580    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
1581
1582    local_var_req_builder = local_var_req_builder.query(&[("flow", &flow.to_string())]);
1583    if let Some(ref local_var_user_agent) = configuration.user_agent {
1584        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1585    }
1586    if let Some(ref local_var_token) = configuration.bearer_access_token {
1587        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1588    };
1589    local_var_req_builder = local_var_req_builder.json(&submit_self_service_settings_flow);
1590
1591    let local_var_req = local_var_req_builder.build()?;
1592    let local_var_resp = local_var_client.execute(local_var_req).await?;
1593
1594    let local_var_status = local_var_resp.status();
1595    let local_var_content = local_var_resp.text().await?;
1596
1597    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1598        serde_json::from_str(&local_var_content).map_err(Error::from)
1599    } else {
1600        let local_var_entity: Option<SubmitSelfServiceSettingsFlowError> = serde_json::from_str(&local_var_content).ok();
1601        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1602        Err(Error::ResponseError(local_var_error))
1603    }
1604}
1605
1606/// Use this endpoint to complete a verification flow. This endpoint behaves differently for API and browser flows and has several states:  `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh verification flow if the flow was otherwise invalid (e.g. expired). For Browser clients it returns a HTTP 302 Found redirect to the Verification UI URL with the Verification Flow ID appended. `sent_email` is the success state after `choose_method` when using the `link` method and allows the user to request another verification email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a verification link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Verification UI URL with a new Verification Flow ID which contains an error message that the verification link was invalid.  More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1607pub async fn submit_self_service_verification_flow(configuration: &configuration::Configuration, flow: &str, body: Option<serde_json::Value>) -> Result<(), Error<SubmitSelfServiceVerificationFlowError>> {
1608
1609    let local_var_client = &configuration.client;
1610
1611    let local_var_uri_str = format!("{}/api/kratos/public/self-service/verification/methods/link", configuration.base_path);
1612    let mut local_var_req_builder = local_var_client.post(local_var_uri_str.as_str());
1613
1614    local_var_req_builder = local_var_req_builder.query(&[("flow", &flow.to_string())]);
1615    if let Some(ref local_var_user_agent) = configuration.user_agent {
1616        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1617    }
1618    local_var_req_builder = local_var_req_builder.json(&body);
1619
1620    let local_var_req = local_var_req_builder.build()?;
1621    let local_var_resp = local_var_client.execute(local_var_req).await?;
1622
1623    let local_var_status = local_var_resp.status();
1624    let local_var_content = local_var_resp.text().await?;
1625
1626    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1627        Ok(())
1628    } else {
1629        let local_var_entity: Option<SubmitSelfServiceVerificationFlowError> = serde_json::from_str(&local_var_content).ok();
1630        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1631        Err(Error::ResponseError(local_var_error))
1632    }
1633}
1634
1635/// Uses the HTTP Headers in the GET request to determine (e.g. by using checking the cookies) who is authenticated. Returns a session object in the body or 401 if the credentials are invalid or no credentials were sent. Additionally when the request it successful it adds the user ID to the 'X-Kratos-Authenticated-Identity-Id' header in the response.  This endpoint is useful for:  AJAX calls. Remember to send credentials and set up CORS correctly! Reverse proxies and API Gateways Server-side calls - use the `X-Session-Token` header!
1636pub async fn to_session(configuration: &configuration::Configuration, x_session_token: Option<&str>) -> Result<crate::models::Session, Error<ToSessionError>> {
1637
1638    let local_var_client = &configuration.client;
1639
1640    let local_var_uri_str = format!("{}/api/kratos/public/sessions/whoami", configuration.base_path);
1641    let mut local_var_req_builder = local_var_client.get(local_var_uri_str.as_str());
1642
1643    if let Some(ref local_var_user_agent) = configuration.user_agent {
1644        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1645    }
1646    if let Some(local_var_param_value) = x_session_token {
1647        local_var_req_builder = local_var_req_builder.header("X-Session-Token", local_var_param_value.to_string());
1648    }
1649
1650    let local_var_req = local_var_req_builder.build()?;
1651    let local_var_resp = local_var_client.execute(local_var_req).await?;
1652
1653    let local_var_status = local_var_resp.status();
1654    let local_var_content = local_var_resp.text().await?;
1655
1656    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1657        serde_json::from_str(&local_var_content).map_err(Error::from)
1658    } else {
1659        let local_var_entity: Option<ToSessionError> = serde_json::from_str(&local_var_content).ok();
1660        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1661        Err(Error::ResponseError(local_var_error))
1662    }
1663}
1664
1665/// This endpoint updates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future.  The full identity payload (except credentials) is expected. This endpoint does not support patching.  Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
1666pub async fn update_identity_admin(configuration: &configuration::Configuration, id: &str, update_identity: Option<crate::models::UpdateIdentity>) -> Result<crate::models::Identity, Error<UpdateIdentityAdminError>> {
1667
1668    let local_var_client = &configuration.client;
1669
1670    let local_var_uri_str = format!("{}/api/kratos/admin/identities/{id}", configuration.base_path, id=crate::apis::urlencode(id));
1671    let mut local_var_req_builder = local_var_client.put(local_var_uri_str.as_str());
1672
1673    if let Some(ref local_var_user_agent) = configuration.user_agent {
1674        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1675    }
1676    if let Some(ref local_var_token) = configuration.bearer_access_token {
1677        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1678    };
1679    local_var_req_builder = local_var_req_builder.json(&update_identity);
1680
1681    let local_var_req = local_var_req_builder.build()?;
1682    let local_var_resp = local_var_client.execute(local_var_req).await?;
1683
1684    let local_var_status = local_var_resp.status();
1685    let local_var_content = local_var_resp.text().await?;
1686
1687    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1688        serde_json::from_str(&local_var_content).map_err(Error::from)
1689    } else {
1690        let local_var_entity: Option<UpdateIdentityAdminError> = serde_json::from_str(&local_var_content).ok();
1691        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1692        Err(Error::ResponseError(local_var_error))
1693    }
1694}
1695