StructureUserManagementTrait

struct StructureUserManagementTrait

Trait for managing users and invitations in a structure.

  • The trait identifier.

    Declaration

    Swift

    static let identifier: String
  • List of all event types on the given Trait.

    Currently, only MatterTrait traits support any events, but this will likely expand to other traits in the future.

    Declaration

    Swift

    static let supportedEventTypes: [any Event.Type]
  • List of all commands supported by the Trait’s definition. The commands supported by a specific Trait instance may vary.

    Declaration

    Swift

    static var supportedCommandTypes: [any Command.Type] { get }
  • Metadata about this Trait.

    Declaration

    Swift

    let metadata: TraitMetadata
  • List of attributes for the StructureUserManagementTrait.

    Declaration

    Swift

    let attributes: Google.StructureUserManagementTrait.Attributes
  • Creates a new Trait instance using data read from the given TraitDecoder.

    Throws

    HomeError.parseError when parsing fails.

    Declaration

    Swift

    init(decoder: TraitDecoder, interactionProxy: (any InteractionProxy)?, metadata: TraitMetadata) throws

    Parameters

    decoder

    The raw data representing this Trait.

    interactionProxy

    Proxy to the Interaction Client.

    metadata

    Metadata about this Trait.

  • Writes this object to the given TraitEncoder. Throws HomeError.encodingFailed if the data could not be encoded.

    Declaration

    Swift

    func encode(with encoder: TraitEncoder) throws
  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    static func == (lhs: Google.StructureUserManagementTrait, rhs: Google.StructureUserManagementTrait) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • Hashes the essential components of this value by feeding them into the given hasher.

    Implement this method to conform to the Hashable protocol. The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components.

    Important

    In your implementation of hash(into:), don’t call finalize() on the hasher instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.

    Declaration

    Swift

    func hash(into hasher: inout Hasher)
  • The attributes for the StructureUserManagementTrait.

    Declaration

    Swift

    struct Attributes
  • Metadata for a user in a structure.

    Declaration

    Swift

    struct UserMetadata
  • Details of an invitation to join a structure.

    Declaration

    Swift

    struct InvitationDetails
  • The role of a user in a structure.

    Declaration

    Swift

    enum UserRole
  • The status of an invitation to join a structure.

    Declaration

    Swift

    enum InvitationStatus
  • Lists the users in a structure.

    Declaration

    Swift

    func listUsersInStructure(structureId: String? = nil) async throws -> Google.StructureUserManagementTrait.ListUsersInStructureResponse

    Parameters

    structureId

    The ID of the structure for which to list users.

  • Removes a user from a structure.

    Declaration

    Swift

    func removeUser(structureId: String? = nil, obfuscatedUserId: String? = nil) async throws

    Parameters

    structureId

    The ID of the structure from which to remove the user.

    obfuscatedUserId

    The obfuscated user ID of the user to remove.

  • Creates an invitation to join the structure.

    Declaration

    Swift

    func createInvitation(intendedUserRole: Google.StructureUserManagementTrait.UserRole? = nil) async throws -> Google.StructureUserManagementTrait.CreateInvitationResponse

    Parameters

    intendedUserRole

    The role the invited user will have in the structure.

  • Revokes a pending invitation to join the structure.

    Declaration

    Swift

    func revokeInvitation(invitationId: String? = nil) async throws

    Parameters

    invitationId

    The ID of the invitation to revoke.

  • Lists invitations for the structure.

    Declaration

    Swift

    func listInvitations() async throws -> Google.StructureUserManagementTrait.ListInvitationsResponse
  • Indicates that a user has accepted an invitation to join a structure.

    Declaration

    Swift

    struct InvitationAcceptedEvent