github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/rust/src/models/user.rs (about)

     1  /*
     2   * lakeFS API
     3   *
     4   * lakeFS HTTP API
     5   *
     6   * The version of the OpenAPI document: 1.0.0
     7   * Contact: services@treeverse.io
     8   * Generated by: https://openapi-generator.tech
     9   */
    10  
    11  use crate::models;
    12  
    13  #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
    14  pub struct User {
    15      /// A unique identifier for the user. Cannot be edited.
    16      #[serde(rename = "id")]
    17      pub id: String,
    18      /// Unix Epoch in seconds
    19      #[serde(rename = "creation_date")]
    20      pub creation_date: i64,
    21      /// A shorter name for the user than the id. Unlike id it does not identify the user (it might not be unique). Used in some places in the UI. 
    22      #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")]
    23      pub friendly_name: Option<String>,
    24      /// The email address of the user. If API authentication is enabled, this field is mandatory and will be invited to login. If API authentication is disabled, this field will be ignored. All current APIAuthenticators require the email to be  lowercase and unique, although custom authenticators may not enforce this. 
    25      #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    26      pub email: Option<String>,
    27  }
    28  
    29  impl User {
    30      pub fn new(id: String, creation_date: i64) -> User {
    31          User {
    32              id,
    33              creation_date,
    34              friendly_name: None,
    35              email: None,
    36          }
    37      }
    38  }
    39