#[non_exhaustive]pub struct Membership {
pub name: String,
pub state: MembershipState,
pub role: MembershipRole,
pub create_time: Option<Timestamp>,
pub delete_time: Option<Timestamp>,
pub affiliation: Affiliation,
pub member_type: Option<MemberType>,
/* private fields */
}Expand description
Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. Resource name of the membership, assigned by the server.
Format: spaces/{space}/members/{member}
state: MembershipStateOutput only. State of the membership.
role: MembershipRoleOptional. User’s role within a Chat space, which determines their permitted actions in the space.
This field can only be used as input in UpdateMembership.
create_time: Option<Timestamp>Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
delete_time: Option<Timestamp>Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
affiliation: AffiliationOutput only. A user’s relationship to the Workspace organization that owns
the space. In spaces owned by consumer accounts, the affiliation of all
members is EXTERNAL.
member_type: Option<MemberType>Member associated with this membership. Other member types might be supported in the future.
Implementations§
Source§impl Membership
impl Membership
Sourcepub fn set_state<T: Into<MembershipState>>(self, v: T) -> Self
pub fn set_state<T: Into<MembershipState>>(self, v: T) -> Self
Sourcepub fn set_role<T: Into<MembershipRole>>(self, v: T) -> Self
pub fn set_role<T: Into<MembershipRole>>(self, v: T) -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = Membership::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = Membership::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Membership::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_delete_time<T>(self, v: T) -> Self
pub fn set_delete_time<T>(self, v: T) -> Self
Sets the value of delete_time.
§Example
use wkt::Timestamp;
let x = Membership::new().set_delete_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_delete_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_delete_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of delete_time.
§Example
use wkt::Timestamp;
let x = Membership::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
let x = Membership::new().set_or_clear_delete_time(None::<Timestamp>);Sourcepub fn set_affiliation<T: Into<Affiliation>>(self, v: T) -> Self
pub fn set_affiliation<T: Into<Affiliation>>(self, v: T) -> Self
Sets the value of affiliation.
§Example
use google_chat_v1::model::membership::Affiliation;
let x0 = Membership::new().set_affiliation(Affiliation::Internal);
let x1 = Membership::new().set_affiliation(Affiliation::External);
let x2 = Membership::new().set_affiliation(Affiliation::ManagedExternal);Sourcepub fn set_member_type<T: Into<Option<MemberType>>>(self, v: T) -> Self
pub fn set_member_type<T: Into<Option<MemberType>>>(self, v: T) -> Self
Sets the value of member_type.
Note that all the setters affecting member_type are mutually
exclusive.
§Example
use google_chat_v1::model::User;
let x = Membership::new().set_member_type(Some(
google_chat_v1::model::membership::MemberType::Member(User::default().into())));Sourcepub fn member(&self) -> Option<&Box<User>>
pub fn member(&self) -> Option<&Box<User>>
The value of member_type
if it holds a Member, None if the field is not set or
holds a different branch.
Sourcepub fn set_member<T: Into<Box<User>>>(self, v: T) -> Self
pub fn set_member<T: Into<Box<User>>>(self, v: T) -> Self
Sets the value of member_type
to hold a Member.
Note that all the setters affecting member_type are
mutually exclusive.
§Example
use google_chat_v1::model::User;
let x = Membership::new().set_member(User::default()/* use setters */);
assert!(x.member().is_some());
assert!(x.group_member().is_none());Sourcepub fn group_member(&self) -> Option<&Box<Group>>
pub fn group_member(&self) -> Option<&Box<Group>>
The value of member_type
if it holds a GroupMember, None if the field is not set or
holds a different branch.
Sourcepub fn set_group_member<T: Into<Box<Group>>>(self, v: T) -> Self
pub fn set_group_member<T: Into<Box<Group>>>(self, v: T) -> Self
Sets the value of member_type
to hold a GroupMember.
Note that all the setters affecting member_type are
mutually exclusive.
§Example
use google_chat_v1::model::Group;
let x = Membership::new().set_group_member(Group::default()/* use setters */);
assert!(x.group_member().is_some());
assert!(x.member().is_none());Trait Implementations§
Source§impl Clone for Membership
impl Clone for Membership
Source§fn clone(&self) -> Membership
fn clone(&self) -> Membership
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more