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