clerk_fapi_rs/apis/
sign_ups_api.rs

1/*
2 * Clerk Frontend API
3 *
4 * The Clerk REST Frontend API, meant to be accessed from a browser or native environment.  This is a Form Based API and all the data must be sent and formatted according to the `application/x-www-form-urlencoded` content type.  ### Versions  When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/backend-requests/versioning/overview).  ### Using the Try It Console  The `Try It` feature of the docs only works for **Development Instances** when using the `DevBrowser` security scheme. To use it, first generate a dev instance token from the `/v1/dev_browser` endpoint.  Please see https://clerk.com/docs for more information.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: support@clerk.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16/// struct for typed errors of method [`attempt_sign_ups_verification`]
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum AttemptSignUpsVerificationError {
20    Status400(models::ClerkErrors),
21    Status403(models::ClerkErrors),
22    Status409(models::ClerkErrors),
23    Status422(models::ClerkErrors),
24    Status429(models::ClerkErrors),
25    UnknownValue(serde_json::Value),
26}
27
28/// struct for typed errors of method [`create_sign_ups`]
29#[derive(Debug, Clone, Serialize, Deserialize)]
30#[serde(untagged)]
31pub enum CreateSignUpsError {
32    Status400(models::ClerkErrors),
33    Status403(models::ClerkErrors),
34    Status404(models::ClerkErrors),
35    Status409(models::ClerkErrors),
36    Status422(models::ClerkErrors),
37    UnknownValue(serde_json::Value),
38}
39
40/// struct for typed errors of method [`get_sign_ups`]
41#[derive(Debug, Clone, Serialize, Deserialize)]
42#[serde(untagged)]
43pub enum GetSignUpsError {
44    Status400(models::ClerkErrors),
45    Status401(models::ClerkErrors),
46    Status404(models::ClerkErrors),
47    UnknownValue(serde_json::Value),
48}
49
50/// struct for typed errors of method [`prepare_sign_ups_verification`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum PrepareSignUpsVerificationError {
54    Status400(models::ClerkErrors),
55    Status401(models::ClerkErrors),
56    Status422(models::ClerkErrors),
57    Status429(models::ClerkErrors),
58    UnknownValue(serde_json::Value),
59}
60
61/// struct for typed errors of method [`update_sign_ups`]
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum UpdateSignUpsError {
65    Status400(models::ClerkErrors),
66    Status403(models::ClerkErrors),
67    Status404(models::ClerkErrors),
68    Status422(models::ClerkErrors),
69    UnknownValue(serde_json::Value),
70}
71
72/// Attempts to verify the identification that corresponds to the given strategy using the given verification code.
73pub async fn attempt_sign_ups_verification(
74    configuration: &configuration::Configuration,
75    sign_up_id: &str,
76    origin: Option<&str>,
77    strategy: Option<&str>,
78    code: Option<&str>,
79    signature: Option<&str>,
80    token: Option<&str>,
81) -> Result<models::ClientClientWrappedSignUp, Error<AttemptSignUpsVerificationError>> {
82    // add a prefix to parameters to efficiently prevent name collisions
83    let p_path_sign_up_id = sign_up_id;
84    let p_header_origin = origin;
85    let p_form_strategy = strategy;
86    let p_form_code = code;
87    let p_form_signature = signature;
88    let p_form_token = token;
89
90    let uri_str = format!(
91        "{}/v1/client/sign_ups/{sign_up_id}/attempt_verification",
92        configuration.base_path,
93        sign_up_id = crate::apis::urlencode(p_path_sign_up_id)
94    );
95    let mut req_builder = configuration
96        .client
97        .request(reqwest::Method::POST, &uri_str);
98
99    if let Some(ref apikey) = configuration.api_key {
100        let key = apikey.key.clone();
101        let value = match apikey.prefix {
102            Some(ref prefix) => format!("{prefix} {key}"),
103            None => key,
104        };
105        req_builder = req_builder.query(&[("__dev_session", value)]);
106    }
107    if let Some(ref user_agent) = configuration.user_agent {
108        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
109    }
110    if let Some(param_value) = p_header_origin {
111        req_builder = req_builder.header("Origin", param_value.to_string());
112    }
113    if let Some(ref apikey) = configuration.api_key {
114        let key = apikey.key.clone();
115        let value = match apikey.prefix {
116            Some(ref prefix) => format!("{prefix} {key}"),
117            None => key,
118        };
119        req_builder = req_builder.header("__session", value);
120    };
121    let mut multipart_form_params = std::collections::HashMap::new();
122    if let Some(param_value) = p_form_strategy {
123        multipart_form_params.insert("strategy", param_value.to_string());
124    }
125    if let Some(param_value) = p_form_code {
126        multipart_form_params.insert("code", param_value.to_string());
127    }
128    if let Some(param_value) = p_form_signature {
129        multipart_form_params.insert("signature", param_value.to_string());
130    }
131    if let Some(param_value) = p_form_token {
132        multipart_form_params.insert("token", param_value.to_string());
133    }
134    req_builder = req_builder.form(&multipart_form_params);
135
136    let req = req_builder.build()?;
137    let resp = configuration.client.execute(req).await?;
138
139    let status = resp.status();
140    let content_type = resp
141        .headers()
142        .get("content-type")
143        .and_then(|v| v.to_str().ok())
144        .unwrap_or("application/octet-stream");
145    let content_type = super::ContentType::from(content_type);
146
147    if !status.is_client_error() && !status.is_server_error() {
148        let content = resp.text().await?;
149        match content_type {
150            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
151            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClientClientWrappedSignUp`"))),
152            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClientClientWrappedSignUp`")))),
153        }
154    } else {
155        let content = resp.text().await?;
156        let entity: Option<AttemptSignUpsVerificationError> = serde_json::from_str(&content).ok();
157        Err(Error::ResponseError(ResponseContent {
158            status,
159            content,
160            entity,
161        }))
162    }
163}
164
165/// Creates or replaces the sign-up on the current Client object.
166pub async fn create_sign_ups(
167    configuration: &configuration::Configuration,
168    origin: Option<&str>,
169    transfer: Option<bool>,
170    password: Option<&str>,
171    first_name: Option<&str>,
172    last_name: Option<&str>,
173    username: Option<&str>,
174    email_address: Option<&str>,
175    phone_number: Option<&str>,
176    email_address_or_phone_number: Option<&str>,
177    unsafe_metadata: Option<&str>,
178    strategy: Option<&str>,
179    action_complete_redirect_url: Option<&str>,
180    redirect_url: Option<&str>,
181    ticket: Option<&str>,
182    web3_wallet: Option<&str>,
183    token: Option<&str>,
184    code: Option<&str>,
185    captcha_token: Option<&str>,
186    captcha_error: Option<&str>,
187    captcha_widget_type: Option<&str>,
188    legal_accepted: Option<bool>,
189    oidc_login_hint: Option<&str>,
190    oidc_prompt: Option<&str>,
191) -> Result<models::ClientClientWrappedSignUp, Error<CreateSignUpsError>> {
192    // add a prefix to parameters to efficiently prevent name collisions
193    let p_header_origin = origin;
194    let p_form_transfer = transfer;
195    let p_form_password = password;
196    let p_form_first_name = first_name;
197    let p_form_last_name = last_name;
198    let p_form_username = username;
199    let p_form_email_address = email_address;
200    let p_form_phone_number = phone_number;
201    let p_form_email_address_or_phone_number = email_address_or_phone_number;
202    let p_form_unsafe_metadata = unsafe_metadata;
203    let p_form_strategy = strategy;
204    let p_form_action_complete_redirect_url = action_complete_redirect_url;
205    let p_form_redirect_url = redirect_url;
206    let p_form_ticket = ticket;
207    let p_form_web3_wallet = web3_wallet;
208    let p_form_token = token;
209    let p_form_code = code;
210    let p_form_captcha_token = captcha_token;
211    let p_form_captcha_error = captcha_error;
212    let p_form_captcha_widget_type = captcha_widget_type;
213    let p_form_legal_accepted = legal_accepted;
214    let p_form_oidc_login_hint = oidc_login_hint;
215    let p_form_oidc_prompt = oidc_prompt;
216
217    let uri_str = format!("{}/v1/client/sign_ups", configuration.base_path);
218    let mut req_builder = configuration
219        .client
220        .request(reqwest::Method::POST, &uri_str);
221
222    if let Some(ref apikey) = configuration.api_key {
223        let key = apikey.key.clone();
224        let value = match apikey.prefix {
225            Some(ref prefix) => format!("{prefix} {key}"),
226            None => key,
227        };
228        req_builder = req_builder.query(&[("__dev_session", value)]);
229    }
230    if let Some(ref user_agent) = configuration.user_agent {
231        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
232    }
233    if let Some(param_value) = p_header_origin {
234        req_builder = req_builder.header("Origin", param_value.to_string());
235    }
236    if let Some(ref apikey) = configuration.api_key {
237        let key = apikey.key.clone();
238        let value = match apikey.prefix {
239            Some(ref prefix) => format!("{prefix} {key}"),
240            None => key,
241        };
242        req_builder = req_builder.header("__session", value);
243    };
244    let mut multipart_form_params = std::collections::HashMap::new();
245    if let Some(param_value) = p_form_transfer {
246        multipart_form_params.insert("transfer", param_value.to_string());
247    }
248    if let Some(param_value) = p_form_password {
249        multipart_form_params.insert("password", param_value.to_string());
250    }
251    if let Some(param_value) = p_form_first_name {
252        multipart_form_params.insert("first_name", param_value.to_string());
253    }
254    if let Some(param_value) = p_form_last_name {
255        multipart_form_params.insert("last_name", param_value.to_string());
256    }
257    if let Some(param_value) = p_form_username {
258        multipart_form_params.insert("username", param_value.to_string());
259    }
260    if let Some(param_value) = p_form_email_address {
261        multipart_form_params.insert("email_address", param_value.to_string());
262    }
263    if let Some(param_value) = p_form_phone_number {
264        multipart_form_params.insert("phone_number", param_value.to_string());
265    }
266    if let Some(param_value) = p_form_email_address_or_phone_number {
267        multipart_form_params.insert("email_address_or_phone_number", param_value.to_string());
268    }
269    if let Some(param_value) = p_form_unsafe_metadata {
270        multipart_form_params.insert("unsafe_metadata", param_value.to_string());
271    }
272    if let Some(param_value) = p_form_strategy {
273        multipart_form_params.insert("strategy", param_value.to_string());
274    }
275    if let Some(param_value) = p_form_action_complete_redirect_url {
276        multipart_form_params.insert("action_complete_redirect_url", param_value.to_string());
277    }
278    if let Some(param_value) = p_form_redirect_url {
279        multipart_form_params.insert("redirect_url", param_value.to_string());
280    }
281    if let Some(param_value) = p_form_ticket {
282        multipart_form_params.insert("ticket", param_value.to_string());
283    }
284    if let Some(param_value) = p_form_web3_wallet {
285        multipart_form_params.insert("web3_wallet", param_value.to_string());
286    }
287    if let Some(param_value) = p_form_token {
288        multipart_form_params.insert("token", param_value.to_string());
289    }
290    if let Some(param_value) = p_form_code {
291        multipart_form_params.insert("code", param_value.to_string());
292    }
293    if let Some(param_value) = p_form_captcha_token {
294        multipart_form_params.insert("captcha_token", param_value.to_string());
295    }
296    if let Some(param_value) = p_form_captcha_error {
297        multipart_form_params.insert("captcha_error", param_value.to_string());
298    }
299    if let Some(param_value) = p_form_captcha_widget_type {
300        multipart_form_params.insert("captcha_widget_type", param_value.to_string());
301    }
302    if let Some(param_value) = p_form_legal_accepted {
303        multipart_form_params.insert("legal_accepted", param_value.to_string());
304    }
305    if let Some(param_value) = p_form_oidc_login_hint {
306        multipart_form_params.insert("oidc_login_hint", param_value.to_string());
307    }
308    if let Some(param_value) = p_form_oidc_prompt {
309        multipart_form_params.insert("oidc_prompt", param_value.to_string());
310    }
311    req_builder = req_builder.form(&multipart_form_params);
312
313    let req = req_builder.build()?;
314    let resp = configuration.client.execute(req).await?;
315
316    let status = resp.status();
317    let content_type = resp
318        .headers()
319        .get("content-type")
320        .and_then(|v| v.to_str().ok())
321        .unwrap_or("application/octet-stream");
322    let content_type = super::ContentType::from(content_type);
323
324    if !status.is_client_error() && !status.is_server_error() {
325        let content = resp.text().await?;
326        match content_type {
327            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
328            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClientClientWrappedSignUp`"))),
329            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClientClientWrappedSignUp`")))),
330        }
331    } else {
332        let content = resp.text().await?;
333        let entity: Option<CreateSignUpsError> = serde_json::from_str(&content).ok();
334        Err(Error::ResponseError(ResponseContent {
335            status,
336            content,
337            entity,
338        }))
339    }
340}
341
342/// Returns the sign-up by ID. Must be associated with the current Client object.
343pub async fn get_sign_ups(
344    configuration: &configuration::Configuration,
345    sign_up_id: &str,
346) -> Result<models::ClientClientWrappedSignUp, Error<GetSignUpsError>> {
347    // add a prefix to parameters to efficiently prevent name collisions
348    let p_path_sign_up_id = sign_up_id;
349
350    let uri_str = format!(
351        "{}/v1/client/sign_ups/{sign_up_id}",
352        configuration.base_path,
353        sign_up_id = crate::apis::urlencode(p_path_sign_up_id)
354    );
355    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
356
357    if let Some(ref apikey) = configuration.api_key {
358        let key = apikey.key.clone();
359        let value = match apikey.prefix {
360            Some(ref prefix) => format!("{prefix} {key}"),
361            None => key,
362        };
363        req_builder = req_builder.query(&[("__dev_session", value)]);
364    }
365    if let Some(ref user_agent) = configuration.user_agent {
366        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
367    }
368    if let Some(ref apikey) = configuration.api_key {
369        let key = apikey.key.clone();
370        let value = match apikey.prefix {
371            Some(ref prefix) => format!("{prefix} {key}"),
372            None => key,
373        };
374        req_builder = req_builder.header("__session", value);
375    };
376
377    let req = req_builder.build()?;
378    let resp = configuration.client.execute(req).await?;
379
380    let status = resp.status();
381    let content_type = resp
382        .headers()
383        .get("content-type")
384        .and_then(|v| v.to_str().ok())
385        .unwrap_or("application/octet-stream");
386    let content_type = super::ContentType::from(content_type);
387
388    if !status.is_client_error() && !status.is_server_error() {
389        let content = resp.text().await?;
390        match content_type {
391            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
392            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClientClientWrappedSignUp`"))),
393            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClientClientWrappedSignUp`")))),
394        }
395    } else {
396        let content = resp.text().await?;
397        let entity: Option<GetSignUpsError> = serde_json::from_str(&content).ok();
398        Err(Error::ResponseError(ResponseContent {
399            status,
400            content,
401            entity,
402        }))
403    }
404}
405
406/// Prepares verification for the sign-up specified by `{id}`.  Depending on the given strategy, the API will prepare the verification for the current sign-up. In particular, * for `email_code`, the API will send a verification email to the email address currently load up in the sign-up * for `phone_code`, the API will send a verification SMS to the phone number currently load up in the sign-up
407pub async fn prepare_sign_ups_verification(
408    configuration: &configuration::Configuration,
409    sign_up_id: &str,
410    origin: Option<&str>,
411    strategy: Option<&str>,
412    redirect_url: Option<&str>,
413    action_complete_redirect_url: Option<&str>,
414    oidc_login_hint: Option<&str>,
415    oidc_prompt: Option<&str>,
416) -> Result<models::ClientClientWrappedSignUp, Error<PrepareSignUpsVerificationError>> {
417    // add a prefix to parameters to efficiently prevent name collisions
418    let p_path_sign_up_id = sign_up_id;
419    let p_header_origin = origin;
420    let p_form_strategy = strategy;
421    let p_form_redirect_url = redirect_url;
422    let p_form_action_complete_redirect_url = action_complete_redirect_url;
423    let p_form_oidc_login_hint = oidc_login_hint;
424    let p_form_oidc_prompt = oidc_prompt;
425
426    let uri_str = format!(
427        "{}/v1/client/sign_ups/{sign_up_id}/prepare_verification",
428        configuration.base_path,
429        sign_up_id = crate::apis::urlencode(p_path_sign_up_id)
430    );
431    let mut req_builder = configuration
432        .client
433        .request(reqwest::Method::POST, &uri_str);
434
435    if let Some(ref apikey) = configuration.api_key {
436        let key = apikey.key.clone();
437        let value = match apikey.prefix {
438            Some(ref prefix) => format!("{prefix} {key}"),
439            None => key,
440        };
441        req_builder = req_builder.query(&[("__dev_session", value)]);
442    }
443    if let Some(ref user_agent) = configuration.user_agent {
444        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
445    }
446    if let Some(param_value) = p_header_origin {
447        req_builder = req_builder.header("Origin", param_value.to_string());
448    }
449    if let Some(ref apikey) = configuration.api_key {
450        let key = apikey.key.clone();
451        let value = match apikey.prefix {
452            Some(ref prefix) => format!("{prefix} {key}"),
453            None => key,
454        };
455        req_builder = req_builder.header("__session", value);
456    };
457    let mut multipart_form_params = std::collections::HashMap::new();
458    if let Some(param_value) = p_form_strategy {
459        multipart_form_params.insert("strategy", param_value.to_string());
460    }
461    if let Some(param_value) = p_form_redirect_url {
462        multipart_form_params.insert("redirect_url", param_value.to_string());
463    }
464    if let Some(param_value) = p_form_action_complete_redirect_url {
465        multipart_form_params.insert("action_complete_redirect_url", param_value.to_string());
466    }
467    if let Some(param_value) = p_form_oidc_login_hint {
468        multipart_form_params.insert("oidc_login_hint", param_value.to_string());
469    }
470    if let Some(param_value) = p_form_oidc_prompt {
471        multipart_form_params.insert("oidc_prompt", param_value.to_string());
472    }
473    req_builder = req_builder.form(&multipart_form_params);
474
475    let req = req_builder.build()?;
476    let resp = configuration.client.execute(req).await?;
477
478    let status = resp.status();
479    let content_type = resp
480        .headers()
481        .get("content-type")
482        .and_then(|v| v.to_str().ok())
483        .unwrap_or("application/octet-stream");
484    let content_type = super::ContentType::from(content_type);
485
486    if !status.is_client_error() && !status.is_server_error() {
487        let content = resp.text().await?;
488        match content_type {
489            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
490            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClientClientWrappedSignUp`"))),
491            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClientClientWrappedSignUp`")))),
492        }
493    } else {
494        let content = resp.text().await?;
495        let entity: Option<PrepareSignUpsVerificationError> = serde_json::from_str(&content).ok();
496        Err(Error::ResponseError(ResponseContent {
497            status,
498            content,
499            entity,
500        }))
501    }
502}
503
504/// Updates the sign-up object specified by id, with the supplied parameters.
505pub async fn update_sign_ups(
506    configuration: &configuration::Configuration,
507    sign_up_id: &str,
508    origin: Option<&str>,
509    password: Option<&str>,
510    first_name: Option<&str>,
511    last_name: Option<&str>,
512    username: Option<&str>,
513    email_address: Option<&str>,
514    phone_number: Option<&str>,
515    email_address_or_phone_number: Option<&str>,
516    unsafe_metadata: Option<&str>,
517    strategy: Option<&str>,
518    redirect_url: Option<&str>,
519    action_complete_redirect_url: Option<&str>,
520    ticket: Option<&str>,
521    web3_wallet: Option<&str>,
522    token: Option<&str>,
523    code: Option<&str>,
524    legal_accepted: Option<bool>,
525    oidc_login_hint: Option<&str>,
526    oidc_prompt: Option<&str>,
527) -> Result<models::ClientClientWrappedSignUp, Error<UpdateSignUpsError>> {
528    // add a prefix to parameters to efficiently prevent name collisions
529    let p_path_sign_up_id = sign_up_id;
530    let p_header_origin = origin;
531    let p_form_password = password;
532    let p_form_first_name = first_name;
533    let p_form_last_name = last_name;
534    let p_form_username = username;
535    let p_form_email_address = email_address;
536    let p_form_phone_number = phone_number;
537    let p_form_email_address_or_phone_number = email_address_or_phone_number;
538    let p_form_unsafe_metadata = unsafe_metadata;
539    let p_form_strategy = strategy;
540    let p_form_redirect_url = redirect_url;
541    let p_form_action_complete_redirect_url = action_complete_redirect_url;
542    let p_form_ticket = ticket;
543    let p_form_web3_wallet = web3_wallet;
544    let p_form_token = token;
545    let p_form_code = code;
546    let p_form_legal_accepted = legal_accepted;
547    let p_form_oidc_login_hint = oidc_login_hint;
548    let p_form_oidc_prompt = oidc_prompt;
549
550    let uri_str = format!(
551        "{}/v1/client/sign_ups/{sign_up_id}",
552        configuration.base_path,
553        sign_up_id = crate::apis::urlencode(p_path_sign_up_id)
554    );
555    let mut req_builder = configuration
556        .client
557        .request(reqwest::Method::PATCH, &uri_str);
558
559    if let Some(ref apikey) = configuration.api_key {
560        let key = apikey.key.clone();
561        let value = match apikey.prefix {
562            Some(ref prefix) => format!("{prefix} {key}"),
563            None => key,
564        };
565        req_builder = req_builder.query(&[("__dev_session", value)]);
566    }
567    if let Some(ref user_agent) = configuration.user_agent {
568        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
569    }
570    if let Some(param_value) = p_header_origin {
571        req_builder = req_builder.header("Origin", param_value.to_string());
572    }
573    if let Some(ref apikey) = configuration.api_key {
574        let key = apikey.key.clone();
575        let value = match apikey.prefix {
576            Some(ref prefix) => format!("{prefix} {key}"),
577            None => key,
578        };
579        req_builder = req_builder.header("__session", value);
580    };
581    let mut multipart_form_params = std::collections::HashMap::new();
582    if let Some(param_value) = p_form_password {
583        multipart_form_params.insert("password", param_value.to_string());
584    }
585    if let Some(param_value) = p_form_first_name {
586        multipart_form_params.insert("first_name", param_value.to_string());
587    }
588    if let Some(param_value) = p_form_last_name {
589        multipart_form_params.insert("last_name", param_value.to_string());
590    }
591    if let Some(param_value) = p_form_username {
592        multipart_form_params.insert("username", param_value.to_string());
593    }
594    if let Some(param_value) = p_form_email_address {
595        multipart_form_params.insert("email_address", param_value.to_string());
596    }
597    if let Some(param_value) = p_form_phone_number {
598        multipart_form_params.insert("phone_number", param_value.to_string());
599    }
600    if let Some(param_value) = p_form_email_address_or_phone_number {
601        multipart_form_params.insert("email_address_or_phone_number", param_value.to_string());
602    }
603    if let Some(param_value) = p_form_unsafe_metadata {
604        multipart_form_params.insert("unsafe_metadata", param_value.to_string());
605    }
606    if let Some(param_value) = p_form_strategy {
607        multipart_form_params.insert("strategy", param_value.to_string());
608    }
609    if let Some(param_value) = p_form_redirect_url {
610        multipart_form_params.insert("redirect_url", param_value.to_string());
611    }
612    if let Some(param_value) = p_form_action_complete_redirect_url {
613        multipart_form_params.insert("action_complete_redirect_url", param_value.to_string());
614    }
615    if let Some(param_value) = p_form_ticket {
616        multipart_form_params.insert("ticket", param_value.to_string());
617    }
618    if let Some(param_value) = p_form_web3_wallet {
619        multipart_form_params.insert("web3_wallet", param_value.to_string());
620    }
621    if let Some(param_value) = p_form_token {
622        multipart_form_params.insert("token", param_value.to_string());
623    }
624    if let Some(param_value) = p_form_code {
625        multipart_form_params.insert("code", param_value.to_string());
626    }
627    if let Some(param_value) = p_form_legal_accepted {
628        multipart_form_params.insert("legal_accepted", param_value.to_string());
629    }
630    if let Some(param_value) = p_form_oidc_login_hint {
631        multipart_form_params.insert("oidc_login_hint", param_value.to_string());
632    }
633    if let Some(param_value) = p_form_oidc_prompt {
634        multipart_form_params.insert("oidc_prompt", param_value.to_string());
635    }
636    req_builder = req_builder.form(&multipart_form_params);
637
638    let req = req_builder.build()?;
639    let resp = configuration.client.execute(req).await?;
640
641    let status = resp.status();
642    let content_type = resp
643        .headers()
644        .get("content-type")
645        .and_then(|v| v.to_str().ok())
646        .unwrap_or("application/octet-stream");
647    let content_type = super::ContentType::from(content_type);
648
649    if !status.is_client_error() && !status.is_server_error() {
650        let content = resp.text().await?;
651        match content_type {
652            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
653            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClientClientWrappedSignUp`"))),
654            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClientClientWrappedSignUp`")))),
655        }
656    } else {
657        let content = resp.text().await?;
658        let entity: Option<UpdateSignUpsError> = serde_json::from_str(&content).ok();
659        Err(Error::ResponseError(ResponseContent {
660            status,
661            content,
662            entity,
663        }))
664    }
665}