zohoProjects 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +17 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +145 -0
  6. data/Rakefile +2 -0
  7. data/lib/projects/api/API.rb +57 -0
  8. data/lib/projects/api/BugsAPI.rb +135 -0
  9. data/lib/projects/api/DocumentsAPI.rb +145 -0
  10. data/lib/projects/api/EventsAPI.rb +115 -0
  11. data/lib/projects/api/FoldersAPI.rb +111 -0
  12. data/lib/projects/api/ForumsAPI.rb +198 -0
  13. data/lib/projects/api/MilestonesAPI.rb +159 -0
  14. data/lib/projects/api/PortalAPI.rb +41 -0
  15. data/lib/projects/api/ProjectsAPI.rb +203 -0
  16. data/lib/projects/api/TasklistsAPI.rb +113 -0
  17. data/lib/projects/api/TasksAPI.rb +153 -0
  18. data/lib/projects/api/TimesheetsAPI.rb +240 -0
  19. data/lib/projects/api/UsersAPI.rb +48 -0
  20. data/lib/projects/exception/ProjectsException.rb +50 -0
  21. data/lib/projects/model/Activity.rb +173 -0
  22. data/lib/projects/model/Bug.rb +701 -0
  23. data/lib/projects/model/Buglog.rb +56 -0
  24. data/lib/projects/model/Category.rb +70 -0
  25. data/lib/projects/model/Comment.rb +289 -0
  26. data/lib/projects/model/Document.rb +260 -0
  27. data/lib/projects/model/Event.rb +391 -0
  28. data/lib/projects/model/Folder.rb +110 -0
  29. data/lib/projects/model/Forum.rb +320 -0
  30. data/lib/projects/model/Generallog.rb +36 -0
  31. data/lib/projects/model/Log.rb +359 -0
  32. data/lib/projects/model/Milestone.rb +322 -0
  33. data/lib/projects/model/Owner.rb +54 -0
  34. data/lib/projects/model/Participant.rb +54 -0
  35. data/lib/projects/model/Portal.rb +273 -0
  36. data/lib/projects/model/Project.rb +593 -0
  37. data/lib/projects/model/Status.rb +168 -0
  38. data/lib/projects/model/Task.rb +497 -0
  39. data/lib/projects/model/Tasklist.rb +300 -0
  40. data/lib/projects/model/Tasklog.rb +56 -0
  41. data/lib/projects/model/Timelog.rb +134 -0
  42. data/lib/projects/model/TimelogList.rb +54 -0
  43. data/lib/projects/model/User.rb +94 -0
  44. data/lib/projects/model/Version.rb +194 -0
  45. data/lib/projects/parser/BugParser.rb +208 -0
  46. data/lib/projects/parser/DocumentParser.rb +197 -0
  47. data/lib/projects/parser/EventParser.rb +156 -0
  48. data/lib/projects/parser/FolderParser.rb +99 -0
  49. data/lib/projects/parser/ForumParser.rb +253 -0
  50. data/lib/projects/parser/MilestonesParser.rb +129 -0
  51. data/lib/projects/parser/PortalParser.rb +103 -0
  52. data/lib/projects/parser/ProjectParser.rb +318 -0
  53. data/lib/projects/parser/TaskParser.rb +293 -0
  54. data/lib/projects/parser/TasklistParser.rb +127 -0
  55. data/lib/projects/parser/TimesheetParser.rb +390 -0
  56. data/lib/projects/parser/UserParser.rb +63 -0
  57. data/lib/projects/service/ZohoProject.rb +174 -0
  58. data/lib/projects/util/ZohoHTTPClient.rb +205 -0
  59. data/lib/test/ProjectsTest.rb +321 -0
  60. data/lib/zohoProjects.rb +35 -0
  61. data/lib/zohoProjects/version.rb +3 -0
  62. data/zohoProjects.gemspec +86 -0
  63. metadata +135 -0
@@ -0,0 +1,701 @@
1
+ # $Id$
2
+ module Projects
3
+ module Model
4
+ # * This class is used to make an object for Bug.
5
+
6
+ class Bug
7
+
8
+ private
9
+ attr_accessor :id, :key, :projectId, :flag, :title, :description, :reporterId, :reportedPerson, :createdTime, :createdTimeFormat, :createdTimeLong, :assigneeId, :assigneeName, :closed, :url, :timesheetUrl, :classificationId, :classificationType, :severityId, :severityType, :statusId, :statusType, :reproducibleId, :reproducibleType, :moduleId, :moduleName, :milestoneId, :dueDate, :dueDateFormat, :dueDateLong;
10
+
11
+ public
12
+
13
+ # * Set the bug id.
14
+ #
15
+ # ==== Parameters
16
+ #
17
+ # * id:: - ID of the bug.
18
+
19
+ def setId(id)
20
+ @id = id
21
+ end
22
+
23
+ # * Get the bug id.
24
+ #
25
+ # ==== Returns
26
+ #
27
+ # * Bug id.
28
+
29
+
30
+ def getId
31
+ return @id
32
+ end
33
+
34
+ # * Set the key for the bug.
35
+ #
36
+ # ==== Parameters
37
+ #
38
+ # * key:: - Key for the bug.
39
+
40
+
41
+ def setKey(key)
42
+ @key = key
43
+ end
44
+
45
+ # * Get the key for the bug.
46
+ #
47
+ # ==== Returns
48
+ #
49
+ # * Bug key.
50
+
51
+
52
+ def getKey
53
+ return @key
54
+ end
55
+
56
+ # * Set the project id.
57
+ #
58
+ # ==== Parameters
59
+ #
60
+ # * projectId:: - ID of the project.
61
+
62
+
63
+ def setProjectId(projectId)
64
+ @projectId = projectId
65
+ end
66
+
67
+ # * get the project id.
68
+ #
69
+ # ==== Returns
70
+ #
71
+ # * Project id.
72
+
73
+
74
+ def getProjectId
75
+ return @projectId
76
+ end
77
+
78
+ # * Set the flag for the bug.
79
+ #
80
+ # ==== Parameters
81
+ #
82
+ # * flag:: - Flag for the bug.
83
+
84
+
85
+ def setFlag(flag)
86
+ @flag = flag
87
+ end
88
+
89
+ # * Get the flag for the bug.
90
+ #
91
+ # ==== Returns
92
+ #
93
+ # * Flag of the bug.
94
+
95
+ def getFlag
96
+ return @flag
97
+ end
98
+
99
+ # * Set the bug title.
100
+ #
101
+ # ==== Parameters
102
+ #
103
+ # * title:: - Title for the bug.
104
+
105
+
106
+ def setTitle(title)
107
+ @title = title
108
+ end
109
+
110
+ # * Get the bug title.
111
+ #
112
+ # ==== Returns
113
+ #
114
+ # * Bug title.
115
+
116
+
117
+ def getTitle
118
+ return @title
119
+ end
120
+
121
+ # * Set the bug description.
122
+ #
123
+ # ==== Parameters
124
+ #
125
+ # * description:: - Description for the bug.
126
+
127
+
128
+ def setDescription(description)
129
+ @description = description
130
+ end
131
+
132
+ # * Get the bug description.
133
+ #
134
+ # ==== Returns
135
+ #
136
+ # * Bug description.
137
+
138
+
139
+ def getDescription
140
+ return @description
141
+ end
142
+
143
+ # * Set the reporter id.
144
+ #
145
+ # ==== Parameters
146
+ #
147
+ # * reporterId:: - ID of the reporter.
148
+
149
+
150
+ def setReporterId(reporterId)
151
+ @reporterId = reporterId
152
+ end
153
+
154
+ # * Get the reporter id.
155
+ #
156
+ # ==== Returns
157
+ #
158
+ # * Reporter id.
159
+
160
+
161
+ def getReporterId
162
+ return @reporterId
163
+ end
164
+
165
+ # * Set the reported person.
166
+ #
167
+ # ==== Parameters
168
+ #
169
+ # * reportedPerson:: - Person who is reporting the bug.
170
+
171
+
172
+ def setReportedPerson(reportedPerson)
173
+ @reportedPerson = reportedPerson
174
+ end
175
+
176
+ # * Get the reported person.
177
+ #
178
+ # ==== Returns
179
+ #
180
+ # * Person who reported the bug.
181
+
182
+
183
+ def getReportedPerson
184
+ return @reportedPerson
185
+ end
186
+
187
+ # * Set the created time.
188
+ #
189
+ # ==== Parameters
190
+ #
191
+ # * createdTime:: - Created time for the bug.
192
+
193
+
194
+ def setCreatedTime(createdTime)
195
+ @createdTime = createdTime
196
+ end
197
+
198
+ # * Get the created time.
199
+ #
200
+ # ==== Returns
201
+ #
202
+ # * created time for the bug.
203
+
204
+
205
+ def getCreatedTime
206
+ return @createdTime
207
+ end
208
+
209
+ # * Set the created time format.
210
+ #
211
+ # ==== Parameters
212
+ #
213
+ # * createdTime:: - Created time format for the bug.
214
+
215
+
216
+ def setCreatedTimeFormat(createdTimeFormat)
217
+ @createdTimeFormat = createdTimeFormat
218
+ end
219
+
220
+ # * Get the created time format.
221
+ #
222
+ # ==== Returns
223
+ #
224
+ # * Created time format for the bug.
225
+
226
+
227
+ def getCreatedTimeFormat
228
+ return @createdTimeFormat
229
+ end
230
+
231
+ # * Set the created time long.
232
+ #
233
+ # ==== Parameters
234
+ #
235
+ # * createdTimeLong:: - Created time for the bug.
236
+
237
+
238
+ def setCreatedTimeLong(createdTimeLong)
239
+ @createdTimeLong = createdTimeLong
240
+ end
241
+
242
+ # * Get the created time long.
243
+ #
244
+ # ==== Returns
245
+ #
246
+ # * Created time for the bug.
247
+
248
+
249
+ def getCreatedTimeLong
250
+ return @createdTimeLong
251
+ end
252
+
253
+ # * Set the assignee id for the bug.
254
+ #
255
+ # ==== Parameters
256
+ #
257
+ # * assigneeId:: - ID of the assignee.
258
+
259
+
260
+ def setAssigneeId(assigneeId)
261
+ @assigneeId = assigneeId
262
+ end
263
+
264
+ # * Get the assignee id.
265
+ #
266
+ # ==== Returns
267
+ #
268
+ # * Assignee id.
269
+
270
+ def getAssigneeId
271
+ return @assigneeId
272
+ end
273
+
274
+ # * Set the assignee name.
275
+ #
276
+ # ==== Parameters
277
+ #
278
+ # * assigneeName:: - Name of the assignee.
279
+
280
+
281
+ def setAssigneeName(assigneeName)
282
+ @assigneeName = assigneeName
283
+ end
284
+
285
+ # * Get the assignee name.
286
+ #
287
+ # ==== Returns
288
+ #
289
+ # * Assignee name.
290
+
291
+
292
+ def getAssigneeName
293
+ return @assigneeName
294
+ end
295
+
296
+ # * Set the bug is closed or not.
297
+ #
298
+ # ==== Parameters
299
+ #
300
+ # * closed:: - Bug is closed or not.
301
+
302
+
303
+ def setClosed(closed)
304
+ @closed = closed
305
+ end
306
+
307
+ # * Get the bug is closed or not.
308
+ #
309
+ # ==== Returns
310
+ #
311
+ # * true, if the big is closed else returns false.
312
+
313
+
314
+ def isClosed
315
+ return @closed
316
+ end
317
+
318
+ # * Set the bug URL.
319
+ #
320
+ # ==== Parameters
321
+ #
322
+ # * url:: - URL for the bug.
323
+
324
+
325
+ def setURL(url)
326
+ @url = url
327
+ end
328
+
329
+ # * Get the bug URL.
330
+ #
331
+ # ==== Returns
332
+ #
333
+ # * Bug URL.
334
+
335
+
336
+ def getURL
337
+ return @url
338
+ end
339
+
340
+ # * Set the time sheet URL.
341
+ #
342
+ # ==== Parameters
343
+ #
344
+ # * timesheetUrl:: - URL for the time sheet.
345
+
346
+
347
+ def setTimesheetURL(timesheetUrl)
348
+ @timesheetUrl = timesheetUrl
349
+ end
350
+
351
+ # * Get the time sheet URL.
352
+ #
353
+ # ==== Returns
354
+ #
355
+ # * Time sheet URL.
356
+
357
+
358
+ def getTimesheetURL
359
+ return @timesheetUrl
360
+ end
361
+
362
+ # * Set the classification id.
363
+ #
364
+ # ==== Parameters
365
+ #
366
+ # * classificationId:: - ID of the classification.
367
+
368
+ def setClassificationId(classificationId)
369
+ @classificationId = classificationId
370
+ end
371
+
372
+ # * Get the classification id.
373
+ #
374
+ # ==== Returns
375
+ #
376
+ # * Classification id.
377
+
378
+ def getClassificationId
379
+ return @classificationId
380
+ end
381
+
382
+ # * Set the classification type.
383
+ #
384
+ # ==== Parameters
385
+ #
386
+ # * classificationType:: - Type of the classification.
387
+
388
+
389
+ def setClassificationType(classificationType)
390
+ @classificationType = classificationType
391
+ end
392
+
393
+ # * Get the classification type.
394
+ #
395
+ # ==== Returns
396
+ #
397
+ # * Classification type.
398
+
399
+
400
+ def getClassificationType
401
+ return @classificationType
402
+ end
403
+
404
+ # * Set the severity id.
405
+ #
406
+ # ==== Parameters
407
+ #
408
+ # * severityId:: - ID of the severity.
409
+
410
+
411
+ def setSeverityId(severityId)
412
+ @severityId = severityId
413
+ end
414
+
415
+ # * Get the severity id.
416
+ #
417
+ # ==== Returns
418
+ #
419
+ # * Severity id.
420
+
421
+
422
+ def getSeverityId
423
+ return @severityId
424
+ end
425
+
426
+ # * Set the severity type.
427
+ #
428
+ # ==== Parameters
429
+ #
430
+ # * severityType:: - Type of the severity.
431
+
432
+
433
+ def setSeverityType(severityType)
434
+ @severityType = severityType
435
+ end
436
+
437
+ # * Get the severity type.
438
+ #
439
+ # ==== Returns
440
+ #
441
+ # * Severity type.
442
+
443
+
444
+ def getSeverityType
445
+ return @severityType
446
+ end
447
+
448
+ # * Set the status id.
449
+ #
450
+ # ==== Parameters
451
+ #
452
+ # * statusId:: - ID of the status.
453
+
454
+
455
+ def setStatusId(statusId)
456
+ @statusId = statusId
457
+ end
458
+
459
+ # * Get the status id.
460
+ #
461
+ # ==== Returns
462
+ #
463
+ # * Status id.
464
+
465
+ def getStatusId
466
+ return @statusId
467
+ end
468
+
469
+ # * Set the status type.
470
+ #
471
+ # ==== Parameters
472
+ #
473
+ # * statusType:: - Type of the status.
474
+
475
+
476
+ def setStatusType(statusType)
477
+ @statusType = statusType
478
+ end
479
+
480
+ # * Get the status type.
481
+ #
482
+ # ==== Returns
483
+ #
484
+ # * Status type.
485
+
486
+
487
+ def getStatusType
488
+ return @statusType
489
+ end
490
+
491
+ # * Set the reproducible id.
492
+ #
493
+ # ==== Parameters
494
+ #
495
+ # * reproducibleId:: - Reproducible id of the bug.
496
+
497
+
498
+ def setReproducibleId(reproducibleId)
499
+ @reproducibleId = reproducibleId
500
+ end
501
+
502
+ # * Get the reproducible id.
503
+ #
504
+ # ==== Returns
505
+ #
506
+ # * Reproducible id of the bug.
507
+
508
+
509
+ def getReproducibleId
510
+ return @reproducibleId
511
+ end
512
+
513
+ # * Set the reproducible type.
514
+ #
515
+ # ==== Parameters
516
+ #
517
+ # * reproducibleType:: - Reproducible type of the bug.
518
+
519
+
520
+ def setReproducibleType(reproducibleType)
521
+ @reproducibleType = reproducibleType
522
+ end
523
+
524
+ # * Get the reproducible type.
525
+ #
526
+ # ==== Returns
527
+ #
528
+ # * Reproducible type of the bug.
529
+
530
+
531
+ def getReproducibleType
532
+ return @reproducibleType
533
+ end
534
+
535
+ # * Set the module id.
536
+ #
537
+ # ==== Parameters
538
+ #
539
+ # * moduleId:: - ID of the module.
540
+
541
+ def setModuleId(moduleId)
542
+ @moduleId = moduleId
543
+ end
544
+
545
+ # * Get the module id.
546
+ #
547
+ # ==== Returns
548
+ #
549
+ # * Module id.
550
+
551
+ def getModuleId
552
+ return @moduleId
553
+ end
554
+
555
+ # * Set the module name.
556
+ #
557
+ # ==== Parameters
558
+ #
559
+ # * moduleName:: - Name of the module.
560
+
561
+ def setModuleName(moduleName)
562
+ @moduleName = moduleName
563
+ end
564
+
565
+ # * Get the module name.
566
+ #
567
+ # ==== Returns
568
+ #
569
+ # * Module name.
570
+
571
+ def getModuleName
572
+ return @moduleName
573
+ end
574
+
575
+ # * Set the milestone id.
576
+ #
577
+ # ==== Parameters
578
+ #
579
+ # * milestoneId:: - ID of the milestone.
580
+
581
+ def setMilestoneId(milestoneId)
582
+ @milestoneId = milestoneId
583
+ end
584
+
585
+
586
+ # * Get the milestone id.
587
+ #
588
+ # ==== Returns
589
+ #
590
+ # * Milestone id.
591
+
592
+ def getMilestoneId
593
+ return @milestoneId
594
+ end
595
+
596
+ # * Set the due date.
597
+ #
598
+ # ==== Parameters
599
+ #
600
+ # * dueDate:: - Due date for the bug.
601
+
602
+ def setDueDate(dueDate)
603
+ @dueDate = dueDate
604
+ end
605
+
606
+ # * Get the due date.
607
+ #
608
+ # ==== Returns
609
+ #
610
+ # * Due date.
611
+
612
+ def getDueDate
613
+ return @dueDate
614
+ end
615
+
616
+ # * Set the due date format.
617
+ #
618
+ # ==== Parameters
619
+ #
620
+ # * dueDate:: - Due date format for the bug.
621
+
622
+ def setDueDateFormat(dueDateFormat)
623
+ @dueDateFormat = dueDateFormat
624
+ end
625
+
626
+ # * Get the due date format.
627
+ #
628
+ # ==== Returns
629
+ #
630
+ # * Due date format.
631
+
632
+ def getDueDateFormat
633
+ return @dueDateFormat
634
+ end
635
+
636
+ # * Set the due date long.
637
+ #
638
+ # ==== Parameters
639
+ #
640
+ # * dueDateLong:: - Due date for the bug.
641
+
642
+ def setDueDateLong(dueDateLong)
643
+ @dueDateLong = dueDateLong
644
+ end
645
+
646
+ # * Get the due date long.
647
+ #
648
+ # ==== Returns
649
+ #
650
+ # * Due date.
651
+
652
+ def getDueDateLong
653
+ return @dueDateLong
654
+ end
655
+
656
+ # * Convert the Bug object into HashMap.
657
+ #
658
+ # ==== Returns
659
+ #
660
+ # * HashMap object.
661
+
662
+ def toParamMAP
663
+
664
+ requestBody = Hash.new
665
+
666
+ if title != nil
667
+ requestBody["title"] = title
668
+ end
669
+ if description != nil
670
+ requestBody["description"] = description
671
+ end
672
+ if assigneeId != nil
673
+ requestBody["assignee"] = assigneeId
674
+ end
675
+ if flag != nil
676
+ requestBody["flag"] = flag
677
+ end
678
+ if classificationId != nil && classificationId > 0
679
+ requestBody["classification_id"] = classificationId
680
+ end
681
+ if milestoneId != nil && milestoneId > 0
682
+ requestBody["milestone_id"] = milestoneId
683
+ end
684
+ if dueDate != nil
685
+ requestBody["due_date"] = dueDate
686
+ end
687
+ if moduleId != nil && moduleId > 0
688
+ requestBody["module_id"] = moduleId
689
+ end
690
+ if severityId != nil && severityId > 0
691
+ requestBody["severity_id"] = severityId
692
+ end
693
+ if reproducibleId != nil && reproducibleId > 0
694
+ requestBody["reproducible_id"] = reproducibleId
695
+ end
696
+
697
+ return requestBody
698
+ end
699
+ end
700
+ end
701
+ end