254 lines
9.4 KiB
PHP
254 lines
9.4 KiB
PHP
<?php
|
|
|
|
namespace Uwil\ArcadiaKiotaOpenApiClient\Models;
|
|
|
|
use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
|
|
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
|
|
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
|
|
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
|
|
|
|
/**
|
|
* Macronutriments de référence pour 100g/ml.
|
|
*/
|
|
class IncoCompoReferenceMacronutrients implements AdditionalDataHolder, Parsable
|
|
{
|
|
/**
|
|
* @var array<string, mixed>|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 NutrientValue|null $carbohydrates Valeur d'un nutriment avec quantité et précision facultative.
|
|
*/
|
|
private ?NutrientValue $carbohydrates = null;
|
|
|
|
/**
|
|
* @var NutrientValue|null $fat Valeur d'un nutriment avec quantité et précision facultative.
|
|
*/
|
|
private ?NutrientValue $fat = null;
|
|
|
|
/**
|
|
* @var NutrientValue|null $fiber Valeur d'un nutriment avec quantité et précision facultative.
|
|
*/
|
|
private ?NutrientValue $fiber = null;
|
|
|
|
/**
|
|
* @var NutrientValue|null $protein Valeur d'un nutriment avec quantité et précision facultative.
|
|
*/
|
|
private ?NutrientValue $protein = null;
|
|
|
|
/**
|
|
* @var NutrientValue|null $salt Valeur d'un nutriment avec quantité et précision facultative.
|
|
*/
|
|
private ?NutrientValue $salt = null;
|
|
|
|
/**
|
|
* @var NutrientValue|null $saturatedFat Valeur d'un nutriment avec quantité et précision facultative.
|
|
*/
|
|
private ?NutrientValue $saturatedFat = null;
|
|
|
|
/**
|
|
* @var string|null $sodium The sodium property
|
|
*/
|
|
private ?string $sodium = null;
|
|
|
|
/**
|
|
* @var NutrientValue|null $sugars Valeur d'un nutriment avec quantité et précision facultative.
|
|
*/
|
|
private ?NutrientValue $sugars = null;
|
|
|
|
/**
|
|
* Instantiates a new IncoCompoReferenceMacronutrients 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 IncoCompoReferenceMacronutrients
|
|
*/
|
|
public static function createFromDiscriminatorValue(ParseNode $parseNode): IncoCompoReferenceMacronutrients {
|
|
return new IncoCompoReferenceMacronutrients();
|
|
}
|
|
|
|
/**
|
|
* 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<string, mixed>|null
|
|
*/
|
|
public function getAdditionalData(): ?array {
|
|
return $this->additionalData;
|
|
}
|
|
|
|
/**
|
|
* Gets the carbohydrates property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @return NutrientValue|null
|
|
*/
|
|
public function getCarbohydrates(): ?NutrientValue {
|
|
return $this->carbohydrates;
|
|
}
|
|
|
|
/**
|
|
* Gets the fat property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @return NutrientValue|null
|
|
*/
|
|
public function getFat(): ?NutrientValue {
|
|
return $this->fat;
|
|
}
|
|
|
|
/**
|
|
* Gets the fiber property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @return NutrientValue|null
|
|
*/
|
|
public function getFiber(): ?NutrientValue {
|
|
return $this->fiber;
|
|
}
|
|
|
|
/**
|
|
* The deserialization information for the current model
|
|
* @return array<string, callable(ParseNode): void>
|
|
*/
|
|
public function getFieldDeserializers(): array {
|
|
$o = $this;
|
|
return [
|
|
'carbohydrates' => fn(ParseNode $n) => $o->setCarbohydrates($n->getObjectValue([NutrientValue::class, 'createFromDiscriminatorValue'])),
|
|
'fat' => fn(ParseNode $n) => $o->setFat($n->getObjectValue([NutrientValue::class, 'createFromDiscriminatorValue'])),
|
|
'fiber' => fn(ParseNode $n) => $o->setFiber($n->getObjectValue([NutrientValue::class, 'createFromDiscriminatorValue'])),
|
|
'protein' => fn(ParseNode $n) => $o->setProtein($n->getObjectValue([NutrientValue::class, 'createFromDiscriminatorValue'])),
|
|
'salt' => fn(ParseNode $n) => $o->setSalt($n->getObjectValue([NutrientValue::class, 'createFromDiscriminatorValue'])),
|
|
'saturatedFat' => fn(ParseNode $n) => $o->setSaturatedFat($n->getObjectValue([NutrientValue::class, 'createFromDiscriminatorValue'])),
|
|
'sodium' => fn(ParseNode $n) => $o->setSodium($n->getStringValue()),
|
|
'sugars' => fn(ParseNode $n) => $o->setSugars($n->getObjectValue([NutrientValue::class, 'createFromDiscriminatorValue'])),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Gets the protein property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @return NutrientValue|null
|
|
*/
|
|
public function getProtein(): ?NutrientValue {
|
|
return $this->protein;
|
|
}
|
|
|
|
/**
|
|
* Gets the salt property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @return NutrientValue|null
|
|
*/
|
|
public function getSalt(): ?NutrientValue {
|
|
return $this->salt;
|
|
}
|
|
|
|
/**
|
|
* Gets the saturatedFat property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @return NutrientValue|null
|
|
*/
|
|
public function getSaturatedFat(): ?NutrientValue {
|
|
return $this->saturatedFat;
|
|
}
|
|
|
|
/**
|
|
* Gets the sodium property value. The sodium property
|
|
* @return string|null
|
|
*/
|
|
public function getSodium(): ?string {
|
|
return $this->sodium;
|
|
}
|
|
|
|
/**
|
|
* Gets the sugars property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @return NutrientValue|null
|
|
*/
|
|
public function getSugars(): ?NutrientValue {
|
|
return $this->sugars;
|
|
}
|
|
|
|
/**
|
|
* Serializes information the current object
|
|
* @param SerializationWriter $writer Serialization writer to use to serialize this model
|
|
*/
|
|
public function serialize(SerializationWriter $writer): void {
|
|
$writer->writeObjectValue('carbohydrates', $this->getCarbohydrates());
|
|
$writer->writeObjectValue('fat', $this->getFat());
|
|
$writer->writeObjectValue('fiber', $this->getFiber());
|
|
$writer->writeObjectValue('protein', $this->getProtein());
|
|
$writer->writeObjectValue('salt', $this->getSalt());
|
|
$writer->writeObjectValue('saturatedFat', $this->getSaturatedFat());
|
|
$writer->writeStringValue('sodium', $this->getSodium());
|
|
$writer->writeObjectValue('sugars', $this->getSugars());
|
|
$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<string,mixed> $value Value to set for the AdditionalData property.
|
|
*/
|
|
public function setAdditionalData(?array $value): void {
|
|
$this->additionalData = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the carbohydrates property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @param NutrientValue|null $value Value to set for the carbohydrates property.
|
|
*/
|
|
public function setCarbohydrates(?NutrientValue $value): void {
|
|
$this->carbohydrates = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the fat property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @param NutrientValue|null $value Value to set for the fat property.
|
|
*/
|
|
public function setFat(?NutrientValue $value): void {
|
|
$this->fat = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the fiber property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @param NutrientValue|null $value Value to set for the fiber property.
|
|
*/
|
|
public function setFiber(?NutrientValue $value): void {
|
|
$this->fiber = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the protein property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @param NutrientValue|null $value Value to set for the protein property.
|
|
*/
|
|
public function setProtein(?NutrientValue $value): void {
|
|
$this->protein = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the salt property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @param NutrientValue|null $value Value to set for the salt property.
|
|
*/
|
|
public function setSalt(?NutrientValue $value): void {
|
|
$this->salt = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the saturatedFat property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @param NutrientValue|null $value Value to set for the saturatedFat property.
|
|
*/
|
|
public function setSaturatedFat(?NutrientValue $value): void {
|
|
$this->saturatedFat = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the sodium property value. The sodium property
|
|
* @param string|null $value Value to set for the sodium property.
|
|
*/
|
|
public function setSodium(?string $value): void {
|
|
$this->sodium = $value;
|
|
}
|
|
|
|
/**
|
|
* Sets the sugars property value. Valeur d'un nutriment avec quantité et précision facultative.
|
|
* @param NutrientValue|null $value Value to set for the sugars property.
|
|
*/
|
|
public function setSugars(?NutrientValue $value): void {
|
|
$this->sugars = $value;
|
|
}
|
|
|
|
}
|