ldc-arcadia-kiota-openapi-c.../client/Models/Inco.php

620 lines
18 KiB
PHP

<?php
declare(strict_types=1);
namespace Uwil\ArcadiaKiotaOpenApiClient\Models;
use DateTime;
use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Types\TypeUtils;
/**
* Fiche produit INCO complète.
*/
class Inco implements AdditionalDataHolder, Parsable
{
/**
* @var array<string, mixed>|null Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
*/
private ?array $additionalData = null;
/**
* @var array<IncoAdditive>|null The additives property
*/
private ?array $additives = null;
/**
* @var IncoAllegations|null Allégations associées au produit (santé, nutrition, etc.).
*/
private ?IncoAllegations $allegations = null;
/**
* @var array<string>|null The allergens property
*/
private ?array $allergens = null;
/**
* @var IncoBrand|null Marque associée à la fiche produit INCO.
*/
private ?IncoBrand $brand = null;
/**
* @var DateTime|null The createdAt property
*/
private ?DateTime $createdAt = null;
/**
* @var string|null The description property
*/
private ?string $description = null;
/**
* @var string|null The incoCompoId property
*/
private ?string $incoCompoId = null;
/**
* @var string|null The incoId property
*/
private ?string $incoId = null;
/**
* @var IncoIngredients|null Liste structurée des ingrédients groupés par section.
*/
private ?IncoIngredients $ingredients = null;
/**
* @var bool|null The isSeasonal property
*/
private ?bool $isSeasonal = null;
/**
* @var string|null The label property
*/
private ?string $label = null;
/**
* @var string|null The name property
*/
private ?string $name = null;
/**
* @var IncoNutriscore|null The nutriscore property
*/
private ?IncoNutriscore $nutriscore = null;
/**
* @var IncoPortionAmount|null The portions property
*/
private ?IncoPortionAmount $portions = null;
/**
* @var string|null The preparationAdvices property
*/
private ?string $preparationAdvices = null;
/**
* @var string|null The sellArguments property
*/
private ?string $sellArguments = null;
/**
* @var string|null The sellFamilly property
*/
private ?string $sellFamilly = null;
/**
* @var IncoStorageCondition|null The storageCondition property
*/
private ?IncoStorageCondition $storageCondition = null;
/**
* @var string|null The tips property
*/
private ?string $tips = null;
/**
* @var DateTime|null The updatedAt property
*/
private ?DateTime $updatedAt = null;
/**
* @var IncoWeight|null The weight property
*/
private ?IncoWeight $weight = null;
/**
* Instantiates a new Inco 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
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): Inco
{
return new Inco();
}
/**
* 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 additives property value. The additives property
*
* @return array<IncoAdditive>|null
*/
public function getAdditives(): ?array
{
return $this->additives;
}
/**
* Gets the allegations property value. Allégations associées au produit (santé, nutrition, etc.).
*/
public function getAllegations(): ?IncoAllegations
{
return $this->allegations;
}
/**
* Gets the allergens property value. The allergens property
*
* @return array<string>|null
*/
public function getAllergens(): ?array
{
return $this->allergens;
}
/**
* Gets the brand property value. Marque associée à la fiche produit INCO.
*/
public function getBrand(): ?IncoBrand
{
return $this->brand;
}
/**
* Gets the createdAt property value. The createdAt property
*/
public function getCreatedAt(): ?DateTime
{
return $this->createdAt;
}
/**
* Gets the description property value. The description property
*/
public function getDescription(): ?string
{
return $this->description;
}
/**
* The deserialization information for the current model
*
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array
{
$o = $this;
return [
'additives' => fn (ParseNode $n) => $o->setAdditives($n->getCollectionOfObjectValues([IncoAdditive::class, 'createFromDiscriminatorValue'])),
'allegations' => fn (ParseNode $n) => $o->setAllegations($n->getObjectValue([IncoAllegations::class, 'createFromDiscriminatorValue'])),
'allergens' => function (ParseNode $n) {
$val = $n->getCollectionOfPrimitiveValues();
if (is_array($val)) {
TypeUtils::validateCollectionValues($val, 'string');
}
/** @var array<string>|null $val */
$this->setAllergens($val);
},
'brand' => fn (ParseNode $n) => $o->setBrand($n->getObjectValue([IncoBrand::class, 'createFromDiscriminatorValue'])),
'createdAt' => fn (ParseNode $n) => $o->setCreatedAt($n->getDateTimeValue()),
'description' => fn (ParseNode $n) => $o->setDescription($n->getStringValue()),
'incoCompoId' => fn (ParseNode $n) => $o->setIncoCompoId($n->getStringValue()),
'incoId' => fn (ParseNode $n) => $o->setIncoId($n->getStringValue()),
'ingredients' => fn (ParseNode $n) => $o->setIngredients($n->getObjectValue([IncoIngredients::class, 'createFromDiscriminatorValue'])),
'isSeasonal' => fn (ParseNode $n) => $o->setIsSeasonal($n->getBooleanValue()),
'label' => fn (ParseNode $n) => $o->setLabel($n->getStringValue()),
'name' => fn (ParseNode $n) => $o->setName($n->getStringValue()),
'nutriscore' => fn (ParseNode $n) => $o->setNutriscore($n->getObjectValue([IncoNutriscore::class, 'createFromDiscriminatorValue'])),
'portions' => fn (ParseNode $n) => $o->setPortions($n->getObjectValue([IncoPortionAmount::class, 'createFromDiscriminatorValue'])),
'preparationAdvices' => fn (ParseNode $n) => $o->setPreparationAdvices($n->getStringValue()),
'sellArguments' => fn (ParseNode $n) => $o->setSellArguments($n->getStringValue()),
'sellFamilly' => fn (ParseNode $n) => $o->setSellFamilly($n->getStringValue()),
'storageCondition' => fn (ParseNode $n) => $o->setStorageCondition($n->getObjectValue([IncoStorageCondition::class, 'createFromDiscriminatorValue'])),
'tips' => fn (ParseNode $n) => $o->setTips($n->getStringValue()),
'updatedAt' => fn (ParseNode $n) => $o->setUpdatedAt($n->getDateTimeValue()),
'weight' => fn (ParseNode $n) => $o->setWeight($n->getObjectValue([IncoWeight::class, 'createFromDiscriminatorValue'])),
];
}
/**
* Gets the incoCompoId property value. The incoCompoId property
*/
public function getIncoCompoId(): ?string
{
return $this->incoCompoId;
}
/**
* Gets the incoId property value. The incoId property
*/
public function getIncoId(): ?string
{
return $this->incoId;
}
/**
* Gets the ingredients property value. Liste structurée des ingrédients groupés par section.
*/
public function getIngredients(): ?IncoIngredients
{
return $this->ingredients;
}
/**
* Gets the isSeasonal property value. The isSeasonal property
*/
public function getIsSeasonal(): ?bool
{
return $this->isSeasonal;
}
/**
* Gets the label property value. The label property
*/
public function getLabel(): ?string
{
return $this->label;
}
/**
* Gets the name property value. The name property
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Gets the nutriscore property value. The nutriscore property
*/
public function getNutriscore(): ?IncoNutriscore
{
return $this->nutriscore;
}
/**
* Gets the portions property value. The portions property
*/
public function getPortions(): ?IncoPortionAmount
{
return $this->portions;
}
/**
* Gets the preparationAdvices property value. The preparationAdvices property
*/
public function getPreparationAdvices(): ?string
{
return $this->preparationAdvices;
}
/**
* Gets the sellArguments property value. The sellArguments property
*/
public function getSellArguments(): ?string
{
return $this->sellArguments;
}
/**
* Gets the sellFamilly property value. The sellFamilly property
*/
public function getSellFamilly(): ?string
{
return $this->sellFamilly;
}
/**
* Gets the storageCondition property value. The storageCondition property
*/
public function getStorageCondition(): ?IncoStorageCondition
{
return $this->storageCondition;
}
/**
* Gets the tips property value. The tips property
*/
public function getTips(): ?string
{
return $this->tips;
}
/**
* Gets the updatedAt property value. The updatedAt property
*/
public function getUpdatedAt(): ?DateTime
{
return $this->updatedAt;
}
/**
* Gets the weight property value. The weight property
*/
public function getWeight(): ?IncoWeight
{
return $this->weight;
}
/**
* Serializes information the current object
*
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void
{
$writer->writeCollectionOfObjectValues('additives', $this->getAdditives());
$writer->writeObjectValue('allegations', $this->getAllegations());
$writer->writeCollectionOfPrimitiveValues('allergens', $this->getAllergens());
$writer->writeObjectValue('brand', $this->getBrand());
$writer->writeDateTimeValue('createdAt', $this->getCreatedAt());
$writer->writeStringValue('description', $this->getDescription());
$writer->writeStringValue('incoCompoId', $this->getIncoCompoId());
$writer->writeStringValue('incoId', $this->getIncoId());
$writer->writeObjectValue('ingredients', $this->getIngredients());
$writer->writeBooleanValue('isSeasonal', $this->getIsSeasonal());
$writer->writeStringValue('label', $this->getLabel());
$writer->writeStringValue('name', $this->getName());
$writer->writeObjectValue('nutriscore', $this->getNutriscore());
$writer->writeObjectValue('portions', $this->getPortions());
$writer->writeStringValue('preparationAdvices', $this->getPreparationAdvices());
$writer->writeStringValue('sellArguments', $this->getSellArguments());
$writer->writeStringValue('sellFamilly', $this->getSellFamilly());
$writer->writeObjectValue('storageCondition', $this->getStorageCondition());
$writer->writeStringValue('tips', $this->getTips());
$writer->writeDateTimeValue('updatedAt', $this->getUpdatedAt());
$writer->writeObjectValue('weight', $this->getWeight());
$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 additives property value. The additives property
*
* @param array<IncoAdditive>|null $value Value to set for the additives property.
*/
public function setAdditives(?array $value): void
{
$this->additives = $value;
}
/**
* Sets the allegations property value. Allégations associées au produit (santé, nutrition, etc.).
*
* @param IncoAllegations|null $value Value to set for the allegations property.
*/
public function setAllegations(?IncoAllegations $value): void
{
$this->allegations = $value;
}
/**
* Sets the allergens property value. The allergens property
*
* @param array<string>|null $value Value to set for the allergens property.
*/
public function setAllergens(?array $value): void
{
$this->allergens = $value;
}
/**
* Sets the brand property value. Marque associée à la fiche produit INCO.
*
* @param IncoBrand|null $value Value to set for the brand property.
*/
public function setBrand(?IncoBrand $value): void
{
$this->brand = $value;
}
/**
* Sets the createdAt property value. The createdAt property
*
* @param DateTime|null $value Value to set for the createdAt property.
*/
public function setCreatedAt(?DateTime $value): void
{
$this->createdAt = $value;
}
/**
* Sets the description property value. The description property
*
* @param string|null $value Value to set for the description property.
*/
public function setDescription(?string $value): void
{
$this->description = $value;
}
/**
* Sets the incoCompoId property value. The incoCompoId property
*
* @param string|null $value Value to set for the incoCompoId property.
*/
public function setIncoCompoId(?string $value): void
{
$this->incoCompoId = $value;
}
/**
* Sets the incoId property value. The incoId property
*
* @param string|null $value Value to set for the incoId property.
*/
public function setIncoId(?string $value): void
{
$this->incoId = $value;
}
/**
* Sets the ingredients property value. Liste structurée des ingrédients groupés par section.
*
* @param IncoIngredients|null $value Value to set for the ingredients property.
*/
public function setIngredients(?IncoIngredients $value): void
{
$this->ingredients = $value;
}
/**
* Sets the isSeasonal property value. The isSeasonal property
*
* @param bool|null $value Value to set for the isSeasonal property.
*/
public function setIsSeasonal(?bool $value): void
{
$this->isSeasonal = $value;
}
/**
* Sets the label property value. The label property
*
* @param string|null $value Value to set for the label property.
*/
public function setLabel(?string $value): void
{
$this->label = $value;
}
/**
* Sets the name property value. The name property
*
* @param string|null $value Value to set for the name property.
*/
public function setName(?string $value): void
{
$this->name = $value;
}
/**
* Sets the nutriscore property value. The nutriscore property
*
* @param IncoNutriscore|null $value Value to set for the nutriscore property.
*/
public function setNutriscore(?IncoNutriscore $value): void
{
$this->nutriscore = $value;
}
/**
* Sets the portions property value. The portions property
*
* @param IncoPortionAmount|null $value Value to set for the portions property.
*/
public function setPortions(?IncoPortionAmount $value): void
{
$this->portions = $value;
}
/**
* Sets the preparationAdvices property value. The preparationAdvices property
*
* @param string|null $value Value to set for the preparationAdvices property.
*/
public function setPreparationAdvices(?string $value): void
{
$this->preparationAdvices = $value;
}
/**
* Sets the sellArguments property value. The sellArguments property
*
* @param string|null $value Value to set for the sellArguments property.
*/
public function setSellArguments(?string $value): void
{
$this->sellArguments = $value;
}
/**
* Sets the sellFamilly property value. The sellFamilly property
*
* @param string|null $value Value to set for the sellFamilly property.
*/
public function setSellFamilly(?string $value): void
{
$this->sellFamilly = $value;
}
/**
* Sets the storageCondition property value. The storageCondition property
*
* @param IncoStorageCondition|null $value Value to set for the storageCondition property.
*/
public function setStorageCondition(?IncoStorageCondition $value): void
{
$this->storageCondition = $value;
}
/**
* Sets the tips property value. The tips property
*
* @param string|null $value Value to set for the tips property.
*/
public function setTips(?string $value): void
{
$this->tips = $value;
}
/**
* Sets the updatedAt property value. The updatedAt property
*
* @param DateTime|null $value Value to set for the updatedAt property.
*/
public function setUpdatedAt(?DateTime $value): void
{
$this->updatedAt = $value;
}
/**
* Sets the weight property value. The weight property
*
* @param IncoWeight|null $value Value to set for the weight property.
*/
public function setWeight(?IncoWeight $value): void
{
$this->weight = $value;
}
}