-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathAppliedConditionalAccessPolicy.php
More file actions
243 lines (219 loc) · 11.1 KB
/
AppliedConditionalAccessPolicy.php
File metadata and controls
243 lines (219 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<?php
namespace Microsoft\Graph\Generated\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;
use Microsoft\Kiota\Abstractions\Store\BackedModel;
use Microsoft\Kiota\Abstractions\Store\BackingStore;
use Microsoft\Kiota\Abstractions\Store\BackingStoreFactorySingleton;
use Microsoft\Kiota\Abstractions\Types\TypeUtils;
class AppliedConditionalAccessPolicy implements AdditionalDataHolder, BackedModel, Parsable
{
/**
* @var BackingStore $backingStore Stores model information.
*/
private BackingStore $backingStore;
/**
* Instantiates a new AppliedConditionalAccessPolicy and sets the default values.
*/
public function __construct() {
$this->backingStore = BackingStoreFactorySingleton::getInstance()->createBackingStore();
$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 AppliedConditionalAccessPolicy
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): AppliedConditionalAccessPolicy {
return new AppliedConditionalAccessPolicy();
}
/**
* 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 {
$val = $this->getBackingStore()->get('additionalData');
if (is_null($val) || is_array($val)) {
/** @var array<string, mixed>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'additionalData'");
}
/**
* Gets the BackingStore property value. Stores model information.
* @return BackingStore
*/
public function getBackingStore(): BackingStore {
return $this->backingStore;
}
/**
* Gets the displayName property value. Refers to the name of the conditional access policy (example: 'Require MFA for Salesforce').
* @return string|null
*/
public function getDisplayName(): ?string {
$val = $this->getBackingStore()->get('displayName');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'displayName'");
}
/**
* Gets the enforcedGrantControls property value. Refers to the grant controls enforced by the conditional access policy (example: 'Require multifactor authentication').
* @return array<string>|null
*/
public function getEnforcedGrantControls(): ?array {
$val = $this->getBackingStore()->get('enforcedGrantControls');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, 'string');
/** @var array<string>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'enforcedGrantControls'");
}
/**
* Gets the enforcedSessionControls property value. Refers to the session controls enforced by the conditional access policy (example: 'Require app enforced controls').
* @return array<string>|null
*/
public function getEnforcedSessionControls(): ?array {
$val = $this->getBackingStore()->get('enforcedSessionControls');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, 'string');
/** @var array<string>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'enforcedSessionControls'");
}
/**
* The deserialization information for the current model
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
$o = $this;
return [
'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),
'enforcedGrantControls' => function (ParseNode $n) {
$val = $n->getCollectionOfPrimitiveValues();
if (is_array($val)) {
TypeUtils::validateCollectionValues($val, 'string');
}
/** @var array<string>|null $val */
$this->setEnforcedGrantControls($val);
},
'enforcedSessionControls' => function (ParseNode $n) {
$val = $n->getCollectionOfPrimitiveValues();
if (is_array($val)) {
TypeUtils::validateCollectionValues($val, 'string');
}
/** @var array<string>|null $val */
$this->setEnforcedSessionControls($val);
},
'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),
'@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),
'result' => fn(ParseNode $n) => $o->setResult($n->getEnumValue(AppliedConditionalAccessPolicyResult::class)),
];
}
/**
* Gets the id property value. An identifier of the conditional access policy. Supports $filter (eq).
* @return string|null
*/
public function getId(): ?string {
$val = $this->getBackingStore()->get('id');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'id'");
}
/**
* Gets the @odata.type property value. The OdataType property
* @return string|null
*/
public function getOdataType(): ?string {
$val = $this->getBackingStore()->get('odataType');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'odataType'");
}
/**
* Gets the result property value. Indicates the result of the CA policy that was triggered. The possible values are: success, failure, notApplied (policy isn't applied because policy conditions weren't met), notEnabled (This is due to the policy in a disabled state), unknown, unknownFutureValue, reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. Use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted.
* @return AppliedConditionalAccessPolicyResult|null
*/
public function getResult(): ?AppliedConditionalAccessPolicyResult {
$val = $this->getBackingStore()->get('result');
if (is_null($val) || $val instanceof AppliedConditionalAccessPolicyResult) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'result'");
}
/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
$writer->writeStringValue('displayName', $this->getDisplayName());
$writer->writeCollectionOfPrimitiveValues('enforcedGrantControls', $this->getEnforcedGrantControls());
$writer->writeCollectionOfPrimitiveValues('enforcedSessionControls', $this->getEnforcedSessionControls());
$writer->writeStringValue('id', $this->getId());
$writer->writeStringValue('@odata.type', $this->getOdataType());
$writer->writeEnumValue('result', $this->getResult());
$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->getBackingStore()->set('additionalData', $value);
}
/**
* Sets the BackingStore property value. Stores model information.
* @param BackingStore $value Value to set for the BackingStore property.
*/
public function setBackingStore(BackingStore $value): void {
$this->backingStore = $value;
}
/**
* Sets the displayName property value. Refers to the name of the conditional access policy (example: 'Require MFA for Salesforce').
* @param string|null $value Value to set for the displayName property.
*/
public function setDisplayName(?string $value): void {
$this->getBackingStore()->set('displayName', $value);
}
/**
* Sets the enforcedGrantControls property value. Refers to the grant controls enforced by the conditional access policy (example: 'Require multifactor authentication').
* @param array<string>|null $value Value to set for the enforcedGrantControls property.
*/
public function setEnforcedGrantControls(?array $value): void {
$this->getBackingStore()->set('enforcedGrantControls', $value);
}
/**
* Sets the enforcedSessionControls property value. Refers to the session controls enforced by the conditional access policy (example: 'Require app enforced controls').
* @param array<string>|null $value Value to set for the enforcedSessionControls property.
*/
public function setEnforcedSessionControls(?array $value): void {
$this->getBackingStore()->set('enforcedSessionControls', $value);
}
/**
* Sets the id property value. An identifier of the conditional access policy. Supports $filter (eq).
* @param string|null $value Value to set for the id property.
*/
public function setId(?string $value): void {
$this->getBackingStore()->set('id', $value);
}
/**
* Sets the @odata.type property value. The OdataType property
* @param string|null $value Value to set for the @odata.type property.
*/
public function setOdataType(?string $value): void {
$this->getBackingStore()->set('odataType', $value);
}
/**
* Sets the result property value. Indicates the result of the CA policy that was triggered. The possible values are: success, failure, notApplied (policy isn't applied because policy conditions weren't met), notEnabled (This is due to the policy in a disabled state), unknown, unknownFutureValue, reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. Use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted.
* @param AppliedConditionalAccessPolicyResult|null $value Value to set for the result property.
*/
public function setResult(?AppliedConditionalAccessPolicyResult $value): void {
$this->getBackingStore()->set('result', $value);
}
}