clerk_fapi_rs/models/
client_public_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 ClientPublicUserData {
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(
21        rename = "image_url",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub image_url: Option<Option<String>>,
27    #[serde(rename = "has_image")]
28    pub has_image: bool,
29    #[serde(rename = "identifier")]
30    pub identifier: String,
31    /// Use `image_url` instead.
32    #[serde(
33        rename = "profile_image_url",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub profile_image_url: Option<Option<String>>,
39    #[serde(
40        rename = "user_id",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub user_id: Option<Option<String>>,
46}
47
48impl ClientPublicUserData {
49    pub fn new(
50        first_name: Option<String>,
51        last_name: Option<String>,
52        has_image: bool,
53        identifier: String,
54    ) -> ClientPublicUserData {
55        ClientPublicUserData {
56            first_name,
57            last_name,
58            image_url: None,
59            has_image,
60            identifier,
61            profile_image_url: None,
62            user_id: None,
63        }
64    }
65}