1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of the WrikePhpSdk package. |
4
|
|
|
* |
5
|
|
|
* (c) Zbigniew Ślązak |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Zibios\WrikePhpSdk\Documents\Contact; |
12
|
|
|
|
13
|
|
|
use JMS\Serializer\Annotation as SA; |
14
|
|
|
use Zibios\WrikePhpSdk\Documents\Components\MetadataDocument; |
15
|
|
|
use Zibios\WrikePhpSdk\Documents\Components\UserProfileDocument; |
16
|
|
|
use Zibios\WrikePhpSdk\Documents\ResourceDocumentAbstract; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Contact Resource Document |
20
|
|
|
*/ |
21
|
|
|
class ContactResourceDocument extends ResourceDocumentAbstract |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* Contact ID |
25
|
|
|
* |
26
|
|
|
* Comment: Contact ID |
27
|
|
|
* |
28
|
|
|
* @SA\Type("string") |
29
|
|
|
* @SA\SerializedName("id") |
30
|
|
|
* @var string|null |
31
|
|
|
*/ |
32
|
|
|
protected $id; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* First name |
36
|
|
|
* |
37
|
|
|
* @SA\Type("string") |
38
|
|
|
* @SA\SerializedName("firstName") |
39
|
|
|
* @var string|null |
40
|
|
|
*/ |
41
|
|
|
protected $firstName; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Last name |
45
|
|
|
* |
46
|
|
|
* @SA\Type("string") |
47
|
|
|
* @SA\SerializedName("lastName") |
48
|
|
|
* @var string|null |
49
|
|
|
*/ |
50
|
|
|
protected $lastName; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Type of the user |
54
|
|
|
* |
55
|
|
|
* Enum: Person, Group |
56
|
|
|
* @see \Zibios\WrikePhpSdk\Enums\UserTypeEnum |
57
|
|
|
* |
58
|
|
|
* @SA\Type("string") |
59
|
|
|
* @SA\SerializedName("type") |
60
|
|
|
* @var string|null |
61
|
|
|
*/ |
62
|
|
|
protected $type; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* List of user profiles in accounts accessible for requesting user |
66
|
|
|
* |
67
|
|
|
* @SA\Type("array<Zibios\WrikePhpSdk\Api\Documents\Components\UserProfileDocument>") |
68
|
|
|
* @SA\SerializedName("profiles") |
69
|
|
|
* @var array|UserProfileDocument[]|null |
70
|
|
|
*/ |
71
|
|
|
protected $profiles; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Avatar URL |
75
|
|
|
* |
76
|
|
|
* @SA\Type("string") |
77
|
|
|
* @SA\SerializedName("avatarUrl") |
78
|
|
|
* @var string|null |
79
|
|
|
*/ |
80
|
|
|
protected $avatarUrl; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Timezone Id, e.g 'America/New_York' |
84
|
|
|
* |
85
|
|
|
* @SA\Type("string") |
86
|
|
|
* @SA\SerializedName("timezone") |
87
|
|
|
* @var string|null |
88
|
|
|
*/ |
89
|
|
|
protected $timezone; |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Locale |
93
|
|
|
* |
94
|
|
|
* @SA\Type("string") |
95
|
|
|
* @SA\SerializedName("locale") |
96
|
|
|
* @var string|null |
97
|
|
|
*/ |
98
|
|
|
protected $locale; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* True if user is deleted, false otherwise |
102
|
|
|
* |
103
|
|
|
* @SA\Type("boolean") |
104
|
|
|
* @SA\SerializedName("deleted") |
105
|
|
|
* @var bool|null |
106
|
|
|
*/ |
107
|
|
|
protected $deleted; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* Field is present and set to true only for requesting user |
111
|
|
|
* |
112
|
|
|
* @SA\Type("boolean") |
113
|
|
|
* @SA\SerializedName("me") |
114
|
|
|
* @var bool|null |
115
|
|
|
*/ |
116
|
|
|
protected $me; |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* List of group members contact IDs (field is present only for groups) |
120
|
|
|
* |
121
|
|
|
* Comment: Contact ID array |
122
|
|
|
* |
123
|
|
|
* @SA\Type("array<string>") |
124
|
|
|
* @SA\SerializedName("memberIds") |
125
|
|
|
* @var array|string[]|null |
126
|
|
|
*/ |
127
|
|
|
protected $memberIds; |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* List of contact metadata entries. |
131
|
|
|
* |
132
|
|
|
* Requesting user has read/write access to his own metadata, other entries are read-only |
133
|
|
|
* Metadata entry key-value pair |
134
|
|
|
* Metadata entries are isolated on per-client (application) basis |
135
|
|
|
* Comment: Optional |
136
|
|
|
* |
137
|
|
|
* @SA\Type("array<Zibios\WrikePhpSdk\Api\Documents\Components\MetadataDocument>") |
138
|
|
|
* @SA\SerializedName("metadata") |
139
|
|
|
* @var array|MetadataDocument[]|null |
140
|
|
|
*/ |
141
|
|
|
protected $metadata; |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Field is present and set to true for My Team (default) group |
145
|
|
|
* |
146
|
|
|
* Comment: Optional |
147
|
|
|
* |
148
|
|
|
* @SA\Type("boolean") |
149
|
|
|
* @SA\SerializedName("myTeam") |
150
|
|
|
* @var bool|null |
151
|
|
|
*/ |
152
|
|
|
protected $myTeam; |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* User Title |
156
|
|
|
* |
157
|
|
|
* Comment: Optional |
158
|
|
|
* |
159
|
|
|
* @SA\Type("string") |
160
|
|
|
* @SA\SerializedName("title") |
161
|
|
|
* @var string|null |
162
|
|
|
*/ |
163
|
|
|
protected $title; |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* User Company Name |
167
|
|
|
* |
168
|
|
|
* Comment: Optional |
169
|
|
|
* |
170
|
|
|
* @SA\Type("string") |
171
|
|
|
* @SA\SerializedName("companyName") |
172
|
|
|
* @var string|null |
173
|
|
|
*/ |
174
|
|
|
protected $companyName; |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* User phone |
178
|
|
|
* |
179
|
|
|
* Comment: Optional |
180
|
|
|
* |
181
|
|
|
* @SA\Type("string") |
182
|
|
|
* @SA\SerializedName("phone") |
183
|
|
|
* @var string|null |
184
|
|
|
*/ |
185
|
|
|
protected $phone; |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* User location |
189
|
|
|
* |
190
|
|
|
* Comment: Optional |
191
|
|
|
* |
192
|
|
|
* @SA\Type("string") |
193
|
|
|
* @SA\SerializedName("location") |
194
|
|
|
* @var string|null |
195
|
|
|
*/ |
196
|
|
|
protected $location; |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* @return null|string |
200
|
|
|
*/ |
201
|
7 |
|
public function getId() |
202
|
|
|
{ |
203
|
7 |
|
return $this->id; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @param null|string $id |
208
|
|
|
* |
209
|
|
|
* @return $this |
210
|
|
|
*/ |
211
|
|
|
public function setId($id) |
212
|
|
|
{ |
213
|
|
|
$this->id = $id; |
214
|
|
|
|
215
|
|
|
return $this; |
216
|
|
|
} |
217
|
|
|
|
218
|
|
|
/** |
219
|
|
|
* @return null|string |
220
|
|
|
*/ |
221
|
|
|
public function getFirstName() |
222
|
|
|
{ |
223
|
|
|
return $this->firstName; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* @param null|string $firstName |
228
|
|
|
* |
229
|
|
|
* @return $this |
230
|
|
|
*/ |
231
|
|
|
public function setFirstName($firstName) |
232
|
|
|
{ |
233
|
|
|
$this->firstName = $firstName; |
234
|
|
|
|
235
|
|
|
return $this; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* @return null|string |
240
|
|
|
*/ |
241
|
|
|
public function getLastName() |
242
|
|
|
{ |
243
|
|
|
return $this->lastName; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @param null|string $lastName |
248
|
|
|
* |
249
|
|
|
* @return $this |
250
|
|
|
*/ |
251
|
|
|
public function setLastName($lastName) |
252
|
|
|
{ |
253
|
|
|
$this->lastName = $lastName; |
254
|
|
|
|
255
|
|
|
return $this; |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
/** |
259
|
|
|
* @return null|string |
260
|
|
|
*/ |
261
|
|
|
public function getType() |
262
|
|
|
{ |
263
|
|
|
return $this->type; |
264
|
|
|
} |
265
|
|
|
|
266
|
|
|
/** |
267
|
|
|
* @param null|string $type |
268
|
|
|
* |
269
|
|
|
* @return $this |
270
|
|
|
*/ |
271
|
|
|
public function setType($type) |
272
|
|
|
{ |
273
|
|
|
$this->type = $type; |
274
|
|
|
|
275
|
|
|
return $this; |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* @return array|null|UserProfileDocument[] |
280
|
|
|
*/ |
281
|
|
|
public function getProfiles() |
282
|
|
|
{ |
283
|
|
|
return $this->profiles; |
284
|
|
|
} |
285
|
|
|
|
286
|
|
|
/** |
287
|
|
|
* @param array|null|UserProfileDocument[] $profiles |
288
|
|
|
* |
289
|
|
|
* @return $this |
290
|
|
|
*/ |
291
|
|
|
public function setProfiles($profiles) |
292
|
|
|
{ |
293
|
|
|
$this->profiles = $profiles; |
294
|
|
|
|
295
|
|
|
return $this; |
296
|
|
|
} |
297
|
|
|
|
298
|
|
|
/** |
299
|
|
|
* @return null|string |
300
|
|
|
*/ |
301
|
|
|
public function getAvatarUrl() |
302
|
|
|
{ |
303
|
|
|
return $this->avatarUrl; |
304
|
|
|
} |
305
|
|
|
|
306
|
|
|
/** |
307
|
|
|
* @param null|string $avatarUrl |
308
|
|
|
* |
309
|
|
|
* @return $this |
310
|
|
|
*/ |
311
|
|
|
public function setAvatarUrl($avatarUrl) |
312
|
|
|
{ |
313
|
|
|
$this->avatarUrl = $avatarUrl; |
314
|
|
|
|
315
|
|
|
return $this; |
316
|
|
|
} |
317
|
|
|
|
318
|
|
|
/** |
319
|
|
|
* @return null|string |
320
|
|
|
*/ |
321
|
|
|
public function getTimezone() |
322
|
|
|
{ |
323
|
|
|
return $this->timezone; |
324
|
|
|
} |
325
|
|
|
|
326
|
|
|
/** |
327
|
|
|
* @param null|string $timezone |
328
|
|
|
* |
329
|
|
|
* @return $this |
330
|
|
|
*/ |
331
|
|
|
public function setTimezone($timezone) |
332
|
|
|
{ |
333
|
|
|
$this->timezone = $timezone; |
334
|
|
|
|
335
|
|
|
return $this; |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
/** |
339
|
|
|
* @return null|string |
340
|
|
|
*/ |
341
|
|
|
public function getLocale() |
342
|
|
|
{ |
343
|
|
|
return $this->locale; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* @param null|string $locale |
348
|
|
|
* |
349
|
|
|
* @return $this |
350
|
|
|
*/ |
351
|
|
|
public function setLocale($locale) |
352
|
|
|
{ |
353
|
|
|
$this->locale = $locale; |
354
|
|
|
|
355
|
|
|
return $this; |
356
|
|
|
} |
357
|
|
|
|
358
|
|
|
/** |
359
|
|
|
* @return bool|null |
360
|
|
|
*/ |
361
|
|
|
public function getDeleted() |
362
|
|
|
{ |
363
|
|
|
return $this->deleted; |
364
|
|
|
} |
365
|
|
|
|
366
|
|
|
/** |
367
|
|
|
* @param bool|null $deleted |
368
|
|
|
* |
369
|
|
|
* @return $this |
370
|
|
|
*/ |
371
|
|
|
public function setDeleted($deleted) |
372
|
|
|
{ |
373
|
|
|
$this->deleted = $deleted; |
374
|
|
|
|
375
|
|
|
return $this; |
376
|
|
|
} |
377
|
|
|
|
378
|
|
|
/** |
379
|
|
|
* @return bool|null |
380
|
|
|
*/ |
381
|
|
|
public function getMe() |
382
|
|
|
{ |
383
|
|
|
return $this->me; |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
/** |
387
|
|
|
* @param bool|null $me |
388
|
|
|
* |
389
|
|
|
* @return $this |
390
|
|
|
*/ |
391
|
|
|
public function setMe($me) |
392
|
|
|
{ |
393
|
|
|
$this->me = $me; |
394
|
|
|
|
395
|
|
|
return $this; |
396
|
|
|
} |
397
|
|
|
|
398
|
|
|
/** |
399
|
|
|
* @return array|null|string[] |
400
|
|
|
*/ |
401
|
|
|
public function getMemberIds() |
402
|
|
|
{ |
403
|
|
|
return $this->memberIds; |
404
|
|
|
} |
405
|
|
|
|
406
|
|
|
/** |
407
|
|
|
* @param array|null|string[] $memberIds |
408
|
|
|
* |
409
|
|
|
* @return $this |
410
|
|
|
*/ |
411
|
|
|
public function setMemberIds($memberIds) |
412
|
|
|
{ |
413
|
|
|
$this->memberIds = $memberIds; |
414
|
|
|
|
415
|
|
|
return $this; |
416
|
|
|
} |
417
|
|
|
|
418
|
|
|
/** |
419
|
|
|
* @return array|null|MetadataDocument[] |
420
|
|
|
*/ |
421
|
|
|
public function getMetadata() |
422
|
|
|
{ |
423
|
|
|
return $this->metadata; |
424
|
|
|
} |
425
|
|
|
|
426
|
|
|
/** |
427
|
|
|
* @param array|null|MetadataDocument[] $metadata |
428
|
|
|
* |
429
|
|
|
* @return $this |
430
|
|
|
*/ |
431
|
|
|
public function setMetadata($metadata) |
432
|
|
|
{ |
433
|
|
|
$this->metadata = $metadata; |
434
|
|
|
|
435
|
|
|
return $this; |
436
|
|
|
} |
437
|
|
|
|
438
|
|
|
/** |
439
|
|
|
* @return bool|null |
440
|
|
|
*/ |
441
|
|
|
public function getMyTeam() |
442
|
|
|
{ |
443
|
|
|
return $this->myTeam; |
444
|
|
|
} |
445
|
|
|
|
446
|
|
|
/** |
447
|
|
|
* @param bool|null $myTeam |
448
|
|
|
* |
449
|
|
|
* @return $this |
450
|
|
|
*/ |
451
|
|
|
public function setMyTeam($myTeam) |
452
|
|
|
{ |
453
|
|
|
$this->myTeam = $myTeam; |
454
|
|
|
|
455
|
|
|
return $this; |
456
|
|
|
} |
457
|
|
|
|
458
|
|
|
/** |
459
|
|
|
* @return null|string |
460
|
|
|
*/ |
461
|
|
|
public function getTitle() |
462
|
|
|
{ |
463
|
|
|
return $this->title; |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
/** |
467
|
|
|
* @param null|string $title |
468
|
|
|
* |
469
|
|
|
* @return $this |
470
|
|
|
*/ |
471
|
|
|
public function setTitle($title) |
472
|
|
|
{ |
473
|
|
|
$this->title = $title; |
474
|
|
|
|
475
|
|
|
return $this; |
476
|
|
|
} |
477
|
|
|
|
478
|
|
|
/** |
479
|
|
|
* @return null|string |
480
|
|
|
*/ |
481
|
|
|
public function getCompanyName() |
482
|
|
|
{ |
483
|
|
|
return $this->companyName; |
484
|
|
|
} |
485
|
|
|
|
486
|
|
|
/** |
487
|
|
|
* @param null|string $companyName |
488
|
|
|
* |
489
|
|
|
* @return $this |
490
|
|
|
*/ |
491
|
|
|
public function setCompanyName($companyName) |
492
|
|
|
{ |
493
|
|
|
$this->companyName = $companyName; |
494
|
|
|
|
495
|
|
|
return $this; |
496
|
|
|
} |
497
|
|
|
|
498
|
|
|
/** |
499
|
|
|
* @return null|string |
500
|
|
|
*/ |
501
|
|
|
public function getPhone() |
502
|
|
|
{ |
503
|
|
|
return $this->phone; |
504
|
|
|
} |
505
|
|
|
|
506
|
|
|
/** |
507
|
|
|
* @param null|string $phone |
508
|
|
|
* |
509
|
|
|
* @return $this |
510
|
|
|
*/ |
511
|
|
|
public function setPhone($phone) |
512
|
|
|
{ |
513
|
|
|
$this->phone = $phone; |
514
|
|
|
|
515
|
|
|
return $this; |
516
|
|
|
} |
517
|
|
|
|
518
|
|
|
/** |
519
|
|
|
* @return null|string |
520
|
|
|
*/ |
521
|
|
|
public function getLocation() |
522
|
|
|
{ |
523
|
|
|
return $this->location; |
524
|
|
|
} |
525
|
|
|
|
526
|
|
|
/** |
527
|
|
|
* @param null|string $location |
528
|
|
|
* |
529
|
|
|
* @return $this |
530
|
|
|
*/ |
531
|
|
|
public function setLocation($location) |
532
|
|
|
{ |
533
|
|
|
$this->location = $location; |
534
|
|
|
|
535
|
|
|
return $this; |
536
|
|
|
} |
537
|
|
|
} |
538
|
|
|
|