Completed
Pull Request — master (#570)
by Delete
07:08
created

Client::processResponse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 13
rs 9.8333
cc 2
nc 2
nop 1
1
<?php
2
/**
3
 * Contains \jamesiarmes\PhpEws\Client.
4
 */
5
6
namespace jamesiarmes\PhpEws;
7
8
use \jamesiarmes\PhpNtlm\SoapClient;
9
10
/**
11
 * Base class of the Exchange Web Services application.
12
 *
13
 * @package php-ews\Client
14
 *
15
 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
16
 * @SuppressWarnings(PHPMD.ExcessiveClassLength)
17
 * @SuppressWarnings(PHPMD.TooManyMethods)
18
 */
19
class Client
20
{
21
    /**
22
     * Microsoft Exchange 2007
23
     *
24
     * @var string
25
     */
26
    const VERSION_2007 = 'Exchange2007';
27
28
    /**
29
     * Microsoft Exchange 2007 SP1
30
     *
31
     * @var string
32
     */
33
    const VERSION_2007_SP1 = 'Exchange2007_SP1';
34
35
    /**
36
     * Microsoft Exchange 2007 SP2
37
     *
38
     * @var string
39
     */
40
    const VERSION_2009 = 'Exchange2009';
41
42
    /**
43
     * Microsoft Exchange 2010
44
     *
45
     * @var string
46
     */
47
    const VERSION_2010 = 'Exchange2010';
48
49
    /**
50
     * Microsoft Exchange 2010 SP1
51
     *
52
     * @var string
53
     */
54
    const VERSION_2010_SP1 = 'Exchange2010_SP1';
55
56
    /**
57
     * Microsoft Exchange 2010 SP2
58
     *
59
     * @var string
60
     */
61
    const VERSION_2010_SP2 = 'Exchange2010_SP2';
62
63
    /**
64
     * Microsoft Exchange 2013.
65
     *
66
     * @var string
67
     */
68
    const VERSION_2013 = 'Exchange2013';
69
70
    /**
71
     * Microsoft Exchange 2013 SP1.
72
     *
73
     * @var string
74
     */
75
    const VERSION_2013_SP1 = 'Exchange2013_SP1';
76
77
    /**
78
     * Microsoft Exchange 2016.
79
     *
80
     * @var string
81
     */
82
    const VERSION_2016 = 'Exchange2016';
83
84
    /**
85
     * cURL options to be passed to the SOAP client.
86
     *
87
     * @var array
88
     */
89
    protected $curl_options = array();
90
91
    /**
92
     * SOAP headers used for requests.
93
     *
94
     * @var \SoapHeader[]
95
     */
96
    protected $headers = array();
97
98
    /**
99
     * Password to use when connecting to the Exchange server.
100
     *
101
     * @var string
102
     */
103
    protected $password;
104
105
    /**
106
     * Location of the Exchange server.
107
     *
108
     * @var string
109
     */
110
    protected $server;
111
112
    /**
113
     * SOAP client used to make the request.
114
     *
115
     * @var null|\jamesiarmes\PhpNtlm\SoapClient
116
     */
117
    protected $soap;
118
119
    /**
120
     * Timezone to be used for all requests.
121
     *
122
     * @var string
123
     */
124
    protected $timezone;
125
126
    /**
127
     * Username to use when connecting to the Exchange server.
128
     *
129
     * @var string
130
     */
131
    protected $username;
132
133
    /**
134
     * Exchange impersonation
135
     *
136
     * @var \jamesiarmes\PhpEws\Type\ExchangeImpersonationType
137
     */
138
    protected $impersonation;
139
    
140
    /**
141
     * Culture to use when opening a mailbox.
142
     *
143
     * @var string
144
     */
145
    protected $mailboxCulture;
146
147
    /**
148
     * Microsoft Exchange version that we are going to connect to
149
     *
150
     * @var string
151
     *
152
     * @see Client::VERSION_2007
153
     * @see Client::VERSION_2007_SP1
154
     * @see Client::VERSION_2007_SP2
155
     * @see Client::VERSION_2007_SP3
156
     * @see Client::VERSION_2010
157
     * @see Client::VERSION_2010_SP1
158
     * @see Client::VERSION_2010_SP2
159
     */
160
    protected $version;
161
162
    /**
163
     * Constructor for the ExchangeWebServices class
164
     *
165
     * @param string $server
166
     * @param string $username
167
     * @param string $password
168
     * @param string $version
169
     *   One of the Client::VERSION_* constants.
170
     */
171
    public function __construct(
172
        $server = null,
173
        $username = null,
174
        $password = null,
175
        $version = self::VERSION_2013
176
    ) {
177
        // Set the object properties.
178
        $this->setServer($server);
179
        $this->setUsername($username);
180
        $this->setPassword($password);
181
        $this->setVersion($version);
182
    }
183
184
    /**
185
     * Returns the SOAP Client that may be used to make calls against the server
186
     *
187
     * @return \jamesiarmes\PhpNtlm\SoapClient
188
     */
189
    public function getClient()
190
    {
191
        // If the SOAP client has yet to be initialized then do so now.
192
        if (empty($this->soap)) {
193
            $this->initializeSoapClient();
194
        }
195
196
        return $this->soap;
197
    }
198
199
    /**
200
     * Sets the cURL options that will be set on the SOAP client.
201
     *
202
     * @param array $options
203
     */
204
    public function setCurlOptions(array $options)
205
    {
206
        $this->curl_options = $options;
207
208
        // We need to reinitialize the SOAP client.
209
        $this->soap = null;
210
    }
211
212
    /**
213
     * Sets the impersonation property
214
     *
215
     * @param \jamesiarmes\PhpEws\Type\ExchangeImpersonationType $impersonation
216
     */
217
    public function setImpersonation($impersonation)
218
    {
219
        $this->impersonation = $impersonation;
220
221
        // We need to re-build the SOAP headers.
222
        $this->headers = array();
223
    }
224
    
225
    /**
226
     * Sets the mailbox culture (locale) to use when opening a mailbox.
227
     * The possible values for this element are described by RFC 3066.
228
     *
229
     * @param string $locale
230
     */
231
    public function setMailboxCulture($locale)
232
    {
233
        $this->mailboxCulture = $locale;
234
    }
235
236
    /**
237
     * Sets the password property
238
     *
239
     * @param string $password
240
     */
241
    public function setPassword($password)
242
    {
243
        $this->password = $password;
244
245
        // We need to reinitialize the SOAP client.
246
        $this->soap = null;
247
    }
248
249
    /**
250
     * Sets the server property
251
     *
252
     * @param string $server
253
     */
254
    public function setServer($server)
255
    {
256
        $this->server = $server;
257
258
        // We need to reinitialize the SOAP client.
259
        $this->soap = null;
260
    }
261
262
    /**
263
     * Sets the timezone to be used for all requests.
264
     *
265
     * @param string $timezone
266
     */
267
    public function setTimezone($timezone)
268
    {
269
        $this->timezone = $timezone;
270
271
        // We need to re-build the SOAP headers.
272
        $this->headers = array();
273
    }
274
275
    /**
276
     * Sets the user name property
277
     *
278
     * @param string $username
279
     */
280
    public function setUsername($username)
281
    {
282
        $this->username = $username;
283
284
        // We need to reinitialize the SOAP client.
285
        $this->soap = null;
286
    }
287
288
    /**
289
     * Sets the version property
290
     *
291
     * @param string $version
292
     */
293
    public function setVersion($version)
294
    {
295
        $this->version = $version;
296
297
        // We need to re-build the SOAP headers.
298
        $this->headers = array();
299
    }
300
301
    /**
302
     * Adds one or more delegates to a principal's mailbox and sets specific
303
     * access permissions.
304
     *
305
     * @since Exchange 2007 SP1
306
     *
307
     * @param \jamesiarmes\PhpEws\Request\AddDelegateType $request
308
     * @return \jamesiarmes\PhpEws\Response\AddDelegateResponseMessageType
309
     */
310
    public function AddDelegate($request)
311
    {
312
        return $this->makeRequest(__FUNCTION__, $request);
313
    }
314
315
    /**
316
     * Adds a distribution group to the instant messaging (IM) list in the
317
     * Unified Contact Store.
318
     *
319
     * @since Exchange 2013
320
     *
321
     * @param \jamesiarmes\PhpEws\Request\AddDistributionGroupToImListType $request
322
     * @return \jamesiarmes\PhpEws\Response\AddDistributionGroupToImListResponseMessageType
323
     */
324
    public function AddDistributionGroupToImList($request)
325
    {
326
        return $this->makeRequest(__FUNCTION__, $request);
327
    }
328
329
    /**
330
     * Adds an existing instant messaging (IM) contact to a group.
331
     *
332
     * @since Exchange 2013
333
     *
334
     * @param \jamesiarmes\PhpEws\Request\AddImContactToGroup $request
335
     * @return \jamesiarmes\PhpEws\Response\AddImContactToGroupResponseMessageType
336
     */
337
    public function AddImContactToGroup($request)
338
    {
339
        return $this->makeRequest(__FUNCTION__, $request);
340
    }
341
342
    /**
343
     * Adds a new instant messaging (IM) group to a mailbox.
344
     *
345
     * @since Exchange 2013
346
     *
347
     * @param \jamesiarmes\PhpEws\Request\AddImGroupType $request
348
     * @return \jamesiarmes\PhpEws\Response\AddImGroupResponseMessageType
349
     */
350
    public function AddImGroup($request)
351
    {
352
        return $this->makeRequest(__FUNCTION__, $request);
353
    }
354
355
    /**
356
     * Adds a new contact to an instant messaging (IM) group.
357
     *
358
     * @since Exchange 2013
359
     *
360
     * @param \jamesiarmes\PhpEws\Request\AddNewImContactToGroup $request
361
     * @return \jamesiarmes\PhpEws\Response\AddNewImContactToGroupResponseMessageType
362
     */
363
    public function AddNewImContactToGroup($request)
364
    {
365
        return $this->makeRequest(__FUNCTION__, $request);
366
    }
367
368
    /**
369
     * Adds a new contact to a group based on a contact's phone number.
370
     *
371
     * @since Exchange 2013
372
     *
373
     * @param \jamesiarmes\PhpEws\Request\AddNewTelUriContactToGroupType $request
374
     * @return \jamesiarmes\PhpEws\Response\AddNewTelUriContactToGroupResponse
375
     */
376
    public function AddNewTelUriContactToGroup($request)
377
    {
378
        return $this->makeRequest(__FUNCTION__, $request);
379
    }
380
381
    /**
382
     * Sets a one-time or follow up action on all the items in a conversation.
383
     *
384
     * This operation allows you to categorize, move, copy, delete, and set the
385
     * read state on all items in a conversation. Actions can also be set for
386
     * new messages in a conversation.
387
     *
388
     * @since Exchange 2010 SP1
389
     *
390
     * @param \jamesiarmes\PhpEws\Request\ApplyConversationActionType $request
391
     * @return \jamesiarmes\PhpEws\Response\ApplyConversationActionResponseType
392
     */
393
    public function ApplyConversationAction($request)
394
    {
395
        return $this->makeRequest(__FUNCTION__, $request);
396
    }
397
398
    /**
399
     * Moves an item into the mailbox user's archive mailbox.
400
     *
401
     * @since Exchange 2013
402
     *
403
     * @param \jamesiarmes\PhpEws\Request\ArchiveItemType $request
404
     * @return \jamesiarmes\PhpEws\Response\ArchiveItemResponse
405
     */
406
    public function ArchiveItem($request)
407
    {
408
        return $this->makeRequest(__FUNCTION__, $request);
409
    }
410
411
    /**
412
     * Converts item and folder identifiers between formats that are accepted by
413
     * Exchange Online, Exchange Online as part of Office 365, and on-premises
414
     * versions of Exchange.
415
     *
416
     * @since Exchange 2007 SP1
417
     *
418
     * @param \jamesiarmes\PhpEws\Request\ConvertIdType $request
419
     * @return \jamesiarmes\PhpEws\Response\ConvertIdResponseType
420
     */
421
    public function ConvertId($request)
422
    {
423
        return $this->makeRequest(__FUNCTION__, $request);
424
    }
425
426
    /**
427
     * Copies folders in a mailbox.
428
     *
429
     * @since Exchange 2007
430
     *
431
     * @param \jamesiarmes\PhpEws\Request\CopyFolderType $request
432
     * @return \jamesiarmes\PhpEws\Response\CopyFolderResponseType
433
     */
434
    public function CopyFolder($request)
435
    {
436
        return $this->makeRequest(__FUNCTION__, $request);
437
    }
438
439
    /**
440
     * Copies items and puts the items in a different folder.
441
     *
442
     * @since Exchange 2007
443
     *
444
     * @param \jamesiarmes\PhpEws\Request\CopyItemType $request
445
     * @return \jamesiarmes\PhpEws\Response\CopyItemResponseType
446
     */
447
    public function CopyItem($request)
448
    {
449
        return $this->makeRequest(__FUNCTION__, $request);
450
    }
451
452
    /**
453
     * Creates either an item or file attachment and attaches it to the
454
     * specified item.
455
     *
456
     * @since Exchange 2007
457
     *
458
     * @param \jamesiarmes\PhpEws\Request\CreateAttachmentType $request
459
     * @return \jamesiarmes\PhpEws\Response\CreateAttachmentResponseType
460
     */
461
    public function CreateAttachment($request)
462
    {
463
        return $this->makeRequest(__FUNCTION__, $request);
464
    }
465
466
    /**
467
     * Creates folders, calendar folders, contacts folders, tasks folders, and
468
     * search folders.
469
     *
470
     * @since Exchange 2007
471
     *
472
     * @param \jamesiarmes\PhpEws\Request\CreateFolderType $request
473
     * @return \jamesiarmes\PhpEws\Response\CreateFolderResponseType
474
     */
475
    public function CreateFolder($request)
476
    {
477
        return $this->makeRequest(__FUNCTION__, $request);
478
    }
479
480
    /**
481
     * Creates a folder hierarchy.
482
     *
483
     * @since Exchange 2013
484
     *
485
     * @param \jamesiarmes\PhpEws\Request\CreateFolderPathType $request
486
     * @return \jamesiarmes\PhpEws\Response\CreateFolderPathResponseType
487
     */
488
    public function CreateFolderPath($request)
489
    {
490
        return $this->makeRequest(__FUNCTION__, $request);
491
    }
492
493
    /**
494
     * Creates items in the Exchange store.
495
     *
496
     * @since Exchange 2007
497
     *
498
     * @param \jamesiarmes\PhpEws\Request\CreateItemType $request
499
     * @return \jamesiarmes\PhpEws\Response\CreateItemResponseType
500
     */
501
    public function CreateItem($request)
502
    {
503
        return $this->makeRequest(__FUNCTION__, $request);
504
    }
505
506
    /**
507
     * Creates a managed folder in the Exchange store.
508
     *
509
     * @since Exchange 2007
510
     *
511
     * @param \jamesiarmes\PhpEws\Request\CreateManagedFolderRequestType $request
512
     * @return \jamesiarmes\PhpEws\Response\CreateManagedFolderResponseType
513
     */
514
    public function CreateManagedFolder($request)
515
    {
516
        return $this->makeRequest(__FUNCTION__, $request);
517
    }
518
519
    /**
520
     * Creates a user configuration object on a folder.
521
     *
522
     * @since Exchange 2010
523
     *
524
     * @param \jamesiarmes\PhpEws\Request\CreateUserConfigurationType $request
525
     * @return \jamesiarmes\PhpEws\Response\CreateUserConfigurationResponseType
526
     */
527
    public function CreateUserConfiguration($request)
528
    {
529
        return $this->makeRequest(__FUNCTION__, $request);
530
    }
531
532
    /**
533
     * Deletes file and item attachments from an existing item in the Exchange
534
     * store.
535
     *
536
     * @since Exchange 2007
537
     *
538
     * @param \jamesiarmes\PhpEws\Request\DeleteAttachmentType $request
539
     * @return \jamesiarmes\PhpEws\Response\DeleteAttachmentResponseType
540
     */
541
    public function DeleteAttachment($request)
542
    {
543
        return $this->makeRequest(__FUNCTION__, $request);
544
    }
545
546
    /**
547
     * Deletes folders from a mailbox.
548
     *
549
     * @since Exchange 2007
550
     *
551
     * @param \jamesiarmes\PhpEws\Request\DeleteFolderType $request
552
     * @return \jamesiarmes\PhpEws\Response\DeleteFolderResponseType
553
     */
554
    public function DeleteFolder($request)
555
    {
556
        return $this->makeRequest(__FUNCTION__, $request);
557
    }
558
559
    /**
560
     * Deletes items in the Exchange store.
561
     *
562
     * @since Exchange 2007
563
     *
564
     * @param \jamesiarmes\PhpEws\Request\DeleteItemType $request
565
     * @return \jamesiarmes\PhpEws\Response\DeleteItemResponseType
566
     */
567
    public function DeleteItem($request)
568
    {
569
        return $this->makeRequest(__FUNCTION__, $request);
570
    }
571
572
    /**
573
     * Deletes a user configuration object on a folder.
574
     *
575
     * @since Exchange 2010
576
     *
577
     * @param \jamesiarmes\PhpEws\Request\DeleteUserConfigurationType $request
578
     * @return \jamesiarmes\PhpEws\Response\DeleteUserConfigurationResponseType
579
     */
580
    public function DeleteUserConfiguration($request)
581
    {
582
        return $this->makeRequest(__FUNCTION__, $request);
583
    }
584
585
    /**
586
     * Disables a mail app for Outlook.
587
     *
588
     * @since Exchange 2013
589
     *
590
     * @param \jamesiarmes\PhpEws\Request\DisableAppType $request
591
     * @return \jamesiarmes\PhpEws\Response\DisableAppResponseType
592
     */
593
    public function DisableApp($request)
594
    {
595
        return $this->makeRequest(__FUNCTION__, $request);
596
    }
597
598
    /**
599
     * Terminates a telephone call.
600
     *
601
     * @since Exchange 2010
602
     *
603
     * @param \jamesiarmes\PhpEws\Request\DisconnectPhoneCallType $request
604
     * @return \jamesiarmes\PhpEws\Response\DisconnectPhoneCallResponseMessageType
605
     */
606
    public function DisconnectPhoneCall($request)
607
    {
608
        return $this->makeRequest(__FUNCTION__, $request);
609
    }
610
611
    /**
612
     * Empties folders in a mailbox.
613
     *
614
     * Optionally, this operation enables you to delete the subfolders of the
615
     * specified folder. When a subfolder is deleted, the subfolder and the
616
     * messages within the subfolder are deleted.
617
     *
618
     * @since Exchange 2010
619
     *
620
     * @param \jamesiarmes\PhpEws\Request\EmptyFolderType $request
621
     * @return \jamesiarmes\PhpEws\Response\EmptyFolderResponseType
622
     */
623
    public function EmptyFolder($request)
624
    {
625
        return $this->makeRequest(__FUNCTION__, $request);
626
    }
627
628
    /**
629
     * Exposes the full membership of distribution lists.
630
     *
631
     * @since Exchange 2007
632
     *
633
     * @param \jamesiarmes\PhpEws\Request\ExpandDLType $request
634
     * @return \jamesiarmes\PhpEws\Response\ExpandDLResponseType
635
     */
636
    public function ExpandDL($request)
637
    {
638
        return $this->makeRequest(__FUNCTION__, $request);
639
    }
640
641
    /**
642
     * Exports items out of a mailbox.
643
     *
644
     * @since Exchange 2010 SP1
645
     *
646
     * @param \jamesiarmes\PhpEws\Request\ExportItemsType $request
647
     * @return \jamesiarmes\PhpEws\Response\ExportItemsResponseType
648
     */
649
    public function ExportItems($request)
650
    {
651
        return $this->makeRequest(__FUNCTION__, $request);
652
    }
653
654
    /**
655
     * Enumerates a list of conversations in a folder.
656
     *
657
     * @param \jamesiarmes\PhpEws\Request\FindConversationType $request
658
     * @return \jamesiarmes\PhpEws\Response\FindConversationResponseMessageType
659
     */
660
    public function FindConversation($request)
661
    {
662
        return $this->makeRequest(__FUNCTION__, $request);
663
    }
664
665
    /**
666
     * Finds subfolders of an identified folder and returns a set of properties
667
     * that describe the set of subfolders.
668
     *
669
     * @since Exchange 2007
670
     *
671
     * @param \jamesiarmes\PhpEws\Request\FindFolderType $request
672
     * @return \jamesiarmes\PhpEws\Response\FindFolderResponseType
673
     */
674
    public function FindFolder($request)
675
    {
676
        return $this->makeRequest(__FUNCTION__, $request);
677
    }
678
679
    /**
680
     * Searches for items that are located in a user’s mailbox.
681
     *
682
     * This operation provides many ways to filter and format how search results
683
     * are returned to the caller.
684
     *
685
     * @since Exchange 2007
686
     *
687
     * @param \jamesiarmes\PhpEws\Request\FindItemType $request
688
     * @return \jamesiarmes\PhpEws\Response\FindItemResponseType
689
     */
690
    public function FindItem($request)
691
    {
692
        return $this->makeRequest(__FUNCTION__, $request);
693
    }
694
695
    /**
696
     * Finds messages that meet the specified criteria.
697
     *
698
     * @since Exchange 2010
699
     *
700
     * @param \jamesiarmes\PhpEws\Request\FindMessageTrackingReportRequestType $request
701
     * @return \jamesiarmes\PhpEws\Response\FindMessageTrackingReportResponseMessageType
702
     */
703
    public function FindMessageTrackingReport($request)
704
    {
705
        return $this->makeRequest(__FUNCTION__, $request);
706
    }
707
708
    /**
709
     * Returns all persona objects from a specified Contacts folder or retrieves
710
     * contacts that match a specified query string.
711
     *
712
     * @since Exchange 2013
713
     *
714
     * @param \jamesiarmes\PhpEws\Request\FindPeopleType $request
715
     * @return \jamesiarmes\PhpEws\Response\FindPeopleResponseMessageType
716
     */
717
    public function FindPeople($request)
718
    {
719
        return $this->makeRequest(__FUNCTION__, $request);
720
    }
721
722
    /**
723
     * Retrieves app manifests.
724
     *
725
     * @since Exchange 2013 SP1
726
     *
727
     * @param \jamesiarmes\PhpEws\Request\GetAppManifestsType $request
728
     * @return \jamesiarmes\PhpEws\Response\GetAppManifestsResponseType
729
     */
730
    public function GetAppManifests($request)
731
    {
732
        return $this->makeRequest(__FUNCTION__, $request);
733
    }
734
735
    /**
736
     * Retrieves the URL for the app marketplace that a client can visit to
737
     * acquire apps to install in a mailbox.
738
     *
739
     * @since Exchange 2013 SP1
740
     *
741
     * @param \jamesiarmes\PhpEws\Request\GetAppMarketplaceUrl $request
742
     * @return \jamesiarmes\PhpEws\Response\GetAppMarketplaceUrlResponseMessageType
743
     */
744
    public function GetAppMarketplaceUrl($request)
745
    {
746
        return $this->makeRequest(__FUNCTION__, $request);
747
    }
748
749
    /**
750
     * Retrieves existing attachments on items in the Exchange store.
751
     *
752
     * @since Exchange 2007
753
     *
754
     * @param \jamesiarmes\PhpEws\Request\GetAttachmentType $request
755
     * @return \jamesiarmes\PhpEws\Response\GetAttachmentResponseType
756
     */
757
    public function GetAttachment($request)
758
    {
759
        return $this->makeRequest(__FUNCTION__, $request);
760
    }
761
762
    /**
763
     * Gets a client access token for a mail app for Outlook.
764
     *
765
     * @since Exchange 2013
766
     *
767
     * @param \jamesiarmes\PhpEws\Request\GetClientAccessTokenType $request
768
     * @return \jamesiarmes\PhpEws\Response\GetClientAccessTokenResponseType
769
     */
770
    public function GetClientAccessToken($request)
771
    {
772
        return $this->makeRequest(__FUNCTION__, $request);
773
    }
774
775
    /**
776
     * Retrieves one or more sets of items that are organized in to nodes in a
777
     * conversation.
778
     *
779
     * @since Exchange 2013
780
     *
781
     * @param \jamesiarmes\PhpEws\Request\GetConversationItemsType $request
782
     * @return \jamesiarmes\PhpEws\Response\GetConversationItemsResponseType
783
     */
784
    public function GetConversationItems($request)
785
    {
786
        return $this->makeRequest(__FUNCTION__, $request);
787
    }
788
789
    /**
790
     * Retrieves the delegate settings for a specified mailbox.
791
     *
792
     * @since Exchange 2007 SP1
793
     *
794
     * @param \jamesiarmes\PhpEws\Request\GetDelegateType $request
795
     * @return \jamesiarmes\PhpEws\Response\GetDelegateResponseMessageType
796
     */
797
    public function GetDelegate($request)
798
    {
799
        return $this->makeRequest(__FUNCTION__, $request);
800
    }
801
802
    /**
803
     * Returns configuration information for in-place holds, saved discovery
804
     * searches, and the mailboxes that are enabled for discovery search.
805
     *
806
     * @since Exchange 2013
807
     *
808
     * @param \jamesiarmes\PhpEws\Request\GetDiscoverySearchConfigurationType $request
809
     * @return \jamesiarmes\PhpEws\Response\GetDiscoverySearchConfigurationResponseMessageType
810
     */
811
    public function GetDiscoverySearchConfiguration($request)
812
    {
813
        return $this->makeRequest(__FUNCTION__, $request);
814
    }
815
816
    /**
817
     * Used by pull subscription clients to request notifications from the
818
     * Client Access server.
819
     *
820
     * The response returns an array of items and events that have occurred in a
821
     * mailbox since the last the notification.
822
     *
823
     * @since Exchange 2007
824
     *
825
     * @param \jamesiarmes\PhpEws\Request\GetEventsType $request
826
     * @return \jamesiarmes\PhpEws\Response\GetEventsResponseType
827
     */
828
    public function GetEvents($request)
829
    {
830
        return $this->makeRequest(__FUNCTION__, $request);
831
    }
832
833
    /**
834
     * Gets folders from the Exchange store.
835
     *
836
     * @since Exchange 2007
837
     *
838
     * @param \jamesiarmes\PhpEws\Request\GetFolderType $request
839
     * @return \jamesiarmes\PhpEws\Response\GetFolderResponseType
840
     */
841
    public function GetFolder($request)
842
    {
843
        return $this->makeRequest(__FUNCTION__, $request);
844
    }
845
846
    /**
847
     * Retrieves the mailboxes that are under a specific hold and the associated
848
     * hold query.
849
     *
850
     * @since Exchange 2013
851
     *
852
     * @param \jamesiarmes\PhpEws\Request\GetHoldOnMailboxesType $request
853
     * @return \jamesiarmes\PhpEws\Response\GetHoldOnMailboxesResponseMessageType
854
     */
855
    public function GetHoldOnMailboxes($request)
856
    {
857
        return $this->makeRequest(__FUNCTION__, $request);
858
    }
859
860
    /**
861
     * Retrieves the list of instant messaging (IM) groups and IM contact
862
     * personas in a mailbox.
863
     *
864
     * @since Exchange 2013
865
     *
866
     * @param \jamesiarmes\PhpEws\Request\GetImItemListType $request
867
     * @return \jamesiarmes\PhpEws\Response\GetImItemListResponseMessageType
868
     */
869
    public function GetImItemList($request)
870
    {
871
        return $this->makeRequest(__FUNCTION__, $request);
872
    }
873
874
    /**
875
     * Retrieves information about instant messaging (IM) groups and IM contact
876
     * personas.
877
     *
878
     * @since Exchange 2013
879
     *
880
     * @param \jamesiarmes\PhpEws\Request\GetImItemsType $request
881
     * @return \jamesiarmes\PhpEws\Response\GetImItemsResponse
882
     */
883
    public function GetImItems($request)
884
    {
885
        return $this->makeRequest(__FUNCTION__, $request);
886
    }
887
888
    /**
889
     * Retrieves Inbox rules in the identified user's mailbox.
890
     *
891
     * @since Exchange 2010
892
     *
893
     * @param \jamesiarmes\PhpEws\Request\GetInboxRulesRequestType $request
894
     * @return \jamesiarmes\PhpEws\Response\GetInboxRulesResponseType
895
     */
896
    public function GetInboxRules($request)
897
    {
898
        return $this->makeRequest(__FUNCTION__, $request);
899
    }
900
901
    /**
902
     * Gets folders from the Exchange store.
903
     *
904
     * @since Exchange 2007
905
     *
906
     * @param \jamesiarmes\PhpEws\Request\GetItemType $request
907
     * @return \jamesiarmes\PhpEws\Response\GetItemResponseType
908
     */
909
    public function GetItem($request)
910
    {
911
        return $this->makeRequest(__FUNCTION__, $request);
912
    }
913
914
    /**
915
     * Retrieves the mail tips information for the specified mailbox.
916
     *
917
     * @since Exchange 2010
918
     *
919
     * @param \jamesiarmes\PhpEws\Request\GetMailTipsType $request
920
     * @return \jamesiarmes\PhpEws\Response\GetMailTipsResponseMessageType
921
     */
922
    public function GetMailTips($request)
923
    {
924
        return $this->makeRequest(__FUNCTION__, $request);
925
    }
926
927
    /**
928
     * Retrieves tracking information about the specified messages.
929
     *
930
     * @since Exchange 2010
931
     *
932
     * @param \jamesiarmes\PhpEws\Request\GetMessageTrackingReportRequestType $request
933
     * @return \jamesiarmes\PhpEws\Response\GetMessageTrackingReportResponseMessageType
934
     */
935
    public function GetMessageTrackingReport($request)
936
    {
937
        return $this->makeRequest(__FUNCTION__, $request);
938
    }
939
940
    /**
941
     * Retrieves details about items that cannot be indexed.
942
     *
943
     * This includes, but is not limited to, the item identifier, an error code,
944
     * an error description, when an attempt was made to index the item, and
945
     * additional information about the file.
946
     *
947
     * @since Exchange 2013
948
     *
949
     * @param \jamesiarmes\PhpEws\Request\GetNonIndexableItemDetailsType $request
950
     * @return \jamesiarmes\PhpEws\Response\GetNonIndexableItemDetailsResponseMessageType
951
     */
952
    public function GetNonIndexableItemDetails($request)
953
    {
954
        return $this->makeRequest(__FUNCTION__, $request);
955
    }
956
957
    /**
958
     * Retrieves the count of items that cannot be indexed in a mailbox.
959
     *
960
     * @since Exchange 2013
961
     *
962
     * @param \jamesiarmes\PhpEws\Request\GetNonIndexableItemStatisticsType $request
963
     * @return \jamesiarmes\PhpEws\Response\GetNonIndexableItemStatisticsResponseMessageType
964
     */
965
    public function GetNonIndexableItemStatistics($request)
966
    {
967
        return $this->makeRequest(__FUNCTION__, $request);
968
    }
969
970
    /**
971
     * Provides the email account password expiration date for the current user.
972
     *
973
     * @since Exchange 2010 SP2
974
     *
975
     * @param \jamesiarmes\PhpEws\Request\GetPasswordExpirationDateType $request
976
     * @return \jamesiarmes\PhpEws\Response\GetPasswordExpirationDateResponseMessageType
977
     */
978
    public function GetPasswordExpirationDate($request)
979
    {
980
        return $this->makeRequest(__FUNCTION__, $request);
981
    }
982
983
    /**
984
     * Retrieves a set of properties that are associated with a persona.
985
     *
986
     * @since Exchange 2013
987
     *
988
     * @param \jamesiarmes\PhpEws\Request\GetPersonaType $request
989
     * @return \jamesiarmes\PhpEws\Response\GetPersonaResponseMessageType
990
     */
991
    public function GetPersona($request)
992
    {
993
        return $this->makeRequest(__FUNCTION__, $request);
994
    }
995
996
    /**
997
     * Retrieves information about the specified telephone call.
998
     *
999
     * @since Exchange 2010
1000
     *
1001
     * @param \jamesiarmes\PhpEws\Request\GetPhoneCallInformationType $request
1002
     * @return \jamesiarmes\PhpEws\Response\GetPhoneCallInformationResponseMessageType
1003
     */
1004
    public function GetPhoneCallInformation($request)
1005
    {
1006
        return $this->makeRequest(__FUNCTION__, $request);
1007
    }
1008
1009
    /**
1010
     * Retrieves reminders for calendar and task items.
1011
     *
1012
     * @since Exchange 2013
1013
     *
1014
     * @param \jamesiarmes\PhpEws\Request\GetRemindersType $request
1015
     * @return \jamesiarmes\PhpEws\Response\GetRemindersResponseMessageType
1016
     */
1017
    public function GetReminders($request)
1018
    {
1019
        return $this->makeRequest(__FUNCTION__, $request);
1020
    }
1021
1022
    /**
1023
     * Retrieves the room lists that are available within the Exchange
1024
     * organization.
1025
     *
1026
     * @since Exchange 2010
1027
     *
1028
     * @param \jamesiarmes\PhpEws\Request\GetRoomListsType $request
1029
     * @return \jamesiarmes\PhpEws\Response\GetRoomListsResponseMessageType
1030
     */
1031
    public function GetRoomLists($request)
1032
    {
1033
        return $this->makeRequest(__FUNCTION__, $request);
1034
    }
1035
1036
    /**
1037
     * Retrieves the rooms within the specified room list.
1038
     *
1039
     * @since Exchange 2010 SP1
1040
     *
1041
     * @param \jamesiarmes\PhpEws\Request\GetRoomsType $request
1042
     * @return \jamesiarmes\PhpEws\Response\GetRoomsResponseMessageType
1043
     */
1044
    public function GetRooms($request)
1045
    {
1046
        return $this->makeRequest(__FUNCTION__, $request);
1047
    }
1048
1049
    /**
1050
     * Retrieves a scoped set of searchable mailboxes for discovery searches.
1051
     *
1052
     * The scope of searchable mailboxes returned in the response is determined
1053
     * by the search filter and whether distribution group membership is
1054
     * expanded.
1055
     *
1056
     * @since Exchange 2013
1057
     *
1058
     * @param \jamesiarmes\PhpEws\Request\GetSearchableMailboxesType $request
1059
     * @return \jamesiarmes\PhpEws\Response\GetSearchableMailboxesResponseMessageType
1060
     */
1061
    public function GetSearchableMailboxes($request)
1062
    {
1063
        return $this->makeRequest(__FUNCTION__, $request);
1064
    }
1065
1066
    /**
1067
     * Retrieve the timezones supported by the server.
1068
     *
1069
     * @since Exchange 2010
1070
     *
1071
     * @param \jamesiarmes\PhpEws\Request\GetServerTimeZonesType $request
1072
     * @return \jamesiarmes\PhpEws\Response\GetServerTimeZonesResponseType
1073
     */
1074
    public function GetServerTimeZones($request)
1075
    {
1076
        return $this->makeRequest(__FUNCTION__, $request);
1077
    }
1078
1079
    /**
1080
     * Retrieves configuration information for the specified type of service.
1081
     *
1082
     * This operation can return configuration settings for the Unified
1083
     * Messaging, Protection Rules, and Mail Tips services.
1084
     *
1085
     * @since Exchange 2010
1086
     *
1087
     * @param \jamesiarmes\PhpEws\Request\GetServiceConfigurationType $request
1088
     * @return \jamesiarmes\PhpEws\Response\GetServiceConfigurationResponseMessageType
1089
     */
1090
    public function GetServiceConfiguration($request)
1091
    {
1092
        return $this->makeRequest(__FUNCTION__, $request);
1093
    }
1094
1095
    /**
1096
     * Retrieves the local folder identifier of a specified shared folder.
1097
     *
1098
     * @since Exchange 2010
1099
     *
1100
     * @param \jamesiarmes\PhpEws\Request\GetSharingFolderType $request
1101
     * @return \jamesiarmes\PhpEws\Response\GetSharingFolderResponseMessageType
1102
     */
1103
    public function GetSharingFolder($request)
1104
    {
1105
        return $this->makeRequest(__FUNCTION__, $request);
1106
    }
1107
1108
    /**
1109
     * Gets an opaque authentication token that identifies a sharing invitation.
1110
     *
1111
     * @since Exchange 2010
1112
     *
1113
     * @param \jamesiarmes\PhpEws\Request\GetSharingMetadataType $request
1114
     * @return \jamesiarmes\PhpEws\Response\GetSharingMetadataResponseMessageType
1115
     */
1116
    public function GetSharingMetadata($request)
1117
    {
1118
        return $this->makeRequest(__FUNCTION__, $request);
1119
    }
1120
1121
    /**
1122
     * Requests notifications from the Client Access server.
1123
     *
1124
     * The GetStreamingEvents response returns an array of items and events that
1125
     * have occurred in a mailbox since the last the notification.
1126
     *
1127
     * @since Exchange 2010 SP1
1128
     *
1129
     * @param \jamesiarmes\PhpEws\Request\GetStreamingEventsType $request
1130
     * @return \jamesiarmes\PhpEws\Response\GetStreamingEventsResponseType
1131
     */
1132
    public function GetStreamingEvents($request)
1133
    {
1134
        return $this->makeRequest(__FUNCTION__, $request);
1135
    }
1136
1137
    /**
1138
     * Provides detailed information about the availability of a set of users,
1139
     * rooms, and resources within a specified time period.
1140
     *
1141
     * @since Exchange 2007
1142
     *
1143
     * @param \jamesiarmes\PhpEws\Request\GetUserAvailabilityRequestType $request
1144
     * @return \jamesiarmes\PhpEws\Response\GetUserAvailabilityResponseType
1145
     */
1146
    public function GetUserAvailability($request)
1147
    {
1148
        return $this->makeRequest(__FUNCTION__, $request);
1149
    }
1150
1151
    /**
1152
     * Retrieves a user configuration object from a folder.
1153
     *
1154
     * @since Exchange 2010
1155
     *
1156
     * @param \jamesiarmes\PhpEws\Request\GetUserConfigurationType $request
1157
     * @return \jamesiarmes\PhpEws\Response\GetUserConfigurationResponseType
1158
     */
1159
    public function GetUserConfiguration($request)
1160
    {
1161
        return $this->makeRequest(__FUNCTION__, $request);
1162
    }
1163
1164
    /**
1165
     * Gets a mailbox user's Out of Office (OOF) settings and messages.
1166
     *
1167
     * @since Exchange 2007
1168
     *
1169
     * @param \jamesiarmes\PhpEws\Request\GetUserOofSettingsRequest $request
1170
     * @return \jamesiarmes\PhpEws\Response\GetUserOofSettingsResponse
1171
     */
1172
    public function GetUserOofSettings($request)
1173
    {
1174
        return $this->makeRequest(__FUNCTION__, $request);
1175
    }
1176
1177
    /**
1178
     * Retrieves a user photo from Active Directory Domain Services (AD DS).
1179
     *
1180
     * @since Exchange 2013
1181
     *
1182
     * @param \jamesiarmes\PhpEws\Request\GetUserPhotoType $request
1183
     * @return \jamesiarmes\PhpEws\Response\GetUserPhotoResponseMessageType
1184
     */
1185
    public function GetUserPhoto($request)
1186
    {
1187
        return $this->makeRequest(__FUNCTION__, $request);
1188
    }
1189
1190
    /**
1191
     * Retrieves a list of all default, system folder, and personal tags that
1192
     * are associated with a user by means of a system policy or that were
1193
     * applied by the user.
1194
     *
1195
     * @since Exchange 2013
1196
     *
1197
     * @param \jamesiarmes\PhpEws\Request\GetUserRetentionPolicyTagsType $request
1198
     * @return \jamesiarmes\PhpEws\Response\GetUserRetentionPolicyTagsResponseMessageType
1199
     */
1200
    public function GetUserRetentionPolicyTags($request)
1201
    {
1202
        return $this->makeRequest(__FUNCTION__, $request);
1203
    }
1204
1205
    /**
1206
     * Installs a mail app for Outlook in a mailbox.
1207
     *
1208
     * @since Exchange 2013
1209
     *
1210
     * @param \jamesiarmes\PhpEws\Request\InstallAppType $request
1211
     * @return \jamesiarmes\PhpEws\Response\InstallAppResponseType
1212
     */
1213
    public function InstallApp($request)
1214
    {
1215
        return $this->makeRequest(__FUNCTION__, $request);
1216
    }
1217
1218
    /**
1219
     * Sets the IsRead property on all items, in one or more folders, to
1220
     * indicate that all items are either read or unread.
1221
     *
1222
     * @since Exchange 2013
1223
     *
1224
     * @param \jamesiarmes\PhpEws\Request\MarkAllItemsAsRead $request
1225
     * @return \jamesiarmes\PhpEws\Response\MarkAllItemsAsReadResponseType
1226
     */
1227
    public function MarkAllItemsAsRead($request)
1228
    {
1229
        return $this->makeRequest(__FUNCTION__, $request);
1230
    }
1231
1232
    /**
1233
     * Adds and removes users from the blocked email list and moves email
1234
     * messages to the Junk Email folder.
1235
     *
1236
     * @since Exchange 2013
1237
     *
1238
     * @param \jamesiarmes\PhpEws\Request\MarkAsJunkType $request
1239
     * @return \jamesiarmes\PhpEws\Response\MarkAsJunkResponseType
1240
     */
1241
    public function MarkAsJunk($request)
1242
    {
1243
        return $this->makeRequest(__FUNCTION__, $request);
1244
    }
1245
1246
    /**
1247
     * Moves folders from a specified folder and puts them in another folder.
1248
     *
1249
     * @since Exchange 2007
1250
     *
1251
     * @param \jamesiarmes\PhpEws\Request\MoveFolderType $request
1252
     * @return \jamesiarmes\PhpEws\Response\MoveFolderResponseType
1253
     */
1254
    public function MoveFolder($request)
1255
    {
1256
        return $this->makeRequest(__FUNCTION__, $request);
1257
    }
1258
1259
    /**
1260
     * Moves one or more items to a single destination folder.
1261
     *
1262
     * @since Exchange 2007
1263
     *
1264
     * @param \jamesiarmes\PhpEws\Request\MoveItemType $request
1265
     * @return \jamesiarmes\PhpEws\Response\MoveItemResponseType
1266
     */
1267
    public function MoveItem($request)
1268
    {
1269
        return $this->makeRequest(__FUNCTION__, $request);
1270
    }
1271
1272
    /**
1273
     * Initiates a dismiss or snooze action on a reminder.
1274
     *
1275
     * @since Exchange 2013
1276
     *
1277
     * @param \jamesiarmes\PhpEws\Request\PerformReminderActionType $request
1278
     * @return \jamesiarmes\PhpEws\Response\PerformReminderActionResponseMessageType
1279
     */
1280
    public function PerformReminderAction($request)
1281
    {
1282
        return $this->makeRequest(__FUNCTION__, $request);
1283
    }
1284
1285
    /**
1286
     * Initiates an outbound call and plays a message over the telephone.
1287
     *
1288
     * @since Exchange 2010
1289
     *
1290
     * @param \jamesiarmes\PhpEws\Request\PlayOnPhoneType $request
1291
     * @return \jamesiarmes\PhpEws\Response\PlayOnPhoneResponseMessageType
1292
     */
1293
    public function PlayOnPhone($request)
1294
    {
1295
        return $this->makeRequest(__FUNCTION__, $request);
1296
    }
1297
1298
    /**
1299
     * Refreshes the specified local folder with the latest data from the folder
1300
     * that is being shared.
1301
     *
1302
     * @since Exchange 2010
1303
     *
1304
     * @param \jamesiarmes\PhpEws\Request\RefreshSharingFolderType $request
1305
     * @return \jamesiarmes\PhpEws\Response\RefreshSharingFolderResponseMessageType
1306
     */
1307
    public function RefreshSharingFolder($request)
1308
    {
1309
        return $this->makeRequest(__FUNCTION__, $request);
1310
    }
1311
1312
    /**
1313
     * Removes contacts from the Lync instant messaging (IM) list when Lync uses
1314
     * Exchange for the contact store.
1315
     *
1316
     * @since Exchange 2013
1317
     *
1318
     * @param \jamesiarmes\PhpEws\Request\RemoveContactFromImListType $request
1319
     * @return \jamesiarmes\PhpEws\Response\RemoveContactFromImListResponseMessageType
1320
     */
1321
    public function RemoveContactFromImList($request)
1322
    {
1323
        return $this->makeRequest(__FUNCTION__, $request);
1324
    }
1325
1326
    /**
1327
     * Removes one or more delegates from a user's mailbox.
1328
     *
1329
     * @since Exchange 2007 SP1
1330
     *
1331
     * @param \jamesiarmes\PhpEws\Request\RemoveDelegateType $request
1332
     * @return \jamesiarmes\PhpEws\Response\RemoveDelegateResponseMessageType
1333
     */
1334
    public function RemoveDelegate($request)
1335
    {
1336
        return $this->makeRequest(__FUNCTION__, $request);
1337
    }
1338
1339
    /**
1340
     * Removes a distribution group from the Lync instant messaging (IM) list
1341
     * when Lync uses Exchange for the contact store.
1342
     *
1343
     * @since Exchange 2013
1344
     *
1345
     * @param \jamesiarmes\PhpEws\Request\RemoveDistributionGroupFromImListType $request
1346
     * @return \jamesiarmes\PhpEws\Response\RemoveDistributionGroupFromImListResponseMessageType
1347
     */
1348
    public function RemoveDistributionGroupFromImList($request)
1349
    {
1350
        return $this->makeRequest(__FUNCTION__, $request);
1351
    }
1352
1353
    /**
1354
     * Removes a single IM contact from an IM group.
1355
     *
1356
     * @since Exchange 2013
1357
     *
1358
     * @param \jamesiarmes\PhpEws\Request\RemoveImContactFromGroupType $request
1359
     * @return \jamesiarmes\PhpEws\Response\RemoveImContactFromGroupResponseMessageType
1360
     */
1361
    public function RemoveImContactFromGroup($request)
1362
    {
1363
        return $this->makeRequest(__FUNCTION__, $request);
1364
    }
1365
1366
    /**
1367
     * Removes a single instant messaging (IM) group from a mailbox.
1368
     *
1369
     * @since Exchange 2013
1370
     *
1371
     * @param \jamesiarmes\PhpEws\Request\RemoveImGroupType $request
1372
     * @return \jamesiarmes\PhpEws\Response\RemoveImGroupResponseMessageType
1373
     */
1374
    public function RemoveImGroup($request)
1375
    {
1376
        return $this->makeRequest(__FUNCTION__, $request);
1377
    }
1378
1379
    /**
1380
     * Resolves ambiguous email addresses and display names.
1381
     *
1382
     * @since Exchange 2007
1383
     *
1384
     * @param \jamesiarmes\PhpEws\Request\ResolveNamesType $request
1385
     * @return \jamesiarmes\PhpEws\Response\ResolveNamesResponseType
1386
     */
1387
    public function ResolveNames($request)
1388
    {
1389
        return $this->makeRequest(__FUNCTION__, $request);
1390
    }
1391
1392
    /**
1393
     * Searches mailboxes for occurrences of terms in mailbox items.
1394
     *
1395
     * @since Exchange 2013
1396
     *
1397
     * @param \jamesiarmes\PhpEws\Request\SearchMailboxesType $request
1398
     * @return \jamesiarmes\PhpEws\Response\SearchMailboxesResponseType
1399
     */
1400
    public function SearchMailboxes($request)
1401
    {
1402
        return $this->makeRequest(__FUNCTION__, $request);
1403
    }
1404
1405
    /**
1406
     * Sends e-mail messages that are located in the Exchange store.
1407
     *
1408
     * @since Exchange 2007
1409
     *
1410
     * @param \jamesiarmes\PhpEws\Request\SendItemType $request
1411
     * @return \jamesiarmes\PhpEws\Response\SendItemResponseType
1412
     */
1413
    public function SendItem($request)
1414
    {
1415
        return $this->makeRequest(__FUNCTION__, $request);
1416
    }
1417
1418
    /**
1419
     * Sets a mailbox hold policy on mailboxes.
1420
     *
1421
     * @since Exchange 2013
1422
     *
1423
     * @param \jamesiarmes\PhpEws\Request\SetHoldOnMailboxesType $request
1424
     * @return \jamesiarmes\PhpEws\Response\SetHoldOnMailboxesResponseMessageType
1425
     */
1426
    public function SetHoldOnMailboxes($request)
1427
    {
1428
        return $this->makeRequest(__FUNCTION__, $request);
1429
    }
1430
1431
    /**
1432
     * Changes the display name of an instant messaging (IM) group.
1433
     *
1434
     * @since Exchange 2013
1435
     *
1436
     * @param \jamesiarmes\PhpEws\Request\SetImGroupType $request
1437
     * @return \jamesiarmes\PhpEws\Response\SetImGroupResponseMessageType
1438
     */
1439
    public function SetImGroup($request)
1440
    {
1441
        return $this->makeRequest(__FUNCTION__, $request);
1442
    }
1443
1444
    /**
1445
     * Sets a mailbox user's Out of Office (OOF) settings and message.
1446
     *
1447
     * @since Exchange 2007
1448
     *
1449
     * @param \jamesiarmes\PhpEws\Request\SetUserOofSettingsRequest $request
1450
     * @return \jamesiarmes\PhpEws\Response\SetUserOofSettingsResponse
1451
     */
1452
    public function SetUserOofSettings($request)
1453
    {
1454
        return $this->makeRequest(__FUNCTION__, $request);
1455
    }
1456
1457
    /**
1458
     * Subscribes client applications to either push or pull notifications.
1459
     *
1460
     * It is important to be aware that the structure of the request messages
1461
     * and responses is different depending on the type of event notification.
1462
     *
1463
     * @since Exchange 2007
1464
     *
1465
     * @param \jamesiarmes\PhpEws\Request\SubscribeType $request
1466
     * @return \jamesiarmes\PhpEws\Response\SubscribeResponseType
1467
     */
1468
    public function Subscribe($request)
1469
    {
1470
        return $this->makeRequest(__FUNCTION__, $request);
1471
    }
1472
1473
    /**
1474
     * Synchronizes folders between the computer that is running Microsoft
1475
     * Exchange Server and the client.
1476
     *
1477
     * @since Exchange 2007
1478
     *
1479
     * @param \jamesiarmes\PhpEws\Request\SyncFolderHierarchyType $request
1480
     * @return \jamesiarmes\PhpEws\Response\SyncFolderHierarchyResponseType
1481
     */
1482
    public function SyncFolderHierarchy($request)
1483
    {
1484
        return $this->makeRequest(__FUNCTION__, $request);
1485
    }
1486
1487
    /**
1488
     * Synchronizes items between the Exchange server and the client.
1489
     *
1490
     * @since Exchange 2007
1491
     *
1492
     * @param \jamesiarmes\PhpEws\Request\SyncFolderItemsType $request
1493
     * @return \jamesiarmes\PhpEws\Response\SyncFolderItemsResponseType
1494
     */
1495
    public function SyncFolderItems($request)
1496
    {
1497
        return $this->makeRequest(__FUNCTION__, $request);
1498
    }
1499
1500
    /**
1501
     * Uninstalls a mail app for Outlook.
1502
     *
1503
     * @since Exchange 2013
1504
     *
1505
     * @param \jamesiarmes\PhpEws\Request\UninstallAppType $request
1506
     * @return \jamesiarmes\PhpEws\Response\UninstallAppResponseType
1507
     */
1508
    public function UninstallApp($request)
1509
    {
1510
        return $this->makeRequest(__FUNCTION__, $request);
1511
    }
1512
1513
    /**
1514
     * Ends a pull notification subscription.
1515
     *
1516
     * Use this operation rather than letting a subscription timeout. This
1517
     * operation is only valid for pull notifications.
1518
     *
1519
     * @since Exchange 2007
1520
     *
1521
     * @param \jamesiarmes\PhpEws\Request\UnsubscribeType $request
1522
     * @return \jamesiarmes\PhpEws\Response\UnsubscribeResponseType
1523
     */
1524
    public function Unsubscribe($request)
1525
    {
1526
        return $this->makeRequest(__FUNCTION__, $request);
1527
    }
1528
1529
    /**
1530
     * Updates delegate permissions on a principal's mailbox.
1531
     *
1532
     * @since Exchange 2007 SP1
1533
     *
1534
     * @param \jamesiarmes\PhpEws\Request\UpdateDelegateType $request
1535
     * @return \jamesiarmes\PhpEws\Response\UpdateDelegateResponseMessageType
1536
     */
1537
    public function UpdateDelegate($request)
1538
    {
1539
        return $this->makeRequest(__FUNCTION__, $request);
1540
    }
1541
1542
    /**
1543
     * Modifies properties of an existing item in the Exchange store.
1544
     *
1545
     * Each UpdateFolder operation consists of the following:
1546
     * - A FolderId element that specifies a folder to update.
1547
     * - An internal path of an element in the folder, as specified by the
1548
     *   folder shape, which specifies the data to update.
1549
     * - A folder that contains the new value of the updated field, if the
1550
     *   update is not a deletion.
1551
     *
1552
     * @since Exchange 2007
1553
     *
1554
     * @param \jamesiarmes\PhpEws\Request\UpdateFolderType $request
1555
     * @return \jamesiarmes\PhpEws\Response\UpdateFolderResponseType
1556
     */
1557
    public function UpdateFolder($request)
1558
    {
1559
        return $this->makeRequest(__FUNCTION__, $request);
1560
    }
1561
1562
    /**
1563
     * Updates the authenticated user's Inbox rules by applying the specified
1564
     * operations.
1565
     *
1566
     * This operation is used to create an Inbox rule, to set an Inbox rule, or
1567
     * to delete an Inbox rule.
1568
     *
1569
     * @since Exchange 2010 SP1
1570
     *
1571
     * @param \jamesiarmes\PhpEws\Request\UpdateInboxRulesRequestType $request
1572
     * @return \jamesiarmes\PhpEws\Response\UpdateInboxRulesResponseType
1573
     */
1574
    public function UpdateInboxRules($request)
1575
    {
1576
        return $this->makeRequest(__FUNCTION__, $request);
1577
    }
1578
1579
    /**
1580
     * Used to modify the properties of an existing item in the Exchange store.
1581
     *
1582
     * @since Exchange 2007
1583
     *
1584
     * @param \jamesiarmes\PhpEws\Request\UpdateItemType $request
1585
     * @return \jamesiarmes\PhpEws\Response\UpdateItemResponseType
1586
     */
1587
    public function UpdateItem($request)
1588
    {
1589
        return $this->makeRequest(__FUNCTION__, $request);
1590
    }
1591
1592
    /**
1593
     * Updates a user configuration object on a folder.
1594
     *
1595
     * @since Exchange 2010
1596
     *
1597
     * @param \jamesiarmes\PhpEws\Request\UpdateUserConfigurationType $request
1598
     * @return \jamesiarmes\PhpEws\Response\UpdateUserConfigurationResponseType
1599
     */
1600
    public function UpdateUserConfiguration($request)
1601
    {
1602
        return $this->makeRequest(__FUNCTION__, $request);
1603
    }
1604
1605
    /**
1606
     * Uploads a stream of items into an Exchange mailbox.
1607
     *
1608
     * @since Exchange 2010 SP1
1609
     *
1610
     * @param \jamesiarmes\PhpEws\Request\UploadItemsType $request
1611
     * @return \jamesiarmes\PhpEws\Response\UploadItemsResponseType
1612
     */
1613
    public function UploadItems($request)
1614
    {
1615
        return $this->makeRequest(__FUNCTION__, $request);
1616
    }
1617
1618
    /**
1619
     * Initializes the SoapClient object to make a request
1620
     *
1621
     * @return \jamesiarmes\PhpNtlm\SoapClient
1622
     */
1623
    protected function initializeSoapClient()
1624
    {
1625
        $this->soap = new SoapClient(
1626
            dirname(__FILE__) . '/assets/services.wsdl',
1627
            array(
1628
                'user' => $this->username,
1629
                'password' => $this->password,
1630
                'location' => 'https://' . $this->server . '/EWS/Exchange.asmx',
1631
                'classmap' => $this->classMap(),
1632
                'curlopts' => $this->curl_options,
1633
                'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
1634
            )
1635
        );
1636
1637
        return $this->soap;
1638
    }
1639
1640
    /**
1641
     * The class map used to process SOAP requests and responses.
1642
     *
1643
     * @return string[]
1644
     *
1645
     * @see \jamesiarmes\PhpEws\ClassMap::getMap()
1646
     */
1647
    protected function classMap()
1648
    {
1649
        $class_map = new ClassMap();
1650
1651
        return $class_map->getMap();
1652
    }
1653
1654
    /**
1655
     * Makes the SOAP call for a request.
1656
     *
1657
     * @param string $operation
1658
     *   The operation to be called.
1659
     * @param \jamesiarmes\PhpEws\Request $request
1660
     *   The request object for the operation.
1661
     * @return \jamesiarmes\PhpEws\Response
1662
     *   The response object for the operation.
1663
     *
1664
     * @suppress PhanTypeMismatchReturn
1665
     */
1666
    protected function makeRequest($operation, $request)
1667
    {
1668
        $this->getClient()->__setSoapHeaders($this->soapHeaders());
1669
        $response = $this->soap->{$operation}($request);
1670
1671
        return $this->processResponse($response);
1672
    }
1673
1674
    /**
1675
     * Process a response to verify that it succeeded and take the appropriate
1676
     * action
1677
     *
1678
     * @throws \Exception
1679
     *
1680
     * @param \stdClass $response
1681
     * @return \stdClass
1682
     */
1683
    protected function processResponse($response)
1684
    {
1685
        // If the soap call failed then we need to throw an exception.
1686
        $code = $this->soap->getResponseCode();
1687
        if ($code != 200) {
1688
            throw new \Exception(
1689
                "SOAP client returned status of $code.",
1690
                $code
1691
            );
1692
        }
1693
1694
        return $response;
1695
    }
1696
1697
    /**
1698
     * Builds the soap headers to be included with the request.
1699
     *
1700
     * @return \SoapHeader[]
1701
     */
1702
    protected function soapHeaders()
1703
    {
1704
        // If the headers have already been built, no need to do so again.
1705
        if (!empty($this->headers)) {
1706
            return $this->headers;
1707
        }
1708
1709
        $this->headers = array();
1710
1711
        // Set the schema version.
1712
        $this->headers[] = new \SoapHeader(
1713
            'http://schemas.microsoft.com/exchange/services/2006/types',
1714
            'RequestServerVersion Version="' . $this->version . '"'
1715
        );
1716
1717
        // If impersonation was set then add it to the headers.
1718
        if (!empty($this->impersonation)) {
1719
            $this->headers[] = new \SoapHeader(
1720
                'http://schemas.microsoft.com/exchange/services/2006/types',
1721
                'ExchangeImpersonation',
1722
                $this->impersonation
1723
            );
1724
        }
1725
        
1726
        // If a mailbox culture was set add it to the headers.
1727
        if (!empty($this->culture)) {
0 ignored issues
show
Bug introduced by
The property culture does not seem to exist. Did you mean mailboxCulture?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
1728
            $this->headers[] = new \SoapHeader(
1729
                'http://schemas.microsoft.com/exchange/services/2006/types',
1730
                'MailboxCulture',
1731
                $this->culture
0 ignored issues
show
Bug introduced by
The property culture does not seem to exist. Did you mean mailboxCulture?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
1732
            );
1733
        }
1734
1735
        if (!empty($this->timezone)) {
1736
            $this->headers[] = new \SoapHeader(
1737
                'http://schemas.microsoft.com/exchange/services/2006/types',
1738
                'TimeZoneContext',
1739
                array(
1740
                    'TimeZoneDefinition' => array(
1741
                        'Id' => $this->timezone,
1742
                    )
1743
                )
1744
            );
1745
        }
1746
1747
        return $this->headers;
1748
    }
1749
}
1750