-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBase.php
More file actions
3151 lines (2988 loc) · 104 KB
/
Base.php
File metadata and controls
3151 lines (2988 loc) · 104 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* This file is part of the Zimbra API in PHP library.
*
* © Nguyen Van Nguyen <nguyennv1981@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Zimbra\Mail;
use Zimbra\Account\Base as AccountBase;
use Zimbra\Enum\Action;
use Zimbra\Enum\BrowseBy;
use Zimbra\Enum\GalSearchType;
use Zimbra\Enum\InterestType;
use Zimbra\Enum\ParticipationStatus;
use Zimbra\Enum\SortBy;
use Zimbra\Mail\Struct\ActivityFilter;
use Zimbra\Mail\Struct\AddedComment;
use Zimbra\Mail\Struct\AddMsgSpec;
use Zimbra\Mail\Struct\AttributeName;
use Zimbra\Mail\Struct\BounceMsgSpec;
use Zimbra\Mail\Struct\CalTZInfo;
use Zimbra\Mail\Struct\ContactActionSelector;
use Zimbra\Mail\Struct\ContactSpec;
use Zimbra\Mail\Struct\Content;
use Zimbra\Mail\Struct\ContentSpec;
use Zimbra\Mail\Struct\ConvActionSelector;
use Zimbra\Mail\Struct\ConversationSpec;
use Zimbra\Mail\Struct\DiffDocumentVersionSpec;
use Zimbra\Mail\Struct\DismissAppointmentAlarm;
use Zimbra\Mail\Struct\DismissTaskAlarm;
use Zimbra\Mail\Struct\DocumentActionSelector;
use Zimbra\Mail\Struct\DocumentSpec;
use Zimbra\Mail\Struct\DtTimeInfo;
use Zimbra\Mail\Struct\ExpandedRecurrenceCancel;
use Zimbra\Mail\Struct\ExpandedRecurrenceException;
use Zimbra\Mail\Struct\ExpandedRecurrenceInvite;
use Zimbra\Mail\Struct\FilterRules;
use Zimbra\Mail\Struct\FreeBusyUserSpec;
use Zimbra\Mail\Struct\FolderActionSelector;
use Zimbra\Mail\Struct\FolderSpec;
use Zimbra\Mail\Struct\GetFolderSpec;
use Zimbra\Mail\Struct\IdsAttr;
use Zimbra\Mail\Struct\IdStatus;
use Zimbra\Mail\Struct\InstanceRecurIdInfo;
use Zimbra\Mail\Struct\ItemActionSelector;
use Zimbra\Mail\Struct\ItemSpec;
use Zimbra\Mail\Struct\ListDocumentRevisionsSpec;
use Zimbra\Mail\Struct\MailCustomMetadata;
use Zimbra\Mail\Struct\ModifyContactSpec;
use Zimbra\Mail\Struct\ModifySearchFolderSpec;
use Zimbra\Mail\Struct\Msg;
use Zimbra\Mail\Struct\MsgActionSelector;
use Zimbra\Mail\Struct\MsgPartIds;
use Zimbra\Mail\Struct\MsgSpec;
use Zimbra\Mail\Struct\MsgToSend;
use Zimbra\Mail\Struct\NamedFilterRules;
use Zimbra\Mail\Struct\NewFolderSpec;
use Zimbra\Mail\Struct\NewMountpointSpec;
use Zimbra\Mail\Struct\NewNoteSpec;
use Zimbra\Mail\Struct\NewSearchFolderSpec;
use Zimbra\Mail\Struct\NoteActionSelector;
use Zimbra\Mail\Struct\ParentId;
use Zimbra\Mail\Struct\PurgeRevisionSpec;
use Zimbra\Mail\Struct\RankingActionSpec;
use Zimbra\Mail\Struct\Replies;
use Zimbra\Mail\Struct\SaveDraftMsg;
use Zimbra\Mail\Struct\SectionAttr;
use Zimbra\Mail\Struct\SetCalendarItemInfo;
use Zimbra\Mail\Struct\SharedReminderMount;
use Zimbra\Mail\Struct\SnoozeAppointmentAlarm;
use Zimbra\Mail\Struct\SnoozeTaskAlarm;
use Zimbra\Mail\Struct\TagSpec;
use Zimbra\Mail\Struct\TagActionSelector;
use Zimbra\Mail\Struct\TargetSpec;
use Zimbra\Mail\Struct\MailDataSource;
use Zimbra\Mail\Struct\MailImapDataSource;
use Zimbra\Mail\Struct\MailPop3DataSource;
use Zimbra\Mail\Struct\MailCaldavDataSource;
use Zimbra\Mail\Struct\MailYabDataSource;
use Zimbra\Mail\Struct\MailRssDataSource;
use Zimbra\Mail\Struct\MailGalDataSource;
use Zimbra\Mail\Struct\MailCalDataSource;
use Zimbra\Mail\Struct\MailUnknownDataSource;
use Zimbra\Mail\Struct\ImapDataSourceNameOrId;
use Zimbra\Mail\Struct\Pop3DataSourceNameOrId;
use Zimbra\Mail\Struct\CaldavDataSourceNameOrId;
use Zimbra\Mail\Struct\YabDataSourceNameOrId;
use Zimbra\Mail\Struct\RssDataSourceNameOrId;
use Zimbra\Mail\Struct\GalDataSourceNameOrId;
use Zimbra\Mail\Struct\CalDataSourceNameOrId;
use Zimbra\Mail\Struct\UnknownDataSourceNameOrId;
use Zimbra\Struct\CursorInfo;
use Zimbra\Struct\Id;
use Zimbra\Struct\NamedElement;
use Zimbra\Struct\WaitSetAdd;
use Zimbra\Struct\WaitSetSpec;
use Zimbra\Struct\WaitSetId;
/**
* Base is a abstract class which allows to connect Zimbra API mail public functions via SOAP
*
* @package Zimbra
* @category Mail
* @author Nguyen Van Nguyen - nguyennv1981@gmail.com
* @copyright Copyright © 2013 by Nguyen Van Nguyen.
*/
abstract class Base extends AccountBase implements MailInterface
{
/**
* Base constructor
*
* @param string $location The Zimbra api soap location.
*/
public function __construct($location)
{
parent::__construct($location);
}
/**
* Add an invite to an appointment.
* The invite corresponds to a VEVENT component.
* Based on the UID specified (required),
* a new appointment is created in the default calendar if necessary.
* If an appointment with the same UID exists,
* the appointment is updated with the new invite only if the invite is not outdated,
* according to the iCalendar sequencing rule (based on SEQUENCE, RECURRENCE-ID and DTSTAMP).
*
* @param Msg $message Message.
* @param ParticipationStatus $ptst iCalendar PTST (Participation status). Valid values: NE|AC|TE|DE|DG|CO|IN|WE|DF. Meanings: "NE"eds-action, "TE"ntative, "AC"cept, "DE"clined, "DG" (delegated), "CO"mpleted (todo), "IN"-process (todo), "WA"iting (custom value only for todo), "DF" (deferred; custom value only for todo)
* @return mix
*/
public function addAppointmentInvite(Msg $m = null, ParticipationStatus $ptst = null)
{
$request = new \Zimbra\Mail\Request\AddAppointmentInvite(
$m, $ptst
);
return $this->getClient()->doRequest($request);
}
/**
* Add a comment to the specified item. Currently comments can only be added to documents.
*
* @param AddedComment $comment Added comment.
* @return mix
*/
public function addComment(AddedComment $comment)
{
$request = new \Zimbra\Mail\Request\AddComment(
$comment
);
return $this->getClient()->doRequest($request);
}
/**
* Add a message.
*
* @param AddMsgSpec $m Specification of the message to add.
* @param bool $filterSent If set, then do outgoing message filtering if the msg is being added to the Sent folder and has been flagged as sent. Default is unset.
* @return mix
*/
public function addMsg(AddMsgSpec $m, $filterSent = null)
{
$request = new \Zimbra\Mail\Request\AddMsg(
$m, $filterSent
);
return $this->getClient()->doRequest($request);
}
/**
* Add a task invite.
*
* @param Msg $m Message.
* @param ParticipationStatus $ptst iCalendar PTST (Participation status). Valid values: NE|AC|TE|DE|DG|CO|IN|WE|DF. Meanings: "NE"eds-action, "TE"ntative, "AC"cept, "DE"clined, "DG" (delegated), "CO"mpleted (todo), "IN"-process (todo), "WA"iting (custom value only for todo), "DF" (deferred; custom value only for todo)
* @return mix
*/
public function addTaskInvite(Msg $m = null, ParticipationStatus $ptst = null)
{
$request = new \Zimbra\Mail\Request\AddTaskInvite(
$m, $ptst
);
return $this->getClient()->doRequest($request);
}
/**
* Announce change of organizer.
*
* @param string $id ID.
* @return mix
*/
public function announceOrganizerChange($id)
{
$request = new \Zimbra\Mail\Request\AnnounceOrganizerChange(
$id
);
return $this->getClient()->doRequest($request);
}
/**
* Applies one or more filter rules to messages specified by a comma-separated ID list, or returned by a search query.
* One or the other can be specified, but not both.
* Returns the list of ids of existing messages that were affected.
* Note that redirect actions are ignored when applying filter rules to existing messages.
*
* @param NamedFilterRules $filterRules Filter rules.
* @param IdsAttr $m Comma-separated list of message IDs.
* @param string $query Query string.
* @return mix
*/
public function applyFilterRules(
NamedFilterRules $filterRules,
IdsAttr $m = null,
$query = null
)
{
$request = new \Zimbra\Mail\Request\ApplyFilterRules(
$filterRules, $m, $query
);
return $this->getClient()->doRequest($request);
}
/**
* Applies one or more filter rules to messages specified by a comma-separated ID list, or returned by a search query.
* One or the other can be specified, but not both.
* Returns the list of ids of existing messages that were affected.
*
* @param NamedFilterRules $filterRules Filter rules.
* @param IdsAttr $m Comma-separated list of message IDs.
* @param string $query Query string.
* @return mix
*/
public function applyOutgoingFilterRules(
NamedFilterRules $filterRules,
IdsAttr $m = null,
$query = null
)
{
$request = new \Zimbra\Mail\Request\ApplyOutgoingFilterRules(
$filterRules, $m, $query
);
return $this->getClient()->doRequest($request);
}
/**
* AutoComplete.
*
* @param string $name Name.
* @param GalSearchType $t GAL Search type - default value is "account". Valid values: all|account|resource|group
* @param bool $needExp Set if the "exp" flag is needed in the response for group entries. Default is unset..
* @param string $folders Comma separated list of folder IDs.
* @param bool $includeGal Flag whether to include Global Address Book (GAL).
* @return mix
*/
public function autoComplete(
$name,
GalSearchType $t = null,
$needExp = null,
$folders = null,
$includeGal = null
)
{
$request = new \Zimbra\Mail\Request\AutoComplete(
$name,
$t,
$needExp,
$folders,
$includeGal
);
return $this->getClient()->doRequest($request);
}
/**
* Resend a message.
* Supports (f)rom, (t)o, (c)c, (b)cc, (s)ender "type" on <e> elements
* (these get mapped to Resent-From, Resent-To, Resent-CC, Resent-Bcc, Resent-Sender headers,
* which are prepended to copy of existing message)
* Aside from these prepended headers, message is reinjected verbatim
*
* @param BounceMsgSpec $msg Specification of message to be resent.
* @return mix
*/
public function bounceMsg(BounceMsgSpec $msg)
{
$request = new \Zimbra\Mail\Request\BounceMsg(
$msg
);
return $this->getClient()->doRequest($request);
}
/**
* Browse.
*
* @param BrowseBy $browseBy Browse by setting - domains|attachments|objects.
* @param string $regex Regex string. Return only those results which match the specified regular expression.
* @param int $maxToReturn Return only a maximum number of entries as requested. If more than {max-entries} results exist, the server will return the first {max-entries}, sorted by frequency.
* @return mix
*/
public function browse(BrowseBy $browseBy, $regex = null, $maxToReturn = null)
{
$request = new \Zimbra\Mail\Request\Browse(
$browseBy, $regex, $maxToReturn
);
return $this->getClient()->doRequest($request);
}
/**
* Cancel appointment.
* NOTE: If canceling an exception, the original instance (ie the one the exception was "excepting") WILL NOT be restored when you cancel this exception.
* If <inst> is set, then this cancels just the specified instance or range of instances, otherwise it cancels the entire appointment. If <inst> is not set, then id MUST refer to the default invite for the appointment.
*
* @param InstanceRecurIdInfo $inst Instance recurrence ID information
* @param CalTZInfo $tz Definition for TZID referenced by DATETIME in <inst>
* @param Msg $m Message
* @param string $id ID of default invite
* @param int $comp Component number of default invite
* @param int $ms Modified sequence
* @param int $rev Revision
* @return mix
*/
public function cancelAppointment(
InstanceRecurIdInfo $inst = null,
CalTZInfo $tz = null,
Msg $m = null,
$id = null,
$comp = null,
$ms = null,
$rev = null
)
{
$request = new \Zimbra\Mail\Request\CancelAppointment(
$inst,
$tz,
$m,
$id,
$comp,
$ms,
$rev
);
return $this->getClient()->doRequest($request);
}
/**
* Cancel task.
*
* @param InstanceRecurIdInfo $inst Instance recurrence ID information
* @param CalTZInfo $tz Definition for TZID referenced by DATETIME in <inst>
* @param Msg $m Message
* @param string $id ID of default invite
* @param int $comp Component number of default invite
* @param int $ms Modified sequence
* @param int $rev Revision
* @return mix
*/
public function cancelTask(
InstanceRecurIdInfo $inst = null,
CalTZInfo $tz = null,
Msg $m = null,
$id = null,
$comp = null,
$ms = null,
$rev = null
)
{
$request = new \Zimbra\Mail\Request\CancelTask(
$inst,
$tz,
$m,
$id,
$comp,
$ms,
$rev
);
return $this->getClient()->doRequest($request);
}
/**
* Check device status.
*
* @param Id $id Device ID.
* @return mix
*/
public function checkDeviceStatus(Id $device)
{
$request = new \Zimbra\Mail\Request\CheckDeviceStatus(
$device
);
return $this->getClient()->doRequest($request);
}
/**
* Check if the authed user has the specified right(s) on a target.
* If the specified target cannot be found:
* 1. if by is "id", throw NO_SUCH_ACCOUNT/NO_SUCH_CALENDAR_RESOURCE
* 2. if by is "name", return the default permission for the right.
*
* @param TargetSpec $target Target specification
* @param array $rights Rights to check.
* @return mix
*/
public function checkPermission(TargetSpec $target = null, array $right = [])
{
$request = new \Zimbra\Mail\Request\CheckPermission(
$target, $right
);
return $this->getClient()->doRequest($request);
}
/**
* Check conflicts in recurrence against list of users.
* Set all attribute to get all instances, even those without conflicts.
* By default only instances that have conflicts are returned.
*
* @param int $s Start time in millis. If not specified, defaults to current time
* @param int $e End time in millis. If not specified, unlimited
* @param bool $all Set this to get all instances, even those without conflicts. By default only instances that have conflicts are returned.
* @param string $excludeUid UID of appointment to exclude from free/busy search
* @param array $timezones Timezones
* @param array $component Expanded recurrences
* @param array $users Freebusy user specifications
* @return mix
*/
public function checkRecurConflicts(
$s = null,
$e = null,
$all = null,
$excludeUid = null,
array $timezones = [],
array $component = [],
array $users = []
)
{
$request = new \Zimbra\Mail\Request\CheckRecurConflicts(
$s,
$e,
$all,
$excludeUid,
$timezones,
$component,
$users
);
return $this->getClient()->doRequest($request);
}
/**
* Check spelling.
* Suggested words are listed in decreasing order of their match score.
* The "available" attribute specifies whether the server-side spell checking interface is available or not.
*
* @param string $value Text to spell check
* @param string $dictionary The optional name of the aspell dictionary that will be used to check spelling.
* @param string $ignore Comma-separated list of words to ignore just for this request.
* @return mix
*/
public function checkSpelling($value = null, $dictionary = null, $ignore = null)
{
$request = new \Zimbra\Mail\Request\CheckSpelling(
$value, $dictionary, $ignore
);
return $this->getClient()->doRequest($request);
}
/**
* Complete a task instance.
*
* @param string $id ID
* @param DtTimeInfo $exceptId Exception ID
* @param CalTZInfo $tz Timezone information
* @return mix
*/
public function completeTaskInstance(
$id,
DtTimeInfo $exceptId,
CalTZInfo $tz = null
)
{
$request = new \Zimbra\Mail\Request\CompleteTaskInstance(
$id, $exceptId, $tz
);
return $this->getClient()->doRequest($request);
}
/**
* Contact Action.
*
* @param ContactActionSelector $action Contact action selector
* @return mix
*/
public function contactAction(ContactActionSelector $action)
{
$request = new \Zimbra\Mail\Request\ContactAction(
$action
);
return $this->getClient()->doRequest($request);
}
/**
* Conv Action.
*
* @param ConvActionSelector $action Action selector.
* @return mix
*/
public function convAction(ConvActionSelector $action)
{
$request = new \Zimbra\Mail\Request\ConvAction(
$action
);
return $this->getClient()->doRequest($request);
}
/**
* Propose a new time/location. Sent by meeting attendee to organizer.
* The syntax is very similar to CreateAppointmentRequest.
*
* @param Msg $m Details of counter proposal.
* @param string $id Invite ID of default invite
* @param int $comp Component number of default component
* @param int $ms Changed sequence of fetched version.
* @param int $rev Revision
* @return mix
*/
public function counterAppointment(
Msg $m = null,
$id = null,
$comp = null,
$ms = null,
$rev = null
)
{
$request = new \Zimbra\Mail\Request\CounterAppointment(
$m,
$id,
$comp,
$ms,
$rev
);
return $this->getClient()->doRequest($request);
}
/**
* This is the API to create a new Appointment, optionally sending out meeting Invitations to other people.
*
* @param Msg $m Message
* @param bool $echo If specified, the created appointment is echoed back in the response as if a GetMsgRequest was made
* @param int $max Maximum inlined length
* @param bool $html Set if want HTML included in echoing
* @param bool $neuter Set if want "neuter" set for echoed response
* @param bool $forcesend If set, ignore smtp 550 errors when sending the notification to attendees.
* @return mix
*/
public function createAppointment(
Msg $m = null,
$echo = null,
$max = null,
$html = null,
$neuter = null,
$forcesend = null
)
{
$request = new \Zimbra\Mail\Request\CreateAppointment(
$m,
$echo,
$max,
$html,
$neuter,
$forcesend
);
return $this->getClient()->doRequest($request);
}
/**
* Create Appointment Exception.
*
* @param Msg $m Message
* @param string $id ID of default invite
* @param int $comp Component of default invite
* @param int $ms Change sequence of fetched series
* @param int $rev Revision of fetched series
* @param bool $echo If specified, the created appointment is echoed back in the response as if a GetMsgRequest was made
* @param int $max Maximum inlined length
* @param bool $html Set if want HTML included in echoing
* @param bool $neuter Set if want "neuter" set for echoed response
* @param bool $forcesend If set, ignore smtp 550 errors when sending the notification to attendees.
* @return mix
*/
public function createAppointmentException(
Msg $m = null,
$id = null,
$comp = null,
$ms = null,
$rev = null,
$echo = null,
$max = null,
$html = null,
$neuter = null,
$forcesend = null
)
{
$request = new \Zimbra\Mail\Request\CreateAppointmentException(
$m,
$id,
$comp,
$ms,
$rev,
$echo,
$max,
$html,
$neuter,
$forcesend
);
return $this->getClient()->doRequest($request);
}
/**
* Create a contact.
*
* @param ContactSpec $cn Contact specification
* @param bool $verbose If set (defaults to unset) The returned <cn> is just a placeholder containing the new contact ID (i.e. <cn id="{id}"/>)
* @return mix
*/
public function createContact(ContactSpec $cn, $verbose = null)
{
$request = new \Zimbra\Mail\Request\CreateContact(
$cn, $verbose
);
return $this->getClient()->doRequest($request);
}
/**
* Creates a data source that imports mail items into the specified folder,
* for example via the POP3 or IMAP protocols.
* Only one data source is allowed per request.
*
* @param MailDataSource $ds Data source
* @return mix
*/
public function createDataSource(MailDataSource $ds)
{
$request = new \Zimbra\Mail\Request\CreateDataSource($ds);
return $this->getClient()->doRequest($request);
}
/**
* Creates a imap data source that imports mail items into the specified folder.
*
* @param MailImapDataSource $imap Imap data source
* @return mix
*/
public function createImapDataSource(MailImapDataSource $imap)
{
return $this->createDataSource($imap);
}
/**
* Creates a pop3 data source that imports mail items into the specified folder.
*
* @param MailPop3DataSource $pop3 Pop3 data source
* @return mix
*/
public function createPop3DataSource(MailPop3DataSource $pop3)
{
return $this->createDataSource($pop3);
}
/**
* Creates a caldav data source that imports mail items into the specified folder.
*
* @param MailCaldavDataSource $caldav Caldav data source
* @return mix
*/
public function createCaldavDataSource(MailCaldavDataSource $caldav)
{
return $this->createDataSource($caldav);
}
/**
* Creates a yab data source that imports mail items into the specified folder.
*
* @param MailYabDataSource $yab Caldav data source
* @return mix
*/
public function createYabDataSource(MailYabDataSource $yab)
{
return $this->createDataSource($yab);
}
/**
* Creates a rss data source that imports mail items into the specified folder.
*
* @param MailRssDataSource $rss Rss data source
* @return mix
*/
public function createRssDataSource(MailRssDataSource $rss)
{
return $this->createDataSource($rss);
}
/**
* Creates a gal data source that imports mail items into the specified folder.
*
* @param MailGalDataSource $gal Gal data source
* @return mix
*/
public function createGalDataSource(MailGalDataSource $gal)
{
return $this->createDataSource($gal);
}
/**
* Creates a cal data source that imports mail items into the specified folder.
*
* @param MailCalDataSource $cal Cal data source
* @return mix
*/
public function createCalDataSource(MailCalDataSource $cal)
{
return $this->createDataSource($cal);
}
/**
* Creates a unknown data source that imports mail items into the specified folder.
*
* @param MailUnknownDataSource $unknown Unknown data source
* @return mix
*/
public function createUnknownDataSource(MailUnknownDataSource $unknown)
{
return $this->createDataSource($unknown);
}
/**
* Create folder.
*
* @param NewFolderSpec $folder New folder specification.
* @return mix
*/
public function createFolder(NewFolderSpec $folder)
{
$request = new \Zimbra\Mail\Request\CreateFolder(
$folder
);
return $this->getClient()->doRequest($request);
}
/**
* Create mountpoint.
*
* @param NewMountpointSpec $link New mountpoint specification.
* @return mix
*/
public function createMountpoint(NewMountpointSpec $link)
{
$request = new \Zimbra\Mail\Request\CreateMountpoint(
$link
);
return $this->getClient()->doRequest($request);
}
/**
* Create a note.
*
* @param NewNoteSpec $note New note specification.
* @return mix
*/
public function createNote(NewNoteSpec $note)
{
$request = new \Zimbra\Mail\Request\CreateNote(
$note
);
return $this->getClient()->doRequest($request);
}
/**
* Create a search folder.
*
* @param NewSearchFolderSpec $search New search folder specification.
* @return mix
*/
public function createSearchFolder(NewSearchFolderSpec $search)
{
$request = new \Zimbra\Mail\Request\CreateSearchFolder(
$search
);
return $this->getClient()->doRequest($request);
}
/**
* Create a tag.
*
* @param TagSpec $tag Tag specification.
* @return mix
*/
public function createTag(TagSpec $tag)
{
$request = new \Zimbra\Mail\Request\CreateTag(
$tag
);
return $this->getClient()->doRequest($request);
}
/**
* This is the API to create a new Task.
*
* @param Msg $m Message
* @param bool $echo If specified, the created appointment is echoed back in the response as if a GetMsgRequest was made
* @param int $max Maximum inlined length
* @param bool $html Set if want HTML included in echoing
* @param bool $neuter Set if want "neuter" set for echoed response
* @param bool $forcesend If set, ignore smtp 550 errors when sending the notification to attendees.
* @return mix
*/
public function createTask(
Msg $m = null,
$echo = null,
$max = null,
$html = null,
$neuter = null,
$forcesend = null
)
{
$request = new \Zimbra\Mail\Request\CreateTask(
$m,
$echo,
$max,
$html,
$neuter,
$forcesend
);
return $this->getClient()->doRequest($request);
}
/**
* Create Task Exception.
*
* @param Msg $m Message
* @param string $id ID of default invite
* @param int $comp Component of default invite
* @param int $ms Change sequence of fetched series
* @param int $rev Revision of fetched series
* @param bool $echo If specified, the created appointment is echoed back in the response as if a GetMsgRequest was made
* @param int $max Maximum inlined length
* @param bool $html Set if want HTML included in echoing
* @param bool $neuter Set if want "neuter" set for echoed response
* @param bool $forcesend If set, ignore smtp 550 errors when sending the notification to attendees.
* @return mix
*/
public function createTaskException(
Msg $m = null,
$id = null,
$comp = null,
$ms = null,
$rev = null,
$echo = null,
$max = null,
$html = null,
$neuter = null,
$forcesend = null
)
{
$request = new \Zimbra\Mail\Request\CreateTaskException(
$m,
$id,
$comp,
$ms,
$rev,
$echo,
$max,
$html,
$neuter,
$forcesend
);
return $this->getClient()->doRequest($request);
}
/**
* Create a waitset to listen for changes on one or more accounts.
* Called once to initialize a WaitSet and to set its "default interest types"
* WaitSet: scalable mechanism for listening for changes to one or more accounts
*
* @param WaitSetSpec $add WaitSet add specification.
* @param array $defTypes Default interest types: comma-separated list.
* @param bool $allAccounts If {all-accounts} is set, then all mailboxes on the system will be listened to, including any mailboxes which are created on the system while the WaitSet is in existence.
* @return mix
*/
public function createWaitSet(
WaitSetSpec $add = null,
array $defTypes = [],
$allAccounts = null
)
{
$request = new \Zimbra\Mail\Request\CreateWaitSet(
$add,
$defTypes,
$allAccounts
);
return $this->getClient()->doRequest($request);
}
/**
* Decline a change proposal from an attendee.
* Sent by organizer to an attendee who has previously sent a COUNTER message.
* The syntax of the request is very similar to CreateAppointmentRequest.
*
* @param Msg $message Details of the Decline Counter.
* @return mix
*/
public function declineCounterAppointment(Msg $m = null)
{
$request = new \Zimbra\Mail\Request\DeclineCounterAppointment(
$m
);
return $this->getClient()->doRequest($request);
}
/**
* Deletes the given data sources.
* The name or id of each data source must be specified.
*
* @param ImapDataSourceNameOrId $imap
* @param Pop3DataSourceNameOrId $pop3
* @param CaldavDataSourceNameOrId $caldav
* @param YabDataSourceNameOrId $yab
* @param RssDataSourceNameOrId $rss
* @param GalDataSourceNameOrId $gal
* @param CalDataSourceNameOrId $cal
* @param UnknownDataSourceNameOrId $unknown
* @return mix
*/
public function deleteDataSource(
ImapDataSourceNameOrId $imap = null,
Pop3DataSourceNameOrId $pop3 = null,
CaldavDataSourceNameOrId $caldav = null,
YabDataSourceNameOrId $yab = null,
RssDataSourceNameOrId $rss = null,
GalDataSourceNameOrId $gal = null,
CalDataSourceNameOrId $cal = null,
UnknownDataSourceNameOrId $unknown = null
)
{
$request = new \Zimbra\Mail\Request\DeleteDataSource(
$imap,
$pop3,
$caldav,
$yab,
$rss,
$gal,
$cal,
$unknown
);
return $this->getClient()->doRequest($request);
}
/**
* Permanently deletes mapping for indicated device.
*
* @param Id $id Device ID.
* @return mix
*/
public function deleteDevice(Id $device)
{
$request = new \Zimbra\Mail\Request\DeleteDevice(
$device
);
return $this->getClient()->doRequest($request);
}
/**
* Use this to close out the waitset.
* Note that the server will automatically time out a wait set if there is no reference to it for (default of) 20 minutes.
* WaitSet: scalable mechanism for listening for changes to one or more accounts.
*
* @param string $waitSet Waitset ID.
* @return mix
*/
public function destroyWaitSet($waitSet)
{
$request = new \Zimbra\Mail\Request\DestroyWaitSet(
$waitSet
);
return $this->getClient()->doRequest($request);
}
/**
* Performs line by line diff of two revisions of a Document then returns a list of <chunk/> containing the result.
* Sections of text that are identical to both versions are indicated with disp="common".
* For each conflict the chunk will show disp="first", disp="second" or both.
*
* @param DiffDocumentVersionSpec $doc Diff document version specification.
* @return mix
*/
public function diffDocument(DiffDocumentVersionSpec $doc)
{
$request = new \Zimbra\Mail\Request\DiffDocument(