|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Microsoft\Graph\Generated\Devices\Provision; |
| 4 | + |
| 5 | +use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder; |
| 6 | +use Microsoft\Kiota\Abstractions\Serialization\Parsable; |
| 7 | +use Microsoft\Kiota\Abstractions\Serialization\ParseNode; |
| 8 | +use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter; |
| 9 | +use Microsoft\Kiota\Abstractions\Store\BackedModel; |
| 10 | +use Microsoft\Kiota\Abstractions\Store\BackingStore; |
| 11 | +use Microsoft\Kiota\Abstractions\Store\BackingStoreFactorySingleton; |
| 12 | + |
| 13 | +class ProvisionPostRequestBody implements AdditionalDataHolder, BackedModel, Parsable |
| 14 | +{ |
| 15 | + /** |
| 16 | + * @var BackingStore $backingStore Stores model information. |
| 17 | + */ |
| 18 | + private BackingStore $backingStore; |
| 19 | + |
| 20 | + /** |
| 21 | + * Instantiates a new ProvisionPostRequestBody and sets the default values. |
| 22 | + */ |
| 23 | + public function __construct() { |
| 24 | + $this->backingStore = BackingStoreFactorySingleton::getInstance()->createBackingStore(); |
| 25 | + $this->setAdditionalData([]); |
| 26 | + } |
| 27 | + |
| 28 | + /** |
| 29 | + * Creates a new instance of the appropriate class based on discriminator value |
| 30 | + * @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object |
| 31 | + * @return ProvisionPostRequestBody |
| 32 | + */ |
| 33 | + public static function createFromDiscriminatorValue(ParseNode $parseNode): ProvisionPostRequestBody { |
| 34 | + return new ProvisionPostRequestBody(); |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 39 | + * @return array<string, mixed>|null |
| 40 | + */ |
| 41 | + public function getAdditionalData(): ?array { |
| 42 | + $val = $this->getBackingStore()->get('additionalData'); |
| 43 | + if (is_null($val) || is_array($val)) { |
| 44 | + /** @var array<string, mixed>|null $val */ |
| 45 | + return $val; |
| 46 | + } |
| 47 | + throw new \UnexpectedValueException("Invalid type found in backing store for 'additionalData'"); |
| 48 | + } |
| 49 | + |
| 50 | + /** |
| 51 | + * Gets the BackingStore property value. Stores model information. |
| 52 | + * @return BackingStore |
| 53 | + */ |
| 54 | + public function getBackingStore(): BackingStore { |
| 55 | + return $this->backingStore; |
| 56 | + } |
| 57 | + |
| 58 | + /** |
| 59 | + * The deserialization information for the current model |
| 60 | + * @return array<string, callable(ParseNode): void> |
| 61 | + */ |
| 62 | + public function getFieldDeserializers(): array { |
| 63 | + $o = $this; |
| 64 | + return [ |
| 65 | + 'provisioningBlob' => fn(ParseNode $n) => $o->setProvisioningBlob($n->getStringValue()), |
| 66 | + ]; |
| 67 | + } |
| 68 | + |
| 69 | + /** |
| 70 | + * Gets the provisioningBlob property value. The provisioningBlob property |
| 71 | + * @return string|null |
| 72 | + */ |
| 73 | + public function getProvisioningBlob(): ?string { |
| 74 | + $val = $this->getBackingStore()->get('provisioningBlob'); |
| 75 | + if (is_null($val) || is_string($val)) { |
| 76 | + return $val; |
| 77 | + } |
| 78 | + throw new \UnexpectedValueException("Invalid type found in backing store for 'provisioningBlob'"); |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Serializes information the current object |
| 83 | + * @param SerializationWriter $writer Serialization writer to use to serialize this model |
| 84 | + */ |
| 85 | + public function serialize(SerializationWriter $writer): void { |
| 86 | + $writer->writeStringValue('provisioningBlob', $this->getProvisioningBlob()); |
| 87 | + $writer->writeAdditionalData($this->getAdditionalData()); |
| 88 | + } |
| 89 | + |
| 90 | + /** |
| 91 | + * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 92 | + * @param array<string,mixed> $value Value to set for the AdditionalData property. |
| 93 | + */ |
| 94 | + public function setAdditionalData(?array $value): void { |
| 95 | + $this->getBackingStore()->set('additionalData', $value); |
| 96 | + } |
| 97 | + |
| 98 | + /** |
| 99 | + * Sets the BackingStore property value. Stores model information. |
| 100 | + * @param BackingStore $value Value to set for the BackingStore property. |
| 101 | + */ |
| 102 | + public function setBackingStore(BackingStore $value): void { |
| 103 | + $this->backingStore = $value; |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * Sets the provisioningBlob property value. The provisioningBlob property |
| 108 | + * @param string|null $value Value to set for the provisioningBlob property. |
| 109 | + */ |
| 110 | + public function setProvisioningBlob(?string $value): void { |
| 111 | + $this->getBackingStore()->set('provisioningBlob', $value); |
| 112 | + } |
| 113 | + |
| 114 | +} |
0 commit comments