AttachmentResourceModel   A
last analyzed

Complexity

Total Complexity 30

Size/Duplication

Total Lines 469
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 30
lcom 0
cbo 1
dl 0
loc 469
ccs 75
cts 75
cp 1
rs 10
c 0
b 0
f 0

30 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setId() 0 6 1
A getAuthorId() 0 4 1
A setAuthorId() 0 6 1
A getName() 0 4 1
A setName() 0 6 1
A getCreatedDate() 0 4 1
A setCreatedDate() 0 6 1
A getVersion() 0 4 1
A setVersion() 0 6 1
A getType() 0 4 1
A setType() 0 6 1
A getContentType() 0 4 1
A setContentType() 0 6 1
A getSize() 0 4 1
A setSize() 0 6 1
A getTaskId() 0 4 1
A setTaskId() 0 6 1
A getFolderId() 0 4 1
A setFolderId() 0 6 1
A getCommentId() 0 4 1
A setCommentId() 0 6 1
A getCurrentAttachmentId() 0 4 1
A setCurrentAttachmentId() 0 6 1
A getPreviewUrl() 0 4 1
A setPreviewUrl() 0 6 1
A getUrl() 0 4 1
A setUrl() 0 6 1
A getReviewIds() 0 4 1
A setReviewIds() 0 6 1
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\Attachment;
13
14
use JMS\Serializer\Annotation as SA;
15
use Zibios\WrikePhpJmsserializer\Model\AbstractModel;
16
use Zibios\WrikePhpJmsserializer\Model\ResourceModelInterface;
17
18
/**
19
 * Attachment Resource Model.
20
 */
21
class AttachmentResourceModel extends AbstractModel implements ResourceModelInterface
22
{
23
    /**
24
     * Attachment ID.
25
     *
26
     * Attachment: Attachment ID
27
     *
28
     * @SA\Type("string")
29
     * @SA\SerializedName("id")
30
     *
31
     * @var string|null
32
     */
33
    protected $id;
34
35
    /**
36
     * ID of user who uploaded the attachment.
37
     *
38
     * Comment: Contact ID
39
     *
40
     * @SA\Type("string")
41
     * @SA\SerializedName("authorId")
42
     *
43
     * @var string|null
44
     */
45
    protected $authorId;
46
47
    /**
48
     * Attachment filename.
49
     *
50
     * @SA\Type("string")
51
     * @SA\SerializedName("name")
52
     *
53
     * @var string|null
54
     */
55
    protected $name;
56
57
    /**
58
     * Upload date.
59
     *
60
     * Format: yyyy-MM-dd'T'HH:mm:ss'Z'
61
     *
62
     * @SA\Type("string")
63
     * @SA\SerializedName("createdDate")
64
     *
65
     * @var string|null
66
     */
67
    protected $createdDate;
68
69
    /**
70
     * Attachment version.
71
     *
72
     * @SA\Type("integer")
73
     * @SA\SerializedName("version")
74
     *
75
     * @var int|null
76
     */
77
    protected $version;
78
79
    /**
80
     * Attachment type.
81
     *
82
     * Attachment Type, Enum: Wrike, Google, DropBox, Box, OneDrive
83
     *
84
     * @see \Zibios\WrikePhpLibrary\Enum\AttachmentTypeEnum
85
     *
86
     * @SA\Type("string")
87
     * @SA\SerializedName("type")
88
     *
89
     * @var string|null
90
     */
91
    protected $type;
92
93
    /**
94
     * Content type.
95
     *
96
     * @SA\Type("string")
97
     * @SA\SerializedName("contentType")
98
     *
99
     * @var string|null
100
     */
101
    protected $contentType;
102
103
    /**
104
     * Size for Wrike Attachments. For external attachments, size is equal to -1.
105
     *
106
     * @SA\Type("integer")
107
     * @SA\SerializedName("size")
108
     *
109
     * @var int|null
110
     */
111
    protected $size;
112
113
    /**
114
     * ID of related task. Only one of taskId/folderId fields is present.
115
     *
116
     * @SA\Type("string")
117
     * @SA\SerializedName("taskId")
118
     *
119
     * @var string|null
120
     */
121
    protected $taskId;
122
123
    /**
124
     * ID of related folder. Only one of taskId/folderId fields is present.
125
     *
126
     * @SA\Type("string")
127
     * @SA\SerializedName("folderId")
128
     *
129
     * @var string|null
130
     */
131
    protected $folderId;
132
133
    /**
134
     * ID of related comment.
135
     *
136
     * @SA\Type("string")
137
     * @SA\SerializedName("commentId")
138
     *
139
     * @var string|null
140
     */
141
    protected $commentId;
142
143
    /**
144
     * ID of current attachment version.
145
     *
146
     * Comment: Attachment ID
147
     * Comment: Optional
148
     *
149
     * @SA\Type("string")
150
     * @SA\SerializedName("currentAttachmentId")
151
     *
152
     * @var string|null
153
     */
154
    protected $currentAttachmentId;
155
156
    /**
157
     * Link to download external attachment preview (present if preview is available).
158
     *
159
     * @SA\Type("string")
160
     * @SA\SerializedName("previewUrl")
161
     *
162
     * @var string|null
163
     */
164
    protected $previewUrl;
165
166
    /**
167
     * Link to download attachment.
168
     *
169
     * Comment: Optional
170
     *
171
     * @SA\Type("string")
172
     * @SA\SerializedName("url")
173
     *
174
     * @var string|null
175
     */
176
    protected $url;
177
178
    /**
179
     * Review IDs.
180
     *
181
     * Comment: Optional
182
     *
183
     * @SA\Type("array<string>")
184
     * @SA\SerializedName("reviewIds")
185
     *
186
     * @var array|string[]|null
187
     */
188
    protected $reviewIds;
189
190
    /**
191
     * @return null|string
192
     */
193 1
    public function getId()
194
    {
195 1
        return $this->id;
196
    }
197
198
    /**
199
     * @param null|string $id
200
     *
201
     * @return $this
202
     */
203 1
    public function setId($id)
204
    {
205 1
        $this->id = $id;
206
207 1
        return $this;
208
    }
209
210
    /**
211
     * @return null|string
212
     */
213 1
    public function getAuthorId()
214
    {
215 1
        return $this->authorId;
216
    }
217
218
    /**
219
     * @param null|string $authorId
220
     *
221
     * @return $this
222
     */
223 1
    public function setAuthorId($authorId)
224
    {
225 1
        $this->authorId = $authorId;
226
227 1
        return $this;
228
    }
229
230
    /**
231
     * @return null|string
232
     */
233 1
    public function getName()
234
    {
235 1
        return $this->name;
236
    }
237
238
    /**
239
     * @param null|string $name
240
     *
241
     * @return $this
242
     */
243 1
    public function setName($name)
244
    {
245 1
        $this->name = $name;
246
247 1
        return $this;
248
    }
249
250
    /**
251
     * @return string|null
252
     */
253 1
    public function getCreatedDate()
254
    {
255 1
        return $this->createdDate;
256
    }
257
258
    /**
259
     * @param string|null $createdDate
260
     *
261
     * @return $this
262
     */
263 1
    public function setCreatedDate($createdDate)
264
    {
265 1
        $this->createdDate = $createdDate;
266
267 1
        return $this;
268
    }
269
270
    /**
271
     * @return int|null
272
     */
273 1
    public function getVersion()
274
    {
275 1
        return $this->version;
276
    }
277
278
    /**
279
     * @param int|null $version
280
     *
281
     * @return $this
282
     */
283 1
    public function setVersion($version)
284
    {
285 1
        $this->version = $version;
286
287 1
        return $this;
288
    }
289
290
    /**
291
     * @return null|string
292
     */
293 1
    public function getType()
294
    {
295 1
        return $this->type;
296
    }
297
298
    /**
299
     * @param null|string $type
300
     *
301
     * @return $this
302
     */
303 1
    public function setType($type)
304
    {
305 1
        $this->type = $type;
306
307 1
        return $this;
308
    }
309
310
    /**
311
     * @return null|string
312
     */
313 1
    public function getContentType()
314
    {
315 1
        return $this->contentType;
316
    }
317
318
    /**
319
     * @param null|string $contentType
320
     *
321
     * @return $this
322
     */
323 1
    public function setContentType($contentType)
324
    {
325 1
        $this->contentType = $contentType;
326
327 1
        return $this;
328
    }
329
330
    /**
331
     * @return int|null
332
     */
333 1
    public function getSize()
334
    {
335 1
        return $this->size;
336
    }
337
338
    /**
339
     * @param int|null $size
340
     *
341
     * @return $this
342
     */
343 1
    public function setSize($size)
344
    {
345 1
        $this->size = $size;
346
347 1
        return $this;
348
    }
349
350
    /**
351
     * @return null|string
352
     */
353 1
    public function getTaskId()
354
    {
355 1
        return $this->taskId;
356
    }
357
358
    /**
359
     * @param null|string $taskId
360
     *
361
     * @return $this
362
     */
363 1
    public function setTaskId($taskId)
364
    {
365 1
        $this->taskId = $taskId;
366
367 1
        return $this;
368
    }
369
370
    /**
371
     * @return null|string
372
     */
373 1
    public function getFolderId()
374
    {
375 1
        return $this->folderId;
376
    }
377
378
    /**
379
     * @param null|string $folderId
380
     *
381
     * @return $this
382
     */
383 1
    public function setFolderId($folderId)
384
    {
385 1
        $this->folderId = $folderId;
386
387 1
        return $this;
388
    }
389
390
    /**
391
     * @return null|string
392
     */
393 1
    public function getCommentId()
394
    {
395 1
        return $this->commentId;
396
    }
397
398
    /**
399
     * @param null|string $commentId
400
     *
401
     * @return $this
402
     */
403 1
    public function setCommentId($commentId)
404
    {
405 1
        $this->commentId = $commentId;
406
407 1
        return $this;
408
    }
409
410
    /**
411
     * @return null|string
412
     */
413 1
    public function getCurrentAttachmentId()
414
    {
415 1
        return $this->currentAttachmentId;
416
    }
417
418
    /**
419
     * @param null|string $currentAttachmentId
420
     *
421
     * @return $this
422
     */
423 1
    public function setCurrentAttachmentId($currentAttachmentId)
424
    {
425 1
        $this->currentAttachmentId = $currentAttachmentId;
426
427 1
        return $this;
428
    }
429
430
    /**
431
     * @return null|string
432
     */
433 1
    public function getPreviewUrl()
434
    {
435 1
        return $this->previewUrl;
436
    }
437
438
    /**
439
     * @param null|string $previewUrl
440
     *
441
     * @return $this
442
     */
443 1
    public function setPreviewUrl($previewUrl)
444
    {
445 1
        $this->previewUrl = $previewUrl;
446
447 1
        return $this;
448
    }
449
450
    /**
451
     * @return null|string
452
     */
453 1
    public function getUrl()
454
    {
455 1
        return $this->url;
456
    }
457
458
    /**
459
     * @param null|string $url
460
     *
461
     * @return $this
462
     */
463 1
    public function setUrl($url)
464
    {
465 1
        $this->url = $url;
466
467 1
        return $this;
468
    }
469
470
    /**
471
     * @return array|null|\string[]
472
     */
473 1
    public function getReviewIds()
474
    {
475 1
        return $this->reviewIds;
476
    }
477
478
    /**
479
     * @param array|null|\string[] $reviewIds
480
     *
481
     * @return $this
482
     */
483 1
    public function setReviewIds($reviewIds)
484
    {
485 1
        $this->reviewIds = $reviewIds;
486
487 1
        return $this;
488
    }
489
}
490