teamlab 0.3.16 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.overcommit.yml +34 -0
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +85 -0
- data/.travis.yml +6 -0
- data/Changelog.md +4 -0
- data/Gemfile +2 -0
- data/Rakefile +9 -0
- data/lib/teamlab/{Config.rb → config.rb} +5 -5
- data/lib/teamlab/{Modules/Calendar.rb → modules/calendar.rb} +12 -13
- data/lib/teamlab/{Modules/Community.rb → modules/community.rb} +16 -17
- data/lib/teamlab/{Modules/Crm.rb → modules/crm.rb} +62 -63
- data/lib/teamlab/{Modules/Files.rb → modules/files.rb} +14 -15
- data/lib/teamlab/{Modules/Group.rb → modules/group.rb} +6 -8
- data/lib/teamlab/{Modules/Mail.rb → modules/mail.rb} +34 -36
- data/lib/teamlab/{Modules/People.rb → modules/people.rb} +16 -18
- data/lib/teamlab/modules/portals.rb +15 -0
- data/lib/teamlab/{Modules/Project.rb → modules/project.rb} +46 -46
- data/lib/teamlab/{Modules/Settings.rb → modules/settings.rb} +1 -3
- data/lib/teamlab/{Request.rb → request.rb} +5 -5
- data/lib/teamlab/{Response.rb → response.rb} +3 -5
- data/lib/teamlab/version.rb +1 -1
- data/lib/teamlab.rb +18 -14
- data/spec/lib/calendar_spec.rb +2 -3
- data/spec/lib/community_spec.rb +3 -4
- data/spec/lib/crm_spec.rb +25 -26
- data/spec/lib/files_spec.rb +19 -19
- data/spec/lib/group_spec.rb +2 -2
- data/spec/lib/mail_spec.rb +2 -3
- data/spec/lib/people_spec.rb +2 -2
- data/spec/lib/portal_spec.rb +25 -0
- data/spec/lib/project_spec.rb +6 -8
- data/spec/lib/settings_spec.rb +2 -2
- data/spec/lib/{Teamlab_spec.rb → teamlab_spec.rb} +1 -5
- data/spec/spec_helper.rb +1 -2
- data/spec/support/http_data.rb +23 -23
- data/teamlab.gemspec +6 -6
- metadata +23 -16
@@ -1,11 +1,10 @@
|
|
1
1
|
module Teamlab
|
2
2
|
class Crm
|
3
|
-
|
4
3
|
def initialize
|
5
4
|
@request = Teamlab::Request.new('crm')
|
6
5
|
end
|
7
6
|
|
8
|
-
#region Opportunity
|
7
|
+
# region Opportunity
|
9
8
|
def get_all_opportunity_stages
|
10
9
|
@request.get(%w(opportunity stage))
|
11
10
|
end
|
@@ -38,11 +37,11 @@ module Teamlab
|
|
38
37
|
@request.get(['settings', 'currency', currency.to_s, 'summarytable'])
|
39
38
|
end
|
40
39
|
|
41
|
-
def create_opportunity(stage_id, title, responsible_id, options = {})
|
42
|
-
@request.post(%w(opportunity), {stageId: stage_id, title: title, responsibleid: responsible_id}.merge(options))
|
40
|
+
def create_opportunity(stage_id, title, responsible_id, options = {})
|
41
|
+
@request.post(%w(opportunity), { stageId: stage_id, title: title, responsibleid: responsible_id }.merge(options))
|
43
42
|
end
|
44
43
|
|
45
|
-
def create_opportunity_stage(title, color, options = {})
|
44
|
+
def create_opportunity_stage(title, color, options = {})
|
46
45
|
@request.post(%w(opportunity stage), { title: title, color: color }.merge(options))
|
47
46
|
end
|
48
47
|
|
@@ -55,7 +54,7 @@ module Teamlab
|
|
55
54
|
end
|
56
55
|
|
57
56
|
def update_opportunity_stage(id, title, color, options = {})
|
58
|
-
@request.put(['opportunity', 'stage', id.to_s], { title: title, color: color
|
57
|
+
@request.put(['opportunity', 'stage', id.to_s], { title: title, color: color }.merge(options))
|
59
58
|
end
|
60
59
|
|
61
60
|
def update_opportunity_stages_order(options = {})
|
@@ -72,11 +71,11 @@ module Teamlab
|
|
72
71
|
end
|
73
72
|
|
74
73
|
def update_opportunity_stage_color(stage_id, color)
|
75
|
-
@request.put(['opportunity', 'stage', stage_id.to_s, 'color'],
|
74
|
+
@request.put(['opportunity', 'stage', stage_id.to_s, 'color'], color: color)
|
76
75
|
end
|
77
76
|
|
78
77
|
def set_rights_to_opportunity(opportunity_id, is_private, access_list)
|
79
|
-
@request.put(['opportunity', opportunity_id.to_s, 'access'],
|
78
|
+
@request.put(['opportunity', opportunity_id.to_s, 'access'], isPrivate: is_private, accessList: access_list)
|
80
79
|
end
|
81
80
|
|
82
81
|
def update_opportunity_to_stage(opportunity_id, stage_id)
|
@@ -103,9 +102,9 @@ module Teamlab
|
|
103
102
|
@request.delete(['opportunity', opportunity_id.to_s, 'contact', contact_id.to_s])
|
104
103
|
end
|
105
104
|
|
106
|
-
#endregion
|
105
|
+
# endregion
|
107
106
|
|
108
|
-
#region General
|
107
|
+
# region General
|
109
108
|
|
110
109
|
def get_invoice_taxes
|
111
110
|
@request.get(%w(invoice tax))
|
@@ -160,55 +159,55 @@ module Teamlab
|
|
160
159
|
end
|
161
160
|
|
162
161
|
def create_task(title, deadline, responsible_id, category_id, options = {})
|
163
|
-
@request.post(%w(task), {title: title, deadline: deadline, responsibleId: responsible_id, categoryId: category_id}.merge(options))
|
162
|
+
@request.post(%w(task), { title: title, deadline: deadline, responsibleId: responsible_id, categoryId: category_id }.merge(options))
|
164
163
|
end
|
165
164
|
|
166
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
165
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
167
166
|
|
168
167
|
def create_invoice(options = {})
|
169
168
|
@request.post(%w(invoice), options)
|
170
169
|
end
|
171
170
|
|
172
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
171
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
173
172
|
|
174
173
|
def create_invoice_line(invoice_id, options = {})
|
175
|
-
@request.post(%w(invoiceline), {invoiceId: invoice_id}.merge(options))
|
174
|
+
@request.post(%w(invoiceline), { invoiceId: invoice_id }.merge(options))
|
176
175
|
end
|
177
176
|
|
178
177
|
def create_invoice_item(title, description, price, stock_keeping_unit, options = {})
|
179
|
-
@request.post(%w(invoiceitem), {title: title, description: description, price: price, sku: stock_keeping_unit.to_s}.merge(options))
|
178
|
+
@request.post(%w(invoiceitem), { title: title, description: description, price: price, sku: stock_keeping_unit.to_s }.merge(options))
|
180
179
|
end
|
181
180
|
|
182
181
|
def create_invoice_tax(name, description, options = {})
|
183
|
-
@request.post(%w(invoice tax), {name: name, description: description}.merge(options))
|
182
|
+
@request.post(%w(invoice tax), { name: name, description: description }.merge(options))
|
184
183
|
end
|
185
184
|
|
186
185
|
def create_contact_type(title, options = {})
|
187
|
-
@request.post(%w(contact type), {title: title}.merge(options))
|
186
|
+
@request.post(%w(contact type), { title: title }.merge(options))
|
188
187
|
end
|
189
188
|
|
190
189
|
def create_contact_status(title, color, options = {})
|
191
|
-
@request.post(%w(contact status), {title: title, color: color}.merge(options))
|
190
|
+
@request.post(%w(contact status), { title: title, color: color }.merge(options))
|
192
191
|
end
|
193
192
|
|
194
193
|
def create_person(first_name, last_name, options = {})
|
195
|
-
@request.post(%w(contact person), {firstName: first_name, lastName: last_name}.merge(options))
|
194
|
+
@request.post(%w(contact person), { firstName: first_name, lastName: last_name }.merge(options))
|
196
195
|
end
|
197
196
|
|
198
197
|
def create_company(company_name, managers, options = {})
|
199
|
-
@request.post(%w(contact company), {companyName: company_name, managerList: managers}.merge(options))
|
198
|
+
@request.post(%w(contact company), { companyName: company_name, managerList: managers }.merge(options))
|
200
199
|
end
|
201
200
|
|
202
201
|
def create_task_group(title, options = {})
|
203
|
-
@request.post(%w(contact task group), {title: title}.merge(options))
|
202
|
+
@request.post(%w(contact task group), { title: title }.merge(options))
|
204
203
|
end
|
205
204
|
|
206
205
|
def add_tag_to_batch_contacts(tags, options = {})
|
207
|
-
@request.post(%w(contact filter taglist), {tags: tags}.merge(options))
|
206
|
+
@request.post(%w(contact filter taglist), { tags: tags }.merge(options))
|
208
207
|
end
|
209
208
|
|
210
209
|
def add_contact_tag_to_group(entity_type, entity_id, tag)
|
211
|
-
@request.post([entity_type.to_s, entity_id.to_s, 'tag', 'group'],
|
210
|
+
@request.post([entity_type.to_s, entity_id.to_s, 'tag', 'group'], tagName: tag)
|
212
211
|
end
|
213
212
|
|
214
213
|
def add_deal_to_contact(contact_id, opportunity_id)
|
@@ -220,26 +219,26 @@ module Teamlab
|
|
220
219
|
end
|
221
220
|
|
222
221
|
def update_task(task_id, title, deadline, category_id, options = {})
|
223
|
-
@request.put(['task', task_id.to_s], {title: title, deadline: deadline, categoryid: category_id}.merge(options))
|
222
|
+
@request.put(['task', task_id.to_s], { title: title, deadline: deadline, categoryid: category_id }.merge(options))
|
224
223
|
end
|
225
224
|
|
226
225
|
def update_invoice_item(id, title, description, price, stock_keeping_unit, options = {})
|
227
|
-
@request.put(['invoiceitem', id.to_s], {title: title, description: description, price: price, sku: stock_keeping_unit.to_s}.merge(options))
|
226
|
+
@request.put(['invoiceitem', id.to_s], { title: title, description: description, price: price, sku: stock_keeping_unit.to_s }.merge(options))
|
228
227
|
end
|
229
228
|
|
230
229
|
def update_invoice_tax(id, name, options = {})
|
231
|
-
@request.put(['invoice', 'tax', id.to_s], {name: name}.merge(options))
|
230
|
+
@request.put(['invoice', 'tax', id.to_s], { name: name }.merge(options))
|
232
231
|
end
|
233
232
|
|
234
233
|
def update_contact_type(id, title, options = {})
|
235
|
-
@request.put(['contact', 'type', id.to_s], {title: title}.merge(options))
|
234
|
+
@request.put(['contact', 'type', id.to_s], { title: title }.merge(options))
|
236
235
|
end
|
237
236
|
|
238
237
|
def update_contact_status(id, title, options = {})
|
239
|
-
@request.put(['contact', 'status', id.to_s], {title: title.to_s}.merge(options))
|
238
|
+
@request.put(['contact', 'status', id.to_s], { title: title.to_s }.merge(options))
|
240
239
|
end
|
241
240
|
|
242
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
241
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
243
242
|
|
244
243
|
def update_invoice(id, options = {})
|
245
244
|
@request.put(['invoice', id.to_s], options)
|
@@ -270,7 +269,7 @@ module Teamlab
|
|
270
269
|
end
|
271
270
|
|
272
271
|
def update_invoice_patch_status(status, invoice_ids)
|
273
|
-
@request.put(['invoice', 'status', status.to_s],
|
272
|
+
@request.put(['invoice', 'status', status.to_s], invoiceids: invoice_ids)
|
274
273
|
end
|
275
274
|
|
276
275
|
def update_contact_status_color(status_id, color)
|
@@ -278,21 +277,21 @@ module Teamlab
|
|
278
277
|
end
|
279
278
|
|
280
279
|
def update_person(id, first_name, last_name, options = {})
|
281
|
-
@request.put(['contact', 'person', id.to_s], {firstName: first_name, lastName: last_name}.merge(options))
|
280
|
+
@request.put(['contact', 'person', id.to_s], { firstName: first_name, lastName: last_name }.merge(options))
|
282
281
|
end
|
283
282
|
|
284
283
|
def update_contact_status_by_id(contact_id, contact_status_id)
|
285
|
-
@request.put(['contact', contact_id, 'status'],
|
284
|
+
@request.put(['contact', contact_id, 'status'], contactStatusid: contact_status_id)
|
286
285
|
end
|
287
286
|
|
288
287
|
def update_invoice_line(invoice_line_id, invoice_id, options = {})
|
289
|
-
@request.put(['invoiceline', invoice_line_id], {invoiceId: invoice_id}.merge(options))
|
288
|
+
@request.put(['invoiceline', invoice_line_id], { invoiceId: invoice_id }.merge(options))
|
290
289
|
end
|
291
290
|
|
292
|
-
#=========================================== TODO: MULTIPART-FORM DATA =====================================================
|
291
|
+
#=========================================== TODO: MULTIPART-FORM DATA =====================================================
|
293
292
|
|
294
293
|
def change_contact_photo(contact_id, photo)
|
295
|
-
@request.put(['contact', contact_id.to_s, 'changephoto'],
|
294
|
+
@request.put(['contact', contact_id.to_s, 'changephoto'], photo: photo)
|
296
295
|
end
|
297
296
|
|
298
297
|
def update_person_and_its_company_status(person_id, contact_status_id)
|
@@ -348,19 +347,19 @@ module Teamlab
|
|
348
347
|
end
|
349
348
|
|
350
349
|
def create_event(contact_id, content, category_id, options = {})
|
351
|
-
@request.post(%w(history), {contactId: contact_id, content: content, categoryId: category_id}.merge(options))
|
350
|
+
@request.post(%w(history), { contactId: contact_id, content: content, categoryId: category_id }.merge(options))
|
352
351
|
end
|
353
352
|
|
354
353
|
def create_history_category(title, image_name, options = {})
|
355
|
-
@request.post(%w(history category), {title: title.to_s, imageName: image_name.to_s}.merge(options))
|
354
|
+
@request.post(%w(history category), { title: title.to_s, imageName: image_name.to_s }.merge(options))
|
356
355
|
end
|
357
356
|
|
358
357
|
def update_history_category(id, title, options = {})
|
359
|
-
@request.put(['history', 'category', id.to_s], {title: title}.merge(options))
|
358
|
+
@request.put(['history', 'category', id.to_s], { title: title }.merge(options))
|
360
359
|
end
|
361
360
|
|
362
361
|
def update_history_categories_order(*titles)
|
363
|
-
@request.put(%w(history category reorder),
|
362
|
+
@request.put(%w(history category reorder), titles: titles.flatten)
|
364
363
|
end
|
365
364
|
|
366
365
|
def update_history_category_icon(id, icon_name)
|
@@ -392,7 +391,7 @@ module Teamlab
|
|
392
391
|
end
|
393
392
|
|
394
393
|
def create_task_category(title, image_name, options = {})
|
395
|
-
@request.post(%w(task category), {title: title.to_s, imageName: image_name.to_s}.merge(options))
|
394
|
+
@request.post(%w(task category), { title: title.to_s, imageName: image_name.to_s }.merge(options))
|
396
395
|
end
|
397
396
|
|
398
397
|
def get_contact_upcoming_tasks(*contact_ids)
|
@@ -492,7 +491,7 @@ module Teamlab
|
|
492
491
|
end
|
493
492
|
|
494
493
|
def add_contact_address(contact_id, category, address, options = {})
|
495
|
-
@request.post(['contact', contact_id.to_s, 'data', 'address', category.to_s], {address: address.to_s}.merge(options))
|
494
|
+
@request.post(['contact', contact_id.to_s, 'data', 'address', category.to_s], { address: address.to_s }.merge(options))
|
496
495
|
end
|
497
496
|
|
498
497
|
def delete_contact_group(*contact_ids)
|
@@ -508,7 +507,7 @@ module Teamlab
|
|
508
507
|
end
|
509
508
|
|
510
509
|
def set_contacts_access_rights(contact_ids, options = {})
|
511
|
-
@request.put(%w(contact access), {contactId: contact_ids}.merge(options))
|
510
|
+
@request.put(%w(contact access), { contactId: contact_ids }.merge(options))
|
512
511
|
end
|
513
512
|
|
514
513
|
def update_contact_types_order(*titles)
|
@@ -520,11 +519,11 @@ module Teamlab
|
|
520
519
|
end
|
521
520
|
|
522
521
|
def update_company(company_id, company_name, options = {})
|
523
|
-
@request.put(['contact', 'company', company_id.to_s], {companyName: company_name.to_s}.merge(options))
|
522
|
+
@request.put(['contact', 'company', company_id.to_s], { companyName: company_name.to_s }.merge(options))
|
524
523
|
end
|
525
524
|
|
526
525
|
def update_contact_info(information_id, contact_id, data, options = {})
|
527
|
-
@request.put(['contact', contact_id.to_s, 'data', information_id.to_s], {data: data}.merge(options))
|
526
|
+
@request.put(['contact', contact_id.to_s, 'data', information_id.to_s], { data: data }.merge(options))
|
528
527
|
end
|
529
528
|
|
530
529
|
def change_contact_photo_by_url(contact_id, photo_url)
|
@@ -532,7 +531,7 @@ module Teamlab
|
|
532
531
|
end
|
533
532
|
|
534
533
|
def update_contact_address(contact_id, information_id, address, options = {})
|
535
|
-
@request.put(['contact', contact_id.to_s, 'data', 'address', information_id.to_s], {address: address}.merge(options))
|
534
|
+
@request.put(['contact', contact_id.to_s, 'data', 'address', information_id.to_s], { address: address }.merge(options))
|
536
535
|
end
|
537
536
|
|
538
537
|
def delete_contact(id)
|
@@ -548,7 +547,7 @@ module Teamlab
|
|
548
547
|
end
|
549
548
|
|
550
549
|
def delete_person_from_company(company_id, person_id)
|
551
|
-
@request.delete(['contact', 'company', company_id.to_s, 'person'],
|
550
|
+
@request.delete(['contact', 'company', company_id.to_s, 'person'], personId: person_id)
|
552
551
|
end
|
553
552
|
|
554
553
|
def delete_contact_address(contact_id, information_id)
|
@@ -559,7 +558,7 @@ module Teamlab
|
|
559
558
|
@request.delete(['contact', contact_id.to_s, 'project', project_id.to_s])
|
560
559
|
end
|
561
560
|
|
562
|
-
#region Files
|
561
|
+
# region Files
|
563
562
|
|
564
563
|
def get_root_folder_id
|
565
564
|
@request.get(%w(files root))
|
@@ -601,22 +600,22 @@ module Teamlab
|
|
601
600
|
@request.post([entity_type.to_s, 'tag'], tagName: tag_name)
|
602
601
|
end
|
603
602
|
|
604
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
603
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
605
604
|
|
606
605
|
def add_tag_to_case_group_by_filter(tag_name, options = {})
|
607
|
-
@request.post(%w(case filter taglist), {tagName: tag_name}.merge(options))
|
606
|
+
@request.post(%w(case filter taglist), { tagName: tag_name }.merge(options))
|
608
607
|
end
|
609
608
|
|
610
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
609
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
611
610
|
|
612
611
|
def add_tag_group_to_entity(entity_type, entity_id, tag_name)
|
613
612
|
@request.post([entity_type.to_s, 'taglist'], entityId: entity_id, tagName: tag_name)
|
614
613
|
end
|
615
614
|
|
616
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
615
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
617
616
|
|
618
617
|
def add_tag_to_opportunity_group(tag_name, options = {})
|
619
|
-
@request.post(%w(opportunity filter taglist), {tagName: tag_name}.merge(options))
|
618
|
+
@request.post(%w(opportunity filter taglist), { tagName: tag_name }.merge(options))
|
620
619
|
end
|
621
620
|
|
622
621
|
def add_tag(entity_type, entity_id, tag_name)
|
@@ -655,20 +654,20 @@ module Teamlab
|
|
655
654
|
@request.post([entity_type.to_s, 'tasktemplatecontainer'], title: title)
|
656
655
|
end
|
657
656
|
|
658
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
657
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
659
658
|
|
660
659
|
def create_task_template(container_id, title, options = {})
|
661
|
-
@request.post(['tasktemplatecontainer', container_id.to_s, 'tasktemplate'], {title: title}.merge(options))
|
660
|
+
@request.post(['tasktemplatecontainer', container_id.to_s, 'tasktemplate'], { title: title }.merge(options))
|
662
661
|
end
|
663
662
|
|
664
663
|
def update_task_template_container(container_id, title)
|
665
664
|
@request.put(['tasktemplatecontainer', container_id.to_s], title: title)
|
666
665
|
end
|
667
666
|
|
668
|
-
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
667
|
+
#=========================================== TODO: OPTIONAL VARIABLES =====================================================
|
669
668
|
|
670
669
|
def update_task_template(container_id, task_template_id, title, options = {})
|
671
|
-
@request.put(['tasktemplatecontainer', container_id.to_s, 'tasktemplate'], {id: task_template_id.to_s, title: title}.merge(options))
|
670
|
+
@request.put(['tasktemplatecontainer', container_id.to_s, 'tasktemplate'], { id: task_template_id.to_s, title: title }.merge(options))
|
672
671
|
end
|
673
672
|
|
674
673
|
def delete_task_template_container(container_id)
|
@@ -692,7 +691,7 @@ module Teamlab
|
|
692
691
|
end
|
693
692
|
|
694
693
|
def create_case(title, options = {})
|
695
|
-
@request.post(%w(case), {title: title}.merge(options))
|
694
|
+
@request.post(%w(case), { title: title }.merge(options))
|
696
695
|
end
|
697
696
|
|
698
697
|
def add_case_contact(case_id, contact_id)
|
@@ -700,11 +699,11 @@ module Teamlab
|
|
700
699
|
end
|
701
700
|
|
702
701
|
def set_case_access_rights(case_ids, options = {})
|
703
|
-
@request.put(%w(case access), {caseId: case_ids}.merge(options))
|
702
|
+
@request.put(%w(case access), { caseId: case_ids }.merge(options))
|
704
703
|
end
|
705
704
|
|
706
705
|
def update_case(case_id, title, options = {})
|
707
|
-
@request.put(['case', case_id.to_s], {title: title}.merge(options))
|
706
|
+
@request.put(['case', case_id.to_s], { title: title }.merge(options))
|
708
707
|
end
|
709
708
|
|
710
709
|
def set_case_access_rights_by_filter(options = {})
|
@@ -748,7 +747,7 @@ module Teamlab
|
|
748
747
|
end
|
749
748
|
|
750
749
|
def create_user_field(entity_type, label, field_type, options = {})
|
751
|
-
@request.post([entity_type.to_s, 'customfield'], {fieldType: field_type, label: label}.merge(options))
|
750
|
+
@request.post([entity_type.to_s, 'customfield'], { fieldType: field_type, label: label }.merge(options))
|
752
751
|
end
|
753
752
|
|
754
753
|
def set_user_field_value(entity_type, entity_id, field_id, field_value)
|
@@ -756,15 +755,15 @@ module Teamlab
|
|
756
755
|
end
|
757
756
|
|
758
757
|
def update_selected_user_field(entity_type, user_field_id, label, field_type, options = {})
|
759
|
-
@request.put([entity_type.to_s, 'customfield', user_field_id.to_s], {fieldType: field_type, label: label}.merge(options))
|
758
|
+
@request.put([entity_type.to_s, 'customfield', user_field_id.to_s], { fieldType: field_type, label: label }.merge(options))
|
760
759
|
end
|
761
760
|
|
762
761
|
def update_user_fields_order(entity_type, *field_ids)
|
763
|
-
@request.put([entity_type.to_s, 'customfield', 'reorder'],
|
762
|
+
@request.put([entity_type.to_s, 'customfield', 'reorder'], fieldIds: field_ids.flatten)
|
764
763
|
end
|
765
764
|
|
766
765
|
def delete_user_field(entity_type, field_id)
|
767
766
|
@request.delete([entity_type.to_s, 'customfield', field_id.to_s])
|
768
767
|
end
|
769
768
|
end
|
770
|
-
end
|
769
|
+
end
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module Teamlab
|
2
2
|
class Files
|
3
|
-
|
4
3
|
def initialize
|
5
4
|
@request = Teamlab::Request.new('files')
|
6
5
|
end
|
7
6
|
|
8
|
-
#region File Creation
|
7
|
+
# region File Creation
|
9
8
|
|
10
9
|
def create_txt_in_my_docs(title, content)
|
11
10
|
@request.post(%w(@my text), title: title.to_s, content: content.to_s)
|
@@ -35,9 +34,9 @@ module Teamlab
|
|
35
34
|
@request.post([folder_id.to_s, 'file'], title: title.to_s)
|
36
35
|
end
|
37
36
|
|
38
|
-
#endregion
|
37
|
+
# endregion
|
39
38
|
|
40
|
-
#region File operations
|
39
|
+
# region File operations
|
41
40
|
|
42
41
|
def get_file_operations_list
|
43
42
|
@request.get(%w(fileops))
|
@@ -84,9 +83,9 @@ module Teamlab
|
|
84
83
|
@request.put(['file', file_id.to_s, 'checkconversion'], start: start)
|
85
84
|
end
|
86
85
|
|
87
|
-
#endregion
|
86
|
+
# endregion
|
88
87
|
|
89
|
-
#region Files
|
88
|
+
# region Files
|
90
89
|
|
91
90
|
def get_file_info(file_id)
|
92
91
|
@request.get(['file', file_id.to_s])
|
@@ -108,9 +107,9 @@ module Teamlab
|
|
108
107
|
@request.delete(['file', file_id.to_s])
|
109
108
|
end
|
110
109
|
|
111
|
-
#endregion
|
110
|
+
# endregion
|
112
111
|
|
113
|
-
#region Folders
|
112
|
+
# region Folders
|
114
113
|
|
115
114
|
def get_my_docs
|
116
115
|
@request.get(['@my'])
|
@@ -157,9 +156,9 @@ module Teamlab
|
|
157
156
|
@request.delete(['folder', folder_id.to_s])
|
158
157
|
end
|
159
158
|
|
160
|
-
#endregion
|
159
|
+
# endregion
|
161
160
|
|
162
|
-
#region Sharing
|
161
|
+
# region Sharing
|
163
162
|
|
164
163
|
def get_file_sharing(file_id)
|
165
164
|
@request.get(['file', file_id.to_s, 'share'])
|
@@ -181,9 +180,9 @@ module Teamlab
|
|
181
180
|
@request.delete(['share'], options)
|
182
181
|
end
|
183
182
|
|
184
|
-
#endregion
|
183
|
+
# endregion
|
185
184
|
|
186
|
-
#region Third-Party Integration
|
185
|
+
# region Third-Party Integration
|
187
186
|
|
188
187
|
def get_third_party
|
189
188
|
@request.get(%w(thirdparty))
|
@@ -197,9 +196,9 @@ module Teamlab
|
|
197
196
|
@request.delete(['thirdparty', provider_id.to_s])
|
198
197
|
end
|
199
198
|
|
200
|
-
#endregion
|
199
|
+
# endregion
|
201
200
|
|
202
|
-
#region Uploads
|
201
|
+
# region Uploads
|
203
202
|
|
204
203
|
def upload_to_my_docs(file)
|
205
204
|
@request.post(%w(@my upload), somefile: File.new(file))
|
@@ -221,7 +220,7 @@ module Teamlab
|
|
221
220
|
@request.post([folder_id.to_s, 'upload', 'create_session'], fileName: filename, fileSize: file_size)
|
222
221
|
end
|
223
222
|
|
224
|
-
#endregion
|
223
|
+
# endregion
|
225
224
|
|
226
225
|
def search(query)
|
227
226
|
@request.get(['@search', query.to_s])
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module Teamlab
|
2
|
-
|
3
2
|
class Group
|
4
|
-
|
5
3
|
def initialize
|
6
4
|
@request = Teamlab::Request.new('group')
|
7
5
|
end
|
@@ -11,15 +9,15 @@ module Teamlab
|
|
11
9
|
end
|
12
10
|
|
13
11
|
def get_group(group_id)
|
14
|
-
@request.get([
|
12
|
+
@request.get([group_id.to_s])
|
15
13
|
end
|
16
14
|
|
17
15
|
def add_group(manager, name, members = [])
|
18
|
-
@request.post([''],
|
16
|
+
@request.post([''], groupManager: manager, groupName: name, members: members)
|
19
17
|
end
|
20
18
|
|
21
19
|
def replace_members(group_id, members)
|
22
|
-
@request.post([group_id.to_s, 'members'],
|
20
|
+
@request.post([group_id.to_s, 'members'], members: members)
|
23
21
|
end
|
24
22
|
|
25
23
|
def update_group(group_id, options = {})
|
@@ -27,11 +25,11 @@ module Teamlab
|
|
27
25
|
end
|
28
26
|
|
29
27
|
def add_group_users(group_id, members = [])
|
30
|
-
@request.put([group_id.to_s, 'members'],
|
28
|
+
@request.put([group_id.to_s, 'members'], members: members)
|
31
29
|
end
|
32
30
|
|
33
31
|
def set_group_manager(group_id, user_id)
|
34
|
-
@request.put([group_id.to_s, 'manager'],
|
32
|
+
@request.put([group_id.to_s, 'manager'], userid: user_id)
|
35
33
|
end
|
36
34
|
|
37
35
|
def move_group_members(group_id, new_group_id)
|
@@ -46,4 +44,4 @@ module Teamlab
|
|
46
44
|
@request.delete([group_id.to_s, 'members'], members: members)
|
47
45
|
end
|
48
46
|
end
|
49
|
-
end
|
47
|
+
end
|