Completed
Push — master ( cf858c...158d8f )
by James
03:09
created

Client::RemoveImContactFromGroup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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