    protocol UserStructureController : Sendable

A controller for managing user-structure relationships.
- `


  ### [presenceOptInStatus()](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/UserStructureController#/s:13GoogleHomeSDK23UserStructureControllerP19presenceOptInStatusScsySbs5Error_pGyYaF)


  ` Returns an `AsyncThrowingStream` indicating whether the user has opted in to user presence
  for the current structure.

  The stream yields `true` if the user has opted in to user presence, and `false`
  otherwise.

  #### Declaration

  Swift

      @available(*, deprecated, message: "This API is experimental and is subject to change in a future SDK release.")
      func presenceOptInStatus() async -> AsyncThrowingStream<Bool, any Error>

- `


  ### [setPresenceOptIn(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/UserStructureController#/s:13GoogleHomeSDK23UserStructureControllerP16setPresenceOptInyySbYaKF)


  ` Sets the user's opt-in status for user presence for the current structure.

  This will update the `UserPresenceSettingsTrait` of the `ApplicationInfo` object which is
  managed on a per-application, per-structure, per-user basis.
  Throws
  A `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/HomeError.html` error if the opt-in status could not be updated.

  #### Declaration

  Swift

      @available(*, deprecated, message: "This API is experimental and is subject to change in a future SDK release.")
      func setPresenceOptIn(_ optIn: Bool) async throws

  #### Parameters

  |---|---|
  | ` optIn ` | `true` to opt the user in, `false` to opt the user out. |