jira_api_v2/models/user.rs
1/*
2 * The Jira Cloud platform REST API
3 *
4 * Jira Cloud platform REST API documentation
5 *
6 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
7 * Contact: ecosystem@atlassian.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// User : A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, `displayName` provides an indication and other parameters have default values or are blank (for example, email is blank). * User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted users. In this case, `accountId` returns *unknown* and all other parameters have fallback values. * User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have fallback values.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct User {
17 /// The URL of the user.
18 #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
19 pub param_self: Option<String>,
20 /// This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
21 #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
22 pub key: Option<String>,
23 /// The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required in requests.
24 #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
25 pub account_id: Option<String>,
26 /// The user account type. Can take the following values: * `atlassian` regular Atlassian user account * `app` system account used for Connect applications and OAuth to represent external systems * `customer` Jira Service Desk account representing an external service desk
27 #[serde(rename = "accountType", skip_serializing_if = "Option::is_none")]
28 pub account_type: Option<AccountType>,
29 /// This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
30 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
31 pub name: Option<String>,
32 /// The email address of the user. Depending on the user’s privacy setting, this may be returned as null.
33 #[serde(rename = "emailAddress", skip_serializing_if = "Option::is_none")]
34 pub email_address: Option<String>,
35 /// The avatars of the user.
36 #[serde(rename = "avatarUrls", skip_serializing_if = "Option::is_none")]
37 pub avatar_urls: Option<Box<models::AvatarUrlsBean>>,
38 /// The display name of the user. Depending on the user’s privacy setting, this may return an alternative value.
39 #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
40 pub display_name: Option<String>,
41 /// Whether the user is active.
42 #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
43 pub active: Option<bool>,
44 /// The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as null.
45 #[serde(rename = "timeZone", skip_serializing_if = "Option::is_none")]
46 pub time_zone: Option<String>,
47 /// The locale of the user. Depending on the user’s privacy setting, this may be returned as null.
48 #[serde(rename = "locale", skip_serializing_if = "Option::is_none")]
49 pub locale: Option<String>,
50 /// The groups that the user belongs to.
51 #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
52 pub groups: Option<Box<models::SimpleListWrapperGroupName>>,
53 /// The application roles the user is assigned to.
54 #[serde(rename = "applicationRoles", skip_serializing_if = "Option::is_none")]
55 pub application_roles: Option<Box<models::SimpleListWrapperApplicationRole>>,
56 /// Expand options that include additional user details in the response.
57 #[serde(rename = "expand", skip_serializing_if = "Option::is_none")]
58 pub expand: Option<String>,
59}
60
61impl User {
62 /// A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, `displayName` provides an indication and other parameters have default values or are blank (for example, email is blank). * User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted users. In this case, `accountId` returns *unknown* and all other parameters have fallback values. * User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have fallback values.
63 pub fn new() -> User {
64 User {
65 param_self: None,
66 key: None,
67 account_id: None,
68 account_type: None,
69 name: None,
70 email_address: None,
71 avatar_urls: None,
72 display_name: None,
73 active: None,
74 time_zone: None,
75 locale: None,
76 groups: None,
77 application_roles: None,
78 expand: None,
79 }
80 }
81}
82/// The user account type. Can take the following values: * `atlassian` regular Atlassian user account * `app` system account used for Connect applications and OAuth to represent external systems * `customer` Jira Service Desk account representing an external service desk
83#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
84pub enum AccountType {
85 #[serde(rename = "atlassian")]
86 Atlassian,
87 #[serde(rename = "app")]
88 App,
89 #[serde(rename = "customer")]
90 Customer,
91 #[serde(rename = "unknown")]
92 Unknown,
93}
94
95impl Default for AccountType {
96 fn default() -> AccountType {
97 Self::Atlassian
98 }
99}
100