Total Complexity | 181 |
Total Lines | 1268 |
Duplicated Lines | 0 % |
Changes | 0 |
Complex classes like EwsSyncFolderItemsCreateOrUpdateType 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 EwsSyncFolderItemsCreateOrUpdateType, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
16 | class EwsSyncFolderItemsCreateOrUpdateType extends AbstractStructBase |
||
17 | { |
||
18 | /** |
||
19 | * The Item |
||
20 | * Meta information extracted from the WSDL |
||
21 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
22 | * - choiceMaxOccurs: 1 |
||
23 | * - choiceMinOccurs: 1 |
||
24 | * @var \StructType\EwsItemType|null |
||
25 | */ |
||
26 | protected ?\StructType\EwsItemType $Item = null; |
||
27 | /** |
||
28 | * The Message |
||
29 | * Meta information extracted from the WSDL |
||
30 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
31 | * - choiceMaxOccurs: 1 |
||
32 | * - choiceMinOccurs: 1 |
||
33 | * @var \StructType\EwsMessageType|null |
||
34 | */ |
||
35 | protected ?\StructType\EwsMessageType $Message = null; |
||
36 | /** |
||
37 | * The CalendarItem |
||
38 | * Meta information extracted from the WSDL |
||
39 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
40 | * - choiceMaxOccurs: 1 |
||
41 | * - choiceMinOccurs: 1 |
||
42 | * @var \StructType\EwsCalendarItemType|null |
||
43 | */ |
||
44 | protected ?\StructType\EwsCalendarItemType $CalendarItem = null; |
||
45 | /** |
||
46 | * The Contact |
||
47 | * Meta information extracted from the WSDL |
||
48 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
49 | * - choiceMaxOccurs: 1 |
||
50 | * - choiceMinOccurs: 1 |
||
51 | * @var \StructType\EwsContactItemType|null |
||
52 | */ |
||
53 | protected ?\StructType\EwsContactItemType $Contact = null; |
||
54 | /** |
||
55 | * The DistributionList |
||
56 | * Meta information extracted from the WSDL |
||
57 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
58 | * - choiceMaxOccurs: 1 |
||
59 | * - choiceMinOccurs: 1 |
||
60 | * @var \StructType\EwsDistributionListType|null |
||
61 | */ |
||
62 | protected ?\StructType\EwsDistributionListType $DistributionList = null; |
||
63 | /** |
||
64 | * The MeetingMessage |
||
65 | * Meta information extracted from the WSDL |
||
66 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
67 | * - choiceMaxOccurs: 1 |
||
68 | * - choiceMinOccurs: 1 |
||
69 | * @var \StructType\EwsMeetingMessageType|null |
||
70 | */ |
||
71 | protected ?\StructType\EwsMeetingMessageType $MeetingMessage = null; |
||
72 | /** |
||
73 | * The MeetingRequest |
||
74 | * Meta information extracted from the WSDL |
||
75 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
76 | * - choiceMaxOccurs: 1 |
||
77 | * - choiceMinOccurs: 1 |
||
78 | * @var \StructType\EwsMeetingRequestMessageType|null |
||
79 | */ |
||
80 | protected ?\StructType\EwsMeetingRequestMessageType $MeetingRequest = null; |
||
81 | /** |
||
82 | * The MeetingResponse |
||
83 | * Meta information extracted from the WSDL |
||
84 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
85 | * - choiceMaxOccurs: 1 |
||
86 | * - choiceMinOccurs: 1 |
||
87 | * @var \StructType\EwsMeetingResponseMessageType|null |
||
88 | */ |
||
89 | protected ?\StructType\EwsMeetingResponseMessageType $MeetingResponse = null; |
||
90 | /** |
||
91 | * The MeetingCancellation |
||
92 | * Meta information extracted from the WSDL |
||
93 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
94 | * - choiceMaxOccurs: 1 |
||
95 | * - choiceMinOccurs: 1 |
||
96 | * @var \StructType\EwsMeetingCancellationMessageType|null |
||
97 | */ |
||
98 | protected ?\StructType\EwsMeetingCancellationMessageType $MeetingCancellation = null; |
||
99 | /** |
||
100 | * The Task |
||
101 | * Meta information extracted from the WSDL |
||
102 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
103 | * - choiceMaxOccurs: 1 |
||
104 | * - choiceMinOccurs: 1 |
||
105 | * @var \StructType\EwsTaskType|null |
||
106 | */ |
||
107 | protected ?\StructType\EwsTaskType $Task = null; |
||
108 | /** |
||
109 | * The PostItem |
||
110 | * Meta information extracted from the WSDL |
||
111 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
112 | * - choiceMaxOccurs: 1 |
||
113 | * - choiceMinOccurs: 1 |
||
114 | * @var \StructType\EwsPostItemType|null |
||
115 | */ |
||
116 | protected ?\StructType\EwsPostItemType $PostItem = null; |
||
117 | /** |
||
118 | * The RoleMember |
||
119 | * Meta information extracted from the WSDL |
||
120 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
121 | * - choiceMaxOccurs: 1 |
||
122 | * - choiceMinOccurs: 1 |
||
123 | * @var \StructType\EwsRoleMemberItemType|null |
||
124 | */ |
||
125 | protected ?\StructType\EwsRoleMemberItemType $RoleMember = null; |
||
126 | /** |
||
127 | * The Network |
||
128 | * Meta information extracted from the WSDL |
||
129 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
130 | * - choiceMaxOccurs: 1 |
||
131 | * - choiceMinOccurs: 1 |
||
132 | * @var \StructType\EwsNetworkItemType|null |
||
133 | */ |
||
134 | protected ?\StructType\EwsNetworkItemType $Network = null; |
||
135 | /** |
||
136 | * The Person |
||
137 | * Meta information extracted from the WSDL |
||
138 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
139 | * - choiceMaxOccurs: 1 |
||
140 | * - choiceMinOccurs: 1 |
||
141 | * @var \StructType\EwsAbchPersonItemType|null |
||
142 | */ |
||
143 | protected ?\StructType\EwsAbchPersonItemType $Person = null; |
||
144 | /** |
||
145 | * The Booking |
||
146 | * Meta information extracted from the WSDL |
||
147 | * - choice: Item | Message | CalendarItem | Contact | DistributionList | MeetingMessage | MeetingRequest | MeetingResponse | MeetingCancellation | Task | PostItem | RoleMember | Network | Person | Booking |
||
148 | * - choiceMaxOccurs: 1 |
||
149 | * - choiceMinOccurs: 1 |
||
150 | * @var \StructType\EwsBookingItemType|null |
||
151 | */ |
||
152 | protected ?\StructType\EwsBookingItemType $Booking = null; |
||
153 | /** |
||
154 | * Constructor method for SyncFolderItemsCreateOrUpdateType |
||
155 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setItem() |
||
156 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setMessage() |
||
157 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setCalendarItem() |
||
158 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setContact() |
||
159 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setDistributionList() |
||
160 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setMeetingMessage() |
||
161 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setMeetingRequest() |
||
162 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setMeetingResponse() |
||
163 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setMeetingCancellation() |
||
164 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setTask() |
||
165 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setPostItem() |
||
166 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setRoleMember() |
||
167 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setNetwork() |
||
168 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setPerson() |
||
169 | * @uses EwsSyncFolderItemsCreateOrUpdateType::setBooking() |
||
170 | * @param \StructType\EwsItemType $item |
||
171 | * @param \StructType\EwsMessageType $message |
||
172 | * @param \StructType\EwsCalendarItemType $calendarItem |
||
173 | * @param \StructType\EwsContactItemType $contact |
||
174 | * @param \StructType\EwsDistributionListType $distributionList |
||
175 | * @param \StructType\EwsMeetingMessageType $meetingMessage |
||
176 | * @param \StructType\EwsMeetingRequestMessageType $meetingRequest |
||
177 | * @param \StructType\EwsMeetingResponseMessageType $meetingResponse |
||
178 | * @param \StructType\EwsMeetingCancellationMessageType $meetingCancellation |
||
179 | * @param \StructType\EwsTaskType $task |
||
180 | * @param \StructType\EwsPostItemType $postItem |
||
181 | * @param \StructType\EwsRoleMemberItemType $roleMember |
||
182 | * @param \StructType\EwsNetworkItemType $network |
||
183 | * @param \StructType\EwsAbchPersonItemType $person |
||
184 | * @param \StructType\EwsBookingItemType $booking |
||
185 | */ |
||
186 | public function __construct(?\StructType\EwsItemType $item = null, ?\StructType\EwsMessageType $message = null, ?\StructType\EwsCalendarItemType $calendarItem = null, ?\StructType\EwsContactItemType $contact = null, ?\StructType\EwsDistributionListType $distributionList = null, ?\StructType\EwsMeetingMessageType $meetingMessage = null, ?\StructType\EwsMeetingRequestMessageType $meetingRequest = null, ?\StructType\EwsMeetingResponseMessageType $meetingResponse = null, ?\StructType\EwsMeetingCancellationMessageType $meetingCancellation = null, ?\StructType\EwsTaskType $task = null, ?\StructType\EwsPostItemType $postItem = null, ?\StructType\EwsRoleMemberItemType $roleMember = null, ?\StructType\EwsNetworkItemType $network = null, ?\StructType\EwsAbchPersonItemType $person = null, ?\StructType\EwsBookingItemType $booking = null) |
||
187 | { |
||
188 | $this |
||
189 | ->setItem($item) |
||
190 | ->setMessage($message) |
||
191 | ->setCalendarItem($calendarItem) |
||
192 | ->setContact($contact) |
||
193 | ->setDistributionList($distributionList) |
||
194 | ->setMeetingMessage($meetingMessage) |
||
195 | ->setMeetingRequest($meetingRequest) |
||
196 | ->setMeetingResponse($meetingResponse) |
||
197 | ->setMeetingCancellation($meetingCancellation) |
||
198 | ->setTask($task) |
||
199 | ->setPostItem($postItem) |
||
200 | ->setRoleMember($roleMember) |
||
201 | ->setNetwork($network) |
||
202 | ->setPerson($person) |
||
203 | ->setBooking($booking); |
||
204 | } |
||
205 | /** |
||
206 | * Get Item value |
||
207 | * @return \StructType\EwsItemType|null |
||
208 | */ |
||
209 | public function getItem(): ?\StructType\EwsItemType |
||
210 | { |
||
211 | return isset($this->Item) ? $this->Item : null; |
||
212 | } |
||
213 | /** |
||
214 | * This method is responsible for validating the value passed to the setItem method |
||
215 | * This method is willingly generated in order to preserve the one-line inline validation within the setItem method |
||
216 | * This has to validate that the property which is being set is the only one among the given choices |
||
217 | * @param mixed $value |
||
218 | * @return string A non-empty message if the values does not match the validation rules |
||
219 | */ |
||
220 | public function validateItemForChoiceConstraintsFromSetItem($value): string |
||
221 | { |
||
222 | $message = ''; |
||
223 | if (is_null($value)) { |
||
224 | return $message; |
||
225 | } |
||
226 | $properties = [ |
||
227 | 'Message', |
||
228 | 'CalendarItem', |
||
229 | 'Contact', |
||
230 | 'DistributionList', |
||
231 | 'MeetingMessage', |
||
232 | 'MeetingRequest', |
||
233 | 'MeetingResponse', |
||
234 | 'MeetingCancellation', |
||
235 | 'Task', |
||
236 | 'PostItem', |
||
237 | 'RoleMember', |
||
238 | 'Network', |
||
239 | 'Person', |
||
240 | 'Booking', |
||
241 | ]; |
||
242 | try { |
||
243 | foreach ($properties as $property) { |
||
244 | if (isset($this->{$property})) { |
||
245 | throw new InvalidArgumentException(sprintf('The property Item can\'t be set as the property %s is already set. Only one property must be set among these properties: Item, %s.', $property, implode(', ', $properties)), __LINE__); |
||
246 | } |
||
247 | } |
||
248 | } catch (InvalidArgumentException $e) { |
||
249 | $message = $e->getMessage(); |
||
250 | } |
||
251 | |||
252 | return $message; |
||
253 | } |
||
254 | /** |
||
255 | * Set Item value |
||
256 | * This property belongs to a choice that allows only one property to exist. It is |
||
257 | * therefore removable from the request, consequently if the value assigned to this |
||
258 | * property is null, the property is removed from this object |
||
259 | * @throws InvalidArgumentException |
||
260 | * @param \StructType\EwsItemType $item |
||
261 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
262 | */ |
||
263 | public function setItem(?\StructType\EwsItemType $item = null): self |
||
264 | { |
||
265 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
266 | if ('' !== ($itemChoiceErrorMessage = self::validateItemForChoiceConstraintsFromSetItem($item))) { |
||
|
|||
267 | throw new InvalidArgumentException($itemChoiceErrorMessage, __LINE__); |
||
268 | } |
||
269 | if (is_null($item) || (is_array($item) && empty($item))) { |
||
270 | unset($this->Item); |
||
271 | } else { |
||
272 | $this->Item = $item; |
||
273 | } |
||
274 | |||
275 | return $this; |
||
276 | } |
||
277 | /** |
||
278 | * Get Message value |
||
279 | * @return \StructType\EwsMessageType|null |
||
280 | */ |
||
281 | public function getMessage(): ?\StructType\EwsMessageType |
||
282 | { |
||
283 | return isset($this->Message) ? $this->Message : null; |
||
284 | } |
||
285 | /** |
||
286 | * This method is responsible for validating the value passed to the setMessage method |
||
287 | * This method is willingly generated in order to preserve the one-line inline validation within the setMessage method |
||
288 | * This has to validate that the property which is being set is the only one among the given choices |
||
289 | * @param mixed $value |
||
290 | * @return string A non-empty message if the values does not match the validation rules |
||
291 | */ |
||
292 | public function validateMessageForChoiceConstraintsFromSetMessage($value): string |
||
293 | { |
||
294 | $message = ''; |
||
295 | if (is_null($value)) { |
||
296 | return $message; |
||
297 | } |
||
298 | $properties = [ |
||
299 | 'Item', |
||
300 | 'CalendarItem', |
||
301 | 'Contact', |
||
302 | 'DistributionList', |
||
303 | 'MeetingMessage', |
||
304 | 'MeetingRequest', |
||
305 | 'MeetingResponse', |
||
306 | 'MeetingCancellation', |
||
307 | 'Task', |
||
308 | 'PostItem', |
||
309 | 'RoleMember', |
||
310 | 'Network', |
||
311 | 'Person', |
||
312 | 'Booking', |
||
313 | ]; |
||
314 | try { |
||
315 | foreach ($properties as $property) { |
||
316 | if (isset($this->{$property})) { |
||
317 | throw new InvalidArgumentException(sprintf('The property Message can\'t be set as the property %s is already set. Only one property must be set among these properties: Message, %s.', $property, implode(', ', $properties)), __LINE__); |
||
318 | } |
||
319 | } |
||
320 | } catch (InvalidArgumentException $e) { |
||
321 | $message = $e->getMessage(); |
||
322 | } |
||
323 | |||
324 | return $message; |
||
325 | } |
||
326 | /** |
||
327 | * Set Message value |
||
328 | * This property belongs to a choice that allows only one property to exist. It is |
||
329 | * therefore removable from the request, consequently if the value assigned to this |
||
330 | * property is null, the property is removed from this object |
||
331 | * @throws InvalidArgumentException |
||
332 | * @param \StructType\EwsMessageType $message |
||
333 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
334 | */ |
||
335 | public function setMessage(?\StructType\EwsMessageType $message = null): self |
||
336 | { |
||
337 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
338 | if ('' !== ($messageChoiceErrorMessage = self::validateMessageForChoiceConstraintsFromSetMessage($message))) { |
||
339 | throw new InvalidArgumentException($messageChoiceErrorMessage, __LINE__); |
||
340 | } |
||
341 | if (is_null($message) || (is_array($message) && empty($message))) { |
||
342 | unset($this->Message); |
||
343 | } else { |
||
344 | $this->Message = $message; |
||
345 | } |
||
346 | |||
347 | return $this; |
||
348 | } |
||
349 | /** |
||
350 | * Get CalendarItem value |
||
351 | * @return \StructType\EwsCalendarItemType|null |
||
352 | */ |
||
353 | public function getCalendarItem(): ?\StructType\EwsCalendarItemType |
||
354 | { |
||
355 | return isset($this->CalendarItem) ? $this->CalendarItem : null; |
||
356 | } |
||
357 | /** |
||
358 | * This method is responsible for validating the value passed to the setCalendarItem method |
||
359 | * This method is willingly generated in order to preserve the one-line inline validation within the setCalendarItem method |
||
360 | * This has to validate that the property which is being set is the only one among the given choices |
||
361 | * @param mixed $value |
||
362 | * @return string A non-empty message if the values does not match the validation rules |
||
363 | */ |
||
364 | public function validateCalendarItemForChoiceConstraintsFromSetCalendarItem($value): string |
||
365 | { |
||
366 | $message = ''; |
||
367 | if (is_null($value)) { |
||
368 | return $message; |
||
369 | } |
||
370 | $properties = [ |
||
371 | 'Item', |
||
372 | 'Message', |
||
373 | 'Contact', |
||
374 | 'DistributionList', |
||
375 | 'MeetingMessage', |
||
376 | 'MeetingRequest', |
||
377 | 'MeetingResponse', |
||
378 | 'MeetingCancellation', |
||
379 | 'Task', |
||
380 | 'PostItem', |
||
381 | 'RoleMember', |
||
382 | 'Network', |
||
383 | 'Person', |
||
384 | 'Booking', |
||
385 | ]; |
||
386 | try { |
||
387 | foreach ($properties as $property) { |
||
388 | if (isset($this->{$property})) { |
||
389 | throw new InvalidArgumentException(sprintf('The property CalendarItem can\'t be set as the property %s is already set. Only one property must be set among these properties: CalendarItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
390 | } |
||
391 | } |
||
392 | } catch (InvalidArgumentException $e) { |
||
393 | $message = $e->getMessage(); |
||
394 | } |
||
395 | |||
396 | return $message; |
||
397 | } |
||
398 | /** |
||
399 | * Set CalendarItem value |
||
400 | * This property belongs to a choice that allows only one property to exist. It is |
||
401 | * therefore removable from the request, consequently if the value assigned to this |
||
402 | * property is null, the property is removed from this object |
||
403 | * @throws InvalidArgumentException |
||
404 | * @param \StructType\EwsCalendarItemType $calendarItem |
||
405 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
406 | */ |
||
407 | public function setCalendarItem(?\StructType\EwsCalendarItemType $calendarItem = null): self |
||
408 | { |
||
409 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
410 | if ('' !== ($calendarItemChoiceErrorMessage = self::validateCalendarItemForChoiceConstraintsFromSetCalendarItem($calendarItem))) { |
||
411 | throw new InvalidArgumentException($calendarItemChoiceErrorMessage, __LINE__); |
||
412 | } |
||
413 | if (is_null($calendarItem) || (is_array($calendarItem) && empty($calendarItem))) { |
||
414 | unset($this->CalendarItem); |
||
415 | } else { |
||
416 | $this->CalendarItem = $calendarItem; |
||
417 | } |
||
418 | |||
419 | return $this; |
||
420 | } |
||
421 | /** |
||
422 | * Get Contact value |
||
423 | * @return \StructType\EwsContactItemType|null |
||
424 | */ |
||
425 | public function getContact(): ?\StructType\EwsContactItemType |
||
426 | { |
||
427 | return isset($this->Contact) ? $this->Contact : null; |
||
428 | } |
||
429 | /** |
||
430 | * This method is responsible for validating the value passed to the setContact method |
||
431 | * This method is willingly generated in order to preserve the one-line inline validation within the setContact method |
||
432 | * This has to validate that the property which is being set is the only one among the given choices |
||
433 | * @param mixed $value |
||
434 | * @return string A non-empty message if the values does not match the validation rules |
||
435 | */ |
||
436 | public function validateContactForChoiceConstraintsFromSetContact($value): string |
||
437 | { |
||
438 | $message = ''; |
||
439 | if (is_null($value)) { |
||
440 | return $message; |
||
441 | } |
||
442 | $properties = [ |
||
443 | 'Item', |
||
444 | 'Message', |
||
445 | 'CalendarItem', |
||
446 | 'DistributionList', |
||
447 | 'MeetingMessage', |
||
448 | 'MeetingRequest', |
||
449 | 'MeetingResponse', |
||
450 | 'MeetingCancellation', |
||
451 | 'Task', |
||
452 | 'PostItem', |
||
453 | 'RoleMember', |
||
454 | 'Network', |
||
455 | 'Person', |
||
456 | 'Booking', |
||
457 | ]; |
||
458 | try { |
||
459 | foreach ($properties as $property) { |
||
460 | if (isset($this->{$property})) { |
||
461 | throw new InvalidArgumentException(sprintf('The property Contact can\'t be set as the property %s is already set. Only one property must be set among these properties: Contact, %s.', $property, implode(', ', $properties)), __LINE__); |
||
462 | } |
||
463 | } |
||
464 | } catch (InvalidArgumentException $e) { |
||
465 | $message = $e->getMessage(); |
||
466 | } |
||
467 | |||
468 | return $message; |
||
469 | } |
||
470 | /** |
||
471 | * Set Contact value |
||
472 | * This property belongs to a choice that allows only one property to exist. It is |
||
473 | * therefore removable from the request, consequently if the value assigned to this |
||
474 | * property is null, the property is removed from this object |
||
475 | * @throws InvalidArgumentException |
||
476 | * @param \StructType\EwsContactItemType $contact |
||
477 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
478 | */ |
||
479 | public function setContact(?\StructType\EwsContactItemType $contact = null): self |
||
480 | { |
||
481 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
482 | if ('' !== ($contactChoiceErrorMessage = self::validateContactForChoiceConstraintsFromSetContact($contact))) { |
||
483 | throw new InvalidArgumentException($contactChoiceErrorMessage, __LINE__); |
||
484 | } |
||
485 | if (is_null($contact) || (is_array($contact) && empty($contact))) { |
||
486 | unset($this->Contact); |
||
487 | } else { |
||
488 | $this->Contact = $contact; |
||
489 | } |
||
490 | |||
491 | return $this; |
||
492 | } |
||
493 | /** |
||
494 | * Get DistributionList value |
||
495 | * @return \StructType\EwsDistributionListType|null |
||
496 | */ |
||
497 | public function getDistributionList(): ?\StructType\EwsDistributionListType |
||
498 | { |
||
499 | return isset($this->DistributionList) ? $this->DistributionList : null; |
||
500 | } |
||
501 | /** |
||
502 | * This method is responsible for validating the value passed to the setDistributionList method |
||
503 | * This method is willingly generated in order to preserve the one-line inline validation within the setDistributionList method |
||
504 | * This has to validate that the property which is being set is the only one among the given choices |
||
505 | * @param mixed $value |
||
506 | * @return string A non-empty message if the values does not match the validation rules |
||
507 | */ |
||
508 | public function validateDistributionListForChoiceConstraintsFromSetDistributionList($value): string |
||
509 | { |
||
510 | $message = ''; |
||
511 | if (is_null($value)) { |
||
512 | return $message; |
||
513 | } |
||
514 | $properties = [ |
||
515 | 'Item', |
||
516 | 'Message', |
||
517 | 'CalendarItem', |
||
518 | 'Contact', |
||
519 | 'MeetingMessage', |
||
520 | 'MeetingRequest', |
||
521 | 'MeetingResponse', |
||
522 | 'MeetingCancellation', |
||
523 | 'Task', |
||
524 | 'PostItem', |
||
525 | 'RoleMember', |
||
526 | 'Network', |
||
527 | 'Person', |
||
528 | 'Booking', |
||
529 | ]; |
||
530 | try { |
||
531 | foreach ($properties as $property) { |
||
532 | if (isset($this->{$property})) { |
||
533 | throw new InvalidArgumentException(sprintf('The property DistributionList can\'t be set as the property %s is already set. Only one property must be set among these properties: DistributionList, %s.', $property, implode(', ', $properties)), __LINE__); |
||
534 | } |
||
535 | } |
||
536 | } catch (InvalidArgumentException $e) { |
||
537 | $message = $e->getMessage(); |
||
538 | } |
||
539 | |||
540 | return $message; |
||
541 | } |
||
542 | /** |
||
543 | * Set DistributionList value |
||
544 | * This property belongs to a choice that allows only one property to exist. It is |
||
545 | * therefore removable from the request, consequently if the value assigned to this |
||
546 | * property is null, the property is removed from this object |
||
547 | * @throws InvalidArgumentException |
||
548 | * @param \StructType\EwsDistributionListType $distributionList |
||
549 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
550 | */ |
||
551 | public function setDistributionList(?\StructType\EwsDistributionListType $distributionList = null): self |
||
552 | { |
||
553 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
554 | if ('' !== ($distributionListChoiceErrorMessage = self::validateDistributionListForChoiceConstraintsFromSetDistributionList($distributionList))) { |
||
555 | throw new InvalidArgumentException($distributionListChoiceErrorMessage, __LINE__); |
||
556 | } |
||
557 | if (is_null($distributionList) || (is_array($distributionList) && empty($distributionList))) { |
||
558 | unset($this->DistributionList); |
||
559 | } else { |
||
560 | $this->DistributionList = $distributionList; |
||
561 | } |
||
562 | |||
563 | return $this; |
||
564 | } |
||
565 | /** |
||
566 | * Get MeetingMessage value |
||
567 | * @return \StructType\EwsMeetingMessageType|null |
||
568 | */ |
||
569 | public function getMeetingMessage(): ?\StructType\EwsMeetingMessageType |
||
570 | { |
||
571 | return isset($this->MeetingMessage) ? $this->MeetingMessage : null; |
||
572 | } |
||
573 | /** |
||
574 | * This method is responsible for validating the value passed to the setMeetingMessage method |
||
575 | * This method is willingly generated in order to preserve the one-line inline validation within the setMeetingMessage method |
||
576 | * This has to validate that the property which is being set is the only one among the given choices |
||
577 | * @param mixed $value |
||
578 | * @return string A non-empty message if the values does not match the validation rules |
||
579 | */ |
||
580 | public function validateMeetingMessageForChoiceConstraintsFromSetMeetingMessage($value): string |
||
581 | { |
||
582 | $message = ''; |
||
583 | if (is_null($value)) { |
||
584 | return $message; |
||
585 | } |
||
586 | $properties = [ |
||
587 | 'Item', |
||
588 | 'Message', |
||
589 | 'CalendarItem', |
||
590 | 'Contact', |
||
591 | 'DistributionList', |
||
592 | 'MeetingRequest', |
||
593 | 'MeetingResponse', |
||
594 | 'MeetingCancellation', |
||
595 | 'Task', |
||
596 | 'PostItem', |
||
597 | 'RoleMember', |
||
598 | 'Network', |
||
599 | 'Person', |
||
600 | 'Booking', |
||
601 | ]; |
||
602 | try { |
||
603 | foreach ($properties as $property) { |
||
604 | if (isset($this->{$property})) { |
||
605 | throw new InvalidArgumentException(sprintf('The property MeetingMessage can\'t be set as the property %s is already set. Only one property must be set among these properties: MeetingMessage, %s.', $property, implode(', ', $properties)), __LINE__); |
||
606 | } |
||
607 | } |
||
608 | } catch (InvalidArgumentException $e) { |
||
609 | $message = $e->getMessage(); |
||
610 | } |
||
611 | |||
612 | return $message; |
||
613 | } |
||
614 | /** |
||
615 | * Set MeetingMessage value |
||
616 | * This property belongs to a choice that allows only one property to exist. It is |
||
617 | * therefore removable from the request, consequently if the value assigned to this |
||
618 | * property is null, the property is removed from this object |
||
619 | * @throws InvalidArgumentException |
||
620 | * @param \StructType\EwsMeetingMessageType $meetingMessage |
||
621 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
622 | */ |
||
623 | public function setMeetingMessage(?\StructType\EwsMeetingMessageType $meetingMessage = null): self |
||
624 | { |
||
625 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
626 | if ('' !== ($meetingMessageChoiceErrorMessage = self::validateMeetingMessageForChoiceConstraintsFromSetMeetingMessage($meetingMessage))) { |
||
627 | throw new InvalidArgumentException($meetingMessageChoiceErrorMessage, __LINE__); |
||
628 | } |
||
629 | if (is_null($meetingMessage) || (is_array($meetingMessage) && empty($meetingMessage))) { |
||
630 | unset($this->MeetingMessage); |
||
631 | } else { |
||
632 | $this->MeetingMessage = $meetingMessage; |
||
633 | } |
||
634 | |||
635 | return $this; |
||
636 | } |
||
637 | /** |
||
638 | * Get MeetingRequest value |
||
639 | * @return \StructType\EwsMeetingRequestMessageType|null |
||
640 | */ |
||
641 | public function getMeetingRequest(): ?\StructType\EwsMeetingRequestMessageType |
||
642 | { |
||
643 | return isset($this->MeetingRequest) ? $this->MeetingRequest : null; |
||
644 | } |
||
645 | /** |
||
646 | * This method is responsible for validating the value passed to the setMeetingRequest method |
||
647 | * This method is willingly generated in order to preserve the one-line inline validation within the setMeetingRequest method |
||
648 | * This has to validate that the property which is being set is the only one among the given choices |
||
649 | * @param mixed $value |
||
650 | * @return string A non-empty message if the values does not match the validation rules |
||
651 | */ |
||
652 | public function validateMeetingRequestForChoiceConstraintsFromSetMeetingRequest($value): string |
||
653 | { |
||
654 | $message = ''; |
||
655 | if (is_null($value)) { |
||
656 | return $message; |
||
657 | } |
||
658 | $properties = [ |
||
659 | 'Item', |
||
660 | 'Message', |
||
661 | 'CalendarItem', |
||
662 | 'Contact', |
||
663 | 'DistributionList', |
||
664 | 'MeetingMessage', |
||
665 | 'MeetingResponse', |
||
666 | 'MeetingCancellation', |
||
667 | 'Task', |
||
668 | 'PostItem', |
||
669 | 'RoleMember', |
||
670 | 'Network', |
||
671 | 'Person', |
||
672 | 'Booking', |
||
673 | ]; |
||
674 | try { |
||
675 | foreach ($properties as $property) { |
||
676 | if (isset($this->{$property})) { |
||
677 | throw new InvalidArgumentException(sprintf('The property MeetingRequest can\'t be set as the property %s is already set. Only one property must be set among these properties: MeetingRequest, %s.', $property, implode(', ', $properties)), __LINE__); |
||
678 | } |
||
679 | } |
||
680 | } catch (InvalidArgumentException $e) { |
||
681 | $message = $e->getMessage(); |
||
682 | } |
||
683 | |||
684 | return $message; |
||
685 | } |
||
686 | /** |
||
687 | * Set MeetingRequest value |
||
688 | * This property belongs to a choice that allows only one property to exist. It is |
||
689 | * therefore removable from the request, consequently if the value assigned to this |
||
690 | * property is null, the property is removed from this object |
||
691 | * @throws InvalidArgumentException |
||
692 | * @param \StructType\EwsMeetingRequestMessageType $meetingRequest |
||
693 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
694 | */ |
||
695 | public function setMeetingRequest(?\StructType\EwsMeetingRequestMessageType $meetingRequest = null): self |
||
696 | { |
||
697 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
698 | if ('' !== ($meetingRequestChoiceErrorMessage = self::validateMeetingRequestForChoiceConstraintsFromSetMeetingRequest($meetingRequest))) { |
||
699 | throw new InvalidArgumentException($meetingRequestChoiceErrorMessage, __LINE__); |
||
700 | } |
||
701 | if (is_null($meetingRequest) || (is_array($meetingRequest) && empty($meetingRequest))) { |
||
702 | unset($this->MeetingRequest); |
||
703 | } else { |
||
704 | $this->MeetingRequest = $meetingRequest; |
||
705 | } |
||
706 | |||
707 | return $this; |
||
708 | } |
||
709 | /** |
||
710 | * Get MeetingResponse value |
||
711 | * @return \StructType\EwsMeetingResponseMessageType|null |
||
712 | */ |
||
713 | public function getMeetingResponse(): ?\StructType\EwsMeetingResponseMessageType |
||
714 | { |
||
715 | return isset($this->MeetingResponse) ? $this->MeetingResponse : null; |
||
716 | } |
||
717 | /** |
||
718 | * This method is responsible for validating the value passed to the setMeetingResponse method |
||
719 | * This method is willingly generated in order to preserve the one-line inline validation within the setMeetingResponse method |
||
720 | * This has to validate that the property which is being set is the only one among the given choices |
||
721 | * @param mixed $value |
||
722 | * @return string A non-empty message if the values does not match the validation rules |
||
723 | */ |
||
724 | public function validateMeetingResponseForChoiceConstraintsFromSetMeetingResponse($value): string |
||
725 | { |
||
726 | $message = ''; |
||
727 | if (is_null($value)) { |
||
728 | return $message; |
||
729 | } |
||
730 | $properties = [ |
||
731 | 'Item', |
||
732 | 'Message', |
||
733 | 'CalendarItem', |
||
734 | 'Contact', |
||
735 | 'DistributionList', |
||
736 | 'MeetingMessage', |
||
737 | 'MeetingRequest', |
||
738 | 'MeetingCancellation', |
||
739 | 'Task', |
||
740 | 'PostItem', |
||
741 | 'RoleMember', |
||
742 | 'Network', |
||
743 | 'Person', |
||
744 | 'Booking', |
||
745 | ]; |
||
746 | try { |
||
747 | foreach ($properties as $property) { |
||
748 | if (isset($this->{$property})) { |
||
749 | throw new InvalidArgumentException(sprintf('The property MeetingResponse can\'t be set as the property %s is already set. Only one property must be set among these properties: MeetingResponse, %s.', $property, implode(', ', $properties)), __LINE__); |
||
750 | } |
||
751 | } |
||
752 | } catch (InvalidArgumentException $e) { |
||
753 | $message = $e->getMessage(); |
||
754 | } |
||
755 | |||
756 | return $message; |
||
757 | } |
||
758 | /** |
||
759 | * Set MeetingResponse value |
||
760 | * This property belongs to a choice that allows only one property to exist. It is |
||
761 | * therefore removable from the request, consequently if the value assigned to this |
||
762 | * property is null, the property is removed from this object |
||
763 | * @throws InvalidArgumentException |
||
764 | * @param \StructType\EwsMeetingResponseMessageType $meetingResponse |
||
765 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
766 | */ |
||
767 | public function setMeetingResponse(?\StructType\EwsMeetingResponseMessageType $meetingResponse = null): self |
||
768 | { |
||
769 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
770 | if ('' !== ($meetingResponseChoiceErrorMessage = self::validateMeetingResponseForChoiceConstraintsFromSetMeetingResponse($meetingResponse))) { |
||
771 | throw new InvalidArgumentException($meetingResponseChoiceErrorMessage, __LINE__); |
||
772 | } |
||
773 | if (is_null($meetingResponse) || (is_array($meetingResponse) && empty($meetingResponse))) { |
||
774 | unset($this->MeetingResponse); |
||
775 | } else { |
||
776 | $this->MeetingResponse = $meetingResponse; |
||
777 | } |
||
778 | |||
779 | return $this; |
||
780 | } |
||
781 | /** |
||
782 | * Get MeetingCancellation value |
||
783 | * @return \StructType\EwsMeetingCancellationMessageType|null |
||
784 | */ |
||
785 | public function getMeetingCancellation(): ?\StructType\EwsMeetingCancellationMessageType |
||
786 | { |
||
787 | return isset($this->MeetingCancellation) ? $this->MeetingCancellation : null; |
||
788 | } |
||
789 | /** |
||
790 | * This method is responsible for validating the value passed to the setMeetingCancellation method |
||
791 | * This method is willingly generated in order to preserve the one-line inline validation within the setMeetingCancellation method |
||
792 | * This has to validate that the property which is being set is the only one among the given choices |
||
793 | * @param mixed $value |
||
794 | * @return string A non-empty message if the values does not match the validation rules |
||
795 | */ |
||
796 | public function validateMeetingCancellationForChoiceConstraintsFromSetMeetingCancellation($value): string |
||
797 | { |
||
798 | $message = ''; |
||
799 | if (is_null($value)) { |
||
800 | return $message; |
||
801 | } |
||
802 | $properties = [ |
||
803 | 'Item', |
||
804 | 'Message', |
||
805 | 'CalendarItem', |
||
806 | 'Contact', |
||
807 | 'DistributionList', |
||
808 | 'MeetingMessage', |
||
809 | 'MeetingRequest', |
||
810 | 'MeetingResponse', |
||
811 | 'Task', |
||
812 | 'PostItem', |
||
813 | 'RoleMember', |
||
814 | 'Network', |
||
815 | 'Person', |
||
816 | 'Booking', |
||
817 | ]; |
||
818 | try { |
||
819 | foreach ($properties as $property) { |
||
820 | if (isset($this->{$property})) { |
||
821 | throw new InvalidArgumentException(sprintf('The property MeetingCancellation can\'t be set as the property %s is already set. Only one property must be set among these properties: MeetingCancellation, %s.', $property, implode(', ', $properties)), __LINE__); |
||
822 | } |
||
823 | } |
||
824 | } catch (InvalidArgumentException $e) { |
||
825 | $message = $e->getMessage(); |
||
826 | } |
||
827 | |||
828 | return $message; |
||
829 | } |
||
830 | /** |
||
831 | * Set MeetingCancellation value |
||
832 | * This property belongs to a choice that allows only one property to exist. It is |
||
833 | * therefore removable from the request, consequently if the value assigned to this |
||
834 | * property is null, the property is removed from this object |
||
835 | * @throws InvalidArgumentException |
||
836 | * @param \StructType\EwsMeetingCancellationMessageType $meetingCancellation |
||
837 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
838 | */ |
||
839 | public function setMeetingCancellation(?\StructType\EwsMeetingCancellationMessageType $meetingCancellation = null): self |
||
840 | { |
||
841 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
842 | if ('' !== ($meetingCancellationChoiceErrorMessage = self::validateMeetingCancellationForChoiceConstraintsFromSetMeetingCancellation($meetingCancellation))) { |
||
843 | throw new InvalidArgumentException($meetingCancellationChoiceErrorMessage, __LINE__); |
||
844 | } |
||
845 | if (is_null($meetingCancellation) || (is_array($meetingCancellation) && empty($meetingCancellation))) { |
||
846 | unset($this->MeetingCancellation); |
||
847 | } else { |
||
848 | $this->MeetingCancellation = $meetingCancellation; |
||
849 | } |
||
850 | |||
851 | return $this; |
||
852 | } |
||
853 | /** |
||
854 | * Get Task value |
||
855 | * @return \StructType\EwsTaskType|null |
||
856 | */ |
||
857 | public function getTask(): ?\StructType\EwsTaskType |
||
858 | { |
||
859 | return isset($this->Task) ? $this->Task : null; |
||
860 | } |
||
861 | /** |
||
862 | * This method is responsible for validating the value passed to the setTask method |
||
863 | * This method is willingly generated in order to preserve the one-line inline validation within the setTask method |
||
864 | * This has to validate that the property which is being set is the only one among the given choices |
||
865 | * @param mixed $value |
||
866 | * @return string A non-empty message if the values does not match the validation rules |
||
867 | */ |
||
868 | public function validateTaskForChoiceConstraintsFromSetTask($value): string |
||
869 | { |
||
870 | $message = ''; |
||
871 | if (is_null($value)) { |
||
872 | return $message; |
||
873 | } |
||
874 | $properties = [ |
||
875 | 'Item', |
||
876 | 'Message', |
||
877 | 'CalendarItem', |
||
878 | 'Contact', |
||
879 | 'DistributionList', |
||
880 | 'MeetingMessage', |
||
881 | 'MeetingRequest', |
||
882 | 'MeetingResponse', |
||
883 | 'MeetingCancellation', |
||
884 | 'PostItem', |
||
885 | 'RoleMember', |
||
886 | 'Network', |
||
887 | 'Person', |
||
888 | 'Booking', |
||
889 | ]; |
||
890 | try { |
||
891 | foreach ($properties as $property) { |
||
892 | if (isset($this->{$property})) { |
||
893 | throw new InvalidArgumentException(sprintf('The property Task can\'t be set as the property %s is already set. Only one property must be set among these properties: Task, %s.', $property, implode(', ', $properties)), __LINE__); |
||
894 | } |
||
895 | } |
||
896 | } catch (InvalidArgumentException $e) { |
||
897 | $message = $e->getMessage(); |
||
898 | } |
||
899 | |||
900 | return $message; |
||
901 | } |
||
902 | /** |
||
903 | * Set Task value |
||
904 | * This property belongs to a choice that allows only one property to exist. It is |
||
905 | * therefore removable from the request, consequently if the value assigned to this |
||
906 | * property is null, the property is removed from this object |
||
907 | * @throws InvalidArgumentException |
||
908 | * @param \StructType\EwsTaskType $task |
||
909 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
910 | */ |
||
911 | public function setTask(?\StructType\EwsTaskType $task = null): self |
||
912 | { |
||
913 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
914 | if ('' !== ($taskChoiceErrorMessage = self::validateTaskForChoiceConstraintsFromSetTask($task))) { |
||
915 | throw new InvalidArgumentException($taskChoiceErrorMessage, __LINE__); |
||
916 | } |
||
917 | if (is_null($task) || (is_array($task) && empty($task))) { |
||
918 | unset($this->Task); |
||
919 | } else { |
||
920 | $this->Task = $task; |
||
921 | } |
||
922 | |||
923 | return $this; |
||
924 | } |
||
925 | /** |
||
926 | * Get PostItem value |
||
927 | * @return \StructType\EwsPostItemType|null |
||
928 | */ |
||
929 | public function getPostItem(): ?\StructType\EwsPostItemType |
||
930 | { |
||
931 | return isset($this->PostItem) ? $this->PostItem : null; |
||
932 | } |
||
933 | /** |
||
934 | * This method is responsible for validating the value passed to the setPostItem method |
||
935 | * This method is willingly generated in order to preserve the one-line inline validation within the setPostItem method |
||
936 | * This has to validate that the property which is being set is the only one among the given choices |
||
937 | * @param mixed $value |
||
938 | * @return string A non-empty message if the values does not match the validation rules |
||
939 | */ |
||
940 | public function validatePostItemForChoiceConstraintsFromSetPostItem($value): string |
||
941 | { |
||
942 | $message = ''; |
||
943 | if (is_null($value)) { |
||
944 | return $message; |
||
945 | } |
||
946 | $properties = [ |
||
947 | 'Item', |
||
948 | 'Message', |
||
949 | 'CalendarItem', |
||
950 | 'Contact', |
||
951 | 'DistributionList', |
||
952 | 'MeetingMessage', |
||
953 | 'MeetingRequest', |
||
954 | 'MeetingResponse', |
||
955 | 'MeetingCancellation', |
||
956 | 'Task', |
||
957 | 'RoleMember', |
||
958 | 'Network', |
||
959 | 'Person', |
||
960 | 'Booking', |
||
961 | ]; |
||
962 | try { |
||
963 | foreach ($properties as $property) { |
||
964 | if (isset($this->{$property})) { |
||
965 | throw new InvalidArgumentException(sprintf('The property PostItem can\'t be set as the property %s is already set. Only one property must be set among these properties: PostItem, %s.', $property, implode(', ', $properties)), __LINE__); |
||
966 | } |
||
967 | } |
||
968 | } catch (InvalidArgumentException $e) { |
||
969 | $message = $e->getMessage(); |
||
970 | } |
||
971 | |||
972 | return $message; |
||
973 | } |
||
974 | /** |
||
975 | * Set PostItem value |
||
976 | * This property belongs to a choice that allows only one property to exist. It is |
||
977 | * therefore removable from the request, consequently if the value assigned to this |
||
978 | * property is null, the property is removed from this object |
||
979 | * @throws InvalidArgumentException |
||
980 | * @param \StructType\EwsPostItemType $postItem |
||
981 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
982 | */ |
||
983 | public function setPostItem(?\StructType\EwsPostItemType $postItem = null): self |
||
984 | { |
||
985 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
986 | if ('' !== ($postItemChoiceErrorMessage = self::validatePostItemForChoiceConstraintsFromSetPostItem($postItem))) { |
||
987 | throw new InvalidArgumentException($postItemChoiceErrorMessage, __LINE__); |
||
988 | } |
||
989 | if (is_null($postItem) || (is_array($postItem) && empty($postItem))) { |
||
990 | unset($this->PostItem); |
||
991 | } else { |
||
992 | $this->PostItem = $postItem; |
||
993 | } |
||
994 | |||
995 | return $this; |
||
996 | } |
||
997 | /** |
||
998 | * Get RoleMember value |
||
999 | * @return \StructType\EwsRoleMemberItemType|null |
||
1000 | */ |
||
1001 | public function getRoleMember(): ?\StructType\EwsRoleMemberItemType |
||
1002 | { |
||
1003 | return isset($this->RoleMember) ? $this->RoleMember : null; |
||
1004 | } |
||
1005 | /** |
||
1006 | * This method is responsible for validating the value passed to the setRoleMember method |
||
1007 | * This method is willingly generated in order to preserve the one-line inline validation within the setRoleMember method |
||
1008 | * This has to validate that the property which is being set is the only one among the given choices |
||
1009 | * @param mixed $value |
||
1010 | * @return string A non-empty message if the values does not match the validation rules |
||
1011 | */ |
||
1012 | public function validateRoleMemberForChoiceConstraintsFromSetRoleMember($value): string |
||
1013 | { |
||
1014 | $message = ''; |
||
1015 | if (is_null($value)) { |
||
1016 | return $message; |
||
1017 | } |
||
1018 | $properties = [ |
||
1019 | 'Item', |
||
1020 | 'Message', |
||
1021 | 'CalendarItem', |
||
1022 | 'Contact', |
||
1023 | 'DistributionList', |
||
1024 | 'MeetingMessage', |
||
1025 | 'MeetingRequest', |
||
1026 | 'MeetingResponse', |
||
1027 | 'MeetingCancellation', |
||
1028 | 'Task', |
||
1029 | 'PostItem', |
||
1030 | 'Network', |
||
1031 | 'Person', |
||
1032 | 'Booking', |
||
1033 | ]; |
||
1034 | try { |
||
1035 | foreach ($properties as $property) { |
||
1036 | if (isset($this->{$property})) { |
||
1037 | throw new InvalidArgumentException(sprintf('The property RoleMember can\'t be set as the property %s is already set. Only one property must be set among these properties: RoleMember, %s.', $property, implode(', ', $properties)), __LINE__); |
||
1038 | } |
||
1039 | } |
||
1040 | } catch (InvalidArgumentException $e) { |
||
1041 | $message = $e->getMessage(); |
||
1042 | } |
||
1043 | |||
1044 | return $message; |
||
1045 | } |
||
1046 | /** |
||
1047 | * Set RoleMember value |
||
1048 | * This property belongs to a choice that allows only one property to exist. It is |
||
1049 | * therefore removable from the request, consequently if the value assigned to this |
||
1050 | * property is null, the property is removed from this object |
||
1051 | * @throws InvalidArgumentException |
||
1052 | * @param \StructType\EwsRoleMemberItemType $roleMember |
||
1053 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
1054 | */ |
||
1055 | public function setRoleMember(?\StructType\EwsRoleMemberItemType $roleMember = null): self |
||
1056 | { |
||
1057 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
1058 | if ('' !== ($roleMemberChoiceErrorMessage = self::validateRoleMemberForChoiceConstraintsFromSetRoleMember($roleMember))) { |
||
1059 | throw new InvalidArgumentException($roleMemberChoiceErrorMessage, __LINE__); |
||
1060 | } |
||
1061 | if (is_null($roleMember) || (is_array($roleMember) && empty($roleMember))) { |
||
1062 | unset($this->RoleMember); |
||
1063 | } else { |
||
1064 | $this->RoleMember = $roleMember; |
||
1065 | } |
||
1066 | |||
1067 | return $this; |
||
1068 | } |
||
1069 | /** |
||
1070 | * Get Network value |
||
1071 | * @return \StructType\EwsNetworkItemType|null |
||
1072 | */ |
||
1073 | public function getNetwork(): ?\StructType\EwsNetworkItemType |
||
1074 | { |
||
1075 | return isset($this->Network) ? $this->Network : null; |
||
1076 | } |
||
1077 | /** |
||
1078 | * This method is responsible for validating the value passed to the setNetwork method |
||
1079 | * This method is willingly generated in order to preserve the one-line inline validation within the setNetwork method |
||
1080 | * This has to validate that the property which is being set is the only one among the given choices |
||
1081 | * @param mixed $value |
||
1082 | * @return string A non-empty message if the values does not match the validation rules |
||
1083 | */ |
||
1084 | public function validateNetworkForChoiceConstraintsFromSetNetwork($value): string |
||
1085 | { |
||
1086 | $message = ''; |
||
1087 | if (is_null($value)) { |
||
1088 | return $message; |
||
1089 | } |
||
1090 | $properties = [ |
||
1091 | 'Item', |
||
1092 | 'Message', |
||
1093 | 'CalendarItem', |
||
1094 | 'Contact', |
||
1095 | 'DistributionList', |
||
1096 | 'MeetingMessage', |
||
1097 | 'MeetingRequest', |
||
1098 | 'MeetingResponse', |
||
1099 | 'MeetingCancellation', |
||
1100 | 'Task', |
||
1101 | 'PostItem', |
||
1102 | 'RoleMember', |
||
1103 | 'Person', |
||
1104 | 'Booking', |
||
1105 | ]; |
||
1106 | try { |
||
1107 | foreach ($properties as $property) { |
||
1108 | if (isset($this->{$property})) { |
||
1109 | throw new InvalidArgumentException(sprintf('The property Network can\'t be set as the property %s is already set. Only one property must be set among these properties: Network, %s.', $property, implode(', ', $properties)), __LINE__); |
||
1110 | } |
||
1111 | } |
||
1112 | } catch (InvalidArgumentException $e) { |
||
1113 | $message = $e->getMessage(); |
||
1114 | } |
||
1115 | |||
1116 | return $message; |
||
1117 | } |
||
1118 | /** |
||
1119 | * Set Network value |
||
1120 | * This property belongs to a choice that allows only one property to exist. It is |
||
1121 | * therefore removable from the request, consequently if the value assigned to this |
||
1122 | * property is null, the property is removed from this object |
||
1123 | * @throws InvalidArgumentException |
||
1124 | * @param \StructType\EwsNetworkItemType $network |
||
1125 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
1126 | */ |
||
1127 | public function setNetwork(?\StructType\EwsNetworkItemType $network = null): self |
||
1128 | { |
||
1129 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
1130 | if ('' !== ($networkChoiceErrorMessage = self::validateNetworkForChoiceConstraintsFromSetNetwork($network))) { |
||
1131 | throw new InvalidArgumentException($networkChoiceErrorMessage, __LINE__); |
||
1132 | } |
||
1133 | if (is_null($network) || (is_array($network) && empty($network))) { |
||
1134 | unset($this->Network); |
||
1135 | } else { |
||
1136 | $this->Network = $network; |
||
1137 | } |
||
1138 | |||
1139 | return $this; |
||
1140 | } |
||
1141 | /** |
||
1142 | * Get Person value |
||
1143 | * @return \StructType\EwsAbchPersonItemType|null |
||
1144 | */ |
||
1145 | public function getPerson(): ?\StructType\EwsAbchPersonItemType |
||
1146 | { |
||
1147 | return isset($this->Person) ? $this->Person : null; |
||
1148 | } |
||
1149 | /** |
||
1150 | * This method is responsible for validating the value passed to the setPerson method |
||
1151 | * This method is willingly generated in order to preserve the one-line inline validation within the setPerson method |
||
1152 | * This has to validate that the property which is being set is the only one among the given choices |
||
1153 | * @param mixed $value |
||
1154 | * @return string A non-empty message if the values does not match the validation rules |
||
1155 | */ |
||
1156 | public function validatePersonForChoiceConstraintsFromSetPerson($value): string |
||
1189 | } |
||
1190 | /** |
||
1191 | * Set Person value |
||
1192 | * This property belongs to a choice that allows only one property to exist. It is |
||
1193 | * therefore removable from the request, consequently if the value assigned to this |
||
1194 | * property is null, the property is removed from this object |
||
1195 | * @throws InvalidArgumentException |
||
1196 | * @param \StructType\EwsAbchPersonItemType $person |
||
1197 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
1198 | */ |
||
1199 | public function setPerson(?\StructType\EwsAbchPersonItemType $person = null): self |
||
1200 | { |
||
1201 | // validation for constraint: choice(Item, Message, CalendarItem, Contact, DistributionList, MeetingMessage, MeetingRequest, MeetingResponse, MeetingCancellation, Task, PostItem, RoleMember, Network, Person, Booking) |
||
1202 | if ('' !== ($personChoiceErrorMessage = self::validatePersonForChoiceConstraintsFromSetPerson($person))) { |
||
1203 | throw new InvalidArgumentException($personChoiceErrorMessage, __LINE__); |
||
1204 | } |
||
1205 | if (is_null($person) || (is_array($person) && empty($person))) { |
||
1206 | unset($this->Person); |
||
1207 | } else { |
||
1208 | $this->Person = $person; |
||
1209 | } |
||
1210 | |||
1211 | return $this; |
||
1212 | } |
||
1213 | /** |
||
1214 | * Get Booking value |
||
1215 | * @return \StructType\EwsBookingItemType|null |
||
1216 | */ |
||
1217 | public function getBooking(): ?\StructType\EwsBookingItemType |
||
1218 | { |
||
1219 | return isset($this->Booking) ? $this->Booking : null; |
||
1220 | } |
||
1221 | /** |
||
1222 | * This method is responsible for validating the value passed to the setBooking method |
||
1223 | * This method is willingly generated in order to preserve the one-line inline validation within the setBooking method |
||
1224 | * This has to validate that the property which is being set is the only one among the given choices |
||
1225 | * @param mixed $value |
||
1226 | * @return string A non-empty message if the values does not match the validation rules |
||
1227 | */ |
||
1228 | public function validateBookingForChoiceConstraintsFromSetBooking($value): string |
||
1261 | } |
||
1262 | /** |
||
1263 | * Set Booking value |
||
1264 | * This property belongs to a choice that allows only one property to exist. It is |
||
1265 | * therefore removable from the request, consequently if the value assigned to this |
||
1266 | * property is null, the property is removed from this object |
||
1267 | * @throws InvalidArgumentException |
||
1268 | * @param \StructType\EwsBookingItemType $booking |
||
1269 | * @return \StructType\EwsSyncFolderItemsCreateOrUpdateType |
||
1270 | */ |
||
1271 | public function setBooking(?\StructType\EwsBookingItemType $booking = null): self |
||
1284 | } |
||
1285 | } |
||
1286 |