> Documentation index: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/llms.txt

    struct EstimatedSavings

Estimated savings accrued over a period of time, relative to a comparison scenario.
- `


  ### [structField(id:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EstimatedSavings.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV16EstimatedSavingsV11structField2id0aB3SDK0K0_pSgs6UInt32V_tFZ)


  ` Returns the field corresponding to the given field ID.

  #### Declaration

  Swift

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

- `


  ### [value](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EstimatedSavings.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV16EstimatedSavingsV5value0aB3SDK5MoneyVSgvp)


  ` The estimated savings. Positive values mean the structure spent less than it would have under
  the comparison scenario; negative values mean it spent more. The scenarios behind this estimate
  are reported in EnergyScenarioAnalysisEvent.

  #### Declaration

  Swift

      let value: Money?

- `


  ### [startTime](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EstimatedSavings.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV16EstimatedSavingsV9startTime10Foundation4DateVSgvp)


  ` Start of the period over which savings are accrued, represented as midnight (00:00:00) UTC on
  the start date.

  #### Declaration

  Swift

      let startTime: Date?

- `


  ### [durationDays](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EstimatedSavings.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV16EstimatedSavingsV12durationDayss5Int32VSgvp)


  ` Duration of the period in days.

  #### Declaration

  Swift

      let durationDays: Int32?

- `


  ### [init(decoder:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EstimatedSavings.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV16EstimatedSavingsV7decoderAG0aB3SDK0G7DecoderV_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/EnergyScenarioAnalysisTrait/EstimatedSavings.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV16EstimatedSavingsV6encode4withy0aB3SDK0G7EncoderC_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