    protocol HasParts : Sendable

    extension HasParts : SendableMetatype

An object in the smart home graph that contains functional parts.
- `


  ### [part(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/HasParts#/s:13GoogleHomeSDK8HasPartsP4partyqd__Sgqd__mYaKAA10DeviceTypeRd__lF)


  ` Default implementation Returns the first instance of the given `type` if the entity supports it, otherwise returns
  nil.
  Throws
  An error if retrieving or communicating with the underlying parts fails.

  #### Default Implementation

  Default implementation for entities that do not support parts, returning nil.

  #### Declaration

  Swift

      func part<T>(_ part: T.Type) async throws -> T? where T : https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html

- `


  ### [parts(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/HasParts#/s:13GoogleHomeSDK8HasPartsP5partsySayqd__Gqd__mYaKAA10DeviceTypeRd__lF)


  ` Default implementation Returns an array of the top-level parts matching the given `type`.
  Throws
  An error if retrieving or communicating with the underlying parts fails.

  #### Default Implementation

  Default implementation for entities that do not support parts, returning an empty array.

  #### Declaration

  Swift

      func parts<T>(_ part: T.Type) async throws -> [T] where T : https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html

- `


  ### [part(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/HasParts#/s:13GoogleHomeSDK10DeviceTypePAAE4partyqd__Sgqd__mAaBRd__lF)


  ` Extension method Returns the first instance of the given `type` if supported, otherwise returns nil.

  #### Declaration

  Swift

      func part<T>(_ part: T.Type = T.self) -> T? where T : https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html

- `


  ### [parts(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/HasParts#/s:13GoogleHomeSDK10DeviceTypePAAE5partsySayqd__Gqd__mAaBRd__lF)


  ` Extension method Returns an array of the top-level parts matching the given `type`.

  #### Declaration

  Swift

      func parts<T>(_ part: T.Type = T.self) -> [T] where T : https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html

- `


  ### [part(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/HasParts#/s:13GoogleHomeSDK8HasPartsPAAE4partyqd__Sgqd__mYaKAA10DeviceTypeRd__lF)


  ` Extension method Returns the first instance of the given `type` if the entity supports it, otherwise returns
  nil.
  Throws
  An error if retrieving or communicating with the underlying parts fails.

  #### Declaration

  Swift

      func part<T>(_ part: T.Type = T.self) async throws -> T? where T : https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html

- `


  ### [parts(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/HasParts#/s:13GoogleHomeSDK8HasPartsPAAE5partsySayqd__Gqd__mYaKAA10DeviceTypeRd__lF)


  ` Extension method Returns an array of the top-level parts matching the given `type`.
  Throws
  An error if retrieving or communicating with the underlying parts fails.

  #### Declaration

  Swift

      func parts<T>(_ part: T.Type = T.self) async throws -> [T] where T : https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html