Completed
Pull Request — master (#380)
by
unknown
03:49
created

Client::AddImContactToGroup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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