clerk_fapi_rs/models/client_sign_in_user_data.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 crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClientSignInUserData {
16 #[serde(rename = "first_name", deserialize_with = "Option::deserialize")]
17 pub first_name: Option<String>,
18 #[serde(rename = "last_name", deserialize_with = "Option::deserialize")]
19 pub last_name: Option<String>,
20 #[serde(rename = "image_url", skip_serializing_if = "Option::is_none")]
21 pub image_url: Option<String>,
22 #[serde(rename = "has_image")]
23 pub has_image: bool,
24 /// Use `image_url` instead.
25 #[serde(
26 rename = "profile_image_url",
27 default,
28 with = "::serde_with::rust::double_option",
29 skip_serializing_if = "Option::is_none"
30 )]
31 pub profile_image_url: Option<Option<String>>,
32}
33
34impl ClientSignInUserData {
35 pub fn new(
36 first_name: Option<String>,
37 last_name: Option<String>,
38 has_image: bool,
39 ) -> ClientSignInUserData {
40 ClientSignInUserData {
41 first_name,
42 last_name,
43 image_url: None,
44 has_image,
45 profile_image_url: None,
46 }
47 }
48}