Total Complexity | 157 |
Total Lines | 1074 |
Duplicated Lines | 0 % |
Changes | 0 |
Complex classes like EwsNonEmptyArrayOfResponseObjectsType often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use EwsNonEmptyArrayOfResponseObjectsType, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
16 | class EwsNonEmptyArrayOfResponseObjectsType extends AbstractStructBase |
||
17 | { |
||
18 | /** |
||
19 | * The AcceptItem |
||
20 | * Meta information extracted from the WSDL |
||
21 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
22 | * - choiceMaxOccurs: unbounded |
||
23 | * - choiceMinOccurs: 0 |
||
24 | * @var \StructType\EwsAcceptItemType|null |
||
25 | */ |
||
26 | protected ?\StructType\EwsAcceptItemType $AcceptItem = null; |
||
27 | /** |
||
28 | * The TentativelyAcceptItem |
||
29 | * Meta information extracted from the WSDL |
||
30 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
31 | * - choiceMaxOccurs: unbounded |
||
32 | * - choiceMinOccurs: 0 |
||
33 | * @var \StructType\EwsTentativelyAcceptItemType|null |
||
34 | */ |
||
35 | protected ?\StructType\EwsTentativelyAcceptItemType $TentativelyAcceptItem = null; |
||
36 | /** |
||
37 | * The DeclineItem |
||
38 | * Meta information extracted from the WSDL |
||
39 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
40 | * - choiceMaxOccurs: unbounded |
||
41 | * - choiceMinOccurs: 0 |
||
42 | * @var \StructType\EwsDeclineItemType|null |
||
43 | */ |
||
44 | protected ?\StructType\EwsDeclineItemType $DeclineItem = null; |
||
45 | /** |
||
46 | * The ReplyToItem |
||
47 | * Meta information extracted from the WSDL |
||
48 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
49 | * - choiceMaxOccurs: unbounded |
||
50 | * - choiceMinOccurs: 0 |
||
51 | * @var \StructType\EwsReplyToItemType|null |
||
52 | */ |
||
53 | protected ?\StructType\EwsReplyToItemType $ReplyToItem = null; |
||
54 | /** |
||
55 | * The ForwardItem |
||
56 | * Meta information extracted from the WSDL |
||
57 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
58 | * - choiceMaxOccurs: unbounded |
||
59 | * - choiceMinOccurs: 0 |
||
60 | * @var \StructType\EwsForwardItemType|null |
||
61 | */ |
||
62 | protected ?\StructType\EwsForwardItemType $ForwardItem = null; |
||
63 | /** |
||
64 | * The ReplyAllToItem |
||
65 | * Meta information extracted from the WSDL |
||
66 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
67 | * - choiceMaxOccurs: unbounded |
||
68 | * - choiceMinOccurs: 0 |
||
69 | * @var \StructType\EwsReplyAllToItemType|null |
||
70 | */ |
||
71 | protected ?\StructType\EwsReplyAllToItemType $ReplyAllToItem = null; |
||
72 | /** |
||
73 | * The CancelCalendarItem |
||
74 | * Meta information extracted from the WSDL |
||
75 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
76 | * - choiceMaxOccurs: unbounded |
||
77 | * - choiceMinOccurs: 0 |
||
78 | * @var \StructType\EwsCancelCalendarItemType|null |
||
79 | */ |
||
80 | protected ?\StructType\EwsCancelCalendarItemType $CancelCalendarItem = null; |
||
81 | /** |
||
82 | * The RemoveItem |
||
83 | * Meta information extracted from the WSDL |
||
84 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
85 | * - choiceMaxOccurs: unbounded |
||
86 | * - choiceMinOccurs: 0 |
||
87 | * @var \StructType\EwsRemoveItemType|null |
||
88 | */ |
||
89 | protected ?\StructType\EwsRemoveItemType $RemoveItem = null; |
||
90 | /** |
||
91 | * The SuppressReadReceipt |
||
92 | * Meta information extracted from the WSDL |
||
93 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
94 | * - choiceMaxOccurs: unbounded |
||
95 | * - choiceMinOccurs: 0 |
||
96 | * @var \StructType\EwsSuppressReadReceiptType|null |
||
97 | */ |
||
98 | protected ?\StructType\EwsSuppressReadReceiptType $SuppressReadReceipt = null; |
||
99 | /** |
||
100 | * The PostReplyItem |
||
101 | * Meta information extracted from the WSDL |
||
102 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
103 | * - choiceMaxOccurs: unbounded |
||
104 | * - choiceMinOccurs: 0 |
||
105 | * @var \StructType\EwsPostReplyItemType|null |
||
106 | */ |
||
107 | protected ?\StructType\EwsPostReplyItemType $PostReplyItem = null; |
||
108 | /** |
||
109 | * The AcceptSharingInvitation |
||
110 | * Meta information extracted from the WSDL |
||
111 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
112 | * - choiceMaxOccurs: unbounded |
||
113 | * - choiceMinOccurs: 0 |
||
114 | * @var \StructType\EwsAcceptSharingInvitationType|null |
||
115 | */ |
||
116 | protected ?\StructType\EwsAcceptSharingInvitationType $AcceptSharingInvitation = null; |
||
117 | /** |
||
118 | * The AddItemToMyCalendar |
||
119 | * Meta information extracted from the WSDL |
||
120 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
121 | * - choiceMaxOccurs: unbounded |
||
122 | * - choiceMinOccurs: 0 |
||
123 | * @var \StructType\EwsAddItemToMyCalendarType|null |
||
124 | */ |
||
125 | protected ?\StructType\EwsAddItemToMyCalendarType $AddItemToMyCalendar = null; |
||
126 | /** |
||
127 | * The ProposeNewTime |
||
128 | * Meta information extracted from the WSDL |
||
129 | * - choice: AcceptItem | TentativelyAcceptItem | DeclineItem | ReplyToItem | ForwardItem | ReplyAllToItem | CancelCalendarItem | RemoveItem | SuppressReadReceipt | PostReplyItem | AcceptSharingInvitation | AddItemToMyCalendar | ProposeNewTime |
||
130 | * - choiceMaxOccurs: unbounded |
||
131 | * - choiceMinOccurs: 0 |
||
132 | * @var \StructType\EwsProposeNewTimeType|null |
||
133 | */ |
||
134 | protected ?\StructType\EwsProposeNewTimeType $ProposeNewTime = null; |
||
135 | /** |
||
136 | * Constructor method for NonEmptyArrayOfResponseObjectsType |
||
137 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setAcceptItem() |
||
138 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setTentativelyAcceptItem() |
||
139 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setDeclineItem() |
||
140 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setReplyToItem() |
||
141 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setForwardItem() |
||
142 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setReplyAllToItem() |
||
143 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setCancelCalendarItem() |
||
144 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setRemoveItem() |
||
145 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setSuppressReadReceipt() |
||
146 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setPostReplyItem() |
||
147 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setAcceptSharingInvitation() |
||
148 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setAddItemToMyCalendar() |
||
149 | * @uses EwsNonEmptyArrayOfResponseObjectsType::setProposeNewTime() |
||
150 | * @param \StructType\EwsAcceptItemType $acceptItem |
||
151 | * @param \StructType\EwsTentativelyAcceptItemType $tentativelyAcceptItem |
||
152 | * @param \StructType\EwsDeclineItemType $declineItem |
||
153 | * @param \StructType\EwsReplyToItemType $replyToItem |
||
154 | * @param \StructType\EwsForwardItemType $forwardItem |
||
155 | * @param \StructType\EwsReplyAllToItemType $replyAllToItem |
||
156 | * @param \StructType\EwsCancelCalendarItemType $cancelCalendarItem |
||
157 | * @param \StructType\EwsRemoveItemType $removeItem |
||
158 | * @param \StructType\EwsSuppressReadReceiptType $suppressReadReceipt |
||
159 | * @param \StructType\EwsPostReplyItemType $postReplyItem |
||
160 | * @param \StructType\EwsAcceptSharingInvitationType $acceptSharingInvitation |
||
161 | * @param \StructType\EwsAddItemToMyCalendarType $addItemToMyCalendar |
||
162 | * @param \StructType\EwsProposeNewTimeType $proposeNewTime |
||
163 | */ |
||
164 | public function __construct(?\StructType\EwsAcceptItemType $acceptItem = null, ?\StructType\EwsTentativelyAcceptItemType $tentativelyAcceptItem = null, ?\StructType\EwsDeclineItemType $declineItem = null, ?\StructType\EwsReplyToItemType $replyToItem = null, ?\StructType\EwsForwardItemType $forwardItem = null, ?\StructType\EwsReplyAllToItemType $replyAllToItem = null, ?\StructType\EwsCancelCalendarItemType $cancelCalendarItem = null, ?\StructType\EwsRemoveItemType $removeItem = null, ?\StructType\EwsSuppressReadReceiptType $suppressReadReceipt = null, ?\StructType\EwsPostReplyItemType $postReplyItem = null, ?\StructType\EwsAcceptSharingInvitationType $acceptSharingInvitation = null, ?\StructType\EwsAddItemToMyCalendarType $addItemToMyCalendar = null, ?\StructType\EwsProposeNewTimeType $proposeNewTime = null) |
||
165 | { |
||
166 | $this |
||
167 | ->setAcceptItem($acceptItem) |
||
168 | ->setTentativelyAcceptItem($tentativelyAcceptItem) |
||
169 | ->setDeclineItem($declineItem) |
||
170 | ->setReplyToItem($replyToItem) |
||
171 | ->setForwardItem($forwardItem) |
||
172 | ->setReplyAllToItem($replyAllToItem) |
||
173 | ->setCancelCalendarItem($cancelCalendarItem) |
||
174 | ->setRemoveItem($removeItem) |
||
175 | ->setSuppressReadReceipt($suppressReadReceipt) |
||
176 | ->setPostReplyItem($postReplyItem) |
||
177 | ->setAcceptSharingInvitation($acceptSharingInvitation) |
||
178 | ->setAddItemToMyCalendar($addItemToMyCalendar) |
||
179 | ->setProposeNewTime($proposeNewTime); |
||
180 | } |
||
181 | /** |
||
182 | * Get AcceptItem value |
||
183 | * @return \StructType\EwsAcceptItemType|null |
||
184 | */ |
||
185 | public function getAcceptItem(): ?\StructType\EwsAcceptItemType |
||
186 | { |
||
187 | return isset($this->AcceptItem) ? $this->AcceptItem : null; |
||
188 | } |
||
189 | /** |
||
190 | * This method is responsible for validating the value passed to the setAcceptItem method |
||
191 | * This method is willingly generated in order to preserve the one-line inline validation within the setAcceptItem method |
||
192 | * This has to validate that the property which is being set is the only one among the given choices |
||
193 | * @param mixed $value |
||
194 | * @return string A non-empty message if the values does not match the validation rules |
||
195 | */ |
||
196 | public function validateAcceptItemForChoiceConstraintsFromSetAcceptItem($value): string |
||
197 | { |
||
198 | $message = ''; |
||
199 | if (is_null($value)) { |
||
200 | return $message; |
||
201 | } |
||
202 | $properties = [ |
||
203 | 'TentativelyAcceptItem', |
||
204 | 'DeclineItem', |
||
205 | 'ReplyToItem', |
||
206 | 'ForwardItem', |
||
207 | 'ReplyAllToItem', |
||
208 | 'CancelCalendarItem', |
||
209 | 'RemoveItem', |
||
210 | 'SuppressReadReceipt', |
||
211 | 'PostReplyItem', |
||
212 | 'AcceptSharingInvitation', |
||
213 | 'AddItemToMyCalendar', |
||
214 | 'ProposeNewTime', |
||
215 | ]; |
||
216 | try { |
||
217 | foreach ($properties as $property) { |
||
218 | if (isset($this->{$property})) { |
||
219 | throw new InvalidArgumentException(sprintf('The property AcceptItem can\'t be set as the property %s is already set. Only one property must be set among these properties: AcceptItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
220 | } |
||
221 | } |
||
222 | } catch (InvalidArgumentException $e) { |
||
223 | $message = $e->getMessage(); |
||
224 | } |
||
225 | |||
226 | return $message; |
||
227 | } |
||
228 | /** |
||
229 | * Set AcceptItem value |
||
230 | * This property belongs to a choice that allows only one property to exist. It is |
||
231 | * therefore removable from the request, consequently if the value assigned to this |
||
232 | * property is null, the property is removed from this object |
||
233 | * @throws InvalidArgumentException |
||
234 | * @param \StructType\EwsAcceptItemType $acceptItem |
||
235 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
236 | */ |
||
237 | public function setAcceptItem(?\StructType\EwsAcceptItemType $acceptItem = null): self |
||
238 | { |
||
239 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
240 | if ('' !== ($acceptItemChoiceErrorMessage = self::validateAcceptItemForChoiceConstraintsFromSetAcceptItem($acceptItem))) { |
||
|
|||
241 | throw new InvalidArgumentException($acceptItemChoiceErrorMessage, __LINE__); |
||
242 | } |
||
243 | if (is_null($acceptItem) || (is_array($acceptItem) && empty($acceptItem))) { |
||
244 | unset($this->AcceptItem); |
||
245 | } else { |
||
246 | $this->AcceptItem = $acceptItem; |
||
247 | } |
||
248 | |||
249 | return $this; |
||
250 | } |
||
251 | /** |
||
252 | * Get TentativelyAcceptItem value |
||
253 | * @return \StructType\EwsTentativelyAcceptItemType|null |
||
254 | */ |
||
255 | public function getTentativelyAcceptItem(): ?\StructType\EwsTentativelyAcceptItemType |
||
256 | { |
||
257 | return isset($this->TentativelyAcceptItem) ? $this->TentativelyAcceptItem : null; |
||
258 | } |
||
259 | /** |
||
260 | * This method is responsible for validating the value passed to the setTentativelyAcceptItem method |
||
261 | * This method is willingly generated in order to preserve the one-line inline validation within the setTentativelyAcceptItem method |
||
262 | * This has to validate that the property which is being set is the only one among the given choices |
||
263 | * @param mixed $value |
||
264 | * @return string A non-empty message if the values does not match the validation rules |
||
265 | */ |
||
266 | public function validateTentativelyAcceptItemForChoiceConstraintsFromSetTentativelyAcceptItem($value): string |
||
267 | { |
||
268 | $message = ''; |
||
269 | if (is_null($value)) { |
||
270 | return $message; |
||
271 | } |
||
272 | $properties = [ |
||
273 | 'AcceptItem', |
||
274 | 'DeclineItem', |
||
275 | 'ReplyToItem', |
||
276 | 'ForwardItem', |
||
277 | 'ReplyAllToItem', |
||
278 | 'CancelCalendarItem', |
||
279 | 'RemoveItem', |
||
280 | 'SuppressReadReceipt', |
||
281 | 'PostReplyItem', |
||
282 | 'AcceptSharingInvitation', |
||
283 | 'AddItemToMyCalendar', |
||
284 | 'ProposeNewTime', |
||
285 | ]; |
||
286 | try { |
||
287 | foreach ($properties as $property) { |
||
288 | if (isset($this->{$property})) { |
||
289 | throw new InvalidArgumentException(sprintf('The property TentativelyAcceptItem can\'t be set as the property %s is already set. Only one property must be set among these properties: TentativelyAcceptItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
290 | } |
||
291 | } |
||
292 | } catch (InvalidArgumentException $e) { |
||
293 | $message = $e->getMessage(); |
||
294 | } |
||
295 | |||
296 | return $message; |
||
297 | } |
||
298 | /** |
||
299 | * Set TentativelyAcceptItem value |
||
300 | * This property belongs to a choice that allows only one property to exist. It is |
||
301 | * therefore removable from the request, consequently if the value assigned to this |
||
302 | * property is null, the property is removed from this object |
||
303 | * @throws InvalidArgumentException |
||
304 | * @param \StructType\EwsTentativelyAcceptItemType $tentativelyAcceptItem |
||
305 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
306 | */ |
||
307 | public function setTentativelyAcceptItem(?\StructType\EwsTentativelyAcceptItemType $tentativelyAcceptItem = null): self |
||
308 | { |
||
309 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
310 | if ('' !== ($tentativelyAcceptItemChoiceErrorMessage = self::validateTentativelyAcceptItemForChoiceConstraintsFromSetTentativelyAcceptItem($tentativelyAcceptItem))) { |
||
311 | throw new InvalidArgumentException($tentativelyAcceptItemChoiceErrorMessage, __LINE__); |
||
312 | } |
||
313 | if (is_null($tentativelyAcceptItem) || (is_array($tentativelyAcceptItem) && empty($tentativelyAcceptItem))) { |
||
314 | unset($this->TentativelyAcceptItem); |
||
315 | } else { |
||
316 | $this->TentativelyAcceptItem = $tentativelyAcceptItem; |
||
317 | } |
||
318 | |||
319 | return $this; |
||
320 | } |
||
321 | /** |
||
322 | * Get DeclineItem value |
||
323 | * @return \StructType\EwsDeclineItemType|null |
||
324 | */ |
||
325 | public function getDeclineItem(): ?\StructType\EwsDeclineItemType |
||
326 | { |
||
327 | return isset($this->DeclineItem) ? $this->DeclineItem : null; |
||
328 | } |
||
329 | /** |
||
330 | * This method is responsible for validating the value passed to the setDeclineItem method |
||
331 | * This method is willingly generated in order to preserve the one-line inline validation within the setDeclineItem method |
||
332 | * This has to validate that the property which is being set is the only one among the given choices |
||
333 | * @param mixed $value |
||
334 | * @return string A non-empty message if the values does not match the validation rules |
||
335 | */ |
||
336 | public function validateDeclineItemForChoiceConstraintsFromSetDeclineItem($value): string |
||
337 | { |
||
338 | $message = ''; |
||
339 | if (is_null($value)) { |
||
340 | return $message; |
||
341 | } |
||
342 | $properties = [ |
||
343 | 'AcceptItem', |
||
344 | 'TentativelyAcceptItem', |
||
345 | 'ReplyToItem', |
||
346 | 'ForwardItem', |
||
347 | 'ReplyAllToItem', |
||
348 | 'CancelCalendarItem', |
||
349 | 'RemoveItem', |
||
350 | 'SuppressReadReceipt', |
||
351 | 'PostReplyItem', |
||
352 | 'AcceptSharingInvitation', |
||
353 | 'AddItemToMyCalendar', |
||
354 | 'ProposeNewTime', |
||
355 | ]; |
||
356 | try { |
||
357 | foreach ($properties as $property) { |
||
358 | if (isset($this->{$property})) { |
||
359 | throw new InvalidArgumentException(sprintf('The property DeclineItem can\'t be set as the property %s is already set. Only one property must be set among these properties: DeclineItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
360 | } |
||
361 | } |
||
362 | } catch (InvalidArgumentException $e) { |
||
363 | $message = $e->getMessage(); |
||
364 | } |
||
365 | |||
366 | return $message; |
||
367 | } |
||
368 | /** |
||
369 | * Set DeclineItem value |
||
370 | * This property belongs to a choice that allows only one property to exist. It is |
||
371 | * therefore removable from the request, consequently if the value assigned to this |
||
372 | * property is null, the property is removed from this object |
||
373 | * @throws InvalidArgumentException |
||
374 | * @param \StructType\EwsDeclineItemType $declineItem |
||
375 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
376 | */ |
||
377 | public function setDeclineItem(?\StructType\EwsDeclineItemType $declineItem = null): self |
||
378 | { |
||
379 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
380 | if ('' !== ($declineItemChoiceErrorMessage = self::validateDeclineItemForChoiceConstraintsFromSetDeclineItem($declineItem))) { |
||
381 | throw new InvalidArgumentException($declineItemChoiceErrorMessage, __LINE__); |
||
382 | } |
||
383 | if (is_null($declineItem) || (is_array($declineItem) && empty($declineItem))) { |
||
384 | unset($this->DeclineItem); |
||
385 | } else { |
||
386 | $this->DeclineItem = $declineItem; |
||
387 | } |
||
388 | |||
389 | return $this; |
||
390 | } |
||
391 | /** |
||
392 | * Get ReplyToItem value |
||
393 | * @return \StructType\EwsReplyToItemType|null |
||
394 | */ |
||
395 | public function getReplyToItem(): ?\StructType\EwsReplyToItemType |
||
396 | { |
||
397 | return isset($this->ReplyToItem) ? $this->ReplyToItem : null; |
||
398 | } |
||
399 | /** |
||
400 | * This method is responsible for validating the value passed to the setReplyToItem method |
||
401 | * This method is willingly generated in order to preserve the one-line inline validation within the setReplyToItem method |
||
402 | * This has to validate that the property which is being set is the only one among the given choices |
||
403 | * @param mixed $value |
||
404 | * @return string A non-empty message if the values does not match the validation rules |
||
405 | */ |
||
406 | public function validateReplyToItemForChoiceConstraintsFromSetReplyToItem($value): string |
||
407 | { |
||
408 | $message = ''; |
||
409 | if (is_null($value)) { |
||
410 | return $message; |
||
411 | } |
||
412 | $properties = [ |
||
413 | 'AcceptItem', |
||
414 | 'TentativelyAcceptItem', |
||
415 | 'DeclineItem', |
||
416 | 'ForwardItem', |
||
417 | 'ReplyAllToItem', |
||
418 | 'CancelCalendarItem', |
||
419 | 'RemoveItem', |
||
420 | 'SuppressReadReceipt', |
||
421 | 'PostReplyItem', |
||
422 | 'AcceptSharingInvitation', |
||
423 | 'AddItemToMyCalendar', |
||
424 | 'ProposeNewTime', |
||
425 | ]; |
||
426 | try { |
||
427 | foreach ($properties as $property) { |
||
428 | if (isset($this->{$property})) { |
||
429 | throw new InvalidArgumentException(sprintf('The property ReplyToItem can\'t be set as the property %s is already set. Only one property must be set among these properties: ReplyToItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
430 | } |
||
431 | } |
||
432 | } catch (InvalidArgumentException $e) { |
||
433 | $message = $e->getMessage(); |
||
434 | } |
||
435 | |||
436 | return $message; |
||
437 | } |
||
438 | /** |
||
439 | * Set ReplyToItem value |
||
440 | * This property belongs to a choice that allows only one property to exist. It is |
||
441 | * therefore removable from the request, consequently if the value assigned to this |
||
442 | * property is null, the property is removed from this object |
||
443 | * @throws InvalidArgumentException |
||
444 | * @param \StructType\EwsReplyToItemType $replyToItem |
||
445 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
446 | */ |
||
447 | public function setReplyToItem(?\StructType\EwsReplyToItemType $replyToItem = null): self |
||
448 | { |
||
449 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
450 | if ('' !== ($replyToItemChoiceErrorMessage = self::validateReplyToItemForChoiceConstraintsFromSetReplyToItem($replyToItem))) { |
||
451 | throw new InvalidArgumentException($replyToItemChoiceErrorMessage, __LINE__); |
||
452 | } |
||
453 | if (is_null($replyToItem) || (is_array($replyToItem) && empty($replyToItem))) { |
||
454 | unset($this->ReplyToItem); |
||
455 | } else { |
||
456 | $this->ReplyToItem = $replyToItem; |
||
457 | } |
||
458 | |||
459 | return $this; |
||
460 | } |
||
461 | /** |
||
462 | * Get ForwardItem value |
||
463 | * @return \StructType\EwsForwardItemType|null |
||
464 | */ |
||
465 | public function getForwardItem(): ?\StructType\EwsForwardItemType |
||
466 | { |
||
467 | return isset($this->ForwardItem) ? $this->ForwardItem : null; |
||
468 | } |
||
469 | /** |
||
470 | * This method is responsible for validating the value passed to the setForwardItem method |
||
471 | * This method is willingly generated in order to preserve the one-line inline validation within the setForwardItem method |
||
472 | * This has to validate that the property which is being set is the only one among the given choices |
||
473 | * @param mixed $value |
||
474 | * @return string A non-empty message if the values does not match the validation rules |
||
475 | */ |
||
476 | public function validateForwardItemForChoiceConstraintsFromSetForwardItem($value): string |
||
477 | { |
||
478 | $message = ''; |
||
479 | if (is_null($value)) { |
||
480 | return $message; |
||
481 | } |
||
482 | $properties = [ |
||
483 | 'AcceptItem', |
||
484 | 'TentativelyAcceptItem', |
||
485 | 'DeclineItem', |
||
486 | 'ReplyToItem', |
||
487 | 'ReplyAllToItem', |
||
488 | 'CancelCalendarItem', |
||
489 | 'RemoveItem', |
||
490 | 'SuppressReadReceipt', |
||
491 | 'PostReplyItem', |
||
492 | 'AcceptSharingInvitation', |
||
493 | 'AddItemToMyCalendar', |
||
494 | 'ProposeNewTime', |
||
495 | ]; |
||
496 | try { |
||
497 | foreach ($properties as $property) { |
||
498 | if (isset($this->{$property})) { |
||
499 | throw new InvalidArgumentException(sprintf('The property ForwardItem can\'t be set as the property %s is already set. Only one property must be set among these properties: ForwardItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
500 | } |
||
501 | } |
||
502 | } catch (InvalidArgumentException $e) { |
||
503 | $message = $e->getMessage(); |
||
504 | } |
||
505 | |||
506 | return $message; |
||
507 | } |
||
508 | /** |
||
509 | * Set ForwardItem value |
||
510 | * This property belongs to a choice that allows only one property to exist. It is |
||
511 | * therefore removable from the request, consequently if the value assigned to this |
||
512 | * property is null, the property is removed from this object |
||
513 | * @throws InvalidArgumentException |
||
514 | * @param \StructType\EwsForwardItemType $forwardItem |
||
515 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
516 | */ |
||
517 | public function setForwardItem(?\StructType\EwsForwardItemType $forwardItem = null): self |
||
518 | { |
||
519 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
520 | if ('' !== ($forwardItemChoiceErrorMessage = self::validateForwardItemForChoiceConstraintsFromSetForwardItem($forwardItem))) { |
||
521 | throw new InvalidArgumentException($forwardItemChoiceErrorMessage, __LINE__); |
||
522 | } |
||
523 | if (is_null($forwardItem) || (is_array($forwardItem) && empty($forwardItem))) { |
||
524 | unset($this->ForwardItem); |
||
525 | } else { |
||
526 | $this->ForwardItem = $forwardItem; |
||
527 | } |
||
528 | |||
529 | return $this; |
||
530 | } |
||
531 | /** |
||
532 | * Get ReplyAllToItem value |
||
533 | * @return \StructType\EwsReplyAllToItemType|null |
||
534 | */ |
||
535 | public function getReplyAllToItem(): ?\StructType\EwsReplyAllToItemType |
||
536 | { |
||
537 | return isset($this->ReplyAllToItem) ? $this->ReplyAllToItem : null; |
||
538 | } |
||
539 | /** |
||
540 | * This method is responsible for validating the value passed to the setReplyAllToItem method |
||
541 | * This method is willingly generated in order to preserve the one-line inline validation within the setReplyAllToItem method |
||
542 | * This has to validate that the property which is being set is the only one among the given choices |
||
543 | * @param mixed $value |
||
544 | * @return string A non-empty message if the values does not match the validation rules |
||
545 | */ |
||
546 | public function validateReplyAllToItemForChoiceConstraintsFromSetReplyAllToItem($value): string |
||
547 | { |
||
548 | $message = ''; |
||
549 | if (is_null($value)) { |
||
550 | return $message; |
||
551 | } |
||
552 | $properties = [ |
||
553 | 'AcceptItem', |
||
554 | 'TentativelyAcceptItem', |
||
555 | 'DeclineItem', |
||
556 | 'ReplyToItem', |
||
557 | 'ForwardItem', |
||
558 | 'CancelCalendarItem', |
||
559 | 'RemoveItem', |
||
560 | 'SuppressReadReceipt', |
||
561 | 'PostReplyItem', |
||
562 | 'AcceptSharingInvitation', |
||
563 | 'AddItemToMyCalendar', |
||
564 | 'ProposeNewTime', |
||
565 | ]; |
||
566 | try { |
||
567 | foreach ($properties as $property) { |
||
568 | if (isset($this->{$property})) { |
||
569 | throw new InvalidArgumentException(sprintf('The property ReplyAllToItem can\'t be set as the property %s is already set. Only one property must be set among these properties: ReplyAllToItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
570 | } |
||
571 | } |
||
572 | } catch (InvalidArgumentException $e) { |
||
573 | $message = $e->getMessage(); |
||
574 | } |
||
575 | |||
576 | return $message; |
||
577 | } |
||
578 | /** |
||
579 | * Set ReplyAllToItem value |
||
580 | * This property belongs to a choice that allows only one property to exist. It is |
||
581 | * therefore removable from the request, consequently if the value assigned to this |
||
582 | * property is null, the property is removed from this object |
||
583 | * @throws InvalidArgumentException |
||
584 | * @param \StructType\EwsReplyAllToItemType $replyAllToItem |
||
585 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
586 | */ |
||
587 | public function setReplyAllToItem(?\StructType\EwsReplyAllToItemType $replyAllToItem = null): self |
||
588 | { |
||
589 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
590 | if ('' !== ($replyAllToItemChoiceErrorMessage = self::validateReplyAllToItemForChoiceConstraintsFromSetReplyAllToItem($replyAllToItem))) { |
||
591 | throw new InvalidArgumentException($replyAllToItemChoiceErrorMessage, __LINE__); |
||
592 | } |
||
593 | if (is_null($replyAllToItem) || (is_array($replyAllToItem) && empty($replyAllToItem))) { |
||
594 | unset($this->ReplyAllToItem); |
||
595 | } else { |
||
596 | $this->ReplyAllToItem = $replyAllToItem; |
||
597 | } |
||
598 | |||
599 | return $this; |
||
600 | } |
||
601 | /** |
||
602 | * Get CancelCalendarItem value |
||
603 | * @return \StructType\EwsCancelCalendarItemType|null |
||
604 | */ |
||
605 | public function getCancelCalendarItem(): ?\StructType\EwsCancelCalendarItemType |
||
606 | { |
||
607 | return isset($this->CancelCalendarItem) ? $this->CancelCalendarItem : null; |
||
608 | } |
||
609 | /** |
||
610 | * This method is responsible for validating the value passed to the setCancelCalendarItem method |
||
611 | * This method is willingly generated in order to preserve the one-line inline validation within the setCancelCalendarItem method |
||
612 | * This has to validate that the property which is being set is the only one among the given choices |
||
613 | * @param mixed $value |
||
614 | * @return string A non-empty message if the values does not match the validation rules |
||
615 | */ |
||
616 | public function validateCancelCalendarItemForChoiceConstraintsFromSetCancelCalendarItem($value): string |
||
617 | { |
||
618 | $message = ''; |
||
619 | if (is_null($value)) { |
||
620 | return $message; |
||
621 | } |
||
622 | $properties = [ |
||
623 | 'AcceptItem', |
||
624 | 'TentativelyAcceptItem', |
||
625 | 'DeclineItem', |
||
626 | 'ReplyToItem', |
||
627 | 'ForwardItem', |
||
628 | 'ReplyAllToItem', |
||
629 | 'RemoveItem', |
||
630 | 'SuppressReadReceipt', |
||
631 | 'PostReplyItem', |
||
632 | 'AcceptSharingInvitation', |
||
633 | 'AddItemToMyCalendar', |
||
634 | 'ProposeNewTime', |
||
635 | ]; |
||
636 | try { |
||
637 | foreach ($properties as $property) { |
||
638 | if (isset($this->{$property})) { |
||
639 | throw new InvalidArgumentException(sprintf('The property CancelCalendarItem can\'t be set as the property %s is already set. Only one property must be set among these properties: CancelCalendarItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
640 | } |
||
641 | } |
||
642 | } catch (InvalidArgumentException $e) { |
||
643 | $message = $e->getMessage(); |
||
644 | } |
||
645 | |||
646 | return $message; |
||
647 | } |
||
648 | /** |
||
649 | * Set CancelCalendarItem value |
||
650 | * This property belongs to a choice that allows only one property to exist. It is |
||
651 | * therefore removable from the request, consequently if the value assigned to this |
||
652 | * property is null, the property is removed from this object |
||
653 | * @throws InvalidArgumentException |
||
654 | * @param \StructType\EwsCancelCalendarItemType $cancelCalendarItem |
||
655 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
656 | */ |
||
657 | public function setCancelCalendarItem(?\StructType\EwsCancelCalendarItemType $cancelCalendarItem = null): self |
||
658 | { |
||
659 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
660 | if ('' !== ($cancelCalendarItemChoiceErrorMessage = self::validateCancelCalendarItemForChoiceConstraintsFromSetCancelCalendarItem($cancelCalendarItem))) { |
||
661 | throw new InvalidArgumentException($cancelCalendarItemChoiceErrorMessage, __LINE__); |
||
662 | } |
||
663 | if (is_null($cancelCalendarItem) || (is_array($cancelCalendarItem) && empty($cancelCalendarItem))) { |
||
664 | unset($this->CancelCalendarItem); |
||
665 | } else { |
||
666 | $this->CancelCalendarItem = $cancelCalendarItem; |
||
667 | } |
||
668 | |||
669 | return $this; |
||
670 | } |
||
671 | /** |
||
672 | * Get RemoveItem value |
||
673 | * @return \StructType\EwsRemoveItemType|null |
||
674 | */ |
||
675 | public function getRemoveItem(): ?\StructType\EwsRemoveItemType |
||
676 | { |
||
677 | return isset($this->RemoveItem) ? $this->RemoveItem : null; |
||
678 | } |
||
679 | /** |
||
680 | * This method is responsible for validating the value passed to the setRemoveItem method |
||
681 | * This method is willingly generated in order to preserve the one-line inline validation within the setRemoveItem method |
||
682 | * This has to validate that the property which is being set is the only one among the given choices |
||
683 | * @param mixed $value |
||
684 | * @return string A non-empty message if the values does not match the validation rules |
||
685 | */ |
||
686 | public function validateRemoveItemForChoiceConstraintsFromSetRemoveItem($value): string |
||
687 | { |
||
688 | $message = ''; |
||
689 | if (is_null($value)) { |
||
690 | return $message; |
||
691 | } |
||
692 | $properties = [ |
||
693 | 'AcceptItem', |
||
694 | 'TentativelyAcceptItem', |
||
695 | 'DeclineItem', |
||
696 | 'ReplyToItem', |
||
697 | 'ForwardItem', |
||
698 | 'ReplyAllToItem', |
||
699 | 'CancelCalendarItem', |
||
700 | 'SuppressReadReceipt', |
||
701 | 'PostReplyItem', |
||
702 | 'AcceptSharingInvitation', |
||
703 | 'AddItemToMyCalendar', |
||
704 | 'ProposeNewTime', |
||
705 | ]; |
||
706 | try { |
||
707 | foreach ($properties as $property) { |
||
708 | if (isset($this->{$property})) { |
||
709 | throw new InvalidArgumentException(sprintf('The property RemoveItem can\'t be set as the property %s is already set. Only one property must be set among these properties: RemoveItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
710 | } |
||
711 | } |
||
712 | } catch (InvalidArgumentException $e) { |
||
713 | $message = $e->getMessage(); |
||
714 | } |
||
715 | |||
716 | return $message; |
||
717 | } |
||
718 | /** |
||
719 | * Set RemoveItem value |
||
720 | * This property belongs to a choice that allows only one property to exist. It is |
||
721 | * therefore removable from the request, consequently if the value assigned to this |
||
722 | * property is null, the property is removed from this object |
||
723 | * @throws InvalidArgumentException |
||
724 | * @param \StructType\EwsRemoveItemType $removeItem |
||
725 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
726 | */ |
||
727 | public function setRemoveItem(?\StructType\EwsRemoveItemType $removeItem = null): self |
||
728 | { |
||
729 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
730 | if ('' !== ($removeItemChoiceErrorMessage = self::validateRemoveItemForChoiceConstraintsFromSetRemoveItem($removeItem))) { |
||
731 | throw new InvalidArgumentException($removeItemChoiceErrorMessage, __LINE__); |
||
732 | } |
||
733 | if (is_null($removeItem) || (is_array($removeItem) && empty($removeItem))) { |
||
734 | unset($this->RemoveItem); |
||
735 | } else { |
||
736 | $this->RemoveItem = $removeItem; |
||
737 | } |
||
738 | |||
739 | return $this; |
||
740 | } |
||
741 | /** |
||
742 | * Get SuppressReadReceipt value |
||
743 | * @return \StructType\EwsSuppressReadReceiptType|null |
||
744 | */ |
||
745 | public function getSuppressReadReceipt(): ?\StructType\EwsSuppressReadReceiptType |
||
746 | { |
||
747 | return isset($this->SuppressReadReceipt) ? $this->SuppressReadReceipt : null; |
||
748 | } |
||
749 | /** |
||
750 | * This method is responsible for validating the value passed to the setSuppressReadReceipt method |
||
751 | * This method is willingly generated in order to preserve the one-line inline validation within the setSuppressReadReceipt method |
||
752 | * This has to validate that the property which is being set is the only one among the given choices |
||
753 | * @param mixed $value |
||
754 | * @return string A non-empty message if the values does not match the validation rules |
||
755 | */ |
||
756 | public function validateSuppressReadReceiptForChoiceConstraintsFromSetSuppressReadReceipt($value): string |
||
757 | { |
||
758 | $message = ''; |
||
759 | if (is_null($value)) { |
||
760 | return $message; |
||
761 | } |
||
762 | $properties = [ |
||
763 | 'AcceptItem', |
||
764 | 'TentativelyAcceptItem', |
||
765 | 'DeclineItem', |
||
766 | 'ReplyToItem', |
||
767 | 'ForwardItem', |
||
768 | 'ReplyAllToItem', |
||
769 | 'CancelCalendarItem', |
||
770 | 'RemoveItem', |
||
771 | 'PostReplyItem', |
||
772 | 'AcceptSharingInvitation', |
||
773 | 'AddItemToMyCalendar', |
||
774 | 'ProposeNewTime', |
||
775 | ]; |
||
776 | try { |
||
777 | foreach ($properties as $property) { |
||
778 | if (isset($this->{$property})) { |
||
779 | throw new InvalidArgumentException(sprintf('The property SuppressReadReceipt can\'t be set as the property %s is already set. Only one property must be set among these properties: SuppressReadReceipt, %s.', $property, implode(', ', $properties)), __LINE__); |
||
780 | } |
||
781 | } |
||
782 | } catch (InvalidArgumentException $e) { |
||
783 | $message = $e->getMessage(); |
||
784 | } |
||
785 | |||
786 | return $message; |
||
787 | } |
||
788 | /** |
||
789 | * Set SuppressReadReceipt value |
||
790 | * This property belongs to a choice that allows only one property to exist. It is |
||
791 | * therefore removable from the request, consequently if the value assigned to this |
||
792 | * property is null, the property is removed from this object |
||
793 | * @throws InvalidArgumentException |
||
794 | * @param \StructType\EwsSuppressReadReceiptType $suppressReadReceipt |
||
795 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
796 | */ |
||
797 | public function setSuppressReadReceipt(?\StructType\EwsSuppressReadReceiptType $suppressReadReceipt = null): self |
||
798 | { |
||
799 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
800 | if ('' !== ($suppressReadReceiptChoiceErrorMessage = self::validateSuppressReadReceiptForChoiceConstraintsFromSetSuppressReadReceipt($suppressReadReceipt))) { |
||
801 | throw new InvalidArgumentException($suppressReadReceiptChoiceErrorMessage, __LINE__); |
||
802 | } |
||
803 | if (is_null($suppressReadReceipt) || (is_array($suppressReadReceipt) && empty($suppressReadReceipt))) { |
||
804 | unset($this->SuppressReadReceipt); |
||
805 | } else { |
||
806 | $this->SuppressReadReceipt = $suppressReadReceipt; |
||
807 | } |
||
808 | |||
809 | return $this; |
||
810 | } |
||
811 | /** |
||
812 | * Get PostReplyItem value |
||
813 | * @return \StructType\EwsPostReplyItemType|null |
||
814 | */ |
||
815 | public function getPostReplyItem(): ?\StructType\EwsPostReplyItemType |
||
816 | { |
||
817 | return isset($this->PostReplyItem) ? $this->PostReplyItem : null; |
||
818 | } |
||
819 | /** |
||
820 | * This method is responsible for validating the value passed to the setPostReplyItem method |
||
821 | * This method is willingly generated in order to preserve the one-line inline validation within the setPostReplyItem method |
||
822 | * This has to validate that the property which is being set is the only one among the given choices |
||
823 | * @param mixed $value |
||
824 | * @return string A non-empty message if the values does not match the validation rules |
||
825 | */ |
||
826 | public function validatePostReplyItemForChoiceConstraintsFromSetPostReplyItem($value): string |
||
827 | { |
||
828 | $message = ''; |
||
829 | if (is_null($value)) { |
||
830 | return $message; |
||
831 | } |
||
832 | $properties = [ |
||
833 | 'AcceptItem', |
||
834 | 'TentativelyAcceptItem', |
||
835 | 'DeclineItem', |
||
836 | 'ReplyToItem', |
||
837 | 'ForwardItem', |
||
838 | 'ReplyAllToItem', |
||
839 | 'CancelCalendarItem', |
||
840 | 'RemoveItem', |
||
841 | 'SuppressReadReceipt', |
||
842 | 'AcceptSharingInvitation', |
||
843 | 'AddItemToMyCalendar', |
||
844 | 'ProposeNewTime', |
||
845 | ]; |
||
846 | try { |
||
847 | foreach ($properties as $property) { |
||
848 | if (isset($this->{$property})) { |
||
849 | throw new InvalidArgumentException(sprintf('The property PostReplyItem can\'t be set as the property %s is already set. Only one property must be set among these properties: PostReplyItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
850 | } |
||
851 | } |
||
852 | } catch (InvalidArgumentException $e) { |
||
853 | $message = $e->getMessage(); |
||
854 | } |
||
855 | |||
856 | return $message; |
||
857 | } |
||
858 | /** |
||
859 | * Set PostReplyItem value |
||
860 | * This property belongs to a choice that allows only one property to exist. It is |
||
861 | * therefore removable from the request, consequently if the value assigned to this |
||
862 | * property is null, the property is removed from this object |
||
863 | * @throws InvalidArgumentException |
||
864 | * @param \StructType\EwsPostReplyItemType $postReplyItem |
||
865 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
866 | */ |
||
867 | public function setPostReplyItem(?\StructType\EwsPostReplyItemType $postReplyItem = null): self |
||
868 | { |
||
869 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
870 | if ('' !== ($postReplyItemChoiceErrorMessage = self::validatePostReplyItemForChoiceConstraintsFromSetPostReplyItem($postReplyItem))) { |
||
871 | throw new InvalidArgumentException($postReplyItemChoiceErrorMessage, __LINE__); |
||
872 | } |
||
873 | if (is_null($postReplyItem) || (is_array($postReplyItem) && empty($postReplyItem))) { |
||
874 | unset($this->PostReplyItem); |
||
875 | } else { |
||
876 | $this->PostReplyItem = $postReplyItem; |
||
877 | } |
||
878 | |||
879 | return $this; |
||
880 | } |
||
881 | /** |
||
882 | * Get AcceptSharingInvitation value |
||
883 | * @return \StructType\EwsAcceptSharingInvitationType|null |
||
884 | */ |
||
885 | public function getAcceptSharingInvitation(): ?\StructType\EwsAcceptSharingInvitationType |
||
886 | { |
||
887 | return isset($this->AcceptSharingInvitation) ? $this->AcceptSharingInvitation : null; |
||
888 | } |
||
889 | /** |
||
890 | * This method is responsible for validating the value passed to the setAcceptSharingInvitation method |
||
891 | * This method is willingly generated in order to preserve the one-line inline validation within the setAcceptSharingInvitation method |
||
892 | * This has to validate that the property which is being set is the only one among the given choices |
||
893 | * @param mixed $value |
||
894 | * @return string A non-empty message if the values does not match the validation rules |
||
895 | */ |
||
896 | public function validateAcceptSharingInvitationForChoiceConstraintsFromSetAcceptSharingInvitation($value): string |
||
927 | } |
||
928 | /** |
||
929 | * Set AcceptSharingInvitation value |
||
930 | * This property belongs to a choice that allows only one property to exist. It is |
||
931 | * therefore removable from the request, consequently if the value assigned to this |
||
932 | * property is null, the property is removed from this object |
||
933 | * @throws InvalidArgumentException |
||
934 | * @param \StructType\EwsAcceptSharingInvitationType $acceptSharingInvitation |
||
935 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
936 | */ |
||
937 | public function setAcceptSharingInvitation(?\StructType\EwsAcceptSharingInvitationType $acceptSharingInvitation = null): self |
||
938 | { |
||
939 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
940 | if ('' !== ($acceptSharingInvitationChoiceErrorMessage = self::validateAcceptSharingInvitationForChoiceConstraintsFromSetAcceptSharingInvitation($acceptSharingInvitation))) { |
||
941 | throw new InvalidArgumentException($acceptSharingInvitationChoiceErrorMessage, __LINE__); |
||
942 | } |
||
943 | if (is_null($acceptSharingInvitation) || (is_array($acceptSharingInvitation) && empty($acceptSharingInvitation))) { |
||
944 | unset($this->AcceptSharingInvitation); |
||
945 | } else { |
||
946 | $this->AcceptSharingInvitation = $acceptSharingInvitation; |
||
947 | } |
||
948 | |||
949 | return $this; |
||
950 | } |
||
951 | /** |
||
952 | * Get AddItemToMyCalendar value |
||
953 | * @return \StructType\EwsAddItemToMyCalendarType|null |
||
954 | */ |
||
955 | public function getAddItemToMyCalendar(): ?\StructType\EwsAddItemToMyCalendarType |
||
958 | } |
||
959 | /** |
||
960 | * This method is responsible for validating the value passed to the setAddItemToMyCalendar method |
||
961 | * This method is willingly generated in order to preserve the one-line inline validation within the setAddItemToMyCalendar method |
||
962 | * This has to validate that the property which is being set is the only one among the given choices |
||
963 | * @param mixed $value |
||
964 | * @return string A non-empty message if the values does not match the validation rules |
||
965 | */ |
||
966 | public function validateAddItemToMyCalendarForChoiceConstraintsFromSetAddItemToMyCalendar($value): string |
||
967 | { |
||
968 | $message = ''; |
||
969 | if (is_null($value)) { |
||
970 | return $message; |
||
971 | } |
||
972 | $properties = [ |
||
973 | 'AcceptItem', |
||
974 | 'TentativelyAcceptItem', |
||
975 | 'DeclineItem', |
||
976 | 'ReplyToItem', |
||
977 | 'ForwardItem', |
||
978 | 'ReplyAllToItem', |
||
979 | 'CancelCalendarItem', |
||
980 | 'RemoveItem', |
||
981 | 'SuppressReadReceipt', |
||
982 | 'PostReplyItem', |
||
983 | 'AcceptSharingInvitation', |
||
984 | 'ProposeNewTime', |
||
985 | ]; |
||
986 | try { |
||
987 | foreach ($properties as $property) { |
||
988 | if (isset($this->{$property})) { |
||
989 | throw new InvalidArgumentException(sprintf('The property AddItemToMyCalendar can\'t be set as the property %s is already set. Only one property must be set among these properties: AddItemToMyCalendar, %s.', $property, implode(', ', $properties)), __LINE__); |
||
990 | } |
||
991 | } |
||
992 | } catch (InvalidArgumentException $e) { |
||
993 | $message = $e->getMessage(); |
||
994 | } |
||
995 | |||
996 | return $message; |
||
997 | } |
||
998 | /** |
||
999 | * Set AddItemToMyCalendar value |
||
1000 | * This property belongs to a choice that allows only one property to exist. It is |
||
1001 | * therefore removable from the request, consequently if the value assigned to this |
||
1002 | * property is null, the property is removed from this object |
||
1003 | * @throws InvalidArgumentException |
||
1004 | * @param \StructType\EwsAddItemToMyCalendarType $addItemToMyCalendar |
||
1005 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
1006 | */ |
||
1007 | public function setAddItemToMyCalendar(?\StructType\EwsAddItemToMyCalendarType $addItemToMyCalendar = null): self |
||
1008 | { |
||
1009 | // validation for constraint: choice(AcceptItem, TentativelyAcceptItem, DeclineItem, ReplyToItem, ForwardItem, ReplyAllToItem, CancelCalendarItem, RemoveItem, SuppressReadReceipt, PostReplyItem, AcceptSharingInvitation, AddItemToMyCalendar, ProposeNewTime) |
||
1010 | if ('' !== ($addItemToMyCalendarChoiceErrorMessage = self::validateAddItemToMyCalendarForChoiceConstraintsFromSetAddItemToMyCalendar($addItemToMyCalendar))) { |
||
1011 | throw new InvalidArgumentException($addItemToMyCalendarChoiceErrorMessage, __LINE__); |
||
1012 | } |
||
1013 | if (is_null($addItemToMyCalendar) || (is_array($addItemToMyCalendar) && empty($addItemToMyCalendar))) { |
||
1014 | unset($this->AddItemToMyCalendar); |
||
1015 | } else { |
||
1016 | $this->AddItemToMyCalendar = $addItemToMyCalendar; |
||
1017 | } |
||
1018 | |||
1019 | return $this; |
||
1020 | } |
||
1021 | /** |
||
1022 | * Get ProposeNewTime value |
||
1023 | * @return \StructType\EwsProposeNewTimeType|null |
||
1024 | */ |
||
1025 | public function getProposeNewTime(): ?\StructType\EwsProposeNewTimeType |
||
1026 | { |
||
1027 | return isset($this->ProposeNewTime) ? $this->ProposeNewTime : null; |
||
1028 | } |
||
1029 | /** |
||
1030 | * This method is responsible for validating the value passed to the setProposeNewTime method |
||
1031 | * This method is willingly generated in order to preserve the one-line inline validation within the setProposeNewTime method |
||
1032 | * This has to validate that the property which is being set is the only one among the given choices |
||
1033 | * @param mixed $value |
||
1034 | * @return string A non-empty message if the values does not match the validation rules |
||
1035 | */ |
||
1036 | public function validateProposeNewTimeForChoiceConstraintsFromSetProposeNewTime($value): string |
||
1037 | { |
||
1038 | $message = ''; |
||
1039 | if (is_null($value)) { |
||
1040 | return $message; |
||
1041 | } |
||
1042 | $properties = [ |
||
1043 | 'AcceptItem', |
||
1044 | 'TentativelyAcceptItem', |
||
1045 | 'DeclineItem', |
||
1046 | 'ReplyToItem', |
||
1047 | 'ForwardItem', |
||
1048 | 'ReplyAllToItem', |
||
1049 | 'CancelCalendarItem', |
||
1050 | 'RemoveItem', |
||
1051 | 'SuppressReadReceipt', |
||
1052 | 'PostReplyItem', |
||
1053 | 'AcceptSharingInvitation', |
||
1054 | 'AddItemToMyCalendar', |
||
1055 | ]; |
||
1056 | try { |
||
1057 | foreach ($properties as $property) { |
||
1058 | if (isset($this->{$property})) { |
||
1059 | throw new InvalidArgumentException(sprintf('The property ProposeNewTime can\'t be set as the property %s is already set. Only one property must be set among these properties: ProposeNewTime, %s.', $property, implode(', ', $properties)), __LINE__); |
||
1060 | } |
||
1061 | } |
||
1062 | } catch (InvalidArgumentException $e) { |
||
1063 | $message = $e->getMessage(); |
||
1064 | } |
||
1065 | |||
1066 | return $message; |
||
1067 | } |
||
1068 | /** |
||
1069 | * Set ProposeNewTime value |
||
1070 | * This property belongs to a choice that allows only one property to exist. It is |
||
1071 | * therefore removable from the request, consequently if the value assigned to this |
||
1072 | * property is null, the property is removed from this object |
||
1073 | * @throws InvalidArgumentException |
||
1074 | * @param \StructType\EwsProposeNewTimeType $proposeNewTime |
||
1075 | * @return \StructType\EwsNonEmptyArrayOfResponseObjectsType |
||
1076 | */ |
||
1077 | public function setProposeNewTime(?\StructType\EwsProposeNewTimeType $proposeNewTime = null): self |
||
1090 | } |
||
1091 | } |
||
1092 |