datacentred 0.1.1pre → 1.1.1

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +11 -0
  3. data/.coveralls.yml +1 -0
  4. data/.gitignore +9 -0
  5. data/.rubocop.yml +2 -0
  6. data/.yardopts +1 -0
  7. data/CODE_OF_CONDUCT.md +46 -0
  8. data/Gemfile.lock +39 -2
  9. data/LICENSE +21 -0
  10. data/README.md +160 -2
  11. data/circle.yml +0 -2
  12. data/datacentred.gemspec +17 -14
  13. data/docs/Datacentred.html +537 -0
  14. data/docs/Datacentred/Errors.html +260 -0
  15. data/docs/Datacentred/Errors/Error.html +139 -0
  16. data/docs/Datacentred/Errors/NotFound.html +145 -0
  17. data/docs/Datacentred/Errors/Unauthorized.html +149 -0
  18. data/docs/Datacentred/Errors/UnprocessableEntity.html +145 -0
  19. data/docs/Datacentred/Model.html +128 -0
  20. data/docs/Datacentred/Model/Base.html +255 -0
  21. data/docs/Datacentred/Model/Project.html +1729 -0
  22. data/docs/Datacentred/Model/Role.html +1830 -0
  23. data/docs/Datacentred/Model/Usage.html +510 -0
  24. data/docs/Datacentred/Model/User.html +832 -0
  25. data/docs/Datacentred/Model/Version.html +451 -0
  26. data/docs/Datacentred/Project.html +142 -0
  27. data/docs/Datacentred/Request.html +128 -0
  28. data/docs/Datacentred/Request/Base.html +675 -0
  29. data/docs/Datacentred/Request/Projects.html +1286 -0
  30. data/docs/Datacentred/Request/Roles.html +1286 -0
  31. data/docs/Datacentred/Request/Usage.html +315 -0
  32. data/docs/Datacentred/Request/Users.html +841 -0
  33. data/docs/Datacentred/Request/Versions.html +258 -0
  34. data/docs/Datacentred/Response.html +410 -0
  35. data/docs/Datacentred/Role.html +142 -0
  36. data/docs/Datacentred/Usage.html +142 -0
  37. data/docs/Datacentred/User.html +142 -0
  38. data/docs/Datacentred/Version.html +142 -0
  39. data/docs/_index.html +349 -0
  40. data/docs/class_list.html +51 -0
  41. data/docs/css/common.css +1 -0
  42. data/docs/css/full_list.css +58 -0
  43. data/docs/css/style.css +492 -0
  44. data/docs/file.README.html +231 -0
  45. data/docs/file_list.html +56 -0
  46. data/docs/frames.html +17 -0
  47. data/docs/index.html +231 -0
  48. data/docs/js/app.js +248 -0
  49. data/docs/js/full_list.js +216 -0
  50. data/docs/js/jquery.js +4 -0
  51. data/docs/method_list.html +643 -0
  52. data/docs/top-level-namespace.html +110 -0
  53. data/lib/datacentred.rb +65 -12
  54. data/lib/datacentred/error.rb +37 -15
  55. data/lib/datacentred/model/base.rb +21 -0
  56. data/lib/datacentred/model/project.rb +90 -31
  57. data/lib/datacentred/model/role.rb +89 -31
  58. data/lib/datacentred/model/usage.rb +16 -9
  59. data/lib/datacentred/model/user.rb +54 -22
  60. data/lib/datacentred/model/version.rb +17 -8
  61. data/lib/datacentred/request/base.rb +68 -31
  62. data/lib/datacentred/request/projects.rb +92 -24
  63. data/lib/datacentred/request/roles.rb +92 -24
  64. data/lib/datacentred/request/usage.rb +10 -1
  65. data/lib/datacentred/request/users.rb +58 -15
  66. data/lib/datacentred/request/versions.rb +13 -1
  67. data/lib/datacentred/response.rb +6 -2
  68. data/test/integration/authorization_test.rb +30 -0
  69. data/test/integration/projects_test.rb +11 -11
  70. data/test/integration/roles_test.rb +17 -17
  71. data/test/integration/usage_test.rb +8 -8
  72. data/test/integration/users_test.rb +23 -19
  73. data/test/integration/versions_test.rb +1 -2
  74. data/test/test_helper.rb +8 -5
  75. data/test/vcr_cassettes/not_authorized.yml +57 -0
  76. data/test/vcr_cassettes/unexpected_error.yml +56 -0
  77. metadata +115 -9
@@ -0,0 +1,1286 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Datacentred::Request::Roles
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Datacentred::Request::Roles";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Datacentred.html" title="Datacentred (module)">Datacentred</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Request.html" title="Datacentred::Request (module)">Request</a></span></span>
41
+ &raquo;
42
+ <span class="title">Roles</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Datacentred::Request::Roles
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Base.html" title="Datacentred::Request::Base (class)">Base</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="Base.html" title="Datacentred::Request::Base (class)">Base</a></span></li>
78
+
79
+ <li class="next">Datacentred::Request::Roles</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/datacentred/request/roles.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>RESTful API requests for the roles endpoints.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <h2>
124
+ Class Method Summary
125
+ <small><a href="#" class="summary_toggle">collapse</a></small>
126
+ </h2>
127
+
128
+ <ul class="summary">
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#add_user-class_method" title="add_user (class method)">.<strong>add_user</strong>(role_id, user_id) &#x21d2; nil </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ <span class="summary_desc"><div class='inline'>
148
+ <p>Add new user to this role, giving them the associated permissions.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#create-class_method" title="create (class method)">.<strong>create</strong>(params) &#x21d2; Hash </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>Create a new role.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#destroy-class_method" title="destroy (class method)">.<strong>destroy</strong>(id) &#x21d2; nil </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <span class="summary_desc"><div class='inline'>
196
+ <p>Permanently remove the specified role.</p>
197
+ </div></span>
198
+
199
+ </li>
200
+
201
+
202
+ <li class="public ">
203
+ <span class="summary_signature">
204
+
205
+ <a href="#list-class_method" title="list (class method)">.<strong>list</strong> &#x21d2; [Hash] </a>
206
+
207
+
208
+
209
+ </span>
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+ <span class="summary_desc"><div class='inline'>
220
+ <p>List all available roles.</p>
221
+ </div></span>
222
+
223
+ </li>
224
+
225
+
226
+ <li class="public ">
227
+ <span class="summary_signature">
228
+
229
+ <a href="#list_users-class_method" title="list_users (class method)">.<strong>list_users</strong>(role_id) &#x21d2; [Hash] </a>
230
+
231
+
232
+
233
+ </span>
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+ <span class="summary_desc"><div class='inline'>
244
+ <p>List all users assigned to this role.</p>
245
+ </div></span>
246
+
247
+ </li>
248
+
249
+
250
+ <li class="public ">
251
+ <span class="summary_signature">
252
+
253
+ <a href="#remove_user-class_method" title="remove_user (class method)">.<strong>remove_user</strong>(role_id, user_id) &#x21d2; nil </a>
254
+
255
+
256
+
257
+ </span>
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+ <span class="summary_desc"><div class='inline'>
268
+ <p>Remove user from this role, revoking the associated permissions.</p>
269
+ </div></span>
270
+
271
+ </li>
272
+
273
+
274
+ <li class="public ">
275
+ <span class="summary_signature">
276
+
277
+ <a href="#show-class_method" title="show (class method)">.<strong>show</strong>(id) &#x21d2; Hash </a>
278
+
279
+
280
+
281
+ </span>
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+ <span class="summary_desc"><div class='inline'>
292
+ <p>Find a role by unique ID.</p>
293
+ </div></span>
294
+
295
+ </li>
296
+
297
+
298
+ <li class="public ">
299
+ <span class="summary_signature">
300
+
301
+ <a href="#update-class_method" title="update (class method)">.<strong>update</strong>(id, params) &#x21d2; Hash </a>
302
+
303
+
304
+
305
+ </span>
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+ <span class="summary_desc"><div class='inline'>
316
+ <p>Update a role by unique ID.</p>
317
+ </div></span>
318
+
319
+ </li>
320
+
321
+
322
+ </ul>
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Datacentred::Request::Base (class)">Base</a></span></h3>
335
+ <p class="inherited"><span class='object_link'><a href="Base.html#delete-class_method" title="Datacentred::Request::Base.delete (method)">delete</a></span>, <span class='object_link'><a href="Base.html#get-class_method" title="Datacentred::Request::Base.get (method)">get</a></span>, <span class='object_link'><a href="Base.html#post-class_method" title="Datacentred::Request::Base.post (method)">post</a></span>, <span class='object_link'><a href="Base.html#put-class_method" title="Datacentred::Request::Base.put (method)">put</a></span></p>
336
+
337
+
338
+ <div id="class_method_details" class="method_details_list">
339
+ <h2>Class Method Details</h2>
340
+
341
+
342
+ <div class="method_details first">
343
+ <h3 class="signature first" id="add_user-class_method">
344
+
345
+ .<strong>add_user</strong>(role_id, user_id) &#x21d2; <tt>nil</tt>
346
+
347
+
348
+
349
+
350
+
351
+ </h3><div class="docstring">
352
+ <div class="discussion">
353
+
354
+ <p>Add new user to this role, giving them the associated permissions.</p>
355
+
356
+ <pre class="code ruby"><code class="ruby">PUT /api/roles/ea894bed9d738d9f/users/82fa8de8f09102cc</code></pre>
357
+
358
+
359
+ </div>
360
+ </div>
361
+ <div class="tags">
362
+ <p class="tag_title">Parameters:</p>
363
+ <ul class="param">
364
+
365
+ <li>
366
+
367
+ <span class='name'>role_id</span>
368
+
369
+
370
+ <span class='type'>(<tt>String</tt>)</span>
371
+
372
+
373
+
374
+ &mdash;
375
+ <div class='inline'>
376
+ <p>The unique identifier for this role.</p>
377
+ </div>
378
+
379
+ </li>
380
+
381
+ <li>
382
+
383
+ <span class='name'>user_id</span>
384
+
385
+
386
+ <span class='type'>(<tt>String</tt>)</span>
387
+
388
+
389
+
390
+ &mdash;
391
+ <div class='inline'>
392
+ <p>The unique identifier for this user.</p>
393
+ </div>
394
+
395
+ </li>
396
+
397
+ </ul>
398
+
399
+ <p class="tag_title">Returns:</p>
400
+ <ul class="return">
401
+
402
+ <li>
403
+
404
+
405
+ <span class='type'>(<tt>nil</tt>)</span>
406
+
407
+
408
+
409
+ &mdash;
410
+ <div class='inline'>
411
+ <p>Confirms that user was added (or is already present).</p>
412
+ </div>
413
+
414
+ </li>
415
+
416
+ </ul>
417
+ <p class="tag_title">Raises:</p>
418
+ <ul class="raise">
419
+
420
+ <li>
421
+
422
+
423
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/NotFound.html" title="Datacentred::Errors::NotFound (class)">Errors::NotFound</a></span></tt>)</span>
424
+
425
+
426
+
427
+ &mdash;
428
+ <div class='inline'>
429
+ <p>Raised if the role or user couldn&#39;t be found.</p>
430
+ </div>
431
+
432
+ </li>
433
+
434
+ <li>
435
+
436
+
437
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
438
+
439
+
440
+
441
+ &mdash;
442
+ <div class='inline'>
443
+ <p>Raised if credentials aren&#39;t valid.</p>
444
+ </div>
445
+
446
+ </li>
447
+
448
+ </ul>
449
+
450
+ </div><table class="source_code">
451
+ <tr>
452
+ <td>
453
+ <pre class="lines">
454
+
455
+
456
+ 87
457
+ 88
458
+ 89</pre>
459
+ </td>
460
+ <td>
461
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 87</span>
462
+
463
+ <span class='kw'>def</span> <span class='id identifier rubyid_add_user'>add_user</span><span class='lparen'>(</span><span class='id identifier rubyid_role_id'>role_id</span><span class='comma'>,</span> <span class='id identifier rubyid_user_id'>user_id</span><span class='rparen'>)</span>
464
+ <span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>roles/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_role_id'>role_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/users/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user_id'>user_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
465
+ <span class='kw'>end</span></pre>
466
+ </td>
467
+ </tr>
468
+ </table>
469
+ </div>
470
+
471
+ <div class="method_details ">
472
+ <h3 class="signature " id="create-class_method">
473
+
474
+ .<strong>create</strong>(params) &#x21d2; <tt>Hash</tt>
475
+
476
+
477
+
478
+
479
+
480
+ </h3><div class="docstring">
481
+ <div class="discussion">
482
+
483
+ <p>Create a new role.</p>
484
+
485
+ <pre class="code ruby"><code class="ruby">POST /api/roles</code></pre>
486
+
487
+
488
+ </div>
489
+ </div>
490
+ <div class="tags">
491
+ <p class="tag_title">Parameters:</p>
492
+ <ul class="param">
493
+
494
+ <li>
495
+
496
+ <span class='name'>params</span>
497
+
498
+
499
+ <span class='type'>(<tt>Hash</tt>)</span>
500
+
501
+
502
+
503
+ &mdash;
504
+ <div class='inline'>
505
+ <p>Role attributes.</p>
506
+ </div>
507
+
508
+ </li>
509
+
510
+ </ul>
511
+
512
+ <p class="tag_title">Returns:</p>
513
+ <ul class="return">
514
+
515
+ <li>
516
+
517
+
518
+ <span class='type'>(<tt>Hash</tt>)</span>
519
+
520
+
521
+
522
+ &mdash;
523
+ <div class='inline'>
524
+ <p>New role.</p>
525
+ </div>
526
+
527
+ </li>
528
+
529
+ </ul>
530
+ <p class="tag_title">Raises:</p>
531
+ <ul class="raise">
532
+
533
+ <li>
534
+
535
+
536
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/UnprocessableEntity.html" title="Datacentred::Errors::UnprocessableEntity (class)">Errors::UnprocessableEntity</a></span></tt>)</span>
537
+
538
+
539
+
540
+ &mdash;
541
+ <div class='inline'>
542
+ <p>Raised if validations fail for the supplied attributes.</p>
543
+ </div>
544
+
545
+ </li>
546
+
547
+ <li>
548
+
549
+
550
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
551
+
552
+
553
+
554
+ &mdash;
555
+ <div class='inline'>
556
+ <p>Raised if credentials aren&#39;t valid.</p>
557
+ </div>
558
+
559
+ </li>
560
+
561
+ </ul>
562
+
563
+ </div><table class="source_code">
564
+ <tr>
565
+ <td>
566
+ <pre class="lines">
567
+
568
+
569
+ 14
570
+ 15
571
+ 16</pre>
572
+ </td>
573
+ <td>
574
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 14</span>
575
+
576
+ <span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
577
+ <span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>roles</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>role</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>role</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
578
+ <span class='kw'>end</span></pre>
579
+ </td>
580
+ </tr>
581
+ </table>
582
+ </div>
583
+
584
+ <div class="method_details ">
585
+ <h3 class="signature " id="destroy-class_method">
586
+
587
+ .<strong>destroy</strong>(id) &#x21d2; <tt>nil</tt>
588
+
589
+
590
+
591
+
592
+
593
+ </h3><div class="docstring">
594
+ <div class="discussion">
595
+
596
+ <p>Permanently remove the specified role.</p>
597
+
598
+ <pre class="code ruby"><code class="ruby">DELETE /api/roles/ea894bed9d738d9f</code></pre>
599
+
600
+
601
+ </div>
602
+ </div>
603
+ <div class="tags">
604
+ <p class="tag_title">Parameters:</p>
605
+ <ul class="param">
606
+
607
+ <li>
608
+
609
+ <span class='name'>id</span>
610
+
611
+
612
+ <span class='type'>(<tt>String</tt>)</span>
613
+
614
+
615
+
616
+ &mdash;
617
+ <div class='inline'>
618
+ <p>The unique identifier for this role.</p>
619
+ </div>
620
+
621
+ </li>
622
+
623
+ </ul>
624
+
625
+ <p class="tag_title">Returns:</p>
626
+ <ul class="return">
627
+
628
+ <li>
629
+
630
+
631
+ <span class='type'>(<tt>nil</tt>)</span>
632
+
633
+
634
+
635
+ &mdash;
636
+ <div class='inline'>
637
+ <p>Confirms the role was destroyed.</p>
638
+ </div>
639
+
640
+ </li>
641
+
642
+ </ul>
643
+ <p class="tag_title">Raises:</p>
644
+ <ul class="raise">
645
+
646
+ <li>
647
+
648
+
649
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/NotFound.html" title="Datacentred::Errors::NotFound (class)">Errors::NotFound</a></span></tt>)</span>
650
+
651
+
652
+
653
+ &mdash;
654
+ <div class='inline'>
655
+ <p>Raised if the role couldn&#39;t be found.</p>
656
+ </div>
657
+
658
+ </li>
659
+
660
+ <li>
661
+
662
+
663
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/UnprocessableEntity.html" title="Datacentred::Errors::UnprocessableEntity (class)">Errors::UnprocessableEntity</a></span></tt>)</span>
664
+
665
+
666
+
667
+ &mdash;
668
+ <div class='inline'>
669
+ <p>Raised if validations fail for the specifed role.</p>
670
+ </div>
671
+
672
+ </li>
673
+
674
+ <li>
675
+
676
+
677
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
678
+
679
+
680
+
681
+ &mdash;
682
+ <div class='inline'>
683
+ <p>Raised if credentials aren&#39;t valid.</p>
684
+ </div>
685
+
686
+ </li>
687
+
688
+ </ul>
689
+
690
+ </div><table class="source_code">
691
+ <tr>
692
+ <td>
693
+ <pre class="lines">
694
+
695
+
696
+ 63
697
+ 64
698
+ 65</pre>
699
+ </td>
700
+ <td>
701
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 63</span>
702
+
703
+ <span class='kw'>def</span> <span class='id identifier rubyid_destroy'>destroy</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
704
+ <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>roles/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
705
+ <span class='kw'>end</span></pre>
706
+ </td>
707
+ </tr>
708
+ </table>
709
+ </div>
710
+
711
+ <div class="method_details ">
712
+ <h3 class="signature " id="list-class_method">
713
+
714
+ .<strong>list</strong> &#x21d2; <tt>[Hash]</tt>
715
+
716
+
717
+
718
+
719
+
720
+ </h3><div class="docstring">
721
+ <div class="discussion">
722
+
723
+ <p>List all available roles.</p>
724
+
725
+ <pre class="code ruby"><code class="ruby">GET /api/roles</code></pre>
726
+
727
+
728
+ </div>
729
+ </div>
730
+ <div class="tags">
731
+
732
+ <p class="tag_title">Returns:</p>
733
+ <ul class="return">
734
+
735
+ <li>
736
+
737
+
738
+ <span class='type'>(<tt>[Hash]</tt>)</span>
739
+
740
+
741
+
742
+ &mdash;
743
+ <div class='inline'>
744
+ <p>A collection of all roles on this account.</p>
745
+ </div>
746
+
747
+ </li>
748
+
749
+ </ul>
750
+ <p class="tag_title">Raises:</p>
751
+ <ul class="raise">
752
+
753
+ <li>
754
+
755
+
756
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
757
+
758
+
759
+
760
+ &mdash;
761
+ <div class='inline'>
762
+ <p>Raised if credentials aren&#39;t valid.</p>
763
+ </div>
764
+
765
+ </li>
766
+
767
+ </ul>
768
+
769
+ </div><table class="source_code">
770
+ <tr>
771
+ <td>
772
+ <pre class="lines">
773
+
774
+
775
+ 24
776
+ 25
777
+ 26</pre>
778
+ </td>
779
+ <td>
780
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 24</span>
781
+
782
+ <span class='kw'>def</span> <span class='id identifier rubyid_list'>list</span>
783
+ <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>roles</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>roles</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
784
+ <span class='kw'>end</span></pre>
785
+ </td>
786
+ </tr>
787
+ </table>
788
+ </div>
789
+
790
+ <div class="method_details ">
791
+ <h3 class="signature " id="list_users-class_method">
792
+
793
+ .<strong>list_users</strong>(role_id) &#x21d2; <tt>[Hash]</tt>
794
+
795
+
796
+
797
+
798
+
799
+ </h3><div class="docstring">
800
+ <div class="discussion">
801
+
802
+ <p>List all users assigned to this role.</p>
803
+
804
+ <pre class="code ruby"><code class="ruby">GET /api/roles/ea894bed9d738d9f/users</code></pre>
805
+
806
+
807
+ </div>
808
+ </div>
809
+ <div class="tags">
810
+ <p class="tag_title">Parameters:</p>
811
+ <ul class="param">
812
+
813
+ <li>
814
+
815
+ <span class='name'>role_id</span>
816
+
817
+
818
+ <span class='type'>(<tt>String</tt>)</span>
819
+
820
+
821
+
822
+ &mdash;
823
+ <div class='inline'>
824
+ <p>The unique identifier for this role.</p>
825
+ </div>
826
+
827
+ </li>
828
+
829
+ </ul>
830
+
831
+ <p class="tag_title">Returns:</p>
832
+ <ul class="return">
833
+
834
+ <li>
835
+
836
+
837
+ <span class='type'>(<tt>[Hash]</tt>)</span>
838
+
839
+
840
+
841
+ &mdash;
842
+ <div class='inline'>
843
+ <p>A collection of the role&#39;s users.</p>
844
+ </div>
845
+
846
+ </li>
847
+
848
+ </ul>
849
+ <p class="tag_title">Raises:</p>
850
+ <ul class="raise">
851
+
852
+ <li>
853
+
854
+
855
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
856
+
857
+
858
+
859
+ &mdash;
860
+ <div class='inline'>
861
+ <p>Raised if credentials aren&#39;t valid.</p>
862
+ </div>
863
+
864
+ </li>
865
+
866
+ </ul>
867
+
868
+ </div><table class="source_code">
869
+ <tr>
870
+ <td>
871
+ <pre class="lines">
872
+
873
+
874
+ 74
875
+ 75
876
+ 76</pre>
877
+ </td>
878
+ <td>
879
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 74</span>
880
+
881
+ <span class='kw'>def</span> <span class='id identifier rubyid_list_users'>list_users</span><span class='lparen'>(</span><span class='id identifier rubyid_role_id'>role_id</span><span class='rparen'>)</span>
882
+ <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>roles/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_role_id'>role_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/users</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>users</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
883
+ <span class='kw'>end</span></pre>
884
+ </td>
885
+ </tr>
886
+ </table>
887
+ </div>
888
+
889
+ <div class="method_details ">
890
+ <h3 class="signature " id="remove_user-class_method">
891
+
892
+ .<strong>remove_user</strong>(role_id, user_id) &#x21d2; <tt>nil</tt>
893
+
894
+
895
+
896
+
897
+
898
+ </h3><div class="docstring">
899
+ <div class="discussion">
900
+
901
+ <p>Remove user from this role, revoking the associated permissions.</p>
902
+
903
+ <pre class="code ruby"><code class="ruby">DELETE /api/roles/ea894bed9d738d9f/users/82fa8de8f09102cc</code></pre>
904
+
905
+
906
+ </div>
907
+ </div>
908
+ <div class="tags">
909
+ <p class="tag_title">Parameters:</p>
910
+ <ul class="param">
911
+
912
+ <li>
913
+
914
+ <span class='name'>role_id</span>
915
+
916
+
917
+ <span class='type'>(<tt>String</tt>)</span>
918
+
919
+
920
+
921
+ &mdash;
922
+ <div class='inline'>
923
+ <p>The unique identifier for this role.</p>
924
+ </div>
925
+
926
+ </li>
927
+
928
+ <li>
929
+
930
+ <span class='name'>user_id</span>
931
+
932
+
933
+ <span class='type'>(<tt>String</tt>)</span>
934
+
935
+
936
+
937
+ &mdash;
938
+ <div class='inline'>
939
+ <p>The unique identifier for this user.</p>
940
+ </div>
941
+
942
+ </li>
943
+
944
+ </ul>
945
+
946
+ <p class="tag_title">Returns:</p>
947
+ <ul class="return">
948
+
949
+ <li>
950
+
951
+
952
+ <span class='type'>(<tt>nil</tt>)</span>
953
+
954
+
955
+
956
+ &mdash;
957
+ <div class='inline'>
958
+ <p>Confirms that user was removed (or is already absent).</p>
959
+ </div>
960
+
961
+ </li>
962
+
963
+ </ul>
964
+ <p class="tag_title">Raises:</p>
965
+ <ul class="raise">
966
+
967
+ <li>
968
+
969
+
970
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/NotFound.html" title="Datacentred::Errors::NotFound (class)">Errors::NotFound</a></span></tt>)</span>
971
+
972
+
973
+
974
+ &mdash;
975
+ <div class='inline'>
976
+ <p>Raised if the role or user coundn&#39;t be found.</p>
977
+ </div>
978
+
979
+ </li>
980
+
981
+ <li>
982
+
983
+
984
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
985
+
986
+
987
+
988
+ &mdash;
989
+ <div class='inline'>
990
+ <p>Raised if credentials aren&#39;t valid.</p>
991
+ </div>
992
+
993
+ </li>
994
+
995
+ </ul>
996
+
997
+ </div><table class="source_code">
998
+ <tr>
999
+ <td>
1000
+ <pre class="lines">
1001
+
1002
+
1003
+ 100
1004
+ 101
1005
+ 102</pre>
1006
+ </td>
1007
+ <td>
1008
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 100</span>
1009
+
1010
+ <span class='kw'>def</span> <span class='id identifier rubyid_remove_user'>remove_user</span><span class='lparen'>(</span><span class='id identifier rubyid_role_id'>role_id</span><span class='comma'>,</span> <span class='id identifier rubyid_user_id'>user_id</span><span class='rparen'>)</span>
1011
+ <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>roles/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_role_id'>role_id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/users/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_user_id'>user_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1012
+ <span class='kw'>end</span></pre>
1013
+ </td>
1014
+ </tr>
1015
+ </table>
1016
+ </div>
1017
+
1018
+ <div class="method_details ">
1019
+ <h3 class="signature " id="show-class_method">
1020
+
1021
+ .<strong>show</strong>(id) &#x21d2; <tt>Hash</tt>
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+ </h3><div class="docstring">
1028
+ <div class="discussion">
1029
+
1030
+ <p>Find a role by unique ID.</p>
1031
+
1032
+ <pre class="code ruby"><code class="ruby">GET /api/roles/ea894bed9d738d9f</code></pre>
1033
+
1034
+
1035
+ </div>
1036
+ </div>
1037
+ <div class="tags">
1038
+ <p class="tag_title">Parameters:</p>
1039
+ <ul class="param">
1040
+
1041
+ <li>
1042
+
1043
+ <span class='name'>id</span>
1044
+
1045
+
1046
+ <span class='type'>(<tt>String</tt>)</span>
1047
+
1048
+
1049
+
1050
+ &mdash;
1051
+ <div class='inline'>
1052
+ <p>The unique identifier for this role.</p>
1053
+ </div>
1054
+
1055
+ </li>
1056
+
1057
+ </ul>
1058
+
1059
+ <p class="tag_title">Returns:</p>
1060
+ <ul class="return">
1061
+
1062
+ <li>
1063
+
1064
+
1065
+ <span class='type'>(<tt>Hash</tt>)</span>
1066
+
1067
+
1068
+
1069
+ &mdash;
1070
+ <div class='inline'>
1071
+ <p>The role, if it exists.</p>
1072
+ </div>
1073
+
1074
+ </li>
1075
+
1076
+ </ul>
1077
+ <p class="tag_title">Raises:</p>
1078
+ <ul class="raise">
1079
+
1080
+ <li>
1081
+
1082
+
1083
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/NotFound.html" title="Datacentred::Errors::NotFound (class)">Errors::NotFound</a></span></tt>)</span>
1084
+
1085
+
1086
+
1087
+ &mdash;
1088
+ <div class='inline'>
1089
+ <p>Raised if the role couldn&#39;t be found.</p>
1090
+ </div>
1091
+
1092
+ </li>
1093
+
1094
+ <li>
1095
+
1096
+
1097
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
1098
+
1099
+
1100
+
1101
+ &mdash;
1102
+ <div class='inline'>
1103
+ <p>Raised if credentials aren&#39;t valid.</p>
1104
+ </div>
1105
+
1106
+ </li>
1107
+
1108
+ </ul>
1109
+
1110
+ </div><table class="source_code">
1111
+ <tr>
1112
+ <td>
1113
+ <pre class="lines">
1114
+
1115
+
1116
+ 36
1117
+ 37
1118
+ 38</pre>
1119
+ </td>
1120
+ <td>
1121
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 36</span>
1122
+
1123
+ <span class='kw'>def</span> <span class='id identifier rubyid_show'>show</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
1124
+ <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>roles/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>role</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1125
+ <span class='kw'>end</span></pre>
1126
+ </td>
1127
+ </tr>
1128
+ </table>
1129
+ </div>
1130
+
1131
+ <div class="method_details ">
1132
+ <h3 class="signature " id="update-class_method">
1133
+
1134
+ .<strong>update</strong>(id, params) &#x21d2; <tt>Hash</tt>
1135
+
1136
+
1137
+
1138
+
1139
+
1140
+ </h3><div class="docstring">
1141
+ <div class="discussion">
1142
+
1143
+ <p>Update a role by unique ID.</p>
1144
+
1145
+ <pre class="code ruby"><code class="ruby">PUT /api/roles/ea894bed9d738d9f</code></pre>
1146
+
1147
+
1148
+ </div>
1149
+ </div>
1150
+ <div class="tags">
1151
+ <p class="tag_title">Parameters:</p>
1152
+ <ul class="param">
1153
+
1154
+ <li>
1155
+
1156
+ <span class='name'>id</span>
1157
+
1158
+
1159
+ <span class='type'>(<tt>String</tt>)</span>
1160
+
1161
+
1162
+
1163
+ &mdash;
1164
+ <div class='inline'>
1165
+ <p>The unique identifier for this role.</p>
1166
+ </div>
1167
+
1168
+ </li>
1169
+
1170
+ <li>
1171
+
1172
+ <span class='name'>params</span>
1173
+
1174
+
1175
+ <span class='type'>(<tt>Hash</tt>)</span>
1176
+
1177
+
1178
+
1179
+ &mdash;
1180
+ <div class='inline'>
1181
+ <p>Role attributes.</p>
1182
+ </div>
1183
+
1184
+ </li>
1185
+
1186
+ </ul>
1187
+
1188
+ <p class="tag_title">Returns:</p>
1189
+ <ul class="return">
1190
+
1191
+ <li>
1192
+
1193
+
1194
+ <span class='type'>(<tt>Hash</tt>)</span>
1195
+
1196
+
1197
+
1198
+ &mdash;
1199
+ <div class='inline'>
1200
+ <p>The updated role.</p>
1201
+ </div>
1202
+
1203
+ </li>
1204
+
1205
+ </ul>
1206
+ <p class="tag_title">Raises:</p>
1207
+ <ul class="raise">
1208
+
1209
+ <li>
1210
+
1211
+
1212
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/UnprocessableEntity.html" title="Datacentred::Errors::UnprocessableEntity (class)">Errors::UnprocessableEntity</a></span></tt>)</span>
1213
+
1214
+
1215
+
1216
+ &mdash;
1217
+ <div class='inline'>
1218
+ <p>Raised if validations fail for the supplied attributes.</p>
1219
+ </div>
1220
+
1221
+ </li>
1222
+
1223
+ <li>
1224
+
1225
+
1226
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/NotFound.html" title="Datacentred::Errors::NotFound (class)">Errors::NotFound</a></span></tt>)</span>
1227
+
1228
+
1229
+
1230
+ &mdash;
1231
+ <div class='inline'>
1232
+ <p>Raised if the role doesn&#39;t exist.</p>
1233
+ </div>
1234
+
1235
+ </li>
1236
+
1237
+ <li>
1238
+
1239
+
1240
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Unauthorized.html" title="Datacentred::Errors::Unauthorized (class)">Errors::Unauthorized</a></span></tt>)</span>
1241
+
1242
+
1243
+
1244
+ &mdash;
1245
+ <div class='inline'>
1246
+ <p>Raised if credentials aren&#39;t valid.</p>
1247
+ </div>
1248
+
1249
+ </li>
1250
+
1251
+ </ul>
1252
+
1253
+ </div><table class="source_code">
1254
+ <tr>
1255
+ <td>
1256
+ <pre class="lines">
1257
+
1258
+
1259
+ 50
1260
+ 51
1261
+ 52</pre>
1262
+ </td>
1263
+ <td>
1264
+ <pre class="code"><span class="info file"># File 'lib/datacentred/request/roles.rb', line 50</span>
1265
+
1266
+ <span class='kw'>def</span> <span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
1267
+ <span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>roles/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>role</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>role</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1268
+ <span class='kw'>end</span></pre>
1269
+ </td>
1270
+ </tr>
1271
+ </table>
1272
+ </div>
1273
+
1274
+ </div>
1275
+
1276
+ </div>
1277
+
1278
+ <div id="footer">
1279
+ Generated on Fri Sep 15 16:27:43 2017 by
1280
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1281
+ 0.9.9 (ruby-2.3.1).
1282
+ </div>
1283
+
1284
+ </div>
1285
+ </body>
1286
+ </html>