|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Microsoft\Graph\Generated\Models; |
| 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 ProtectionPolicyArtifactCount implements AdditionalDataHolder, BackedModel, Parsable |
| 14 | +{ |
| 15 | + /** |
| 16 | + * @var BackingStore $backingStore Stores model information. |
| 17 | + */ |
| 18 | + private BackingStore $backingStore; |
| 19 | + |
| 20 | + /** |
| 21 | + * Instantiates a new ProtectionPolicyArtifactCount 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 ProtectionPolicyArtifactCount |
| 32 | + */ |
| 33 | + public static function createFromDiscriminatorValue(ParseNode $parseNode): ProtectionPolicyArtifactCount { |
| 34 | + return new ProtectionPolicyArtifactCount(); |
| 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 | + * Gets the completed property value. The completed property |
| 60 | + * @return int|null |
| 61 | + */ |
| 62 | + public function getCompleted(): ?int { |
| 63 | + $val = $this->getBackingStore()->get('completed'); |
| 64 | + if (is_null($val) || is_int($val)) { |
| 65 | + return $val; |
| 66 | + } |
| 67 | + throw new \UnexpectedValueException("Invalid type found in backing store for 'completed'"); |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * Gets the failed property value. The failed property |
| 72 | + * @return int|null |
| 73 | + */ |
| 74 | + public function getFailed(): ?int { |
| 75 | + $val = $this->getBackingStore()->get('failed'); |
| 76 | + if (is_null($val) || is_int($val)) { |
| 77 | + return $val; |
| 78 | + } |
| 79 | + throw new \UnexpectedValueException("Invalid type found in backing store for 'failed'"); |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * The deserialization information for the current model |
| 84 | + * @return array<string, callable(ParseNode): void> |
| 85 | + */ |
| 86 | + public function getFieldDeserializers(): array { |
| 87 | + $o = $this; |
| 88 | + return [ |
| 89 | + 'completed' => fn(ParseNode $n) => $o->setCompleted($n->getIntegerValue()), |
| 90 | + 'failed' => fn(ParseNode $n) => $o->setFailed($n->getIntegerValue()), |
| 91 | + 'inProgress' => fn(ParseNode $n) => $o->setInProgress($n->getIntegerValue()), |
| 92 | + '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()), |
| 93 | + 'total' => fn(ParseNode $n) => $o->setTotal($n->getIntegerValue()), |
| 94 | + ]; |
| 95 | + } |
| 96 | + |
| 97 | + /** |
| 98 | + * Gets the inProgress property value. The inProgress property |
| 99 | + * @return int|null |
| 100 | + */ |
| 101 | + public function getInProgress(): ?int { |
| 102 | + $val = $this->getBackingStore()->get('inProgress'); |
| 103 | + if (is_null($val) || is_int($val)) { |
| 104 | + return $val; |
| 105 | + } |
| 106 | + throw new \UnexpectedValueException("Invalid type found in backing store for 'inProgress'"); |
| 107 | + } |
| 108 | + |
| 109 | + /** |
| 110 | + * Gets the @odata.type property value. The OdataType property |
| 111 | + * @return string|null |
| 112 | + */ |
| 113 | + public function getOdataType(): ?string { |
| 114 | + $val = $this->getBackingStore()->get('odataType'); |
| 115 | + if (is_null($val) || is_string($val)) { |
| 116 | + return $val; |
| 117 | + } |
| 118 | + throw new \UnexpectedValueException("Invalid type found in backing store for 'odataType'"); |
| 119 | + } |
| 120 | + |
| 121 | + /** |
| 122 | + * Gets the total property value. The total property |
| 123 | + * @return int|null |
| 124 | + */ |
| 125 | + public function getTotal(): ?int { |
| 126 | + $val = $this->getBackingStore()->get('total'); |
| 127 | + if (is_null($val) || is_int($val)) { |
| 128 | + return $val; |
| 129 | + } |
| 130 | + throw new \UnexpectedValueException("Invalid type found in backing store for 'total'"); |
| 131 | + } |
| 132 | + |
| 133 | + /** |
| 134 | + * Serializes information the current object |
| 135 | + * @param SerializationWriter $writer Serialization writer to use to serialize this model |
| 136 | + */ |
| 137 | + public function serialize(SerializationWriter $writer): void { |
| 138 | + $writer->writeIntegerValue('completed', $this->getCompleted()); |
| 139 | + $writer->writeIntegerValue('failed', $this->getFailed()); |
| 140 | + $writer->writeIntegerValue('inProgress', $this->getInProgress()); |
| 141 | + $writer->writeStringValue('@odata.type', $this->getOdataType()); |
| 142 | + $writer->writeIntegerValue('total', $this->getTotal()); |
| 143 | + $writer->writeAdditionalData($this->getAdditionalData()); |
| 144 | + } |
| 145 | + |
| 146 | + /** |
| 147 | + * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 148 | + * @param array<string,mixed> $value Value to set for the AdditionalData property. |
| 149 | + */ |
| 150 | + public function setAdditionalData(?array $value): void { |
| 151 | + $this->getBackingStore()->set('additionalData', $value); |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + * Sets the BackingStore property value. Stores model information. |
| 156 | + * @param BackingStore $value Value to set for the BackingStore property. |
| 157 | + */ |
| 158 | + public function setBackingStore(BackingStore $value): void { |
| 159 | + $this->backingStore = $value; |
| 160 | + } |
| 161 | + |
| 162 | + /** |
| 163 | + * Sets the completed property value. The completed property |
| 164 | + * @param int|null $value Value to set for the completed property. |
| 165 | + */ |
| 166 | + public function setCompleted(?int $value): void { |
| 167 | + $this->getBackingStore()->set('completed', $value); |
| 168 | + } |
| 169 | + |
| 170 | + /** |
| 171 | + * Sets the failed property value. The failed property |
| 172 | + * @param int|null $value Value to set for the failed property. |
| 173 | + */ |
| 174 | + public function setFailed(?int $value): void { |
| 175 | + $this->getBackingStore()->set('failed', $value); |
| 176 | + } |
| 177 | + |
| 178 | + /** |
| 179 | + * Sets the inProgress property value. The inProgress property |
| 180 | + * @param int|null $value Value to set for the inProgress property. |
| 181 | + */ |
| 182 | + public function setInProgress(?int $value): void { |
| 183 | + $this->getBackingStore()->set('inProgress', $value); |
| 184 | + } |
| 185 | + |
| 186 | + /** |
| 187 | + * Sets the @odata.type property value. The OdataType property |
| 188 | + * @param string|null $value Value to set for the @odata.type property. |
| 189 | + */ |
| 190 | + public function setOdataType(?string $value): void { |
| 191 | + $this->getBackingStore()->set('odataType', $value); |
| 192 | + } |
| 193 | + |
| 194 | + /** |
| 195 | + * Sets the total property value. The total property |
| 196 | + * @param int|null $value Value to set for the total property. |
| 197 | + */ |
| 198 | + public function setTotal(?int $value): void { |
| 199 | + $this->getBackingStore()->set('total', $value); |
| 200 | + } |
| 201 | + |
| 202 | +} |
0 commit comments