# DispenseItem

    struct DispenseItem

The state of a given disensible item.
- `


  ### [itemName](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/DispenseItem#/s:15GoogleHomeTypes0A0O13DispenseTraitV0D4ItemV8itemNameSSvp)


  ` Name of the item.

  #### Declaration

  Swift

      let itemName: String

- `


  ### [amountRemaining](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/DispenseItem#/s:15GoogleHomeTypes0A0O13DispenseTraitV0D4ItemV15amountRemainingAE6AmountVvp)


  ` Amount of that item remaining in the device. If the device is currently dispensing, this
  reports the remaining amount or what the amount will be once the device finishes
  dispensing.

  #### Declaration

  Swift

      let amountRemaining: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/Amount.html

- `


  ### [amountLastDispensed](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/DispenseItem#/s:15GoogleHomeTypes0A0O13DispenseTraitV0D4ItemV19amountLastDispensedAE6AmountVvp)


  ` Amount of that item that the device most recently dispensed. If the device is currently
  dispensing, this should report the amount it dispensed prior to the current dispensing
  amount.

  #### Declaration

  Swift

      let amountLastDispensed: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait.html.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/Amount.html

- `


  ### [isCurrentlyDispensing](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/DispenseItem#/s:15GoogleHomeTypes0A0O13DispenseTraitV0D4ItemV21isCurrentlyDispensingSbvp)


  ` Indicates if the device is currently dispensing this item.

  #### Declaration

  Swift

      let isCurrentlyDispensing: Bool

- `


  ### [init(decoder:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/DispenseItem#/s:15GoogleHomeTypes0A0O13DispenseTraitV0D4ItemV7decoderAG0aB3SDK0E7DecoderV_tKcfc)


  ` Creates a new Struct instance using data read from the given `TraitDecoder`.
  Throws
  `HomeError.parseError` when parsing fails.

  #### Declaration

  Swift

      init(decoder: TraitDecoder) throws

  #### Parameters

  |---|---|
  | ` decoder ` | The raw data representing this Struct. |

- `


  ### [encode(with:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/DispenseItem#/s:15GoogleHomeTypes0A0O13DispenseTraitV0D4ItemV6encode4withy0aB3SDK0E7EncoderC_tKF)


  ` Writes this Struct to the given `TraitEncoder`.
  Throws `HomeError.parseError` if the data could not be encoded.

  #### Declaration

  Swift

      func encode(with encoder: TraitEncoder) throws

- `


  ### [structField(id:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/DispenseTrait/DispenseItem#/s:15GoogleHomeTypes0A0O13DispenseTraitV0D4ItemV11structField2id0aB3SDK0H0_pSgs6UInt32V_tFZ)


  ` Returns the field corresponding to the given field ID.

  #### Declaration

  Swift

      static func structField(id: UInt32) -> (any Field)?