|null $additionalData Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. */ private ?array $additionalData = null; /** * @var string|null $amount The amount property */ private ?string $amount = null; /** * @var string|null $precision The precision property */ private ?string $precision = null; /** * Instantiates a new NutrientValue and sets the default values. */ public function __construct() { $this->setAdditionalData([]); } /** * Creates a new instance of the appropriate class based on discriminator value * @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object * @return NutrientValue */ public static function createFromDiscriminatorValue(ParseNode $parseNode): NutrientValue { return new NutrientValue(); } /** * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @return array|null */ public function getAdditionalData(): ?array { return $this->additionalData; } /** * Gets the amount property value. The amount property * @return string|null */ public function getAmount(): ?string { return $this->amount; } /** * The deserialization information for the current model * @return array */ public function getFieldDeserializers(): array { $o = $this; return [ 'amount' => fn(ParseNode $n) => $o->setAmount($n->getStringValue()), 'precision' => fn(ParseNode $n) => $o->setPrecision($n->getStringValue()), ]; } /** * Gets the precision property value. The precision property * @return string|null */ public function getPrecision(): ?string { return $this->precision; } /** * Serializes information the current object * @param SerializationWriter $writer Serialization writer to use to serialize this model */ public function serialize(SerializationWriter $writer): void { $writer->writeStringValue('amount', $this->getAmount()); $writer->writeStringValue('precision', $this->getPrecision()); $writer->writeAdditionalData($this->getAdditionalData()); } /** * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. * @param array $value Value to set for the AdditionalData property. */ public function setAdditionalData(?array $value): void { $this->additionalData = $value; } /** * Sets the amount property value. The amount property * @param string|null $value Value to set for the amount property. */ public function setAmount(?string $value): void { $this->amount = $value; } /** * Sets the precision property value. The precision property * @param string|null $value Value to set for the precision property. */ public function setPrecision(?string $value): void { $this->precision = $value; } }