pub struct User { /* private fields */ }Expand description
Represents basic data on a given Zulip user.
Changes: Removed is_billing_admin field in Zulip 10.0 (feature level 363), as it was replaced by the can_manage_billing_group realm setting.
Modified from openapi-generator-cli output:
$ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec/*
* Zulip REST API
*
* Powerful open source group chat
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/See zerver/openapi/zulip.yaml for the original OpenAPI configuration.
Configuration slightly modified to work with the Rust generator of openapi-generator-cli.
Implementations§
Source§impl User
impl User
Sourcepub fn set_user_id(&mut self, val: u64)
pub fn set_user_id(&mut self, val: u64)
Sets the User user_id.
The unique ID of the user.
Sourcepub fn unset_user_id(&mut self) -> Option<u64>
pub fn unset_user_id(&mut self) -> Option<u64>
Unsets the User user_id.
The unique ID of the user.
Sourcepub fn with_user_id(self, val: u64) -> Self
pub fn with_user_id(self, val: u64) -> Self
Builder function that sets the User user_id.
The unique ID of the user.
Sourcepub const fn is_active(&self) -> Option<bool>
pub const fn is_active(&self) -> Option<bool>
Gets the User is_active.
A boolean specifying whether the user account has been deactivated.
Sourcepub fn set_is_active(&mut self, val: bool)
pub fn set_is_active(&mut self, val: bool)
Sets the User is_active.
A boolean specifying whether the user account has been deactivated.
Sourcepub fn unset_is_active(&mut self) -> Option<bool>
pub fn unset_is_active(&mut self) -> Option<bool>
Unsets the User is_active.
A boolean specifying whether the user account has been deactivated.
Sourcepub fn with_is_active(self, val: bool) -> Self
pub fn with_is_active(self, val: bool) -> Self
Builder function that sets the User is_active.
A boolean specifying whether the user account has been deactivated.
Sourcepub const fn is_owner(&self) -> Option<bool>
pub const fn is_owner(&self) -> Option<bool>
Gets the User is_owner.
A boolean specifying whether the user is an organization owner. If true, is_admin will also be true. Changes: New in Zulip 3.0 (feature level 8).
Sourcepub fn set_is_owner(&mut self, val: bool)
pub fn set_is_owner(&mut self, val: bool)
Sets the User is_owner.
A boolean specifying whether the user is an organization owner. If true, is_admin will also be true. Changes: New in Zulip 3.0 (feature level 8).
Sourcepub fn unset_is_owner(&mut self) -> Option<bool>
pub fn unset_is_owner(&mut self) -> Option<bool>
Unsets the User is_owner.
A boolean specifying whether the user is an organization owner. If true, is_admin will also be true. Changes: New in Zulip 3.0 (feature level 8).
Sourcepub fn with_is_owner(self, val: bool) -> Self
pub fn with_is_owner(self, val: bool) -> Self
Builder function that sets the User is_owner.
A boolean specifying whether the user is an organization owner. If true, is_admin will also be true. Changes: New in Zulip 3.0 (feature level 8).
Sourcepub const fn is_admin(&self) -> Option<bool>
pub const fn is_admin(&self) -> Option<bool>
Gets the User is_admin.
A boolean specifying whether the user is an organization administrator.
Sourcepub fn set_is_admin(&mut self, val: bool)
pub fn set_is_admin(&mut self, val: bool)
Sets the User is_admin.
A boolean specifying whether the user is an organization administrator.
Sourcepub fn unset_is_admin(&mut self) -> Option<bool>
pub fn unset_is_admin(&mut self) -> Option<bool>
Unsets the User is_admin.
A boolean specifying whether the user is an organization administrator.
Sourcepub fn with_is_admin(self, val: bool) -> Self
pub fn with_is_admin(self, val: bool) -> Self
Builder function that sets the User is_admin.
A boolean specifying whether the user is an organization administrator.
Sourcepub const fn is_guest(&self) -> Option<bool>
pub const fn is_guest(&self) -> Option<bool>
Gets the User is_guest.
A boolean specifying whether the user is a guest user.
Sourcepub fn set_is_guest(&mut self, val: bool)
pub fn set_is_guest(&mut self, val: bool)
Sets the User is_guest.
A boolean specifying whether the user is a guest user.
Sourcepub fn unset_is_guest(&mut self) -> Option<bool>
pub fn unset_is_guest(&mut self) -> Option<bool>
Unsets the User is_guest.
A boolean specifying whether the user is a guest user.
Sourcepub fn with_is_guest(self, val: bool) -> Self
pub fn with_is_guest(self, val: bool) -> Self
Builder function that sets the User is_guest.
A boolean specifying whether the user is a guest user.
Sourcepub const fn is_bot(&self) -> Option<bool>
pub const fn is_bot(&self) -> Option<bool>
Gets the User is_bot.
A boolean specifying whether the user is a bot or full account.
Sourcepub fn set_is_bot(&mut self, val: bool)
pub fn set_is_bot(&mut self, val: bool)
Sets the User is_bot.
A boolean specifying whether the user is a bot or full account.
Sourcepub fn unset_is_bot(&mut self) -> Option<bool>
pub fn unset_is_bot(&mut self) -> Option<bool>
Unsets the User is_bot.
A boolean specifying whether the user is a bot or full account.
Sourcepub fn with_is_bot(self, val: bool) -> Self
pub fn with_is_bot(self, val: bool) -> Self
Builder function that sets the User is_bot.
A boolean specifying whether the user is a bot or full account.
Sourcepub const fn bot_type(&self) -> Option<BotType>
pub const fn bot_type(&self) -> Option<BotType>
Gets the User bot_type.
An integer describing the type of bot.
Sourcepub fn set_bot_type(&mut self, val: BotType)
pub fn set_bot_type(&mut self, val: BotType)
Sets the User bot_type.
An integer describing the type of bot.
Sourcepub fn unset_bot_type(&mut self) -> Option<BotType>
pub fn unset_bot_type(&mut self) -> Option<BotType>
Unsets the User bot_type.
An integer describing the type of bot.
Sourcepub fn with_bot_type(self, val: BotType) -> Self
pub fn with_bot_type(self, val: BotType) -> Self
Builder function that sets the User bot_type.
An integer describing the type of bot.
Sourcepub const fn bot_owner_id(&self) -> Option<u64>
pub const fn bot_owner_id(&self) -> Option<u64>
Gets the User bot_owner_id.
If the user is a bot (i.e. is_bot is true), then bot_owner_id is the user ID of the bot’s owner (usually, whoever created the bot).
Will be null for legacy bots that do not have an owner.
Changes: New in Zulip 3.0 (feature level 1). In previous versions, there was a bot_owner field containing the email address of the bot’s owner.
Sourcepub fn set_bot_owner_id(&mut self, val: u64)
pub fn set_bot_owner_id(&mut self, val: u64)
Sets the User bot_owner_id.
If the user is a bot (i.e. is_bot is true), then bot_owner_id is the user ID of the bot’s owner (usually, whoever created the bot).
Will be null for legacy bots that do not have an owner.
Changes: New in Zulip 3.0 (feature level 1). In previous versions, there was a bot_owner field containing the email address of the bot’s owner.
Sourcepub fn unset_bot_owner_id(&mut self) -> Option<u64>
pub fn unset_bot_owner_id(&mut self) -> Option<u64>
Unsets the User bot_owner_id.
If the user is a bot (i.e. is_bot is true), then bot_owner_id is the user ID of the bot’s owner (usually, whoever created the bot).
Will be null for legacy bots that do not have an owner.
Changes: New in Zulip 3.0 (feature level 1). In previous versions, there was a bot_owner field containing the email address of the bot’s owner.
Sourcepub fn with_bot_owner_id(self, val: u64) -> Self
pub fn with_bot_owner_id(self, val: u64) -> Self
Builder function that sets the User bot_owner_id.
If the user is a bot (i.e. is_bot is true), then bot_owner_id is the user ID of the bot’s owner (usually, whoever created the bot).
Will be null for legacy bots that do not have an owner.
Changes: New in Zulip 3.0 (feature level 1). In previous versions, there was a bot_owner field containing the email address of the bot’s owner.
Sourcepub const fn role(&self) -> Option<Role>
pub const fn role(&self) -> Option<Role>
Gets the User role.
Organization-level role of the user.
Sourcepub fn set_role(&mut self, val: Role)
pub fn set_role(&mut self, val: Role)
Sets the User role.
Organization-level role of the user.
Sourcepub fn unset_role(&mut self) -> Option<Role>
pub fn unset_role(&mut self) -> Option<Role>
Unsets the User role.
Organization-level role of the user.
Sourcepub fn with_role(self, val: Role) -> Self
pub fn with_role(self, val: Role) -> Self
Builder function that sets the User role.
Organization-level role of the user.
Sourcepub const fn avatar_version(&self) -> Option<u64>
pub const fn avatar_version(&self) -> Option<u64>
Gets the User avatar_version.
Version for the user’s avatar. Used for cache-busting requests for the user’s avatar. Clients generally shouldn’t need to use this; most avatar URLs sent by Zulip will already end with ?v={avatar_version}.
Sourcepub fn set_avatar_version(&mut self, val: u64)
pub fn set_avatar_version(&mut self, val: u64)
Sets the User avatar_version.
Version for the user’s avatar. Used for cache-busting requests for the user’s avatar. Clients generally shouldn’t need to use this; most avatar URLs sent by Zulip will already end with ?v={avatar_version}.
Sourcepub fn unset_avatar_version(&mut self) -> Option<u64>
pub fn unset_avatar_version(&mut self) -> Option<u64>
Unsets the User avatar_version.
Version for the user’s avatar. Used for cache-busting requests for the user’s avatar. Clients generally shouldn’t need to use this; most avatar URLs sent by Zulip will already end with ?v={avatar_version}.
Sourcepub fn with_avatar_version(self, val: u64) -> Self
pub fn with_avatar_version(self, val: u64) -> Self
Builder function that sets the User avatar_version.
Version for the user’s avatar. Used for cache-busting requests for the user’s avatar. Clients generally shouldn’t need to use this; most avatar URLs sent by Zulip will already end with ?v={avatar_version}.
Source§impl User
impl User
Sourcepub fn delivery_email(&self) -> Option<&str>
pub fn delivery_email(&self) -> Option<&str>
Gets the User delivery_email.
The user’s real email address.
This value will be null if you cannot access user’s real email address.
For bot users, this field is always set to the real email of the bot, because bot users always have email_address_visibility set to everyone.
Changes: Prior to Zulip 7.0 (feature level 163), this field was present only when email_address_visibility was restricted and you had access to the user’s real email.
As of this feature level, this field is always present, including the case when email_address_visibility is set to everyone (and therefore not restricted).
Sourcepub fn set_delivery_email<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_delivery_email<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the User delivery_email.
The user’s real email address.
This value will be null if you cannot access user’s real email address.
For bot users, this field is always set to the real email of the bot, because bot users always have email_address_visibility set to everyone.
Changes: Prior to Zulip 7.0 (feature level 163), this field was present only when email_address_visibility was restricted and you had access to the user’s real email.
As of this feature level, this field is always present, including the case when email_address_visibility is set to everyone (and therefore not restricted).
Sourcepub fn unset_delivery_email(&mut self) -> Option<String>
pub fn unset_delivery_email(&mut self) -> Option<String>
Unsets the User delivery_email.
The user’s real email address.
This value will be null if you cannot access user’s real email address.
For bot users, this field is always set to the real email of the bot, because bot users always have email_address_visibility set to everyone.
Changes: Prior to Zulip 7.0 (feature level 163), this field was present only when email_address_visibility was restricted and you had access to the user’s real email.
As of this feature level, this field is always present, including the case when email_address_visibility is set to everyone (and therefore not restricted).
Sourcepub fn with_delivery_email<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_delivery_email<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the User delivery_email.
The user’s real email address.
This value will be null if you cannot access user’s real email address.
For bot users, this field is always set to the real email of the bot, because bot users always have email_address_visibility set to everyone.
Changes: Prior to Zulip 7.0 (feature level 163), this field was present only when email_address_visibility was restricted and you had access to the user’s real email.
As of this feature level, this field is always present, including the case when email_address_visibility is set to everyone (and therefore not restricted).
Sourcepub fn email(&self) -> Option<&str>
pub fn email(&self) -> Option<&str>
Gets the User email.
The Zulip API email address of the user or bot.
If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else.
Sourcepub fn set_email<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_email<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the User email.
The Zulip API email address of the user or bot.
If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else.
Sourcepub fn unset_email(&mut self) -> Option<String>
pub fn unset_email(&mut self) -> Option<String>
Unsets the User email.
The Zulip API email address of the user or bot.
If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else.
Sourcepub fn with_email<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_email<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the User email.
The Zulip API email address of the user or bot.
If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else.
Sourcepub fn full_name(&self) -> Option<&str>
pub fn full_name(&self) -> Option<&str>
Gets the User full_name.
Full name of the user or bot, used for all display purposes.
Sourcepub fn set_full_name<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_full_name<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the User full_name.
Full name of the user or bot, used for all display purposes.
Sourcepub fn unset_full_name(&mut self) -> Option<String>
pub fn unset_full_name(&mut self) -> Option<String>
Unsets the User full_name.
Full name of the user or bot, used for all display purposes.
Sourcepub fn with_full_name<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_full_name<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the User full_name.
Full name of the user or bot, used for all display purposes.
Sourcepub fn date_joined(&self) -> Option<&str>
pub fn date_joined(&self) -> Option<&str>
Gets the User date_joined.
The time the user account was created.
Sourcepub fn set_date_joined<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_date_joined<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the User date_joined.
The time the user account was created.
Sourcepub fn unset_date_joined(&mut self) -> Option<String>
pub fn unset_date_joined(&mut self) -> Option<String>
Unsets the User date_joined.
The time the user account was created.
Sourcepub fn with_date_joined<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_date_joined<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the User date_joined.
The time the user account was created.
Sourcepub fn timezone(&self) -> Option<&str>
pub fn timezone(&self) -> Option<&str>
Gets the User timezone.
The IANA identifier of the user’s profile time zone, which is used primarily to display the user’s local time to other users.
Sourcepub fn set_timezone<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_timezone<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the User timezone.
The IANA identifier of the user’s profile time zone, which is used primarily to display the user’s local time to other users.
Sourcepub fn unset_timezone(&mut self) -> Option<String>
pub fn unset_timezone(&mut self) -> Option<String>
Unsets the User timezone.
The IANA identifier of the user’s profile time zone, which is used primarily to display the user’s local time to other users.
Sourcepub fn with_timezone<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_timezone<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the User timezone.
The IANA identifier of the user’s profile time zone, which is used primarily to display the user’s local time to other users.
Sourcepub fn avatar_url(&self) -> Option<&str>
pub fn avatar_url(&self) -> Option<&str>
Gets the User avatar_url.
URL for the user’s avatar.
Will be null if the client_gravatar query parameter was set to true,
the current user has access to this user’s real email address,
and this user’s avatar is hosted by the Gravatar provider (i.e. this user has never uploaded an avatar).
Changes: Before Zulip 7.0 (feature level 163),
access to a user’s real email address was a realm-level setting.
As of this feature level, email_address_visibility is a user setting.
In Zulip 3.0 (feature level 18), if the client has the user_avatar_url_field_optional capability, this will be missing at the server’s sole discretion.
Sourcepub fn set_avatar_url<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_avatar_url<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the User avatar_url.
URL for the user’s avatar.
Will be null if the client_gravatar query parameter was set to true,
the current user has access to this user’s real email address,
and this user’s avatar is hosted by the Gravatar provider (i.e. this user has never uploaded an avatar).
Changes: Before Zulip 7.0 (feature level 163),
access to a user’s real email address was a realm-level setting.
As of this feature level, email_address_visibility is a user setting.
In Zulip 3.0 (feature level 18), if the client has the user_avatar_url_field_optional capability, this will be missing at the server’s sole discretion.
Sourcepub fn unset_avatar_url(&mut self) -> Option<String>
pub fn unset_avatar_url(&mut self) -> Option<String>
Unsets the User avatar_url.
URL for the user’s avatar.
Will be null if the client_gravatar query parameter was set to true,
the current user has access to this user’s real email address,
and this user’s avatar is hosted by the Gravatar provider (i.e. this user has never uploaded an avatar).
Changes: Before Zulip 7.0 (feature level 163),
access to a user’s real email address was a realm-level setting.
As of this feature level, email_address_visibility is a user setting.
In Zulip 3.0 (feature level 18), if the client has the user_avatar_url_field_optional capability, this will be missing at the server’s sole discretion.
Sourcepub fn with_avatar_url<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_avatar_url<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the User avatar_url.
URL for the user’s avatar.
Will be null if the client_gravatar query parameter was set to true,
the current user has access to this user’s real email address,
and this user’s avatar is hosted by the Gravatar provider (i.e. this user has never uploaded an avatar).
Changes: Before Zulip 7.0 (feature level 163),
access to a user’s real email address was a realm-level setting.
As of this feature level, email_address_visibility is a user setting.
In Zulip 3.0 (feature level 18), if the client has the user_avatar_url_field_optional capability, this will be missing at the server’s sole discretion.
Source§impl User
impl User
Sourcepub fn profile_data(&self) -> Option<&HashMap<String, ProfileData>>
pub fn profile_data(&self) -> Option<&HashMap<String, ProfileData>>
Gets the User profile_data.
Only present if is_bot is false; bots can’t have custom profile fields.
A dictionary containing custom profile field data for the user.
Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user’s data for that field.
Generally the data includes just a single value key; for those custom profile fields supporting Markdown, a rendered_value key will also be present.
Sourcepub fn set_profile_data(&mut self, val: HashMap<String, ProfileData>)
pub fn set_profile_data(&mut self, val: HashMap<String, ProfileData>)
Sets the User profile_data.
Only present if is_bot is false; bots can’t have custom profile fields.
A dictionary containing custom profile field data for the user.
Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user’s data for that field.
Generally the data includes just a single value key; for those custom profile fields supporting Markdown, a rendered_value key will also be present.
Sourcepub fn unset_profile_data(&mut self) -> Option<HashMap<String, ProfileData>>
pub fn unset_profile_data(&mut self) -> Option<HashMap<String, ProfileData>>
Unsets the User profile_data.
Only present if is_bot is false; bots can’t have custom profile fields.
A dictionary containing custom profile field data for the user.
Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user’s data for that field.
Generally the data includes just a single value key; for those custom profile fields supporting Markdown, a rendered_value key will also be present.
Sourcepub fn with_profile_data(self, val: HashMap<String, ProfileData>) -> Self
pub fn with_profile_data(self, val: HashMap<String, ProfileData>) -> Self
Builder function that sets the User profile_data.
Only present if is_bot is false; bots can’t have custom profile fields.
A dictionary containing custom profile field data for the user.
Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user’s data for that field.
Generally the data includes just a single value key; for those custom profile fields supporting Markdown, a rendered_value key will also be present.