Skip to main content

User

Struct User 

Source
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

Source

pub const fn new() -> Self

A dictionary containing 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.

Source§

impl User

Source

pub const fn user_id(&self) -> Option<u64>

Gets the User user_id.

The unique ID of the user.

Source

pub fn set_user_id(&mut self, val: u64)

Sets the User user_id.

The unique ID of the user.

Source

pub fn unset_user_id(&mut self) -> Option<u64>

Unsets the User user_id.

The unique ID of the user.

Source

pub fn with_user_id(self, val: u64) -> Self

Builder function that sets the User user_id.

The unique ID of the user.

Source

pub const fn is_active(&self) -> Option<bool>

Gets the User is_active.

A boolean specifying whether the user account has been deactivated.

Source

pub fn set_is_active(&mut self, val: bool)

Sets the User is_active.

A boolean specifying whether the user account has been deactivated.

Source

pub fn unset_is_active(&mut self) -> Option<bool>

Unsets the User is_active.

A boolean specifying whether the user account has been deactivated.

Source

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.

Source

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).

Source

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).

Source

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).

Source

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).

Source

pub const fn is_admin(&self) -> Option<bool>

Gets the User is_admin.

A boolean specifying whether the user is an organization administrator.

Source

pub fn set_is_admin(&mut self, val: bool)

Sets the User is_admin.

A boolean specifying whether the user is an organization administrator.

Source

pub fn unset_is_admin(&mut self) -> Option<bool>

Unsets the User is_admin.

A boolean specifying whether the user is an organization administrator.

Source

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.

Source

pub const fn is_guest(&self) -> Option<bool>

Gets the User is_guest.

A boolean specifying whether the user is a guest user.

Source

pub fn set_is_guest(&mut self, val: bool)

Sets the User is_guest.

A boolean specifying whether the user is a guest user.

Source

pub fn unset_is_guest(&mut self) -> Option<bool>

Unsets the User is_guest.

A boolean specifying whether the user is a guest user.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn bot_type(&self) -> Option<BotType>

Gets the User bot_type.

An integer describing the type of bot.

Source

pub fn set_bot_type(&mut self, val: BotType)

Sets the User bot_type.

An integer describing the type of bot.

Source

pub fn unset_bot_type(&mut self) -> Option<BotType>

Unsets the User bot_type.

An integer describing the type of bot.

Source

pub fn with_bot_type(self, val: BotType) -> Self

Builder function that sets the User bot_type.

An integer describing the type of bot.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn role(&self) -> Option<Role>

Gets the User role.

Organization-level role of the user.

Source

pub fn set_role(&mut self, val: Role)

Sets the User role.

Organization-level role of the user.

Source

pub fn unset_role(&mut self) -> Option<Role>

Unsets the User role.

Organization-level role of the user.

Source

pub fn with_role(self, val: Role) -> Self

Builder function that sets the User role.

Organization-level role of the user.

Source

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}.

Source

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}.

Source

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}.

Source

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

Source

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).

Source

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).

Source

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).

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn full_name(&self) -> Option<&str>

Gets the User full_name.

Full name of the user or bot, used for all display purposes.

Source

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.

Source

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.

Source

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.

Source

pub fn date_joined(&self) -> Option<&str>

Gets the User date_joined.

The time the user account was created.

Source

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.

Source

pub fn unset_date_joined(&mut self) -> Option<String>

Unsets the User date_joined.

The time the user account was created.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for User

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for User

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for User

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for User

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for User

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for User

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for User

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for User

Auto Trait Implementations§

§

impl Freeze for User

§

impl RefUnwindSafe for User

§

impl Send for User

§

impl Sync for User

§

impl Unpin for User

§

impl UnsafeUnpin for User

§

impl UnwindSafe for User

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more