# CommandRequest

    protocol CommandRequest : Sendable

A protocol for the request of a Matter command.
- `


  ### [encode(with:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/CommandRequest#/s:13GoogleHomeSDK14CommandRequestP6encode4withyAA12TraitEncoderC_tKF)


  ` Writes this Request to the given `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Classes/TraitEncoder.html`.
  Throws
  `HomeError.parseError` when parsing fails.

  #### Declaration

  Swift

      func encode(with encoder: https://developers.home.google.com/reference/swift/GoogleHomeSDK/Classes/TraitEncoder.html) throws