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