travis-client 0.1.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -2
  3. data/.rspec +3 -2
  4. data/.travis.yml +2 -9
  5. data/.yardopts +2 -0
  6. data/Gemfile +1 -3
  7. data/Gemfile.lock +59 -0
  8. data/lib/travis/client.rb +20 -104
  9. data/lib/travis/client/action.rb +128 -0
  10. data/lib/travis/client/collection.rb +66 -0
  11. data/lib/travis/client/connection.rb +104 -0
  12. data/lib/travis/client/context.rb +52 -0
  13. data/lib/travis/client/entity.rb +77 -0
  14. data/lib/travis/client/error.rb +47 -0
  15. data/lib/travis/client/generated.rb +2073 -0
  16. data/lib/travis/client/link.rb +34 -0
  17. data/lib/travis/client/session.rb +101 -0
  18. data/lib/travis/client/unknown.rb +5 -0
  19. data/lib/travis/client/version.rb +6 -0
  20. data/readme.md +187 -0
  21. data/script/generate +44 -0
  22. data/spec/http_responses/default/branches.http +715 -0
  23. data/spec/http_responses/default/find_owner.http +23 -0
  24. data/spec/http_responses/default/index.http +1518 -0
  25. data/spec/http_responses/default/repo.http +44 -0
  26. data/spec/http_responses/default/repo_branches_10.http +347 -0
  27. data/spec/http_responses/default/repo_branches_10_0.http +347 -0
  28. data/spec/http_responses/default/repo_branches_10_10.http +351 -0
  29. data/spec/http_responses/default/repo_branches_10_20.http +99 -0
  30. data/spec/http_responses/default/sync.http +12 -0
  31. data/spec/http_responses/default/user_repos.http +6315 -0
  32. data/spec/spec_helper.rb +4 -2
  33. data/spec/support/coverage.rb +8 -0
  34. data/spec/support/generate_http_response.rb +16 -0
  35. data/spec/support/http.rb +54 -0
  36. data/spec/travis/collection_spec.rb +19 -0
  37. data/spec/travis/connection_spec.rb +26 -0
  38. data/spec/travis/entity_spec.rb +27 -0
  39. data/spec/travis_spec.rb +18 -0
  40. data/travis-client.gemspec +21 -21
  41. metadata +103 -75
  42. data/README.textile +0 -111
  43. data/Rakefile +0 -8
  44. data/bin/travis +0 -21
  45. data/features/repositories.feature +0 -117
  46. data/features/step_definitions/repositories_steps.rb +0 -51
  47. data/features/support/env.rb +0 -2
  48. data/lib/travis.rb +0 -2
  49. data/lib/travis/api.rb +0 -3
  50. data/lib/travis/api/client.rb +0 -95
  51. data/lib/travis/api/client/repositories.rb +0 -234
  52. data/lib/travis/api/entity.rb +0 -44
  53. data/lib/travis/api/entity/build.rb +0 -129
  54. data/lib/travis/api/entity/repository.rb +0 -79
  55. data/lib/travis/client/repositories.rb +0 -345
  56. data/spec/travis/api/client/repositories_spec.rb +0 -2
  57. data/spec/travis/api/client_spec.rb +0 -15
  58. data/spec/travis/api/entity/build_spec.rb +0 -84
  59. data/spec/travis/api/entity/repository_spec.rb +0 -79
  60. data/spec/travis/api/entity_spec.rb +0 -46
  61. data/spec/travis/api/shared_client_examples.rb +0 -3
  62. data/spec/travis/api/shared_entity_examples.rb +0 -16
@@ -0,0 +1,23 @@
1
+ GET https://api.travis-ci.org/owner/rkh HTTP/1.1
2
+ Accept: application/json
3
+ Travis-API-Version: 3
4
+
5
+ HTTP/1.1 200 OK
6
+ Content-Type: application/json
7
+
8
+ {
9
+ "@type": "user",
10
+ "@href": "/user/267",
11
+ "@representation": "standard",
12
+ "@permissions": {
13
+ "read": true,
14
+ "sync": false
15
+ },
16
+ "id": 267,
17
+ "login": "rkh",
18
+ "name": "Konstantin Haase",
19
+ "github_id": 30442,
20
+ "avatar_url": "https://avatars1.githubusercontent.com/u/30442?v=3",
21
+ "is_syncing": false,
22
+ "synced_at": "2017-04-03T00:03:25Z"
23
+ }
@@ -0,0 +1,1518 @@
1
+ GET https://api.travis-ci.org HTTP/1.1
2
+ Accept: application/json
3
+ Travis-API-Version: 3
4
+
5
+ HTTP/1.1 200 OK
6
+ Content-Type: application/json
7
+
8
+ {
9
+ "@type": "home",
10
+ "@href": "/",
11
+ "config": {
12
+ "host": "travis-ci.org",
13
+ "github": {
14
+ "api_url": "https://api.github.com",
15
+ "web_url": "https://github.com",
16
+ "scopes": [
17
+ "read:org",
18
+ "user:email",
19
+ "repo_deployment",
20
+ "repo:status",
21
+ "write:repo_hook"
22
+ ]
23
+ },
24
+ "pusher": {
25
+ "key": "5df8ac576dcccf4fd076"
26
+ }
27
+ },
28
+ "errors": {
29
+ "already_syncing": {
30
+ "status": 409,
31
+ "default_message": "sync already in progress",
32
+ "additional_attributes": [
33
+
34
+ ]
35
+ },
36
+ "build_already_running": {
37
+ "status": 409,
38
+ "default_message": "build already running, cannot restart",
39
+ "additional_attributes": [
40
+
41
+ ]
42
+ },
43
+ "build_not_cancelable": {
44
+ "status": 409,
45
+ "default_message": "build is not running, cannot cancel",
46
+ "additional_attributes": [
47
+
48
+ ]
49
+ },
50
+ "client_error": {
51
+ "status": 400,
52
+ "default_message": "bad request",
53
+ "additional_attributes": [
54
+
55
+ ]
56
+ },
57
+ "duplicate_resource": {
58
+ "status": 409,
59
+ "default_message": "resource already exists",
60
+ "additional_attributes": [
61
+
62
+ ]
63
+ },
64
+ "insufficient_access": {
65
+ "status": 403,
66
+ "default_message": "forbidden",
67
+ "additional_attributes": [
68
+ "permission",
69
+ "resource_type"
70
+ ]
71
+ },
72
+ "job_already_running": {
73
+ "status": 409,
74
+ "default_message": "job already running, cannot restart",
75
+ "additional_attributes": [
76
+
77
+ ]
78
+ },
79
+ "job_not_cancelable": {
80
+ "status": 409,
81
+ "default_message": "job is not running, cannot cancel",
82
+ "additional_attributes": [
83
+
84
+ ]
85
+ },
86
+ "job_unfinished": {
87
+ "status": 409,
88
+ "default_message": "job still running, cannot remove log yet",
89
+ "additional_attributes": [
90
+
91
+ ]
92
+ },
93
+ "log_already_removed": {
94
+ "status": 409,
95
+ "default_message": "log has already been removed",
96
+ "additional_attributes": [
97
+
98
+ ]
99
+ },
100
+ "login_required": {
101
+ "status": 403,
102
+ "default_message": "login required",
103
+ "additional_attributes": [
104
+
105
+ ]
106
+ },
107
+ "method_not_allowed": {
108
+ "status": 405,
109
+ "default_message": "method not allowed",
110
+ "additional_attributes": [
111
+
112
+ ]
113
+ },
114
+ "not_found": {
115
+ "status": 404,
116
+ "default_message": "resource not found (or insufficient access)",
117
+ "additional_attributes": [
118
+ "resource_type"
119
+ ]
120
+ },
121
+ "not_implemented": {
122
+ "status": 501,
123
+ "default_message": "request not (yet) implemented",
124
+ "additional_attributes": [
125
+
126
+ ]
127
+ },
128
+ "private_repo_feature": {
129
+ "status": 403,
130
+ "default_message": "this feature is only available on private repositories and for Travis CI Enterprise customers",
131
+ "additional_attributes": [
132
+
133
+ ]
134
+ },
135
+ "request_limit_reached": {
136
+ "status": 429,
137
+ "default_message": "request limit reached for resource",
138
+ "additional_attributes": [
139
+
140
+ ]
141
+ },
142
+ "server_error": {
143
+ "status": 500,
144
+ "default_message": "internal server error",
145
+ "additional_attributes": [
146
+
147
+ ]
148
+ },
149
+ "source_unknown": {
150
+ "status": 400,
151
+ "default_message": "source unknown",
152
+ "additional_attributes": [
153
+
154
+ ]
155
+ },
156
+ "unprocessable_entity": {
157
+ "status": 422,
158
+ "default_message": "request unable to be processed due to semantic errors",
159
+ "additional_attributes": [
160
+
161
+ ]
162
+ },
163
+ "wrong_credentials": {
164
+ "status": 403,
165
+ "default_message": "access denied",
166
+ "additional_attributes": [
167
+
168
+ ]
169
+ },
170
+ "wrong_params": {
171
+ "status": 400,
172
+ "default_message": "wrong parameters",
173
+ "additional_attributes": [
174
+
175
+ ]
176
+ }
177
+ },
178
+ "resources": {
179
+ "account": {
180
+ "@type": "resource",
181
+ "actions": {
182
+ }
183
+ },
184
+ "active": {
185
+ "@type": "resource",
186
+ "actions": {
187
+ "for_owner": [
188
+ {
189
+ "@type": "template",
190
+ "request_method": "GET",
191
+ "uri_template": "/owner/{owner.login}/active{?include}"
192
+ },
193
+ {
194
+ "@type": "template",
195
+ "request_method": "GET",
196
+ "uri_template": "/owner/{user.login}/active{?include}"
197
+ },
198
+ {
199
+ "@type": "template",
200
+ "request_method": "GET",
201
+ "uri_template": "/owner/{organization.login}/active{?include}"
202
+ },
203
+ {
204
+ "@type": "template",
205
+ "request_method": "GET",
206
+ "uri_template": "/owner/github_id/{owner.github_id}/active{?include}"
207
+ }
208
+ ]
209
+ },
210
+ "attributes": ["builds"],
211
+ "representations": {
212
+ "standard": ["builds"]
213
+ }
214
+ },
215
+ "beta_feature": {
216
+ "@type": "resource",
217
+ "actions": {
218
+ "update": [
219
+ {
220
+ "@type": "template",
221
+ "request_method": "PATCH",
222
+ "uri_template": "/user/{user.id}/beta_feature/{beta_feature.id}",
223
+ "accepted_params": [
224
+ "beta_feature.id",
225
+ "beta_feature.enabled"
226
+ ]
227
+ }
228
+ ],
229
+ "delete": [
230
+ {
231
+ "@type": "template",
232
+ "request_method": "DELETE",
233
+ "uri_template": "/user/{user.id}/beta_feature/{beta_feature.id}"
234
+ }
235
+ ]
236
+ },
237
+ "attributes": ["id","name","description","enabled","feedback_url"],
238
+ "representations": {
239
+ "standard": [
240
+ "id",
241
+ "name",
242
+ "description",
243
+ "enabled",
244
+ "feedback_url"
245
+ ]
246
+ }
247
+ },
248
+ "beta_features": {
249
+ "@type": "resource",
250
+ "actions": {
251
+ "find": [
252
+ {
253
+ "@type": "template",
254
+ "request_method": "GET",
255
+ "uri_template": "/user/{user.id}/beta_features{?include}"
256
+ }
257
+ ]
258
+ },
259
+ "attributes": ["beta_features"],
260
+ "representations": {
261
+ "standard": ["beta_features"]
262
+ }
263
+ },
264
+ "branch": {
265
+ "@type": "resource",
266
+ "actions": {
267
+ "find": [
268
+ {
269
+ "@type": "template",
270
+ "request_method": "GET",
271
+ "uri_template": "/repo/{repository.id}/branch/{branch.name}{?include}"
272
+ },
273
+ {
274
+ "@type": "template",
275
+ "request_method": "GET",
276
+ "uri_template": "/repo/{repository.slug}/branch/{branch.name}{?include}"
277
+ }
278
+ ]
279
+ },
280
+ "attributes": ["name","repository","default_branch","exists_on_github","last_build"],
281
+ "representations": {
282
+ "minimal": [
283
+ "name"
284
+ ],
285
+ "standard": [
286
+ "name",
287
+ "repository",
288
+ "default_branch",
289
+ "exists_on_github",
290
+ "last_build"
291
+ ]
292
+ }
293
+ },
294
+ "branches": {
295
+ "@type": "resource",
296
+ "actions": {
297
+ "find": [
298
+ {
299
+ "@type": "template",
300
+ "request_method": "GET",
301
+ "uri_template": "/repo/{repository.id}/branches{?branch.exists_on_github,exists_on_github,include,limit,offset,sort_by}"
302
+ },
303
+ {
304
+ "@type": "template",
305
+ "request_method": "GET",
306
+ "uri_template": "/repo/{repository.slug}/branches{?branch.exists_on_github,exists_on_github,include,limit,offset,sort_by}"
307
+ }
308
+ ]
309
+ },
310
+ "attributes": ["branches"],
311
+ "representations": {
312
+ "standard": ["branches"]
313
+ },
314
+ "sortable_by": [
315
+ "name",
316
+ "last_build",
317
+ "exists_on_github",
318
+ "default_branch"
319
+ ],
320
+ "default_sort": "default_branch,exists_on_github,last_build:desc"
321
+ },
322
+ "broadcast": {
323
+ "@type": "resource",
324
+ "actions": {
325
+ },
326
+ "attributes": ["id","message","created_at","category","active","recipient"],
327
+ "representations": {
328
+ "minimal": [
329
+ "id",
330
+ "message",
331
+ "created_at",
332
+ "category",
333
+ "active"
334
+ ],
335
+ "standard": [
336
+ "id",
337
+ "id",
338
+ "message",
339
+ "created_at",
340
+ "category",
341
+ "active",
342
+ "recipient"
343
+ ]
344
+ }
345
+ },
346
+ "broadcasts": {
347
+ "@type": "resource",
348
+ "actions": {
349
+ "for_current_user": [
350
+ {
351
+ "@type": "template",
352
+ "request_method": "GET",
353
+ "uri_template": "/broadcasts{?active,broadcast.active,include}"
354
+ }
355
+ ]
356
+ },
357
+ "attributes": ["broadcasts"],
358
+ "representations": {
359
+ "standard": ["broadcasts"]
360
+ }
361
+ },
362
+ "build": {
363
+ "@type": "resource",
364
+ "actions": {
365
+ "find": [
366
+ {
367
+ "@type": "template",
368
+ "request_method": "GET",
369
+ "uri_template": "/build/{build.id}{?include}"
370
+ }
371
+ ],
372
+ "cancel": [
373
+ {
374
+ "@type": "template",
375
+ "request_method": "POST",
376
+ "uri_template": "/build/{build.id}/cancel",
377
+ "accepted_params": [
378
+
379
+ ]
380
+ }
381
+ ],
382
+ "restart": [
383
+ {
384
+ "@type": "template",
385
+ "request_method": "POST",
386
+ "uri_template": "/build/{build.id}/restart",
387
+ "accepted_params": [
388
+
389
+ ]
390
+ }
391
+ ]
392
+ },
393
+ "attributes": ["id","number","state","duration","event_type","previous_state","pull_request_title","pull_request_number","started_at","finished_at","repository","branch","commit","jobs"],
394
+ "representations": {
395
+ "minimal": [
396
+ "id",
397
+ "number",
398
+ "state",
399
+ "duration",
400
+ "event_type",
401
+ "previous_state",
402
+ "pull_request_title",
403
+ "pull_request_number",
404
+ "started_at",
405
+ "finished_at"
406
+ ],
407
+ "standard": [
408
+ "id",
409
+ "number",
410
+ "state",
411
+ "duration",
412
+ "event_type",
413
+ "previous_state",
414
+ "pull_request_title",
415
+ "pull_request_number",
416
+ "started_at",
417
+ "finished_at",
418
+ "repository",
419
+ "branch",
420
+ "commit",
421
+ "jobs"
422
+ ],
423
+ "active": [
424
+ "id",
425
+ "number",
426
+ "state",
427
+ "duration",
428
+ "event_type",
429
+ "previous_state",
430
+ "pull_request_title",
431
+ "pull_request_number",
432
+ "started_at",
433
+ "finished_at",
434
+ "repository",
435
+ "branch",
436
+ "commit",
437
+ "jobs"
438
+ ]
439
+ },
440
+ "permissions": [
441
+ "read",
442
+ "cancel",
443
+ "restart"
444
+ ]
445
+ },
446
+ "builds": {
447
+ "@type": "resource",
448
+ "actions": {
449
+ "find": [
450
+ {
451
+ "@type": "template",
452
+ "request_method": "GET",
453
+ "uri_template": "/repo/{repository.id}/builds{?branch.name,build.event_type,build.previous_state,build.state,event_type,include,limit,offset,previous_state,sort_by,state}"
454
+ },
455
+ {
456
+ "@type": "template",
457
+ "request_method": "GET",
458
+ "uri_template": "/repo/{repository.slug}/builds{?branch.name,build.event_type,build.previous_state,build.state,event_type,include,limit,offset,previous_state,sort_by,state}"
459
+ }
460
+ ]
461
+ },
462
+ "attributes": ["builds"],
463
+ "representations": {
464
+ "standard": ["builds"]
465
+ },
466
+ "sortable_by": [
467
+ "id",
468
+ "started_at",
469
+ "finished_at"
470
+ ]
471
+ },
472
+ "caches": {
473
+ "@type": "resource",
474
+ "actions": {
475
+ "find": [
476
+ {
477
+ "@type": "template",
478
+ "request_method": "GET",
479
+ "uri_template": "/repo/{repository.id}/caches{?branch,caches.branch,caches.match,include,match}"
480
+ },
481
+ {
482
+ "@type": "template",
483
+ "request_method": "GET",
484
+ "uri_template": "/repo/{repository.slug}/caches{?branch,caches.branch,caches.match,include,match}"
485
+ }
486
+ ],
487
+ "delete": [
488
+ {
489
+ "@type": "template",
490
+ "request_method": "DELETE",
491
+ "uri_template": "/repo/{repository.id}/caches"
492
+ },
493
+ {
494
+ "@type": "template",
495
+ "request_method": "DELETE",
496
+ "uri_template": "/repo/{repository.slug}/caches"
497
+ }
498
+ ]
499
+ },
500
+ "attributes": [
501
+ "branch",
502
+ "match"
503
+ ],
504
+ "representations": {
505
+ "standard": [
506
+ "branch",
507
+ "match"
508
+ ]
509
+ }
510
+ },
511
+ "commit": {
512
+ "@type": "resource",
513
+ "actions": {
514
+ },
515
+ "attributes": ["id","sha","ref","message","compare_url","committed_at","committer","author"],
516
+ "representations": {
517
+ "minimal": [
518
+ "id",
519
+ "sha",
520
+ "ref",
521
+ "message",
522
+ "compare_url",
523
+ "committed_at"
524
+ ],
525
+ "standard": [
526
+ "id",
527
+ "sha",
528
+ "ref",
529
+ "message",
530
+ "compare_url",
531
+ "committed_at",
532
+ "committer",
533
+ "author"
534
+ ]
535
+ }
536
+ },
537
+ "cron": {
538
+ "@type": "resource",
539
+ "actions": {
540
+ "find": [
541
+ {
542
+ "@type": "template",
543
+ "request_method": "GET",
544
+ "uri_template": "/cron/{cron.id}{?include}"
545
+ }
546
+ ],
547
+ "delete": [
548
+ {
549
+ "@type": "template",
550
+ "request_method": "DELETE",
551
+ "uri_template": "/cron/{cron.id}"
552
+ }
553
+ ],
554
+ "for_branch": [
555
+ {
556
+ "@type": "template",
557
+ "request_method": "GET",
558
+ "uri_template": "/repo/{repository.id}/branch/{branch.name}/cron{?include}"
559
+ },
560
+ {
561
+ "@type": "template",
562
+ "request_method": "GET",
563
+ "uri_template": "/repo/{repository.slug}/branch/{branch.name}/cron{?include}"
564
+ }
565
+ ],
566
+ "create": [
567
+ {
568
+ "@type": "template",
569
+ "request_method": "POST",
570
+ "uri_template": "/repo/{repository.id}/branch/{branch.name}/cron",
571
+ "accepted_params": [
572
+ "cron.interval",
573
+ "cron.dont_run_if_recent_build_exists",
574
+ "cron.interval",
575
+ "cron.dont_run_if_recent_build_exists"
576
+ ]
577
+ },
578
+ {
579
+ "@type": "template",
580
+ "request_method": "POST",
581
+ "uri_template": "/repo/{repository.slug}/branch/{branch.name}/cron",
582
+ "accepted_params": [
583
+ "cron.interval",
584
+ "cron.dont_run_if_recent_build_exists",
585
+ "cron.interval",
586
+ "cron.dont_run_if_recent_build_exists"
587
+ ]
588
+ }
589
+ ]
590
+ },
591
+ "attributes": ["id","repository","branch","interval","dont_run_if_recent_build_exists","last_run","next_run","created_at"],
592
+ "representations": {
593
+ "minimal": [
594
+ "id"
595
+ ],
596
+ "standard": [
597
+ "id",
598
+ "repository",
599
+ "branch",
600
+ "interval",
601
+ "dont_run_if_recent_build_exists",
602
+ "last_run",
603
+ "next_run",
604
+ "created_at"
605
+ ]
606
+ },
607
+ "permissions": [
608
+ "read",
609
+ "delete",
610
+ "start"
611
+ ]
612
+ },
613
+ "crons": {
614
+ "@type": "resource",
615
+ "actions": {
616
+ "for_repository": [
617
+ {
618
+ "@type": "template",
619
+ "request_method": "GET",
620
+ "uri_template": "/repo/{repository.id}/crons{?include,limit,offset}"
621
+ },
622
+ {
623
+ "@type": "template",
624
+ "request_method": "GET",
625
+ "uri_template": "/repo/{repository.slug}/crons{?include,limit,offset}"
626
+ }
627
+ ]
628
+ },
629
+ "attributes": ["crons"],
630
+ "representations": {
631
+ "standard": ["crons"]
632
+ }
633
+ },
634
+ "env_var": {
635
+ "@type": "resource",
636
+ "actions": {
637
+ "find": [
638
+ {
639
+ "@type": "template",
640
+ "request_method": "GET",
641
+ "uri_template": "/repo/{repository.id}/env_var/{env_var.id}{?env_var.id,id,id,include,repository.id}"
642
+ },
643
+ {
644
+ "@type": "template",
645
+ "request_method": "GET",
646
+ "uri_template": "/repo/{repository.slug}/env_var/{env_var.id}{?env_var.id,id,id,include,repository.id}"
647
+ }
648
+ ],
649
+ "update": [
650
+ {
651
+ "@type": "template",
652
+ "request_method": "PATCH",
653
+ "uri_template": "/repo/{repository.id}/env_var/{env_var.id}",
654
+ "accepted_params": [
655
+ "env_var.name",
656
+ "env_var.value",
657
+ "env_var.public"
658
+ ]
659
+ },
660
+ {
661
+ "@type": "template",
662
+ "request_method": "PATCH",
663
+ "uri_template": "/repo/{repository.slug}/env_var/{env_var.id}",
664
+ "accepted_params": [
665
+ "env_var.name",
666
+ "env_var.value",
667
+ "env_var.public"
668
+ ]
669
+ }
670
+ ],
671
+ "delete": [
672
+ {
673
+ "@type": "template",
674
+ "request_method": "DELETE",
675
+ "uri_template": "/repo/{repository.id}/env_var/{env_var.id}"
676
+ },
677
+ {
678
+ "@type": "template",
679
+ "request_method": "DELETE",
680
+ "uri_template": "/repo/{repository.slug}/env_var/{env_var.id}"
681
+ }
682
+ ]
683
+ },
684
+ "attributes": ["id","name","value","public"],
685
+ "representations": {
686
+ "standard": [
687
+ "id",
688
+ "name",
689
+ "value",
690
+ "public"
691
+ ],
692
+ "minimal": [
693
+ "id",
694
+ "name",
695
+ "public"
696
+ ]
697
+ },
698
+ "permissions": [
699
+ "read",
700
+ "write"
701
+ ]
702
+ },
703
+ "env_vars": {
704
+ "@type": "resource",
705
+ "actions": {
706
+ "for_repository": [
707
+ {
708
+ "@type": "template",
709
+ "request_method": "GET",
710
+ "uri_template": "/repo/{repository.id}/env_vars{?include}"
711
+ },
712
+ {
713
+ "@type": "template",
714
+ "request_method": "GET",
715
+ "uri_template": "/repo/{repository.slug}/env_vars{?include}"
716
+ }
717
+ ],
718
+ "create": [
719
+ {
720
+ "@type": "template",
721
+ "request_method": "POST",
722
+ "uri_template": "/repo/{repository.id}/env_vars",
723
+ "accepted_params": [
724
+ "env_var.name",
725
+ "env_var.value",
726
+ "env_var.public"
727
+ ]
728
+ },
729
+ {
730
+ "@type": "template",
731
+ "request_method": "POST",
732
+ "uri_template": "/repo/{repository.slug}/env_vars",
733
+ "accepted_params": [
734
+ "env_var.name",
735
+ "env_var.value",
736
+ "env_var.public"
737
+ ]
738
+ }
739
+ ]
740
+ },
741
+ "attributes": ["env_vars"],
742
+ "representations": {
743
+ "standard": ["env_vars"]
744
+ }
745
+ },
746
+ "error": {
747
+ "@type": "resource",
748
+ "actions": {
749
+ },
750
+ "attributes": [
751
+ "error_type",
752
+ "error_message",
753
+ "resource_type",
754
+ "permission"
755
+ ]
756
+ },
757
+ "home": {
758
+ "@type": "resource",
759
+ "actions": {
760
+ "find": [
761
+ {
762
+ "@type": "template",
763
+ "request_method": "GET",
764
+ "uri_template": "/"
765
+ }
766
+ ]
767
+ },
768
+ "attributes": [
769
+ "config",
770
+ "errors",
771
+ "resources"
772
+ ]
773
+ },
774
+ "job": {
775
+ "@type": "resource",
776
+ "actions": {
777
+ "find": [
778
+ {
779
+ "@type": "template",
780
+ "request_method": "GET",
781
+ "uri_template": "/job/{job.id}{?include}"
782
+ }
783
+ ],
784
+ "cancel": [
785
+ {
786
+ "@type": "template",
787
+ "request_method": "POST",
788
+ "uri_template": "/job/{job.id}/cancel",
789
+ "accepted_params": [
790
+
791
+ ]
792
+ }
793
+ ],
794
+ "restart": [
795
+ {
796
+ "@type": "template",
797
+ "request_method": "POST",
798
+ "uri_template": "/job/{job.id}/restart",
799
+ "accepted_params": [
800
+
801
+ ]
802
+ }
803
+ ],
804
+ "debug": [
805
+ {
806
+ "@type": "template",
807
+ "request_method": "POST",
808
+ "uri_template": "/job/{job.id}/debug",
809
+ "accepted_params": [
810
+
811
+ ]
812
+ }
813
+ ]
814
+ },
815
+ "attributes": ["id","number","state","started_at","finished_at","build","queue","repository","commit","owner"],
816
+ "representations": {
817
+ "minimal": [
818
+ "id"
819
+ ],
820
+ "standard": [
821
+ "id",
822
+ "number",
823
+ "state",
824
+ "started_at",
825
+ "finished_at",
826
+ "build",
827
+ "queue",
828
+ "repository",
829
+ "commit",
830
+ "owner"
831
+ ],
832
+ "active": [
833
+ "id",
834
+ "number",
835
+ "state",
836
+ "started_at",
837
+ "finished_at",
838
+ "build",
839
+ "queue",
840
+ "repository",
841
+ "commit",
842
+ "owner"
843
+ ]
844
+ },
845
+ "permissions": [
846
+ "read",
847
+ "debug",
848
+ "cancel",
849
+ "restart",
850
+ "delete_log"
851
+ ]
852
+ },
853
+ "jobs": {
854
+ "@type": "resource",
855
+ "actions": {
856
+ "find": [
857
+ {
858
+ "@type": "template",
859
+ "request_method": "GET",
860
+ "uri_template": "/build/{build.id}/jobs{?include}"
861
+ }
862
+ ]
863
+ },
864
+ "attributes": ["jobs"],
865
+ "representations": {
866
+ "standard": ["jobs"]
867
+ }
868
+ },
869
+ "key_pair": {
870
+ "@type": "resource",
871
+ "actions": {
872
+ "find": [
873
+ {
874
+ "@type": "template",
875
+ "request_method": "GET",
876
+ "uri_template": "/repo/{repository.id}/key_pair{?include}"
877
+ },
878
+ {
879
+ "@type": "template",
880
+ "request_method": "GET",
881
+ "uri_template": "/repo/{repository.slug}/key_pair{?include}"
882
+ }
883
+ ],
884
+ "create": [
885
+ {
886
+ "@type": "template",
887
+ "request_method": "POST",
888
+ "uri_template": "/repo/{repository.id}/key_pair",
889
+ "accepted_params": [
890
+ "key_pair.description",
891
+ "key_pair.value"
892
+ ]
893
+ },
894
+ {
895
+ "@type": "template",
896
+ "request_method": "POST",
897
+ "uri_template": "/repo/{repository.slug}/key_pair",
898
+ "accepted_params": [
899
+ "key_pair.description",
900
+ "key_pair.value"
901
+ ]
902
+ }
903
+ ],
904
+ "update": [
905
+ {
906
+ "@type": "template",
907
+ "request_method": "PATCH",
908
+ "uri_template": "/repo/{repository.id}/key_pair",
909
+ "accepted_params": [
910
+ "key_pair.description",
911
+ "key_pair.value"
912
+ ]
913
+ },
914
+ {
915
+ "@type": "template",
916
+ "request_method": "PATCH",
917
+ "uri_template": "/repo/{repository.slug}/key_pair",
918
+ "accepted_params": [
919
+ "key_pair.description",
920
+ "key_pair.value"
921
+ ]
922
+ }
923
+ ],
924
+ "delete": [
925
+ {
926
+ "@type": "template",
927
+ "request_method": "DELETE",
928
+ "uri_template": "/repo/{repository.id}/key_pair"
929
+ },
930
+ {
931
+ "@type": "template",
932
+ "request_method": "DELETE",
933
+ "uri_template": "/repo/{repository.slug}/key_pair"
934
+ }
935
+ ]
936
+ },
937
+ "attributes": [
938
+ "description",
939
+ "public_key",
940
+ "fingerprint",
941
+ "value"
942
+ ],
943
+ "representations": {
944
+ "standard": [
945
+ "description",
946
+ "public_key",
947
+ "fingerprint"
948
+ ],
949
+ "minimal": [
950
+ "description",
951
+ "public_key",
952
+ "fingerprint"
953
+ ]
954
+ },
955
+ "permissions": [
956
+ "read",
957
+ "write"
958
+ ]
959
+ },
960
+ "key_pair_generated": {
961
+ "@type": "resource",
962
+ "actions": {
963
+ "find": [
964
+ {
965
+ "@type": "template",
966
+ "request_method": "GET",
967
+ "uri_template": "/repo/{repository.id}/key_pair/generated{?include}"
968
+ },
969
+ {
970
+ "@type": "template",
971
+ "request_method": "GET",
972
+ "uri_template": "/repo/{repository.slug}/key_pair/generated{?include}"
973
+ }
974
+ ],
975
+ "create": [
976
+ {
977
+ "@type": "template",
978
+ "request_method": "POST",
979
+ "uri_template": "/repo/{repository.id}/key_pair/generated",
980
+ "accepted_params": [
981
+
982
+ ]
983
+ },
984
+ {
985
+ "@type": "template",
986
+ "request_method": "POST",
987
+ "uri_template": "/repo/{repository.slug}/key_pair/generated",
988
+ "accepted_params": [
989
+
990
+ ]
991
+ }
992
+ ]
993
+ },
994
+ "attributes": ["description","public_key","fingerprint"],
995
+ "representations": {
996
+ "standard": [
997
+ "description",
998
+ "public_key",
999
+ "fingerprint"
1000
+ ],
1001
+ "minimal": [
1002
+ "description",
1003
+ "public_key",
1004
+ "fingerprint"
1005
+ ]
1006
+ }
1007
+ },
1008
+ "lint": {
1009
+ "@type": "resource",
1010
+ "actions": {
1011
+ "lint": [
1012
+ {
1013
+ "@type": "template",
1014
+ "request_method": "POST",
1015
+ "uri_template": "/lint",
1016
+ "accepted_params": [
1017
+
1018
+ ]
1019
+ }
1020
+ ]
1021
+ },
1022
+ "attributes": [
1023
+ "warnings"
1024
+ ]
1025
+ },
1026
+ "log": {
1027
+ "@type": "resource",
1028
+ "actions": {
1029
+ "find": [
1030
+ {
1031
+ "@type": "template",
1032
+ "request_method": "GET",
1033
+ "uri_template": "/job/{job.id}/log{?include}"
1034
+ }
1035
+ ],
1036
+ "delete": [
1037
+ {
1038
+ "@type": "template",
1039
+ "request_method": "DELETE",
1040
+ "uri_template": "/job/{job.id}/log"
1041
+ }
1042
+ ]
1043
+ }
1044
+ },
1045
+ "organization": {
1046
+ "@type": "resource",
1047
+ "actions": {
1048
+ "find": [
1049
+ {
1050
+ "@type": "template",
1051
+ "request_method": "GET",
1052
+ "uri_template": "/org/{organization.id}{?include}"
1053
+ }
1054
+ ]
1055
+ },
1056
+ "attributes": ["id","login","name","github_id","avatar_url","repositories"],
1057
+ "representations": {
1058
+ "minimal": [
1059
+ "id",
1060
+ "login"
1061
+ ],
1062
+ "standard": [
1063
+ "id",
1064
+ "login",
1065
+ "name",
1066
+ "github_id",
1067
+ "avatar_url"
1068
+ ],
1069
+ "additional": [
1070
+ "repositories"
1071
+ ]
1072
+ },
1073
+ "permissions": [
1074
+ "read",
1075
+ "sync"
1076
+ ]
1077
+ },
1078
+ "organizations": {
1079
+ "@type": "resource",
1080
+ "actions": {
1081
+ "for_current_user": [
1082
+ {
1083
+ "@type": "template",
1084
+ "request_method": "GET",
1085
+ "uri_template": "/orgs{?include,limit,offset,sort_by}"
1086
+ }
1087
+ ]
1088
+ },
1089
+ "attributes": ["organizations"],
1090
+ "representations": {
1091
+ "standard": ["organizations"]
1092
+ },
1093
+ "sortable_by": [
1094
+ "id",
1095
+ "login",
1096
+ "name",
1097
+ "github_id"
1098
+ ]
1099
+ },
1100
+ "owner": {
1101
+ "@type": "resource",
1102
+ "actions": {
1103
+ "find": [
1104
+ {
1105
+ "@type": "template",
1106
+ "request_method": "GET",
1107
+ "uri_template": "/owner/{owner.login}{?include}"
1108
+ },
1109
+ {
1110
+ "@type": "template",
1111
+ "request_method": "GET",
1112
+ "uri_template": "/owner/{user.login}{?include}"
1113
+ },
1114
+ {
1115
+ "@type": "template",
1116
+ "request_method": "GET",
1117
+ "uri_template": "/owner/{organization.login}{?include}"
1118
+ },
1119
+ {
1120
+ "@type": "template",
1121
+ "request_method": "GET",
1122
+ "uri_template": "/owner/github_id/{owner.github_id}{?include}"
1123
+ }
1124
+ ]
1125
+ },
1126
+ "attributes": ["id","login","name","github_id","avatar_url","repositories"],
1127
+ "representations": {
1128
+ "minimal": [
1129
+ "id",
1130
+ "login"
1131
+ ],
1132
+ "standard": [
1133
+ "id",
1134
+ "login",
1135
+ "name",
1136
+ "github_id",
1137
+ "avatar_url"
1138
+ ],
1139
+ "additional": [
1140
+ "repositories"
1141
+ ]
1142
+ }
1143
+ },
1144
+ "repositories": {
1145
+ "@type": "resource",
1146
+ "actions": {
1147
+ "for_owner": [
1148
+ {
1149
+ "@type": "template",
1150
+ "request_method": "GET",
1151
+ "uri_template": "/owner/{owner.login}/repos{?active,include,limit,offset,private,repository.active,repository.private,repository.starred,sort_by,starred}"
1152
+ },
1153
+ {
1154
+ "@type": "template",
1155
+ "request_method": "GET",
1156
+ "uri_template": "/owner/{user.login}/repos{?active,include,limit,offset,private,repository.active,repository.private,repository.starred,sort_by,starred}"
1157
+ },
1158
+ {
1159
+ "@type": "template",
1160
+ "request_method": "GET",
1161
+ "uri_template": "/owner/{organization.login}/repos{?active,include,limit,offset,private,repository.active,repository.private,repository.starred,sort_by,starred}"
1162
+ },
1163
+ {
1164
+ "@type": "template",
1165
+ "request_method": "GET",
1166
+ "uri_template": "/owner/github_id/{owner.github_id}/repos{?active,include,limit,offset,private,repository.active,repository.private,repository.starred,sort_by,starred}"
1167
+ }
1168
+ ],
1169
+ "for_current_user": [
1170
+ {
1171
+ "@type": "template",
1172
+ "request_method": "GET",
1173
+ "uri_template": "/repos{?active,include,limit,offset,private,repository.active,repository.private,repository.starred,sort_by,starred}"
1174
+ }
1175
+ ]
1176
+ },
1177
+ "attributes": ["repositories"],
1178
+ "representations": {
1179
+ "standard": ["repositories"]
1180
+ },
1181
+ "sortable_by": [
1182
+ "id",
1183
+ "github_id",
1184
+ "owner_name",
1185
+ "name",
1186
+ "active",
1187
+ "default_branch.last_build"
1188
+ ]
1189
+ },
1190
+ "repository": {
1191
+ "@type": "resource",
1192
+ "actions": {
1193
+ "find": [
1194
+ {
1195
+ "@type": "template",
1196
+ "request_method": "GET",
1197
+ "uri_template": "/repo/{repository.id}{?include}"
1198
+ },
1199
+ {
1200
+ "@type": "template",
1201
+ "request_method": "GET",
1202
+ "uri_template": "/repo/{repository.slug}{?include}"
1203
+ }
1204
+ ],
1205
+ "activate": [
1206
+ {
1207
+ "@type": "template",
1208
+ "request_method": "POST",
1209
+ "uri_template": "/repo/{repository.id}/activate",
1210
+ "accepted_params": [
1211
+
1212
+ ]
1213
+ },
1214
+ {
1215
+ "@type": "template",
1216
+ "request_method": "POST",
1217
+ "uri_template": "/repo/{repository.slug}/activate",
1218
+ "accepted_params": [
1219
+
1220
+ ]
1221
+ }
1222
+ ],
1223
+ "deactivate": [
1224
+ {
1225
+ "@type": "template",
1226
+ "request_method": "POST",
1227
+ "uri_template": "/repo/{repository.id}/deactivate",
1228
+ "accepted_params": [
1229
+
1230
+ ]
1231
+ },
1232
+ {
1233
+ "@type": "template",
1234
+ "request_method": "POST",
1235
+ "uri_template": "/repo/{repository.slug}/deactivate",
1236
+ "accepted_params": [
1237
+
1238
+ ]
1239
+ }
1240
+ ],
1241
+ "star": [
1242
+ {
1243
+ "@type": "template",
1244
+ "request_method": "POST",
1245
+ "uri_template": "/repo/{repository.id}/star",
1246
+ "accepted_params": [
1247
+
1248
+ ]
1249
+ },
1250
+ {
1251
+ "@type": "template",
1252
+ "request_method": "POST",
1253
+ "uri_template": "/repo/{repository.slug}/star",
1254
+ "accepted_params": [
1255
+
1256
+ ]
1257
+ }
1258
+ ],
1259
+ "unstar": [
1260
+ {
1261
+ "@type": "template",
1262
+ "request_method": "POST",
1263
+ "uri_template": "/repo/{repository.id}/unstar",
1264
+ "accepted_params": [
1265
+
1266
+ ]
1267
+ },
1268
+ {
1269
+ "@type": "template",
1270
+ "request_method": "POST",
1271
+ "uri_template": "/repo/{repository.slug}/unstar",
1272
+ "accepted_params": [
1273
+
1274
+ ]
1275
+ }
1276
+ ]
1277
+ },
1278
+ "attributes": ["id","name","slug","description","github_language","active","private","owner","default_branch","starred","current_build"],
1279
+ "representations": {
1280
+ "minimal": [
1281
+ "id",
1282
+ "name",
1283
+ "slug"
1284
+ ],
1285
+ "standard": [
1286
+ "id",
1287
+ "name",
1288
+ "slug",
1289
+ "description",
1290
+ "github_language",
1291
+ "active",
1292
+ "private",
1293
+ "owner",
1294
+ "default_branch",
1295
+ "starred"
1296
+ ]
1297
+ },
1298
+ "permissions": [
1299
+ "read",
1300
+ "admin",
1301
+ "activate",
1302
+ "deactivate",
1303
+ "star",
1304
+ "unstar",
1305
+ "create_cron",
1306
+ "create_env_var",
1307
+ "create_key_pair",
1308
+ "create_request"
1309
+ ]
1310
+ },
1311
+ "request": {
1312
+ "@type": "resource",
1313
+ "actions": {
1314
+ },
1315
+ "attributes": ["id","repository","branch_name","commit","owner","created_at","result","message","event_type"],
1316
+ "representations": {
1317
+ "minimal": [
1318
+ "id"
1319
+ ],
1320
+ "standard": [
1321
+ "id",
1322
+ "repository",
1323
+ "branch_name",
1324
+ "commit",
1325
+ "owner",
1326
+ "created_at",
1327
+ "result",
1328
+ "message",
1329
+ "event_type"
1330
+ ]
1331
+ }
1332
+ },
1333
+ "requests": {
1334
+ "@type": "resource",
1335
+ "actions": {
1336
+ "find": [
1337
+ {
1338
+ "@type": "template",
1339
+ "request_method": "GET",
1340
+ "uri_template": "/repo/{repository.id}/requests{?include,limit,offset}"
1341
+ },
1342
+ {
1343
+ "@type": "template",
1344
+ "request_method": "GET",
1345
+ "uri_template": "/repo/{repository.slug}/requests{?include,limit,offset}"
1346
+ }
1347
+ ],
1348
+ "create": [
1349
+ {
1350
+ "@type": "template",
1351
+ "request_method": "POST",
1352
+ "uri_template": "/repo/{repository.id}/requests",
1353
+ "accepted_params": [
1354
+ "request.config",
1355
+ "request.message",
1356
+ "request.branch",
1357
+ "request.token"
1358
+ ]
1359
+ },
1360
+ {
1361
+ "@type": "template",
1362
+ "request_method": "POST",
1363
+ "uri_template": "/repo/{repository.slug}/requests",
1364
+ "accepted_params": [
1365
+ "request.config",
1366
+ "request.message",
1367
+ "request.branch",
1368
+ "request.token"
1369
+ ]
1370
+ }
1371
+ ]
1372
+ },
1373
+ "attributes": ["requests"],
1374
+ "representations": {
1375
+ "standard": ["requests"]
1376
+ }
1377
+ },
1378
+ "resource": {
1379
+ "@type": "resource",
1380
+ "actions": {
1381
+ },
1382
+ "attributes": [
1383
+ "actions",
1384
+ "attributes",
1385
+ "representations",
1386
+ "access_rights"
1387
+ ]
1388
+ },
1389
+ "setting": {
1390
+ "@type": "resource",
1391
+ "actions": {
1392
+ "find": [
1393
+ {
1394
+ "@type": "template",
1395
+ "request_method": "GET",
1396
+ "uri_template": "/repo/{repository.id}/setting/{setting.name}{?include}"
1397
+ },
1398
+ {
1399
+ "@type": "template",
1400
+ "request_method": "GET",
1401
+ "uri_template": "/repo/{repository.slug}/setting/{setting.name}{?include}"
1402
+ }
1403
+ ],
1404
+ "update": [
1405
+ {
1406
+ "@type": "template",
1407
+ "request_method": "PATCH",
1408
+ "uri_template": "/repo/{repository.id}/setting/{setting.name}",
1409
+ "accepted_params": [
1410
+ "setting.value"
1411
+ ]
1412
+ },
1413
+ {
1414
+ "@type": "template",
1415
+ "request_method": "PATCH",
1416
+ "uri_template": "/repo/{repository.slug}/setting/{setting.name}",
1417
+ "accepted_params": [
1418
+ "setting.value"
1419
+ ]
1420
+ }
1421
+ ]
1422
+ },
1423
+ "attributes": ["name","value"],
1424
+ "representations": {
1425
+ "standard": [
1426
+ "name",
1427
+ "value"
1428
+ ],
1429
+ "minimal": [
1430
+ "name",
1431
+ "value"
1432
+ ]
1433
+ }
1434
+ },
1435
+ "settings": {
1436
+ "@type": "resource",
1437
+ "actions": {
1438
+ "for_repository": [
1439
+ {
1440
+ "@type": "template",
1441
+ "request_method": "GET",
1442
+ "uri_template": "/repo/{repository.id}/settings{?include}"
1443
+ },
1444
+ {
1445
+ "@type": "template",
1446
+ "request_method": "GET",
1447
+ "uri_template": "/repo/{repository.slug}/settings{?include}"
1448
+ }
1449
+ ]
1450
+ },
1451
+ "attributes": ["settings"],
1452
+ "representations": {
1453
+ "standard": ["settings"]
1454
+ }
1455
+ },
1456
+ "template": {
1457
+ "@type": "resource",
1458
+ "actions": {
1459
+ },
1460
+ "attributes": [
1461
+ "request_method",
1462
+ "uri_template"
1463
+ ]
1464
+ },
1465
+ "user": {
1466
+ "@type": "resource",
1467
+ "actions": {
1468
+ "find": [
1469
+ {
1470
+ "@type": "template",
1471
+ "request_method": "GET",
1472
+ "uri_template": "/user/{user.id}{?include}"
1473
+ }
1474
+ ],
1475
+ "sync": [
1476
+ {
1477
+ "@type": "template",
1478
+ "request_method": "POST",
1479
+ "uri_template": "/user/{user.id}/sync",
1480
+ "accepted_params": [
1481
+
1482
+ ]
1483
+ }
1484
+ ],
1485
+ "current": [
1486
+ {
1487
+ "@type": "template",
1488
+ "request_method": "GET",
1489
+ "uri_template": "/user{?include}"
1490
+ }
1491
+ ]
1492
+ },
1493
+ "attributes": ["id","login","name","github_id","avatar_url","repositories","is_syncing","synced_at"],
1494
+ "representations": {
1495
+ "minimal": [
1496
+ "id",
1497
+ "login"
1498
+ ],
1499
+ "standard": [
1500
+ "id",
1501
+ "login",
1502
+ "name",
1503
+ "github_id",
1504
+ "avatar_url",
1505
+ "is_syncing",
1506
+ "synced_at"
1507
+ ],
1508
+ "additional": [
1509
+ "repositories"
1510
+ ]
1511
+ },
1512
+ "permissions": [
1513
+ "read",
1514
+ "sync"
1515
+ ]
1516
+ }
1517
+ }
1518
+ }