gitabu 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +33 -0
  4. data/CHANGELOG.md +3 -0
  5. data/Gemfile +10 -0
  6. data/Gemfile.lock +65 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +42 -0
  9. data/Rakefile +12 -0
  10. data/gitabu.gemspec +41 -0
  11. data/lib/gitabu/api/v3/actions.rb +3724 -0
  12. data/lib/gitabu/api/v3/activity.rb +835 -0
  13. data/lib/gitabu/api/v3/apps.rb +961 -0
  14. data/lib/gitabu/api/v3/billing.rb +217 -0
  15. data/lib/gitabu/api/v3/branches.rb +1098 -0
  16. data/lib/gitabu/api/v3/checks.rb +384 -0
  17. data/lib/gitabu/api/v3/code_scanning.rb +315 -0
  18. data/lib/gitabu/api/v3/codes_of_conduct.rb +92 -0
  19. data/lib/gitabu/api/v3/codespaces.rb +650 -0
  20. data/lib/gitabu/api/v3/collaborators.rb +341 -0
  21. data/lib/gitabu/api/v3/commits.rb +428 -0
  22. data/lib/gitabu/api/v3/dependabot.rb +419 -0
  23. data/lib/gitabu/api/v3/deploy_keys.rb +152 -0
  24. data/lib/gitabu/api/v3/deployments.rb +356 -0
  25. data/lib/gitabu/api/v3/emojis.rb +67 -0
  26. data/lib/gitabu/api/v3/enterprise_admin.rb +495 -0
  27. data/lib/gitabu/api/v3/gists.rb +552 -0
  28. data/lib/gitabu/api/v3/git.rb +409 -0
  29. data/lib/gitabu/api/v3/gitignore.rb +92 -0
  30. data/lib/gitabu/api/v3/interactions.rb +275 -0
  31. data/lib/gitabu/api/v3/issues.rb +1119 -0
  32. data/lib/gitabu/api/v3/licenses.rb +118 -0
  33. data/lib/gitabu/api/v3/markdown.rb +94 -0
  34. data/lib/gitabu/api/v3/meta.rb +142 -0
  35. data/lib/gitabu/api/v3/metrics.rb +302 -0
  36. data/lib/gitabu/api/v3/migrations.rb +631 -0
  37. data/lib/gitabu/api/v3/orgs.rb +1291 -0
  38. data/lib/gitabu/api/v3/packages.rb +686 -0
  39. data/lib/gitabu/api/v3/pages.rb +282 -0
  40. data/lib/gitabu/api/v3/projects.rb +693 -0
  41. data/lib/gitabu/api/v3/pulls.rb +816 -0
  42. data/lib/gitabu/api/v3/rate_limit.rb +67 -0
  43. data/lib/gitabu/api/v3/reactions.rb +734 -0
  44. data/lib/gitabu/api/v3/releases.rb +411 -0
  45. data/lib/gitabu/api/v3/repos.rb +1136 -0
  46. data/lib/gitabu/api/v3/scim.rb +214 -0
  47. data/lib/gitabu/api/v3/search.rb +217 -0
  48. data/lib/gitabu/api/v3/secret_scanning.rb +201 -0
  49. data/lib/gitabu/api/v3/teams.rb +1963 -0
  50. data/lib/gitabu/api/v3/users.rb +851 -0
  51. data/lib/gitabu/api/v3/webhooks.rb +379 -0
  52. data/lib/gitabu/builder.rb +37 -0
  53. data/lib/gitabu/client.rb +8 -0
  54. data/lib/gitabu/generator.rb +75 -0
  55. data/lib/gitabu/http_client.rb +96 -0
  56. data/lib/gitabu/items.rb +110 -0
  57. data/lib/gitabu/public/api/v3/actions.json +5779 -0
  58. data/lib/gitabu/public/api/v3/activity.json +1248 -0
  59. data/lib/gitabu/public/api/v3/apps.json +1174 -0
  60. data/lib/gitabu/public/api/v3/billing.json +183 -0
  61. data/lib/gitabu/public/api/v3/branches.json +1886 -0
  62. data/lib/gitabu/public/api/v3/checks.json +856 -0
  63. data/lib/gitabu/public/api/v3/code_scanning.json +666 -0
  64. data/lib/gitabu/public/api/v3/codes_of_conduct.json +41 -0
  65. data/lib/gitabu/public/api/v3/codespaces.json +884 -0
  66. data/lib/gitabu/public/api/v3/collaborators.json +464 -0
  67. data/lib/gitabu/public/api/v3/commits.json +830 -0
  68. data/lib/gitabu/public/api/v3/dependabot.json +596 -0
  69. data/lib/gitabu/public/api/v3/deploy_keys.json +195 -0
  70. data/lib/gitabu/public/api/v3/deployments.json +698 -0
  71. data/lib/gitabu/public/api/v3/emojis.json +18 -0
  72. data/lib/gitabu/public/api/v3/enterprise_admin.json +881 -0
  73. data/lib/gitabu/public/api/v3/gists.json +689 -0
  74. data/lib/gitabu/public/api/v3/git.json +735 -0
  75. data/lib/gitabu/public/api/v3/gitignore.json +41 -0
  76. data/lib/gitabu/public/api/v3/interactions.json +265 -0
  77. data/lib/gitabu/public/api/v3/issues.json +2359 -0
  78. data/lib/gitabu/public/api/v3/licenses.json +100 -0
  79. data/lib/gitabu/public/api/v3/markdown.json +59 -0
  80. data/lib/gitabu/public/api/v3/meta.json +69 -0
  81. data/lib/gitabu/public/api/v3/metrics.json +342 -0
  82. data/lib/gitabu/public/api/v3/migrations.json +960 -0
  83. data/lib/gitabu/public/api/v3/orgs.json +1989 -0
  84. data/lib/gitabu/public/api/v3/packages.json +1078 -0
  85. data/lib/gitabu/public/api/v3/pages.json +373 -0
  86. data/lib/gitabu/public/api/v3/projects.json +966 -0
  87. data/lib/gitabu/public/api/v3/pulls.json +1768 -0
  88. data/lib/gitabu/public/api/v3/rate_limit.json +18 -0
  89. data/lib/gitabu/public/api/v3/reactions.json +1425 -0
  90. data/lib/gitabu/public/api/v3/releases.json +753 -0
  91. data/lib/gitabu/public/api/v3/repos.json +2314 -0
  92. data/lib/gitabu/public/api/v3/scim.json +412 -0
  93. data/lib/gitabu/public/api/v3/search.json +408 -0
  94. data/lib/gitabu/public/api/v3/secret_scanning.json +385 -0
  95. data/lib/gitabu/public/api/v3/teams.json +3126 -0
  96. data/lib/gitabu/public/api/v3/users.json +956 -0
  97. data/lib/gitabu/public/api/v3/webhooks.json +667 -0
  98. data/lib/gitabu/run.rb +237 -0
  99. data/lib/gitabu/scraper.rb +86 -0
  100. data/lib/gitabu/templates/template.rb.erb +70 -0
  101. data/lib/gitabu/version.rb +6 -0
  102. data/lib/gitabu.rb +57 -0
  103. data/sig/gitabu.rbs +4 -0
  104. metadata +177 -0
@@ -0,0 +1,3724 @@
1
+ # frozen_string_literal: true
2
+
3
+ # INFO ON GENERATED CODE
4
+ #
5
+ # This file is generated.
6
+ # See the contribution guide on how to improve the code.
7
+ #
8
+ # INFO ON GENERATED CODE
9
+
10
+ # Ruby gem that helps you work with Github API.
11
+ module Gitabu
12
+ # API module
13
+ module Api
14
+ # Github Version 3
15
+ module V3
16
+ # Class to display Actions result
17
+ class ActionsResult
18
+ attr_accessor :result, :message
19
+
20
+ def initialize(result:, message:)
21
+ @result = result
22
+ @message = message
23
+ end
24
+ end
25
+
26
+ # Class to display error result
27
+ class ActionsErrorResult
28
+ attr_accessor :result, :message
29
+
30
+ def initialize(result:, message:)
31
+ @result = result
32
+ @message = message
33
+ end
34
+ end
35
+
36
+ # Actions endpoints.
37
+ class Actions
38
+ def self.list_artifacts_for_a_repository(owner: nil, repo: nil, options: nil)
39
+ new.list_artifacts_for_a_repository(owner, repo, options)
40
+ end
41
+
42
+ def self.get_an_artifact(owner: nil, repo: nil, artifact_id: nil, options: nil)
43
+ new.get_an_artifact(owner, repo, artifact_id, options)
44
+ end
45
+
46
+ def self.delete_an_artifact(owner: nil, repo: nil, artifact_id: nil, options: nil)
47
+ new.delete_an_artifact(owner, repo, artifact_id, options)
48
+ end
49
+
50
+ def self.download_an_artifact(owner: nil, repo: nil, artifact_id: nil, archive_format: nil, options: nil)
51
+ new.download_an_artifact(owner, repo, artifact_id, archive_format, options)
52
+ end
53
+
54
+ def self.list_workflow_run_artifacts(owner: nil, repo: nil, run_id: nil, options: nil)
55
+ new.list_workflow_run_artifacts(owner, repo, run_id, options)
56
+ end
57
+
58
+ def self.get_github_actions_cache_usage_for_an_enterprise(enterprise: nil, options: nil)
59
+ new.get_github_actions_cache_usage_for_an_enterprise(enterprise, options)
60
+ end
61
+
62
+ def self.get_github_actions_cache_usage_for_an_organization(org: nil, options: nil)
63
+ new.get_github_actions_cache_usage_for_an_organization(org, options)
64
+ end
65
+
66
+ def self.list_repositories_with_github_actions_cache_usage_for_an_organization(org: nil, options: nil)
67
+ new.list_repositories_with_github_actions_cache_usage_for_an_organization(org, options)
68
+ end
69
+
70
+ def self.get_github_actions_cache_usage_for_a_repository(owner: nil, repo: nil, options: nil)
71
+ new.get_github_actions_cache_usage_for_a_repository(owner, repo, options)
72
+ end
73
+
74
+ def self.get_github_actions_permissions_for_an_enterprise(enterprise: nil, options: nil)
75
+ new.get_github_actions_permissions_for_an_enterprise(enterprise, options)
76
+ end
77
+
78
+ def self.set_github_actions_permissions_for_an_enterprise(enterprise: nil, enabled_organizations: nil, allowed_actions: nil, options: nil)
79
+ new.set_github_actions_permissions_for_an_enterprise(enterprise, enabled_organizations, allowed_actions, options)
80
+ end
81
+
82
+ def self.list_selected_organizations_enabled_for_github_actions_in_an_enterprise(enterprise: nil, options: nil)
83
+ new.list_selected_organizations_enabled_for_github_actions_in_an_enterprise(enterprise, options)
84
+ end
85
+
86
+ def self.set_selected_organizations_enabled_for_github_actions_in_an_enterprise(enterprise: nil, selected_organization_ids: nil, options: nil)
87
+ new.set_selected_organizations_enabled_for_github_actions_in_an_enterprise(enterprise, selected_organization_ids, options)
88
+ end
89
+
90
+ def self.enable_a_selected_organization_for_github_actions_in_an_enterprise(enterprise: nil, org_id: nil, options: nil)
91
+ new.enable_a_selected_organization_for_github_actions_in_an_enterprise(enterprise, org_id, options)
92
+ end
93
+
94
+ def self.disable_a_selected_organization_for_github_actions_in_an_enterprise(enterprise: nil, org_id: nil, options: nil)
95
+ new.disable_a_selected_organization_for_github_actions_in_an_enterprise(enterprise, org_id, options)
96
+ end
97
+
98
+ def self.get_allowed_actions_and_reusable_workflows_for_an_enterprise(enterprise: nil, options: nil)
99
+ new.get_allowed_actions_and_reusable_workflows_for_an_enterprise(enterprise, options)
100
+ end
101
+
102
+ def self.set_allowed_actions_and_reusable_workflows_for_an_enterprise(enterprise: nil, github_owned_allowed: nil, verified_allowed: nil, patterns_allowed: nil, options: nil)
103
+ new.set_allowed_actions_and_reusable_workflows_for_an_enterprise(enterprise, github_owned_allowed, verified_allowed, patterns_allowed, options)
104
+ end
105
+
106
+ def self.get_github_actions_permissions_for_an_organization(org: nil, options: nil)
107
+ new.get_github_actions_permissions_for_an_organization(org, options)
108
+ end
109
+
110
+ def self.set_github_actions_permissions_for_an_organization(org: nil, enabled_repositories: nil, allowed_actions: nil, options: nil)
111
+ new.set_github_actions_permissions_for_an_organization(org, enabled_repositories, allowed_actions, options)
112
+ end
113
+
114
+ def self.list_selected_repositories_enabled_for_github_actions_in_an_organization(org: nil, options: nil)
115
+ new.list_selected_repositories_enabled_for_github_actions_in_an_organization(org, options)
116
+ end
117
+
118
+ def self.set_selected_repositories_enabled_for_github_actions_in_an_organization(org: nil, selected_repository_ids: nil, options: nil)
119
+ new.set_selected_repositories_enabled_for_github_actions_in_an_organization(org, selected_repository_ids, options)
120
+ end
121
+
122
+ def self.enable_a_selected_repository_for_github_actions_in_an_organization(org: nil, repository_id: nil, options: nil)
123
+ new.enable_a_selected_repository_for_github_actions_in_an_organization(org, repository_id, options)
124
+ end
125
+
126
+ def self.disable_a_selected_repository_for_github_actions_in_an_organization(org: nil, repository_id: nil, options: nil)
127
+ new.disable_a_selected_repository_for_github_actions_in_an_organization(org, repository_id, options)
128
+ end
129
+
130
+ def self.get_allowed_actions_and_reusable_workflows_for_an_organization(org: nil, options: nil)
131
+ new.get_allowed_actions_and_reusable_workflows_for_an_organization(org, options)
132
+ end
133
+
134
+ def self.set_allowed_actions_and_reusable_workflows_for_an_organization(org: nil, github_owned_allowed: nil, verified_allowed: nil, patterns_allowed: nil, options: nil)
135
+ new.set_allowed_actions_and_reusable_workflows_for_an_organization(org, github_owned_allowed, verified_allowed, patterns_allowed, options)
136
+ end
137
+
138
+ def self.get_default_workflow_permissions(org: nil, options: nil)
139
+ new.get_default_workflow_permissions(org, options)
140
+ end
141
+
142
+ def self.set_default_workflow_permissions(org: nil, default_workflow_permissions: nil, can_approve_pull_request_reviews: nil, options: nil)
143
+ new.set_default_workflow_permissions(org, default_workflow_permissions, can_approve_pull_request_reviews, options)
144
+ end
145
+
146
+ def self.get_github_actions_permissions_for_a_repository(owner: nil, repo: nil, options: nil)
147
+ new.get_github_actions_permissions_for_a_repository(owner, repo, options)
148
+ end
149
+
150
+ def self.set_github_actions_permissions_for_a_repository(owner: nil, repo: nil, enabled: nil, allowed_actions: nil, options: nil)
151
+ new.set_github_actions_permissions_for_a_repository(owner, repo, enabled, allowed_actions, options)
152
+ end
153
+
154
+ def self.get_the_level_of_access_for_workflows_outside_of_the_repository(owner: nil, repo: nil, options: nil)
155
+ new.get_the_level_of_access_for_workflows_outside_of_the_repository(owner, repo, options)
156
+ end
157
+
158
+ def self.set_the_level_of_access_for_workflows_outside_of_the_repository(owner: nil, repo: nil, access_level: nil, options: nil)
159
+ new.set_the_level_of_access_for_workflows_outside_of_the_repository(owner, repo, access_level, options)
160
+ end
161
+
162
+ def self.get_allowed_actions_and_reusable_workflows_for_a_repository(owner: nil, repo: nil, options: nil)
163
+ new.get_allowed_actions_and_reusable_workflows_for_a_repository(owner, repo, options)
164
+ end
165
+
166
+ def self.set_allowed_actions_and_reusable_workflows_for_a_repository(owner: nil, repo: nil, github_owned_allowed: nil, verified_allowed: nil, patterns_allowed: nil, options: nil)
167
+ new.set_allowed_actions_and_reusable_workflows_for_a_repository(owner, repo, github_owned_allowed, verified_allowed, patterns_allowed, options)
168
+ end
169
+
170
+ def self.list_organization_secrets(org: nil, options: nil)
171
+ new.list_organization_secrets(org, options)
172
+ end
173
+
174
+ def self.get_an_organization_public_key(org: nil, options: nil)
175
+ new.get_an_organization_public_key(org, options)
176
+ end
177
+
178
+ def self.get_an_organization_secret(org: nil, secret_name: nil, options: nil)
179
+ new.get_an_organization_secret(org, secret_name, options)
180
+ end
181
+
182
+ def self.create_or_update_an_organization_secret(org: nil, secret_name: nil, encrypted_value: nil, key_id: nil, visibility: nil, selected_repository_ids: nil, options: nil)
183
+ new.create_or_update_an_organization_secret(org, secret_name, encrypted_value, key_id, visibility, selected_repository_ids, options)
184
+ end
185
+
186
+ def self.delete_an_organization_secret(org: nil, secret_name: nil, options: nil)
187
+ new.delete_an_organization_secret(org, secret_name, options)
188
+ end
189
+
190
+ def self.list_selected_repositories_for_an_organization_secret(org: nil, secret_name: nil, options: nil)
191
+ new.list_selected_repositories_for_an_organization_secret(org, secret_name, options)
192
+ end
193
+
194
+ def self.set_selected_repositories_for_an_organization_secret(org: nil, secret_name: nil, selected_repository_ids: nil, options: nil)
195
+ new.set_selected_repositories_for_an_organization_secret(org, secret_name, selected_repository_ids, options)
196
+ end
197
+
198
+ def self.add_selected_repository_to_an_organization_secret(org: nil, secret_name: nil, repository_id: nil, options: nil)
199
+ new.add_selected_repository_to_an_organization_secret(org, secret_name, repository_id, options)
200
+ end
201
+
202
+ def self.remove_selected_repository_from_an_organization_secret(org: nil, secret_name: nil, repository_id: nil, options: nil)
203
+ new.remove_selected_repository_from_an_organization_secret(org, secret_name, repository_id, options)
204
+ end
205
+
206
+ def self.list_repository_secrets(owner: nil, repo: nil, options: nil)
207
+ new.list_repository_secrets(owner, repo, options)
208
+ end
209
+
210
+ def self.get_a_repository_public_key(owner: nil, repo: nil, options: nil)
211
+ new.get_a_repository_public_key(owner, repo, options)
212
+ end
213
+
214
+ def self.get_a_repository_secret(owner: nil, repo: nil, secret_name: nil, options: nil)
215
+ new.get_a_repository_secret(owner, repo, secret_name, options)
216
+ end
217
+
218
+ def self.create_or_update_a_repository_secret(owner: nil, repo: nil, secret_name: nil, encrypted_value: nil, key_id: nil, options: nil)
219
+ new.create_or_update_a_repository_secret(owner, repo, secret_name, encrypted_value, key_id, options)
220
+ end
221
+
222
+ def self.delete_a_repository_secret(owner: nil, repo: nil, secret_name: nil, options: nil)
223
+ new.delete_a_repository_secret(owner, repo, secret_name, options)
224
+ end
225
+
226
+ def self.list_environment_secrets(repository_id: nil, environment_name: nil, options: nil)
227
+ new.list_environment_secrets(repository_id, environment_name, options)
228
+ end
229
+
230
+ def self.get_an_environment_public_key(repository_id: nil, environment_name: nil, options: nil)
231
+ new.get_an_environment_public_key(repository_id, environment_name, options)
232
+ end
233
+
234
+ def self.get_an_environment_secret(repository_id: nil, environment_name: nil, secret_name: nil, options: nil)
235
+ new.get_an_environment_secret(repository_id, environment_name, secret_name, options)
236
+ end
237
+
238
+ def self.create_or_update_an_environment_secret(repository_id: nil, environment_name: nil, secret_name: nil, encrypted_value: nil, key_id: nil, options: nil)
239
+ new.create_or_update_an_environment_secret(repository_id, environment_name, secret_name, encrypted_value, key_id, options)
240
+ end
241
+
242
+ def self.delete_an_environment_secret(repository_id: nil, environment_name: nil, secret_name: nil, options: nil)
243
+ new.delete_an_environment_secret(repository_id, environment_name, secret_name, options)
244
+ end
245
+
246
+ def self.list_self_hosted_runner_groups_for_an_enterprise(enterprise: nil, options: nil)
247
+ new.list_self_hosted_runner_groups_for_an_enterprise(enterprise, options)
248
+ end
249
+
250
+ def self.create_a_self_hosted_runner_group_for_an_enterprise(enterprise: nil, name: nil, visibility: nil, selected_organization_ids: nil, runners: nil, allows_public_repositories: nil, options: nil)
251
+ new.create_a_self_hosted_runner_group_for_an_enterprise(enterprise, name, visibility, selected_organization_ids, runners, allows_public_repositories, options)
252
+ end
253
+
254
+ def self.get_a_self_hosted_runner_group_for_an_enterprise(enterprise: nil, runner_group_id: nil, options: nil)
255
+ new.get_a_self_hosted_runner_group_for_an_enterprise(enterprise, runner_group_id, options)
256
+ end
257
+
258
+ def self.update_a_self_hosted_runner_group_for_an_enterprise(enterprise: nil, runner_group_id: nil, name: nil, visibility: nil, allows_public_repositories: nil, options: nil)
259
+ new.update_a_self_hosted_runner_group_for_an_enterprise(enterprise, runner_group_id, name, visibility, allows_public_repositories, options)
260
+ end
261
+
262
+ def self.delete_a_self_hosted_runner_group_from_an_enterprise(enterprise: nil, runner_group_id: nil, options: nil)
263
+ new.delete_a_self_hosted_runner_group_from_an_enterprise(enterprise, runner_group_id, options)
264
+ end
265
+
266
+ def self.list_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise: nil, runner_group_id: nil, options: nil)
267
+ new.list_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, options)
268
+ end
269
+
270
+ def self.set_organization_access_for_a_self_hosted_runner_group_in_an_enterprise(enterprise: nil, runner_group_id: nil, selected_organization_ids: nil, options: nil)
271
+ new.set_organization_access_for_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, selected_organization_ids, options)
272
+ end
273
+
274
+ def self.add_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise: nil, runner_group_id: nil, org_id: nil, options: nil)
275
+ new.add_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, org_id, options)
276
+ end
277
+
278
+ def self.remove_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise: nil, runner_group_id: nil, org_id: nil, options: nil)
279
+ new.remove_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, org_id, options)
280
+ end
281
+
282
+ def self.list_self_hosted_runners_in_a_group_for_an_enterprise(enterprise: nil, runner_group_id: nil, options: nil)
283
+ new.list_self_hosted_runners_in_a_group_for_an_enterprise(enterprise, runner_group_id, options)
284
+ end
285
+
286
+ def self.set_self_hosted_runners_in_a_group_for_an_enterprise(enterprise: nil, runner_group_id: nil, runners: nil, options: nil)
287
+ new.set_self_hosted_runners_in_a_group_for_an_enterprise(enterprise, runner_group_id, runners, options)
288
+ end
289
+
290
+ def self.add_a_self_hosted_runner_to_a_group_for_an_enterprise(enterprise: nil, runner_group_id: nil, runner_id: nil, options: nil)
291
+ new.add_a_self_hosted_runner_to_a_group_for_an_enterprise(enterprise, runner_group_id, runner_id, options)
292
+ end
293
+
294
+ def self.remove_a_self_hosted_runner_from_a_group_for_an_enterprise(enterprise: nil, runner_group_id: nil, runner_id: nil, options: nil)
295
+ new.remove_a_self_hosted_runner_from_a_group_for_an_enterprise(enterprise, runner_group_id, runner_id, options)
296
+ end
297
+
298
+ def self.list_self_hosted_runner_groups_for_an_organization(org: nil, options: nil)
299
+ new.list_self_hosted_runner_groups_for_an_organization(org, options)
300
+ end
301
+
302
+ def self.create_a_self_hosted_runner_group_for_an_organization(org: nil, name: nil, visibility: nil, selected_repository_ids: nil, runners: nil, allows_public_repositories: nil, options: nil)
303
+ new.create_a_self_hosted_runner_group_for_an_organization(org, name, visibility, selected_repository_ids, runners, allows_public_repositories, options)
304
+ end
305
+
306
+ def self.get_a_self_hosted_runner_group_for_an_organization(org: nil, runner_group_id: nil, options: nil)
307
+ new.get_a_self_hosted_runner_group_for_an_organization(org, runner_group_id, options)
308
+ end
309
+
310
+ def self.update_a_self_hosted_runner_group_for_an_organization(org: nil, runner_group_id: nil, name: nil, visibility: nil, allows_public_repositories: nil, options: nil)
311
+ new.update_a_self_hosted_runner_group_for_an_organization(org, runner_group_id, name, visibility, allows_public_repositories, options)
312
+ end
313
+
314
+ def self.delete_a_self_hosted_runner_group_from_an_organization(org: nil, runner_group_id: nil, options: nil)
315
+ new.delete_a_self_hosted_runner_group_from_an_organization(org, runner_group_id, options)
316
+ end
317
+
318
+ def self.list_repository_access_to_a_self_hosted_runner_group_in_an_organization(org: nil, runner_group_id: nil, options: nil)
319
+ new.list_repository_access_to_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, options)
320
+ end
321
+
322
+ def self.set_repository_access_for_a_self_hosted_runner_group_in_an_organization(org: nil, runner_group_id: nil, selected_repository_ids: nil, options: nil)
323
+ new.set_repository_access_for_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, selected_repository_ids, options)
324
+ end
325
+
326
+ def self.add_repository_access_to_a_self_hosted_runner_group_in_an_organization(org: nil, runner_group_id: nil, repository_id: nil, options: nil)
327
+ new.add_repository_access_to_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, repository_id, options)
328
+ end
329
+
330
+ def self.remove_repository_access_to_a_self_hosted_runner_group_in_an_organization(org: nil, runner_group_id: nil, repository_id: nil, options: nil)
331
+ new.remove_repository_access_to_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, repository_id, options)
332
+ end
333
+
334
+ def self.list_self_hosted_runners_in_a_group_for_an_organization(org: nil, runner_group_id: nil, options: nil)
335
+ new.list_self_hosted_runners_in_a_group_for_an_organization(org, runner_group_id, options)
336
+ end
337
+
338
+ def self.set_self_hosted_runners_in_a_group_for_an_organization(org: nil, runner_group_id: nil, runners: nil, options: nil)
339
+ new.set_self_hosted_runners_in_a_group_for_an_organization(org, runner_group_id, runners, options)
340
+ end
341
+
342
+ def self.add_a_self_hosted_runner_to_a_group_for_an_organization(org: nil, runner_group_id: nil, runner_id: nil, options: nil)
343
+ new.add_a_self_hosted_runner_to_a_group_for_an_organization(org, runner_group_id, runner_id, options)
344
+ end
345
+
346
+ def self.remove_a_self_hosted_runner_from_a_group_for_an_organization(org: nil, runner_group_id: nil, runner_id: nil, options: nil)
347
+ new.remove_a_self_hosted_runner_from_a_group_for_an_organization(org, runner_group_id, runner_id, options)
348
+ end
349
+
350
+ def self.list_self_hosted_runners_for_an_enterprise(enterprise: nil, options: nil)
351
+ new.list_self_hosted_runners_for_an_enterprise(enterprise, options)
352
+ end
353
+
354
+ def self.list_runner_applications_for_an_enterprise(enterprise: nil, options: nil)
355
+ new.list_runner_applications_for_an_enterprise(enterprise, options)
356
+ end
357
+
358
+ def self.create_a_registration_token_for_an_enterprise(enterprise: nil, options: nil)
359
+ new.create_a_registration_token_for_an_enterprise(enterprise, options)
360
+ end
361
+
362
+ def self.create_a_remove_token_for_an_enterprise(enterprise: nil, options: nil)
363
+ new.create_a_remove_token_for_an_enterprise(enterprise, options)
364
+ end
365
+
366
+ def self.get_a_self_hosted_runner_for_an_enterprise(enterprise: nil, runner_id: nil, options: nil)
367
+ new.get_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, options)
368
+ end
369
+
370
+ def self.delete_a_self_hosted_runner_from_an_enterprise(enterprise: nil, runner_id: nil, options: nil)
371
+ new.delete_a_self_hosted_runner_from_an_enterprise(enterprise, runner_id, options)
372
+ end
373
+
374
+ def self.list_labels_for_a_self_hosted_runner_for_an_enterprise(enterprise: nil, runner_id: nil, options: nil)
375
+ new.list_labels_for_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, options)
376
+ end
377
+
378
+ def self.add_custom_labels_to_a_self_hosted_runner_for_an_enterprise(enterprise: nil, runner_id: nil, labels: nil, options: nil)
379
+ new.add_custom_labels_to_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, labels, options)
380
+ end
381
+
382
+ def self.set_custom_labels_for_a_self_hosted_runner_for_an_enterprise(enterprise: nil, runner_id: nil, labels: nil, options: nil)
383
+ new.set_custom_labels_for_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, labels, options)
384
+ end
385
+
386
+ def self.remove_all_custom_labels_from_a_self_hosted_runner_for_an_enterprise(enterprise: nil, runner_id: nil, options: nil)
387
+ new.remove_all_custom_labels_from_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, options)
388
+ end
389
+
390
+ def self.remove_a_custom_label_from_a_self_hosted_runner_for_an_enterprise(enterprise: nil, runner_id: nil, name: nil, options: nil)
391
+ new.remove_a_custom_label_from_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, name, options)
392
+ end
393
+
394
+ def self.list_self_hosted_runners_for_an_organization(org: nil, options: nil)
395
+ new.list_self_hosted_runners_for_an_organization(org, options)
396
+ end
397
+
398
+ def self.list_runner_applications_for_an_organization(org: nil, options: nil)
399
+ new.list_runner_applications_for_an_organization(org, options)
400
+ end
401
+
402
+ def self.create_a_registration_token_for_an_organization(org: nil, options: nil)
403
+ new.create_a_registration_token_for_an_organization(org, options)
404
+ end
405
+
406
+ def self.create_a_remove_token_for_an_organization(org: nil, options: nil)
407
+ new.create_a_remove_token_for_an_organization(org, options)
408
+ end
409
+
410
+ def self.get_a_self_hosted_runner_for_an_organization(org: nil, runner_id: nil, options: nil)
411
+ new.get_a_self_hosted_runner_for_an_organization(org, runner_id, options)
412
+ end
413
+
414
+ def self.delete_a_self_hosted_runner_from_an_organization(org: nil, runner_id: nil, options: nil)
415
+ new.delete_a_self_hosted_runner_from_an_organization(org, runner_id, options)
416
+ end
417
+
418
+ def self.list_labels_for_a_self_hosted_runner_for_an_organization(org: nil, runner_id: nil, options: nil)
419
+ new.list_labels_for_a_self_hosted_runner_for_an_organization(org, runner_id, options)
420
+ end
421
+
422
+ def self.add_custom_labels_to_a_self_hosted_runner_for_an_organization(org: nil, runner_id: nil, labels: nil, options: nil)
423
+ new.add_custom_labels_to_a_self_hosted_runner_for_an_organization(org, runner_id, labels, options)
424
+ end
425
+
426
+ def self.set_custom_labels_for_a_self_hosted_runner_for_an_organization(org: nil, runner_id: nil, labels: nil, options: nil)
427
+ new.set_custom_labels_for_a_self_hosted_runner_for_an_organization(org, runner_id, labels, options)
428
+ end
429
+
430
+ def self.remove_all_custom_labels_from_a_self_hosted_runner_for_an_organization(org: nil, runner_id: nil, options: nil)
431
+ new.remove_all_custom_labels_from_a_self_hosted_runner_for_an_organization(org, runner_id, options)
432
+ end
433
+
434
+ def self.remove_a_custom_label_from_a_self_hosted_runner_for_an_organization(org: nil, runner_id: nil, name: nil, options: nil)
435
+ new.remove_a_custom_label_from_a_self_hosted_runner_for_an_organization(org, runner_id, name, options)
436
+ end
437
+
438
+ def self.list_self_hosted_runners_for_a_repository(owner: nil, repo: nil, options: nil)
439
+ new.list_self_hosted_runners_for_a_repository(owner, repo, options)
440
+ end
441
+
442
+ def self.list_runner_applications_for_a_repository(owner: nil, repo: nil, options: nil)
443
+ new.list_runner_applications_for_a_repository(owner, repo, options)
444
+ end
445
+
446
+ def self.create_a_registration_token_for_a_repository(owner: nil, repo: nil, options: nil)
447
+ new.create_a_registration_token_for_a_repository(owner, repo, options)
448
+ end
449
+
450
+ def self.create_a_remove_token_for_a_repository(owner: nil, repo: nil, options: nil)
451
+ new.create_a_remove_token_for_a_repository(owner, repo, options)
452
+ end
453
+
454
+ def self.get_a_self_hosted_runner_for_a_repository(owner: nil, repo: nil, runner_id: nil, options: nil)
455
+ new.get_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, options)
456
+ end
457
+
458
+ def self.delete_a_self_hosted_runner_from_a_repository(owner: nil, repo: nil, runner_id: nil, options: nil)
459
+ new.delete_a_self_hosted_runner_from_a_repository(owner, repo, runner_id, options)
460
+ end
461
+
462
+ def self.list_labels_for_a_self_hosted_runner_for_a_repository(owner: nil, repo: nil, runner_id: nil, options: nil)
463
+ new.list_labels_for_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, options)
464
+ end
465
+
466
+ def self.add_custom_labels_to_a_self_hosted_runner_for_a_repository(owner: nil, repo: nil, runner_id: nil, labels: nil, options: nil)
467
+ new.add_custom_labels_to_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, labels, options)
468
+ end
469
+
470
+ def self.set_custom_labels_for_a_self_hosted_runner_for_a_repository(owner: nil, repo: nil, runner_id: nil, labels: nil, options: nil)
471
+ new.set_custom_labels_for_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, labels, options)
472
+ end
473
+
474
+ def self.remove_all_custom_labels_from_a_self_hosted_runner_for_a_repository(owner: nil, repo: nil, runner_id: nil, options: nil)
475
+ new.remove_all_custom_labels_from_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, options)
476
+ end
477
+
478
+ def self.remove_a_custom_label_from_a_self_hosted_runner_for_a_repository(owner: nil, repo: nil, runner_id: nil, name: nil, options: nil)
479
+ new.remove_a_custom_label_from_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, name, options)
480
+ end
481
+
482
+ def self.get_a_job_for_a_workflow_run(owner: nil, repo: nil, job_id: nil, options: nil)
483
+ new.get_a_job_for_a_workflow_run(owner, repo, job_id, options)
484
+ end
485
+
486
+ def self.download_job_logs_for_a_workflow_run(owner: nil, repo: nil, job_id: nil, options: nil)
487
+ new.download_job_logs_for_a_workflow_run(owner, repo, job_id, options)
488
+ end
489
+
490
+ def self.list_jobs_for_a_workflow_run_attempt(owner: nil, repo: nil, run_id: nil, attempt_number: nil, options: nil)
491
+ new.list_jobs_for_a_workflow_run_attempt(owner, repo, run_id, attempt_number, options)
492
+ end
493
+
494
+ def self.list_jobs_for_a_workflow_run(owner: nil, repo: nil, run_id: nil, options: nil)
495
+ new.list_jobs_for_a_workflow_run(owner, repo, run_id, options)
496
+ end
497
+
498
+ def self.re_run_a_job_from_a_workflow_run(owner: nil, repo: nil, job_id: nil, options: nil)
499
+ new.re_run_a_job_from_a_workflow_run(owner, repo, job_id, options)
500
+ end
501
+
502
+ def self.list_workflow_runs_for_a_repository(owner: nil, repo: nil, options: nil)
503
+ new.list_workflow_runs_for_a_repository(owner, repo, options)
504
+ end
505
+
506
+ def self.get_a_workflow_run(owner: nil, repo: nil, run_id: nil, options: nil)
507
+ new.get_a_workflow_run(owner, repo, run_id, options)
508
+ end
509
+
510
+ def self.delete_a_workflow_run(owner: nil, repo: nil, run_id: nil, options: nil)
511
+ new.delete_a_workflow_run(owner, repo, run_id, options)
512
+ end
513
+
514
+ def self.get_the_review_history_for_a_workflow_run(owner: nil, repo: nil, run_id: nil, options: nil)
515
+ new.get_the_review_history_for_a_workflow_run(owner, repo, run_id, options)
516
+ end
517
+
518
+ def self.approve_a_workflow_run_for_a_fork_pull_request(owner: nil, repo: nil, run_id: nil, options: nil)
519
+ new.approve_a_workflow_run_for_a_fork_pull_request(owner, repo, run_id, options)
520
+ end
521
+
522
+ def self.get_a_workflow_run_attempt(owner: nil, repo: nil, run_id: nil, attempt_number: nil, options: nil)
523
+ new.get_a_workflow_run_attempt(owner, repo, run_id, attempt_number, options)
524
+ end
525
+
526
+ def self.download_workflow_run_attempt_logs(owner: nil, repo: nil, run_id: nil, attempt_number: nil, options: nil)
527
+ new.download_workflow_run_attempt_logs(owner, repo, run_id, attempt_number, options)
528
+ end
529
+
530
+ def self.cancel_a_workflow_run(owner: nil, repo: nil, run_id: nil, options: nil)
531
+ new.cancel_a_workflow_run(owner, repo, run_id, options)
532
+ end
533
+
534
+ def self.download_workflow_run_logs(owner: nil, repo: nil, run_id: nil, options: nil)
535
+ new.download_workflow_run_logs(owner, repo, run_id, options)
536
+ end
537
+
538
+ def self.delete_workflow_run_logs(owner: nil, repo: nil, run_id: nil, options: nil)
539
+ new.delete_workflow_run_logs(owner, repo, run_id, options)
540
+ end
541
+
542
+ def self.get_pending_deployments_for_a_workflow_run(owner: nil, repo: nil, run_id: nil, options: nil)
543
+ new.get_pending_deployments_for_a_workflow_run(owner, repo, run_id, options)
544
+ end
545
+
546
+ def self.review_pending_deployments_for_a_workflow_run(owner: nil, repo: nil, run_id: nil, environment_ids: nil, state: nil, comment: nil, options: nil)
547
+ new.review_pending_deployments_for_a_workflow_run(owner, repo, run_id, environment_ids, state, comment, options)
548
+ end
549
+
550
+ def self.re_run_a_workflow(owner: nil, repo: nil, run_id: nil, options: nil)
551
+ new.re_run_a_workflow(owner, repo, run_id, options)
552
+ end
553
+
554
+ def self.re_run_failed_jobs_from_a_workflow_run(owner: nil, repo: nil, run_id: nil, options: nil)
555
+ new.re_run_failed_jobs_from_a_workflow_run(owner, repo, run_id, options)
556
+ end
557
+
558
+ def self.get_workflow_run_usage(owner: nil, repo: nil, run_id: nil, options: nil)
559
+ new.get_workflow_run_usage(owner, repo, run_id, options)
560
+ end
561
+
562
+ def self.list_workflow_runs(owner: nil, repo: nil, workflow_id: nil, options: nil)
563
+ new.list_workflow_runs(owner, repo, workflow_id, options)
564
+ end
565
+
566
+ def self.list_repository_workflows(owner: nil, repo: nil, options: nil)
567
+ new.list_repository_workflows(owner, repo, options)
568
+ end
569
+
570
+ def self.get_a_workflow(owner: nil, repo: nil, workflow_id: nil, options: nil)
571
+ new.get_a_workflow(owner, repo, workflow_id, options)
572
+ end
573
+
574
+ def self.disable_a_workflow(owner: nil, repo: nil, workflow_id: nil, options: nil)
575
+ new.disable_a_workflow(owner, repo, workflow_id, options)
576
+ end
577
+
578
+ def self.create_a_workflow_dispatch_event(owner: nil, repo: nil, workflow_id: nil, ref: nil, inputs: nil, options: nil)
579
+ new.create_a_workflow_dispatch_event(owner, repo, workflow_id, ref, inputs, options)
580
+ end
581
+
582
+ def self.enable_a_workflow(owner: nil, repo: nil, workflow_id: nil, options: nil)
583
+ new.enable_a_workflow(owner, repo, workflow_id, options)
584
+ end
585
+
586
+ def self.get_workflow_usage(owner: nil, repo: nil, workflow_id: nil, options: nil)
587
+ new.get_workflow_usage(owner, repo, workflow_id, options)
588
+ end
589
+
590
+ private
591
+
592
+ # list artifacts for a repository
593
+ #
594
+ # @param owner [String]
595
+ # @param repo [String]
596
+ #
597
+ # @return ActionsResult, ActionsErrorResult
598
+ def list_artifacts_for_a_repository(owner, repo, options)
599
+ auth = nil
600
+ body = nil
601
+ headers = { accept: 'application/vnd.github.v3+json' }
602
+ params = { per_page: options[:per_page], page: options[:page] }
603
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/artifacts"
604
+
605
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
606
+
607
+ if http_call.successful?
608
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
609
+ else
610
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
611
+ end
612
+ end
613
+
614
+ # get an artifact
615
+ #
616
+ # @param owner [String]
617
+ # @param repo [String]
618
+ # @param artifact_id [Integer] artifact_id parameter
619
+ #
620
+ # @return ActionsResult, ActionsErrorResult
621
+ def get_an_artifact(owner, repo, artifact_id, _options)
622
+ auth = nil
623
+ body = nil
624
+ headers = { accept: 'application/vnd.github.v3+json' }
625
+ params = nil
626
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/artifacts/#{artifact_id}"
627
+
628
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
629
+
630
+ if http_call.successful?
631
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
632
+ else
633
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
634
+ end
635
+ end
636
+
637
+ # delete an artifact
638
+ #
639
+ # @param owner [String]
640
+ # @param repo [String]
641
+ # @param artifact_id [Integer] artifact_id parameter
642
+ #
643
+ # @return ActionsResult, ActionsErrorResult
644
+ def delete_an_artifact(owner, repo, artifact_id, _options)
645
+ auth = nil
646
+ body = nil
647
+ headers = { accept: 'application/vnd.github.v3+json' }
648
+ params = nil
649
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/artifacts/#{artifact_id}"
650
+
651
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
652
+
653
+ if http_call.successful?
654
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
655
+ else
656
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
657
+ end
658
+ end
659
+
660
+ # download an artifact
661
+ #
662
+ # @param owner [String]
663
+ # @param repo [String]
664
+ # @param artifact_id [Integer] artifact_id parameter
665
+ # @param archive_format [String]
666
+ #
667
+ # @return ActionsResult, ActionsErrorResult
668
+ def download_an_artifact(owner, repo, artifact_id, archive_format, _options)
669
+ auth = nil
670
+ body = nil
671
+ headers = { accept: 'application/vnd.github.v3+json' }
672
+ params = nil
673
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/artifacts/#{artifact_id}/#{archive_format}"
674
+
675
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
676
+
677
+ if http_call.successful?
678
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
679
+ else
680
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
681
+ end
682
+ end
683
+
684
+ # list workflow run artifacts
685
+ #
686
+ # @param owner [String]
687
+ # @param repo [String]
688
+ # @param run_id [Integer] The id of the workflow run.
689
+ #
690
+ # @return ActionsResult, ActionsErrorResult
691
+ def list_workflow_run_artifacts(owner, repo, run_id, options)
692
+ auth = nil
693
+ body = nil
694
+ headers = { accept: 'application/vnd.github.v3+json' }
695
+ params = { per_page: options[:per_page], page: options[:page] }
696
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/artifacts"
697
+
698
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
699
+
700
+ if http_call.successful?
701
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
702
+ else
703
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
704
+ end
705
+ end
706
+
707
+ # get github actions cache usage for an enterprise
708
+ #
709
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
710
+ #
711
+ # @return ActionsResult, ActionsErrorResult
712
+ def get_github_actions_cache_usage_for_an_enterprise(enterprise, _options)
713
+ auth = nil
714
+ body = nil
715
+ headers = { accept: 'application/vnd.github.v3+json' }
716
+ params = nil
717
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/cache/usage"
718
+
719
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
720
+
721
+ if http_call.successful?
722
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
723
+ else
724
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
725
+ end
726
+ end
727
+
728
+ # get github actions cache usage for an organization
729
+ #
730
+ # @param org [String]
731
+ #
732
+ # @return ActionsResult, ActionsErrorResult
733
+ def get_github_actions_cache_usage_for_an_organization(org, _options)
734
+ auth = nil
735
+ body = nil
736
+ headers = { accept: 'application/vnd.github.v3+json' }
737
+ params = nil
738
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/cache/usage"
739
+
740
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
741
+
742
+ if http_call.successful?
743
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
744
+ else
745
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
746
+ end
747
+ end
748
+
749
+ # list repositories with github actions cache usage for an organization
750
+ #
751
+ # @param org [String]
752
+ #
753
+ # @return ActionsResult, ActionsErrorResult
754
+ def list_repositories_with_github_actions_cache_usage_for_an_organization(org, options)
755
+ auth = nil
756
+ body = nil
757
+ headers = { accept: 'application/vnd.github.v3+json' }
758
+ params = { per_page: options[:per_page], page: options[:page] }
759
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/cache/usage-by-repository"
760
+
761
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
762
+
763
+ if http_call.successful?
764
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
765
+ else
766
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
767
+ end
768
+ end
769
+
770
+ # get github actions cache usage for a repository
771
+ #
772
+ # @param owner [String]
773
+ # @param repo [String]
774
+ #
775
+ # @return ActionsResult, ActionsErrorResult
776
+ def get_github_actions_cache_usage_for_a_repository(owner, repo, _options)
777
+ auth = nil
778
+ body = nil
779
+ headers = { accept: 'application/vnd.github.v3+json' }
780
+ params = nil
781
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/cache/usage"
782
+
783
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
784
+
785
+ if http_call.successful?
786
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
787
+ else
788
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
789
+ end
790
+ end
791
+
792
+ # get github actions permissions for an enterprise
793
+ #
794
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
795
+ #
796
+ # @return ActionsResult, ActionsErrorResult
797
+ def get_github_actions_permissions_for_an_enterprise(enterprise, _options)
798
+ auth = nil
799
+ body = nil
800
+ headers = { accept: 'application/vnd.github.v3+json' }
801
+ params = nil
802
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions"
803
+
804
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
805
+
806
+ if http_call.successful?
807
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
808
+ else
809
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
810
+ end
811
+ end
812
+
813
+ # set github actions permissions for an enterprise
814
+ #
815
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
816
+ # @param enabled_organizations [String] Required. The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: all, none, or selected.
817
+ # @param allowed_actions [String] The permissions policy that controls the actions and reusable workflows that are allowed to run. Can be one of: all, local_only, or selected.
818
+ #
819
+ # @return ActionsResult, ActionsErrorResult
820
+ def set_github_actions_permissions_for_an_enterprise(enterprise, enabled_organizations, allowed_actions, _options)
821
+ auth = nil
822
+ body = { enabled_organizations: enabled_organizations, allowed_actions: allowed_actions }
823
+ headers = { accept: 'application/vnd.github.v3+json' }
824
+ params = nil
825
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions"
826
+
827
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
828
+
829
+ if http_call.successful?
830
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
831
+ else
832
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
833
+ end
834
+ end
835
+
836
+ # list selected organizations enabled for github actions in an enterprise
837
+ #
838
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
839
+ #
840
+ # @return ActionsResult, ActionsErrorResult
841
+ def list_selected_organizations_enabled_for_github_actions_in_an_enterprise(enterprise, options)
842
+ auth = nil
843
+ body = nil
844
+ headers = { accept: 'application/vnd.github.v3+json' }
845
+ params = { per_page: options[:per_page], page: options[:page] }
846
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions/organizations"
847
+
848
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
849
+
850
+ if http_call.successful?
851
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
852
+ else
853
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
854
+ end
855
+ end
856
+
857
+ # set selected organizations enabled for github actions in an enterprise
858
+ #
859
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
860
+ # @param selected_organization_ids [Array of integers] Required. List of organization IDs to enable for GitHub Actions.
861
+ #
862
+ # @return ActionsResult, ActionsErrorResult
863
+ def set_selected_organizations_enabled_for_github_actions_in_an_enterprise(enterprise, selected_organization_ids, _options)
864
+ auth = nil
865
+ body = { selected_organization_ids: selected_organization_ids }
866
+ headers = { accept: 'application/vnd.github.v3+json' }
867
+ params = nil
868
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions/organizations"
869
+
870
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
871
+
872
+ if http_call.successful?
873
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
874
+ else
875
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
876
+ end
877
+ end
878
+
879
+ # enable a selected organization for github actions in an enterprise
880
+ #
881
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
882
+ # @param org_id [Integer] Unique identifier of an organization.
883
+ #
884
+ # @return ActionsResult, ActionsErrorResult
885
+ def enable_a_selected_organization_for_github_actions_in_an_enterprise(enterprise, org_id, _options)
886
+ auth = nil
887
+ body = nil
888
+ headers = { accept: 'application/vnd.github.v3+json' }
889
+ params = nil
890
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions/organizations/#{org_id}"
891
+
892
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
893
+
894
+ if http_call.successful?
895
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
896
+ else
897
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
898
+ end
899
+ end
900
+
901
+ # disable a selected organization for github actions in an enterprise
902
+ #
903
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
904
+ # @param org_id [Integer] Unique identifier of an organization.
905
+ #
906
+ # @return ActionsResult, ActionsErrorResult
907
+ def disable_a_selected_organization_for_github_actions_in_an_enterprise(enterprise, org_id, _options)
908
+ auth = nil
909
+ body = nil
910
+ headers = { accept: 'application/vnd.github.v3+json' }
911
+ params = nil
912
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions/organizations/#{org_id}"
913
+
914
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
915
+
916
+ if http_call.successful?
917
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
918
+ else
919
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
920
+ end
921
+ end
922
+
923
+ # get allowed actions and reusable workflows for an enterprise
924
+ #
925
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
926
+ #
927
+ # @return ActionsResult, ActionsErrorResult
928
+ def get_allowed_actions_and_reusable_workflows_for_an_enterprise(enterprise, _options)
929
+ auth = nil
930
+ body = nil
931
+ headers = { accept: 'application/vnd.github.v3+json' }
932
+ params = nil
933
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions/selected-actions"
934
+
935
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
936
+
937
+ if http_call.successful?
938
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
939
+ else
940
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
941
+ end
942
+ end
943
+
944
+ # set allowed actions and reusable workflows for an enterprise
945
+ #
946
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
947
+ # @param github_owned_allowed [Boolean] Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.
948
+ # @param verified_allowed [Boolean] Whether actions from GitHub Marketplace verified creators are allowed. Set to true to allow all actions by GitHub Marketplace verified creators.
949
+ # @param patterns_allowed [Array of strings] Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."
950
+ #
951
+ # @return ActionsResult, ActionsErrorResult
952
+ def set_allowed_actions_and_reusable_workflows_for_an_enterprise(enterprise, github_owned_allowed, verified_allowed, patterns_allowed, _options)
953
+ auth = nil
954
+ body = { github_owned_allowed: github_owned_allowed, verified_allowed: verified_allowed, patterns_allowed: patterns_allowed }
955
+ headers = { accept: 'application/vnd.github.v3+json' }
956
+ params = nil
957
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/permissions/selected-actions"
958
+
959
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
960
+
961
+ if http_call.successful?
962
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
963
+ else
964
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
965
+ end
966
+ end
967
+
968
+ # get github actions permissions for an organization
969
+ #
970
+ # @param org [String]
971
+ #
972
+ # @return ActionsResult, ActionsErrorResult
973
+ def get_github_actions_permissions_for_an_organization(org, _options)
974
+ auth = nil
975
+ body = nil
976
+ headers = { accept: 'application/vnd.github.v3+json' }
977
+ params = nil
978
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions"
979
+
980
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
981
+
982
+ if http_call.successful?
983
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
984
+ else
985
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
986
+ end
987
+ end
988
+
989
+ # set github actions permissions for an organization
990
+ #
991
+ # @param org [String]
992
+ # @param enabled_repositories [String] Required. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: all, none, or selected.
993
+ # @param allowed_actions [String] The permissions policy that controls the actions and reusable workflows that are allowed to run. Can be one of: all, local_only, or selected.
994
+ #
995
+ # @return ActionsResult, ActionsErrorResult
996
+ def set_github_actions_permissions_for_an_organization(org, enabled_repositories, allowed_actions, _options)
997
+ auth = nil
998
+ body = { enabled_repositories: enabled_repositories, allowed_actions: allowed_actions }
999
+ headers = { accept: 'application/vnd.github.v3+json' }
1000
+ params = nil
1001
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions"
1002
+
1003
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1004
+
1005
+ if http_call.successful?
1006
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1007
+ else
1008
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1009
+ end
1010
+ end
1011
+
1012
+ # list selected repositories enabled for github actions in an organization
1013
+ #
1014
+ # @param org [String]
1015
+ #
1016
+ # @return ActionsResult, ActionsErrorResult
1017
+ def list_selected_repositories_enabled_for_github_actions_in_an_organization(org, options)
1018
+ auth = nil
1019
+ body = nil
1020
+ headers = { accept: 'application/vnd.github.v3+json' }
1021
+ params = { per_page: options[:per_page], page: options[:page] }
1022
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/repositories"
1023
+
1024
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1025
+
1026
+ if http_call.successful?
1027
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1028
+ else
1029
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1030
+ end
1031
+ end
1032
+
1033
+ # set selected repositories enabled for github actions in an organization
1034
+ #
1035
+ # @param org [String]
1036
+ # @param selected_repository_ids [Array of integers] Required. List of repository IDs to enable for GitHub Actions.
1037
+ #
1038
+ # @return ActionsResult, ActionsErrorResult
1039
+ def set_selected_repositories_enabled_for_github_actions_in_an_organization(org, selected_repository_ids, _options)
1040
+ auth = nil
1041
+ body = { selected_repository_ids: selected_repository_ids }
1042
+ headers = { accept: 'application/vnd.github.v3+json' }
1043
+ params = nil
1044
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/repositories"
1045
+
1046
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1047
+
1048
+ if http_call.successful?
1049
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1050
+ else
1051
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1052
+ end
1053
+ end
1054
+
1055
+ # enable a selected repository for github actions in an organization
1056
+ #
1057
+ # @param org [String]
1058
+ # @param repository_id [Integer]
1059
+ #
1060
+ # @return ActionsResult, ActionsErrorResult
1061
+ def enable_a_selected_repository_for_github_actions_in_an_organization(org, repository_id, _options)
1062
+ auth = nil
1063
+ body = nil
1064
+ headers = { accept: 'application/vnd.github.v3+json' }
1065
+ params = nil
1066
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/repositories/#{repository_id}"
1067
+
1068
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1069
+
1070
+ if http_call.successful?
1071
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1072
+ else
1073
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1074
+ end
1075
+ end
1076
+
1077
+ # disable a selected repository for github actions in an organization
1078
+ #
1079
+ # @param org [String]
1080
+ # @param repository_id [Integer]
1081
+ #
1082
+ # @return ActionsResult, ActionsErrorResult
1083
+ def disable_a_selected_repository_for_github_actions_in_an_organization(org, repository_id, _options)
1084
+ auth = nil
1085
+ body = nil
1086
+ headers = { accept: 'application/vnd.github.v3+json' }
1087
+ params = nil
1088
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/repositories/#{repository_id}"
1089
+
1090
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
1091
+
1092
+ if http_call.successful?
1093
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1094
+ else
1095
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1096
+ end
1097
+ end
1098
+
1099
+ # get allowed actions and reusable workflows for an organization
1100
+ #
1101
+ # @param org [String]
1102
+ #
1103
+ # @return ActionsResult, ActionsErrorResult
1104
+ def get_allowed_actions_and_reusable_workflows_for_an_organization(org, _options)
1105
+ auth = nil
1106
+ body = nil
1107
+ headers = { accept: 'application/vnd.github.v3+json' }
1108
+ params = nil
1109
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/selected-actions"
1110
+
1111
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1112
+
1113
+ if http_call.successful?
1114
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1115
+ else
1116
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1117
+ end
1118
+ end
1119
+
1120
+ # set allowed actions and reusable workflows for an organization
1121
+ #
1122
+ # @param org [String]
1123
+ # @param github_owned_allowed [Boolean] Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.
1124
+ # @param verified_allowed [Boolean] Whether actions from GitHub Marketplace verified creators are allowed. Set to true to allow all actions by GitHub Marketplace verified creators.
1125
+ # @param patterns_allowed [Array of strings] Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."
1126
+ #
1127
+ # @return ActionsResult, ActionsErrorResult
1128
+ def set_allowed_actions_and_reusable_workflows_for_an_organization(org, github_owned_allowed, verified_allowed, patterns_allowed, _options)
1129
+ auth = nil
1130
+ body = { github_owned_allowed: github_owned_allowed, verified_allowed: verified_allowed, patterns_allowed: patterns_allowed }
1131
+ headers = { accept: 'application/vnd.github.v3+json' }
1132
+ params = nil
1133
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/selected-actions"
1134
+
1135
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1136
+
1137
+ if http_call.successful?
1138
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1139
+ else
1140
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1141
+ end
1142
+ end
1143
+
1144
+ # get default workflow permissions
1145
+ #
1146
+ # @param org [String]
1147
+ #
1148
+ # @return ActionsResult, ActionsErrorResult
1149
+ def get_default_workflow_permissions(org, _options)
1150
+ auth = nil
1151
+ body = nil
1152
+ headers = { accept: 'application/vnd.github.v3+json' }
1153
+ params = nil
1154
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/workflow"
1155
+
1156
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1157
+
1158
+ if http_call.successful?
1159
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1160
+ else
1161
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1162
+ end
1163
+ end
1164
+
1165
+ # set default workflow permissions
1166
+ #
1167
+ # @param org [String]
1168
+ # @param default_workflow_permissions [String] The default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization.
1169
+ # @param can_approve_pull_request_reviews [Boolean] Whether GitHub Actions can submit approving pull request reviews.
1170
+ #
1171
+ # @return ActionsResult, ActionsErrorResult
1172
+ def set_default_workflow_permissions(org, default_workflow_permissions, can_approve_pull_request_reviews, _options)
1173
+ auth = nil
1174
+ body = { default_workflow_permissions: default_workflow_permissions, can_approve_pull_request_reviews: can_approve_pull_request_reviews }
1175
+ headers = { accept: 'application/vnd.github.v3+json' }
1176
+ params = nil
1177
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/permissions/workflow"
1178
+
1179
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1180
+
1181
+ if http_call.successful?
1182
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1183
+ else
1184
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1185
+ end
1186
+ end
1187
+
1188
+ # get github actions permissions for a repository
1189
+ #
1190
+ # @param owner [String]
1191
+ # @param repo [String]
1192
+ #
1193
+ # @return ActionsResult, ActionsErrorResult
1194
+ def get_github_actions_permissions_for_a_repository(owner, repo, _options)
1195
+ auth = nil
1196
+ body = nil
1197
+ headers = { accept: 'application/vnd.github.v3+json' }
1198
+ params = nil
1199
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/permissions"
1200
+
1201
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1202
+
1203
+ if http_call.successful?
1204
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1205
+ else
1206
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1207
+ end
1208
+ end
1209
+
1210
+ # set github actions permissions for a repository
1211
+ #
1212
+ # @param owner [String]
1213
+ # @param repo [String]
1214
+ # @param enabled [Boolean] Required. Whether GitHub Actions is enabled on the repository.
1215
+ # @param allowed_actions [String] The permissions policy that controls the actions and reusable workflows that are allowed to run. Can be one of: all, local_only, or selected.
1216
+ #
1217
+ # @return ActionsResult, ActionsErrorResult
1218
+ def set_github_actions_permissions_for_a_repository(owner, repo, enabled, allowed_actions, _options)
1219
+ auth = nil
1220
+ body = { enabled: enabled, allowed_actions: allowed_actions }
1221
+ headers = { accept: 'application/vnd.github.v3+json' }
1222
+ params = nil
1223
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/permissions"
1224
+
1225
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1226
+
1227
+ if http_call.successful?
1228
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1229
+ else
1230
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1231
+ end
1232
+ end
1233
+
1234
+ # get the level of access for workflows outside of the repository
1235
+ #
1236
+ # @param owner [String]
1237
+ # @param repo [String]
1238
+ #
1239
+ # @return ActionsResult, ActionsErrorResult
1240
+ def get_the_level_of_access_for_workflows_outside_of_the_repository(owner, repo, _options)
1241
+ auth = nil
1242
+ body = nil
1243
+ headers = { accept: 'application/vnd.github.v3+json' }
1244
+ params = nil
1245
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/permissions/access"
1246
+
1247
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1248
+
1249
+ if http_call.successful?
1250
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1251
+ else
1252
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1253
+ end
1254
+ end
1255
+
1256
+ # set the level of access for workflows outside of the repository
1257
+ #
1258
+ # @param owner [String]
1259
+ # @param repo [String]
1260
+ # @param access_level [String] Required. Defines the level of access that workflows outside of the repository have to actions and reusable workflows within the repository. none means access is only possible from workflows in this repository. Can be one of none, organization, enterprise.
1261
+ #
1262
+ # @return ActionsResult, ActionsErrorResult
1263
+ def set_the_level_of_access_for_workflows_outside_of_the_repository(owner, repo, access_level, _options)
1264
+ auth = nil
1265
+ body = { access_level: access_level }
1266
+ headers = { accept: 'application/vnd.github.v3+json' }
1267
+ params = nil
1268
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/permissions/access"
1269
+
1270
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1271
+
1272
+ if http_call.successful?
1273
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1274
+ else
1275
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1276
+ end
1277
+ end
1278
+
1279
+ # get allowed actions and reusable workflows for a repository
1280
+ #
1281
+ # @param owner [String]
1282
+ # @param repo [String]
1283
+ #
1284
+ # @return ActionsResult, ActionsErrorResult
1285
+ def get_allowed_actions_and_reusable_workflows_for_a_repository(owner, repo, _options)
1286
+ auth = nil
1287
+ body = nil
1288
+ headers = { accept: 'application/vnd.github.v3+json' }
1289
+ params = nil
1290
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/permissions/selected-actions"
1291
+
1292
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1293
+
1294
+ if http_call.successful?
1295
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1296
+ else
1297
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1298
+ end
1299
+ end
1300
+
1301
+ # set allowed actions and reusable workflows for a repository
1302
+ #
1303
+ # @param owner [String]
1304
+ # @param repo [String]
1305
+ # @param github_owned_allowed [Boolean] Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.
1306
+ # @param verified_allowed [Boolean] Whether actions from GitHub Marketplace verified creators are allowed. Set to true to allow all actions by GitHub Marketplace verified creators.
1307
+ # @param patterns_allowed [Array of strings] Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."
1308
+ #
1309
+ # @return ActionsResult, ActionsErrorResult
1310
+ def set_allowed_actions_and_reusable_workflows_for_a_repository(owner, repo, github_owned_allowed, verified_allowed, patterns_allowed, _options)
1311
+ auth = nil
1312
+ body = { github_owned_allowed: github_owned_allowed, verified_allowed: verified_allowed, patterns_allowed: patterns_allowed }
1313
+ headers = { accept: 'application/vnd.github.v3+json' }
1314
+ params = nil
1315
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/permissions/selected-actions"
1316
+
1317
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1318
+
1319
+ if http_call.successful?
1320
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1321
+ else
1322
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1323
+ end
1324
+ end
1325
+
1326
+ # list organization secrets
1327
+ #
1328
+ # @param org [String]
1329
+ #
1330
+ # @return ActionsResult, ActionsErrorResult
1331
+ def list_organization_secrets(org, options)
1332
+ auth = nil
1333
+ body = nil
1334
+ headers = { accept: 'application/vnd.github.v3+json' }
1335
+ params = { per_page: options[:per_page], page: options[:page] }
1336
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets"
1337
+
1338
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1339
+
1340
+ if http_call.successful?
1341
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1342
+ else
1343
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1344
+ end
1345
+ end
1346
+
1347
+ # get an organization public key
1348
+ #
1349
+ # @param org [String]
1350
+ #
1351
+ # @return ActionsResult, ActionsErrorResult
1352
+ def get_an_organization_public_key(org, _options)
1353
+ auth = nil
1354
+ body = nil
1355
+ headers = { accept: 'application/vnd.github.v3+json' }
1356
+ params = nil
1357
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/public-key"
1358
+
1359
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1360
+
1361
+ if http_call.successful?
1362
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1363
+ else
1364
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1365
+ end
1366
+ end
1367
+
1368
+ # get an organization secret
1369
+ #
1370
+ # @param org [String]
1371
+ # @param secret_name [String] secret_name parameter
1372
+ #
1373
+ # @return ActionsResult, ActionsErrorResult
1374
+ def get_an_organization_secret(org, secret_name, _options)
1375
+ auth = nil
1376
+ body = nil
1377
+ headers = { accept: 'application/vnd.github.v3+json' }
1378
+ params = nil
1379
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/#{secret_name}"
1380
+
1381
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1382
+
1383
+ if http_call.successful?
1384
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1385
+ else
1386
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1387
+ end
1388
+ end
1389
+
1390
+ # create or update an organization secret
1391
+ #
1392
+ # @param org [String]
1393
+ # @param secret_name [String] secret_name parameter
1394
+ # @param encrypted_value [String] Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an organization public key endpoint.
1395
+ # @param key_id [String] ID of the key you used to encrypt the secret.
1396
+ # @param visibility [String] Required. Configures the access that repositories have to the organization secret. Can be one of: - all - All repositories in an organization can access the secret. - private - Private repositories in an organization can access the secret. - selected - Only specific repositories can access the secret.
1397
+ # @param selected_repository_ids [Array of strings] An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the visibility is set to selected. You can manage the list of selected repositories using the List selected repositories for an organization secret, Set selected repositories for an organization secret, and Remove selected repository from an organization secret endpoints.
1398
+ #
1399
+ # @return ActionsResult, ActionsErrorResult
1400
+ def create_or_update_an_organization_secret(org, secret_name, encrypted_value, key_id, visibility, selected_repository_ids, _options)
1401
+ auth = nil
1402
+ body = { encrypted_value: encrypted_value, key_id: key_id, visibility: visibility, selected_repository_ids: selected_repository_ids }
1403
+ headers = { accept: 'application/vnd.github.v3+json' }
1404
+ params = nil
1405
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/#{secret_name}"
1406
+
1407
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1408
+
1409
+ if http_call.successful?
1410
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1411
+ else
1412
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1413
+ end
1414
+ end
1415
+
1416
+ # delete an organization secret
1417
+ #
1418
+ # @param org [String]
1419
+ # @param secret_name [String] secret_name parameter
1420
+ #
1421
+ # @return ActionsResult, ActionsErrorResult
1422
+ def delete_an_organization_secret(org, secret_name, _options)
1423
+ auth = nil
1424
+ body = nil
1425
+ headers = { accept: 'application/vnd.github.v3+json' }
1426
+ params = nil
1427
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/#{secret_name}"
1428
+
1429
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
1430
+
1431
+ if http_call.successful?
1432
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1433
+ else
1434
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1435
+ end
1436
+ end
1437
+
1438
+ # list selected repositories for an organization secret
1439
+ #
1440
+ # @param org [String]
1441
+ # @param secret_name [String] secret_name parameter
1442
+ #
1443
+ # @return ActionsResult, ActionsErrorResult
1444
+ def list_selected_repositories_for_an_organization_secret(org, secret_name, options)
1445
+ auth = nil
1446
+ body = nil
1447
+ headers = { accept: 'application/vnd.github.v3+json' }
1448
+ params = { page: options[:page], per_page: options[:per_page] }
1449
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/#{secret_name}/repositories"
1450
+
1451
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1452
+
1453
+ if http_call.successful?
1454
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1455
+ else
1456
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1457
+ end
1458
+ end
1459
+
1460
+ # set selected repositories for an organization secret
1461
+ #
1462
+ # @param org [String]
1463
+ # @param secret_name [String] secret_name parameter
1464
+ # @param selected_repository_ids [Array of integers] Required. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the visibility is set to selected. You can add and remove individual repositories using the Set selected repositories for an organization secret and Remove selected repository from an organization secret endpoints.
1465
+ #
1466
+ # @return ActionsResult, ActionsErrorResult
1467
+ def set_selected_repositories_for_an_organization_secret(org, secret_name, selected_repository_ids, _options)
1468
+ auth = nil
1469
+ body = { selected_repository_ids: selected_repository_ids }
1470
+ headers = { accept: 'application/vnd.github.v3+json' }
1471
+ params = nil
1472
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/#{secret_name}/repositories"
1473
+
1474
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1475
+
1476
+ if http_call.successful?
1477
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1478
+ else
1479
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1480
+ end
1481
+ end
1482
+
1483
+ # add selected repository to an organization secret
1484
+ #
1485
+ # @param org [String]
1486
+ # @param secret_name [String] secret_name parameter
1487
+ # @param repository_id [Integer]
1488
+ #
1489
+ # @return ActionsResult, ActionsErrorResult
1490
+ def add_selected_repository_to_an_organization_secret(org, secret_name, repository_id, _options)
1491
+ auth = nil
1492
+ body = nil
1493
+ headers = { accept: 'application/vnd.github.v3+json' }
1494
+ params = nil
1495
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/#{secret_name}/repositories/#{repository_id}"
1496
+
1497
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1498
+
1499
+ if http_call.successful?
1500
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1501
+ else
1502
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1503
+ end
1504
+ end
1505
+
1506
+ # remove selected repository from an organization secret
1507
+ #
1508
+ # @param org [String]
1509
+ # @param secret_name [String] secret_name parameter
1510
+ # @param repository_id [Integer]
1511
+ #
1512
+ # @return ActionsResult, ActionsErrorResult
1513
+ def remove_selected_repository_from_an_organization_secret(org, secret_name, repository_id, _options)
1514
+ auth = nil
1515
+ body = nil
1516
+ headers = { accept: 'application/vnd.github.v3+json' }
1517
+ params = nil
1518
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/secrets/#{secret_name}/repositories/#{repository_id}"
1519
+
1520
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
1521
+
1522
+ if http_call.successful?
1523
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1524
+ else
1525
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1526
+ end
1527
+ end
1528
+
1529
+ # list repository secrets
1530
+ #
1531
+ # @param owner [String]
1532
+ # @param repo [String]
1533
+ #
1534
+ # @return ActionsResult, ActionsErrorResult
1535
+ def list_repository_secrets(owner, repo, options)
1536
+ auth = nil
1537
+ body = nil
1538
+ headers = { accept: 'application/vnd.github.v3+json' }
1539
+ params = { per_page: options[:per_page], page: options[:page] }
1540
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/secrets"
1541
+
1542
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1543
+
1544
+ if http_call.successful?
1545
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1546
+ else
1547
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1548
+ end
1549
+ end
1550
+
1551
+ # get a repository public key
1552
+ #
1553
+ # @param owner [String]
1554
+ # @param repo [String]
1555
+ #
1556
+ # @return ActionsResult, ActionsErrorResult
1557
+ def get_a_repository_public_key(owner, repo, _options)
1558
+ auth = nil
1559
+ body = nil
1560
+ headers = { accept: 'application/vnd.github.v3+json' }
1561
+ params = nil
1562
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/secrets/public-key"
1563
+
1564
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1565
+
1566
+ if http_call.successful?
1567
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1568
+ else
1569
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1570
+ end
1571
+ end
1572
+
1573
+ # get a repository secret
1574
+ #
1575
+ # @param owner [String]
1576
+ # @param repo [String]
1577
+ # @param secret_name [String] secret_name parameter
1578
+ #
1579
+ # @return ActionsResult, ActionsErrorResult
1580
+ def get_a_repository_secret(owner, repo, secret_name, _options)
1581
+ auth = nil
1582
+ body = nil
1583
+ headers = { accept: 'application/vnd.github.v3+json' }
1584
+ params = nil
1585
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/secrets/#{secret_name}"
1586
+
1587
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1588
+
1589
+ if http_call.successful?
1590
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1591
+ else
1592
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1593
+ end
1594
+ end
1595
+
1596
+ # create or update a repository secret
1597
+ #
1598
+ # @param owner [String]
1599
+ # @param repo [String]
1600
+ # @param secret_name [String] secret_name parameter
1601
+ # @param encrypted_value [String] Value for your secret, encrypted with LibSodium using the public key retrieved from the Get a repository public key endpoint.
1602
+ # @param key_id [String] ID of the key you used to encrypt the secret.
1603
+ #
1604
+ # @return ActionsResult, ActionsErrorResult
1605
+ def create_or_update_a_repository_secret(owner, repo, secret_name, encrypted_value, key_id, _options)
1606
+ auth = nil
1607
+ body = { encrypted_value: encrypted_value, key_id: key_id }
1608
+ headers = { accept: 'application/vnd.github.v3+json' }
1609
+ params = nil
1610
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/secrets/#{secret_name}"
1611
+
1612
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1613
+
1614
+ if http_call.successful?
1615
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1616
+ else
1617
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1618
+ end
1619
+ end
1620
+
1621
+ # delete a repository secret
1622
+ #
1623
+ # @param owner [String]
1624
+ # @param repo [String]
1625
+ # @param secret_name [String] secret_name parameter
1626
+ #
1627
+ # @return ActionsResult, ActionsErrorResult
1628
+ def delete_a_repository_secret(owner, repo, secret_name, _options)
1629
+ auth = nil
1630
+ body = nil
1631
+ headers = { accept: 'application/vnd.github.v3+json' }
1632
+ params = nil
1633
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/secrets/#{secret_name}"
1634
+
1635
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
1636
+
1637
+ if http_call.successful?
1638
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1639
+ else
1640
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1641
+ end
1642
+ end
1643
+
1644
+ # list environment secrets
1645
+ #
1646
+ # @param repository_id [Integer]
1647
+ # @param environment_name [String] The name of the environment
1648
+ #
1649
+ # @return ActionsResult, ActionsErrorResult
1650
+ def list_environment_secrets(repository_id, environment_name, options)
1651
+ auth = nil
1652
+ body = nil
1653
+ headers = { accept: 'application/vnd.github.v3+json' }
1654
+ params = { per_page: options[:per_page], page: options[:page] }
1655
+ uri = "#{Gitabu::BASE_URL}/repositories/#{repository_id}/environments/#{environment_name}/secrets"
1656
+
1657
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1658
+
1659
+ if http_call.successful?
1660
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1661
+ else
1662
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1663
+ end
1664
+ end
1665
+
1666
+ # get an environment public key
1667
+ #
1668
+ # @param repository_id [Integer]
1669
+ # @param environment_name [String] The name of the environment
1670
+ #
1671
+ # @return ActionsResult, ActionsErrorResult
1672
+ def get_an_environment_public_key(repository_id, environment_name, _options)
1673
+ auth = nil
1674
+ body = nil
1675
+ headers = { accept: 'application/vnd.github.v3+json' }
1676
+ params = nil
1677
+ uri = "#{Gitabu::BASE_URL}/repositories/#{repository_id}/environments/#{environment_name}/secrets/public-key"
1678
+
1679
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1680
+
1681
+ if http_call.successful?
1682
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1683
+ else
1684
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1685
+ end
1686
+ end
1687
+
1688
+ # get an environment secret
1689
+ #
1690
+ # @param repository_id [Integer]
1691
+ # @param environment_name [String] The name of the environment
1692
+ # @param secret_name [String] secret_name parameter
1693
+ #
1694
+ # @return ActionsResult, ActionsErrorResult
1695
+ def get_an_environment_secret(repository_id, environment_name, secret_name, _options)
1696
+ auth = nil
1697
+ body = nil
1698
+ headers = { accept: 'application/vnd.github.v3+json' }
1699
+ params = nil
1700
+ uri = "#{Gitabu::BASE_URL}/repositories/#{repository_id}/environments/#{environment_name}/secrets/#{secret_name}"
1701
+
1702
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1703
+
1704
+ if http_call.successful?
1705
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1706
+ else
1707
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1708
+ end
1709
+ end
1710
+
1711
+ # create or update an environment secret
1712
+ #
1713
+ # @param repository_id [Integer]
1714
+ # @param environment_name [String] The name of the environment
1715
+ # @param secret_name [String] secret_name parameter
1716
+ # @param encrypted_value [String] Required. Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an environment public key endpoint.
1717
+ # @param key_id [String] Required. ID of the key you used to encrypt the secret.
1718
+ #
1719
+ # @return ActionsResult, ActionsErrorResult
1720
+ def create_or_update_an_environment_secret(repository_id, environment_name, secret_name, encrypted_value, key_id, _options)
1721
+ auth = nil
1722
+ body = { encrypted_value: encrypted_value, key_id: key_id }
1723
+ headers = { accept: 'application/vnd.github.v3+json' }
1724
+ params = nil
1725
+ uri = "#{Gitabu::BASE_URL}/repositories/#{repository_id}/environments/#{environment_name}/secrets/#{secret_name}"
1726
+
1727
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1728
+
1729
+ if http_call.successful?
1730
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1731
+ else
1732
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1733
+ end
1734
+ end
1735
+
1736
+ # delete an environment secret
1737
+ #
1738
+ # @param repository_id [Integer]
1739
+ # @param environment_name [String] The name of the environment
1740
+ # @param secret_name [String] secret_name parameter
1741
+ #
1742
+ # @return ActionsResult, ActionsErrorResult
1743
+ def delete_an_environment_secret(repository_id, environment_name, secret_name, _options)
1744
+ auth = nil
1745
+ body = nil
1746
+ headers = { accept: 'application/vnd.github.v3+json' }
1747
+ params = nil
1748
+ uri = "#{Gitabu::BASE_URL}/repositories/#{repository_id}/environments/#{environment_name}/secrets/#{secret_name}"
1749
+
1750
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
1751
+
1752
+ if http_call.successful?
1753
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1754
+ else
1755
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1756
+ end
1757
+ end
1758
+
1759
+ # list self-hosted runner groups for an enterprise
1760
+ #
1761
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1762
+ #
1763
+ # @return ActionsResult, ActionsErrorResult
1764
+ def list_self_hosted_runner_groups_for_an_enterprise(enterprise, options)
1765
+ auth = nil
1766
+ body = nil
1767
+ headers = { accept: 'application/vnd.github.v3+json' }
1768
+ params = { per_page: options[:per_page], page: options[:page] }
1769
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups"
1770
+
1771
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1772
+
1773
+ if http_call.successful?
1774
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1775
+ else
1776
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1777
+ end
1778
+ end
1779
+
1780
+ # create a self-hosted runner group for an enterprise
1781
+ #
1782
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1783
+ # @param name [String] Required. Name of the runner group.
1784
+ # @param visibility [String] Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: all or selected
1785
+ # @param selected_organization_ids [Array of integers] List of organization IDs that can access the runner group.
1786
+ # @param runners [Array of integers] List of runner IDs to add to the runner group.
1787
+ # @param allows_public_repositories [Boolean] Whether the runner group can be used by public repositories.
1788
+ #
1789
+ # @return ActionsResult, ActionsErrorResult
1790
+ def create_a_self_hosted_runner_group_for_an_enterprise(enterprise, name, visibility, selected_organization_ids, runners, allows_public_repositories, _options)
1791
+ auth = nil
1792
+ body = { name: name, visibility: visibility, selected_organization_ids: selected_organization_ids, runners: runners, allows_public_repositories: allows_public_repositories }
1793
+ headers = { accept: 'application/vnd.github.v3+json' }
1794
+ params = nil
1795
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups"
1796
+
1797
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
1798
+
1799
+ if http_call.successful?
1800
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1801
+ else
1802
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1803
+ end
1804
+ end
1805
+
1806
+ # get a self-hosted runner group for an enterprise
1807
+ #
1808
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1809
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1810
+ #
1811
+ # @return ActionsResult, ActionsErrorResult
1812
+ def get_a_self_hosted_runner_group_for_an_enterprise(enterprise, runner_group_id, _options)
1813
+ auth = nil
1814
+ body = nil
1815
+ headers = { accept: 'application/vnd.github.v3+json' }
1816
+ params = nil
1817
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}"
1818
+
1819
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1820
+
1821
+ if http_call.successful?
1822
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1823
+ else
1824
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1825
+ end
1826
+ end
1827
+
1828
+ # update a self-hosted runner group for an enterprise
1829
+ #
1830
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1831
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1832
+ # @param name [String] Name of the runner group.
1833
+ # @param visibility [String] Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: all or selectedDefault: all
1834
+ # @param allows_public_repositories [Boolean] Whether the runner group can be used by public repositories.
1835
+ #
1836
+ # @return ActionsResult, ActionsErrorResult
1837
+ def update_a_self_hosted_runner_group_for_an_enterprise(enterprise, runner_group_id, name, visibility, allows_public_repositories, _options)
1838
+ auth = nil
1839
+ body = { name: name, visibility: visibility, allows_public_repositories: allows_public_repositories }
1840
+ headers = { accept: 'application/vnd.github.v3+json' }
1841
+ params = nil
1842
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}"
1843
+
1844
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :patch, params: params, uri: uri)
1845
+
1846
+ if http_call.successful?
1847
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1848
+ else
1849
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1850
+ end
1851
+ end
1852
+
1853
+ # delete a self-hosted runner group from an enterprise
1854
+ #
1855
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1856
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1857
+ #
1858
+ # @return ActionsResult, ActionsErrorResult
1859
+ def delete_a_self_hosted_runner_group_from_an_enterprise(enterprise, runner_group_id, _options)
1860
+ auth = nil
1861
+ body = nil
1862
+ headers = { accept: 'application/vnd.github.v3+json' }
1863
+ params = nil
1864
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}"
1865
+
1866
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
1867
+
1868
+ if http_call.successful?
1869
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1870
+ else
1871
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1872
+ end
1873
+ end
1874
+
1875
+ # list organization access to a self-hosted runner group in an enterprise
1876
+ #
1877
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1878
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1879
+ #
1880
+ # @return ActionsResult, ActionsErrorResult
1881
+ def list_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, options)
1882
+ auth = nil
1883
+ body = nil
1884
+ headers = { accept: 'application/vnd.github.v3+json' }
1885
+ params = { per_page: options[:per_page], page: options[:page] }
1886
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/organizations"
1887
+
1888
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1889
+
1890
+ if http_call.successful?
1891
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1892
+ else
1893
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1894
+ end
1895
+ end
1896
+
1897
+ # set organization access for a self-hosted runner group in an enterprise
1898
+ #
1899
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1900
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1901
+ # @param selected_organization_ids [Array of integers] Required. List of organization IDs that can access the runner group.
1902
+ #
1903
+ # @return ActionsResult, ActionsErrorResult
1904
+ def set_organization_access_for_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, selected_organization_ids, _options)
1905
+ auth = nil
1906
+ body = { selected_organization_ids: selected_organization_ids }
1907
+ headers = { accept: 'application/vnd.github.v3+json' }
1908
+ params = nil
1909
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/organizations"
1910
+
1911
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1912
+
1913
+ if http_call.successful?
1914
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1915
+ else
1916
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1917
+ end
1918
+ end
1919
+
1920
+ # add organization access to a self-hosted runner group in an enterprise
1921
+ #
1922
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1923
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1924
+ # @param org_id [Integer] Unique identifier of an organization.
1925
+ #
1926
+ # @return ActionsResult, ActionsErrorResult
1927
+ def add_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, org_id, _options)
1928
+ auth = nil
1929
+ body = nil
1930
+ headers = { accept: 'application/vnd.github.v3+json' }
1931
+ params = nil
1932
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/organizations/#{org_id}"
1933
+
1934
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
1935
+
1936
+ if http_call.successful?
1937
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1938
+ else
1939
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1940
+ end
1941
+ end
1942
+
1943
+ # remove organization access to a self-hosted runner group in an enterprise
1944
+ #
1945
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1946
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1947
+ # @param org_id [Integer] Unique identifier of an organization.
1948
+ #
1949
+ # @return ActionsResult, ActionsErrorResult
1950
+ def remove_organization_access_to_a_self_hosted_runner_group_in_an_enterprise(enterprise, runner_group_id, org_id, _options)
1951
+ auth = nil
1952
+ body = nil
1953
+ headers = { accept: 'application/vnd.github.v3+json' }
1954
+ params = nil
1955
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/organizations/#{org_id}"
1956
+
1957
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
1958
+
1959
+ if http_call.successful?
1960
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1961
+ else
1962
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1963
+ end
1964
+ end
1965
+
1966
+ # list self-hosted runners in a group for an enterprise
1967
+ #
1968
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1969
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1970
+ #
1971
+ # @return ActionsResult, ActionsErrorResult
1972
+ def list_self_hosted_runners_in_a_group_for_an_enterprise(enterprise, runner_group_id, options)
1973
+ auth = nil
1974
+ body = nil
1975
+ headers = { accept: 'application/vnd.github.v3+json' }
1976
+ params = { per_page: options[:per_page], page: options[:page] }
1977
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/runners"
1978
+
1979
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
1980
+
1981
+ if http_call.successful?
1982
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
1983
+ else
1984
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
1985
+ end
1986
+ end
1987
+
1988
+ # set self-hosted runners in a group for an enterprise
1989
+ #
1990
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
1991
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
1992
+ # @param runners [Array of integers] Required. List of runner IDs to add to the runner group.
1993
+ #
1994
+ # @return ActionsResult, ActionsErrorResult
1995
+ def set_self_hosted_runners_in_a_group_for_an_enterprise(enterprise, runner_group_id, runners, _options)
1996
+ auth = nil
1997
+ body = { runners: runners }
1998
+ headers = { accept: 'application/vnd.github.v3+json' }
1999
+ params = nil
2000
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/runners"
2001
+
2002
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2003
+
2004
+ if http_call.successful?
2005
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2006
+ else
2007
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2008
+ end
2009
+ end
2010
+
2011
+ # add a self-hosted runner to a group for an enterprise
2012
+ #
2013
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2014
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2015
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2016
+ #
2017
+ # @return ActionsResult, ActionsErrorResult
2018
+ def add_a_self_hosted_runner_to_a_group_for_an_enterprise(enterprise, runner_group_id, runner_id, _options)
2019
+ auth = nil
2020
+ body = nil
2021
+ headers = { accept: 'application/vnd.github.v3+json' }
2022
+ params = nil
2023
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/runners/#{runner_id}"
2024
+
2025
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2026
+
2027
+ if http_call.successful?
2028
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2029
+ else
2030
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2031
+ end
2032
+ end
2033
+
2034
+ # remove a self-hosted runner from a group for an enterprise
2035
+ #
2036
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2037
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2038
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2039
+ #
2040
+ # @return ActionsResult, ActionsErrorResult
2041
+ def remove_a_self_hosted_runner_from_a_group_for_an_enterprise(enterprise, runner_group_id, runner_id, _options)
2042
+ auth = nil
2043
+ body = nil
2044
+ headers = { accept: 'application/vnd.github.v3+json' }
2045
+ params = nil
2046
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runner-groups/#{runner_group_id}/runners/#{runner_id}"
2047
+
2048
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2049
+
2050
+ if http_call.successful?
2051
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2052
+ else
2053
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2054
+ end
2055
+ end
2056
+
2057
+ # list self-hosted runner groups for an organization
2058
+ #
2059
+ # @param org [String]
2060
+ #
2061
+ # @return ActionsResult, ActionsErrorResult
2062
+ def list_self_hosted_runner_groups_for_an_organization(org, options)
2063
+ auth = nil
2064
+ body = nil
2065
+ headers = { accept: 'application/vnd.github.v3+json' }
2066
+ params = { per_page: options[:per_page], page: options[:page] }
2067
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups"
2068
+
2069
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2070
+
2071
+ if http_call.successful?
2072
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2073
+ else
2074
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2075
+ end
2076
+ end
2077
+
2078
+ # create a self-hosted runner group for an organization
2079
+ #
2080
+ # @param org [String]
2081
+ # @param name [String] Required. Name of the runner group.
2082
+ # @param visibility [String] Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: all, selected, or private.Default: all
2083
+ # @param selected_repository_ids [Array of integers] List of repository IDs that can access the runner group.
2084
+ # @param runners [Array of integers] List of runner IDs to add to the runner group.
2085
+ # @param allows_public_repositories [Boolean] Whether the runner group can be used by public repositories.
2086
+ #
2087
+ # @return ActionsResult, ActionsErrorResult
2088
+ def create_a_self_hosted_runner_group_for_an_organization(org, name, visibility, selected_repository_ids, runners, allows_public_repositories, _options)
2089
+ auth = nil
2090
+ body = { name: name, visibility: visibility, selected_repository_ids: selected_repository_ids, runners: runners, allows_public_repositories: allows_public_repositories }
2091
+ headers = { accept: 'application/vnd.github.v3+json' }
2092
+ params = nil
2093
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups"
2094
+
2095
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2096
+
2097
+ if http_call.successful?
2098
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2099
+ else
2100
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2101
+ end
2102
+ end
2103
+
2104
+ # get a self-hosted runner group for an organization
2105
+ #
2106
+ # @param org [String]
2107
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2108
+ #
2109
+ # @return ActionsResult, ActionsErrorResult
2110
+ def get_a_self_hosted_runner_group_for_an_organization(org, runner_group_id, _options)
2111
+ auth = nil
2112
+ body = nil
2113
+ headers = { accept: 'application/vnd.github.v3+json' }
2114
+ params = nil
2115
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}"
2116
+
2117
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2118
+
2119
+ if http_call.successful?
2120
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2121
+ else
2122
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2123
+ end
2124
+ end
2125
+
2126
+ # update a self-hosted runner group for an organization
2127
+ #
2128
+ # @param org [String]
2129
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2130
+ # @param name [String] Required. Name of the runner group.
2131
+ # @param visibility [String] Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: all, selected, or private.
2132
+ # @param allows_public_repositories [Boolean] Whether the runner group can be used by public repositories.
2133
+ #
2134
+ # @return ActionsResult, ActionsErrorResult
2135
+ def update_a_self_hosted_runner_group_for_an_organization(org, runner_group_id, name, visibility, allows_public_repositories, _options)
2136
+ auth = nil
2137
+ body = { name: name, visibility: visibility, allows_public_repositories: allows_public_repositories }
2138
+ headers = { accept: 'application/vnd.github.v3+json' }
2139
+ params = nil
2140
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}"
2141
+
2142
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :patch, params: params, uri: uri)
2143
+
2144
+ if http_call.successful?
2145
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2146
+ else
2147
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2148
+ end
2149
+ end
2150
+
2151
+ # delete a self-hosted runner group from an organization
2152
+ #
2153
+ # @param org [String]
2154
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2155
+ #
2156
+ # @return ActionsResult, ActionsErrorResult
2157
+ def delete_a_self_hosted_runner_group_from_an_organization(org, runner_group_id, _options)
2158
+ auth = nil
2159
+ body = nil
2160
+ headers = { accept: 'application/vnd.github.v3+json' }
2161
+ params = nil
2162
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}"
2163
+
2164
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2165
+
2166
+ if http_call.successful?
2167
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2168
+ else
2169
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2170
+ end
2171
+ end
2172
+
2173
+ # list repository access to a self-hosted runner group in an organization
2174
+ #
2175
+ # @param org [String]
2176
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2177
+ #
2178
+ # @return ActionsResult, ActionsErrorResult
2179
+ def list_repository_access_to_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, options)
2180
+ auth = nil
2181
+ body = nil
2182
+ headers = { accept: 'application/vnd.github.v3+json' }
2183
+ params = { page: options[:page], per_page: options[:per_page] }
2184
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/repositories"
2185
+
2186
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2187
+
2188
+ if http_call.successful?
2189
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2190
+ else
2191
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2192
+ end
2193
+ end
2194
+
2195
+ # set repository access for a self-hosted runner group in an organization
2196
+ #
2197
+ # @param org [String]
2198
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2199
+ # @param selected_repository_ids [Array of integers] Required. List of repository IDs that can access the runner group.
2200
+ #
2201
+ # @return ActionsResult, ActionsErrorResult
2202
+ def set_repository_access_for_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, selected_repository_ids, _options)
2203
+ auth = nil
2204
+ body = { selected_repository_ids: selected_repository_ids }
2205
+ headers = { accept: 'application/vnd.github.v3+json' }
2206
+ params = nil
2207
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/repositories"
2208
+
2209
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2210
+
2211
+ if http_call.successful?
2212
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2213
+ else
2214
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2215
+ end
2216
+ end
2217
+
2218
+ # add repository access to a self-hosted runner group in an organization
2219
+ #
2220
+ # @param org [String]
2221
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2222
+ # @param repository_id [Integer]
2223
+ #
2224
+ # @return ActionsResult, ActionsErrorResult
2225
+ def add_repository_access_to_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, repository_id, _options)
2226
+ auth = nil
2227
+ body = nil
2228
+ headers = { accept: 'application/vnd.github.v3+json' }
2229
+ params = nil
2230
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/repositories/#{repository_id}"
2231
+
2232
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2233
+
2234
+ if http_call.successful?
2235
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2236
+ else
2237
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2238
+ end
2239
+ end
2240
+
2241
+ # remove repository access to a self-hosted runner group in an organization
2242
+ #
2243
+ # @param org [String]
2244
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2245
+ # @param repository_id [Integer]
2246
+ #
2247
+ # @return ActionsResult, ActionsErrorResult
2248
+ def remove_repository_access_to_a_self_hosted_runner_group_in_an_organization(org, runner_group_id, repository_id, _options)
2249
+ auth = nil
2250
+ body = nil
2251
+ headers = { accept: 'application/vnd.github.v3+json' }
2252
+ params = nil
2253
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/repositories/#{repository_id}"
2254
+
2255
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2256
+
2257
+ if http_call.successful?
2258
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2259
+ else
2260
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2261
+ end
2262
+ end
2263
+
2264
+ # list self-hosted runners in a group for an organization
2265
+ #
2266
+ # @param org [String]
2267
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2268
+ #
2269
+ # @return ActionsResult, ActionsErrorResult
2270
+ def list_self_hosted_runners_in_a_group_for_an_organization(org, runner_group_id, options)
2271
+ auth = nil
2272
+ body = nil
2273
+ headers = { accept: 'application/vnd.github.v3+json' }
2274
+ params = { per_page: options[:per_page], page: options[:page] }
2275
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/runners"
2276
+
2277
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2278
+
2279
+ if http_call.successful?
2280
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2281
+ else
2282
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2283
+ end
2284
+ end
2285
+
2286
+ # set self-hosted runners in a group for an organization
2287
+ #
2288
+ # @param org [String]
2289
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2290
+ # @param runners [Array of integers] Required. List of runner IDs to add to the runner group.
2291
+ #
2292
+ # @return ActionsResult, ActionsErrorResult
2293
+ def set_self_hosted_runners_in_a_group_for_an_organization(org, runner_group_id, runners, _options)
2294
+ auth = nil
2295
+ body = { runners: runners }
2296
+ headers = { accept: 'application/vnd.github.v3+json' }
2297
+ params = nil
2298
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/runners"
2299
+
2300
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2301
+
2302
+ if http_call.successful?
2303
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2304
+ else
2305
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2306
+ end
2307
+ end
2308
+
2309
+ # add a self-hosted runner to a group for an organization
2310
+ #
2311
+ # @param org [String]
2312
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2313
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2314
+ #
2315
+ # @return ActionsResult, ActionsErrorResult
2316
+ def add_a_self_hosted_runner_to_a_group_for_an_organization(org, runner_group_id, runner_id, _options)
2317
+ auth = nil
2318
+ body = nil
2319
+ headers = { accept: 'application/vnd.github.v3+json' }
2320
+ params = nil
2321
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/runners/#{runner_id}"
2322
+
2323
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2324
+
2325
+ if http_call.successful?
2326
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2327
+ else
2328
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2329
+ end
2330
+ end
2331
+
2332
+ # remove a self-hosted runner from a group for an organization
2333
+ #
2334
+ # @param org [String]
2335
+ # @param runner_group_id [Integer] Unique identifier of the self-hosted runner group.
2336
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2337
+ #
2338
+ # @return ActionsResult, ActionsErrorResult
2339
+ def remove_a_self_hosted_runner_from_a_group_for_an_organization(org, runner_group_id, runner_id, _options)
2340
+ auth = nil
2341
+ body = nil
2342
+ headers = { accept: 'application/vnd.github.v3+json' }
2343
+ params = nil
2344
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runner-groups/#{runner_group_id}/runners/#{runner_id}"
2345
+
2346
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2347
+
2348
+ if http_call.successful?
2349
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2350
+ else
2351
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2352
+ end
2353
+ end
2354
+
2355
+ # list self-hosted runners for an enterprise
2356
+ #
2357
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2358
+ #
2359
+ # @return ActionsResult, ActionsErrorResult
2360
+ def list_self_hosted_runners_for_an_enterprise(enterprise, options)
2361
+ auth = nil
2362
+ body = nil
2363
+ headers = { accept: 'application/vnd.github.v3+json' }
2364
+ params = { per_page: options[:per_page], page: options[:page] }
2365
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners"
2366
+
2367
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2368
+
2369
+ if http_call.successful?
2370
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2371
+ else
2372
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2373
+ end
2374
+ end
2375
+
2376
+ # list runner applications for an enterprise
2377
+ #
2378
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2379
+ #
2380
+ # @return ActionsResult, ActionsErrorResult
2381
+ def list_runner_applications_for_an_enterprise(enterprise, _options)
2382
+ auth = nil
2383
+ body = nil
2384
+ headers = { accept: 'application/vnd.github.v3+json' }
2385
+ params = nil
2386
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/downloads"
2387
+
2388
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2389
+
2390
+ if http_call.successful?
2391
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2392
+ else
2393
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2394
+ end
2395
+ end
2396
+
2397
+ # create a registration token for an enterprise
2398
+ #
2399
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2400
+ #
2401
+ # @return ActionsResult, ActionsErrorResult
2402
+ def create_a_registration_token_for_an_enterprise(_enterprise, _options)
2403
+ auth = nil
2404
+ body = nil
2405
+ headers = { accept: 'application/vnd.github.v3+json' }
2406
+ params = nil
2407
+ uri = "#{Gitabu::BASE_URL}./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN
2408
+ "
2409
+
2410
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2411
+
2412
+ if http_call.successful?
2413
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2414
+ else
2415
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2416
+ end
2417
+ end
2418
+
2419
+ # create a remove token for an enterprise
2420
+ #
2421
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2422
+ #
2423
+ # @return ActionsResult, ActionsErrorResult
2424
+ def create_a_remove_token_for_an_enterprise(_enterprise, _options)
2425
+ auth = nil
2426
+ body = nil
2427
+ headers = { accept: 'application/vnd.github.v3+json' }
2428
+ params = nil
2429
+ uri = "#{Gitabu::BASE_URL}./config.sh remove --token TOKEN
2430
+ "
2431
+
2432
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2433
+
2434
+ if http_call.successful?
2435
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2436
+ else
2437
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2438
+ end
2439
+ end
2440
+
2441
+ # get a self-hosted runner for an enterprise
2442
+ #
2443
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2444
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2445
+ #
2446
+ # @return ActionsResult, ActionsErrorResult
2447
+ def get_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, _options)
2448
+ auth = nil
2449
+ body = nil
2450
+ headers = { accept: 'application/vnd.github.v3+json' }
2451
+ params = nil
2452
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/#{runner_id}"
2453
+
2454
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2455
+
2456
+ if http_call.successful?
2457
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2458
+ else
2459
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2460
+ end
2461
+ end
2462
+
2463
+ # delete a self-hosted runner from an enterprise
2464
+ #
2465
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2466
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2467
+ #
2468
+ # @return ActionsResult, ActionsErrorResult
2469
+ def delete_a_self_hosted_runner_from_an_enterprise(enterprise, runner_id, _options)
2470
+ auth = nil
2471
+ body = nil
2472
+ headers = { accept: 'application/vnd.github.v3+json' }
2473
+ params = nil
2474
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/#{runner_id}"
2475
+
2476
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2477
+
2478
+ if http_call.successful?
2479
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2480
+ else
2481
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2482
+ end
2483
+ end
2484
+
2485
+ # list labels for a self-hosted runner for an enterprise
2486
+ #
2487
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2488
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2489
+ #
2490
+ # @return ActionsResult, ActionsErrorResult
2491
+ def list_labels_for_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, _options)
2492
+ auth = nil
2493
+ body = nil
2494
+ headers = { accept: 'application/vnd.github.v3+json' }
2495
+ params = nil
2496
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/#{runner_id}/labels"
2497
+
2498
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2499
+
2500
+ if http_call.successful?
2501
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2502
+ else
2503
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2504
+ end
2505
+ end
2506
+
2507
+ # add custom labels to a self-hosted runner for an enterprise
2508
+ #
2509
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2510
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2511
+ # @param labels [Array of strings] Required. The names of the custom labels to add to the runner.
2512
+ #
2513
+ # @return ActionsResult, ActionsErrorResult
2514
+ def add_custom_labels_to_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, labels, _options)
2515
+ auth = nil
2516
+ body = { labels: labels }
2517
+ headers = { accept: 'application/vnd.github.v3+json' }
2518
+ params = nil
2519
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/#{runner_id}/labels"
2520
+
2521
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2522
+
2523
+ if http_call.successful?
2524
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2525
+ else
2526
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2527
+ end
2528
+ end
2529
+
2530
+ # set custom labels for a self-hosted runner for an enterprise
2531
+ #
2532
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2533
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2534
+ # @param labels [Array of strings] Required. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.
2535
+ #
2536
+ # @return ActionsResult, ActionsErrorResult
2537
+ def set_custom_labels_for_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, labels, _options)
2538
+ auth = nil
2539
+ body = { labels: labels }
2540
+ headers = { accept: 'application/vnd.github.v3+json' }
2541
+ params = nil
2542
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/#{runner_id}/labels"
2543
+
2544
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2545
+
2546
+ if http_call.successful?
2547
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2548
+ else
2549
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2550
+ end
2551
+ end
2552
+
2553
+ # remove all custom labels from a self-hosted runner for an enterprise
2554
+ #
2555
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2556
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2557
+ #
2558
+ # @return ActionsResult, ActionsErrorResult
2559
+ def remove_all_custom_labels_from_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, _options)
2560
+ auth = nil
2561
+ body = nil
2562
+ headers = { accept: 'application/vnd.github.v3+json' }
2563
+ params = nil
2564
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/#{runner_id}/labels"
2565
+
2566
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2567
+
2568
+ if http_call.successful?
2569
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2570
+ else
2571
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2572
+ end
2573
+ end
2574
+
2575
+ # remove a custom label from a self-hosted runner for an enterprise
2576
+ #
2577
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
2578
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2579
+ # @param name [String] The name of a self-hosted runner's custom label.
2580
+ #
2581
+ # @return ActionsResult, ActionsErrorResult
2582
+ def remove_a_custom_label_from_a_self_hosted_runner_for_an_enterprise(enterprise, runner_id, name, _options)
2583
+ auth = nil
2584
+ body = nil
2585
+ headers = { accept: 'application/vnd.github.v3+json' }
2586
+ params = nil
2587
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/actions/runners/#{runner_id}/labels/#{name}"
2588
+
2589
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2590
+
2591
+ if http_call.successful?
2592
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2593
+ else
2594
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2595
+ end
2596
+ end
2597
+
2598
+ # list self-hosted runners for an organization
2599
+ #
2600
+ # @param org [String]
2601
+ #
2602
+ # @return ActionsResult, ActionsErrorResult
2603
+ def list_self_hosted_runners_for_an_organization(org, options)
2604
+ auth = nil
2605
+ body = nil
2606
+ headers = { accept: 'application/vnd.github.v3+json' }
2607
+ params = { per_page: options[:per_page], page: options[:page] }
2608
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners"
2609
+
2610
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2611
+
2612
+ if http_call.successful?
2613
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2614
+ else
2615
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2616
+ end
2617
+ end
2618
+
2619
+ # list runner applications for an organization
2620
+ #
2621
+ # @param org [String]
2622
+ #
2623
+ # @return ActionsResult, ActionsErrorResult
2624
+ def list_runner_applications_for_an_organization(org, _options)
2625
+ auth = nil
2626
+ body = nil
2627
+ headers = { accept: 'application/vnd.github.v3+json' }
2628
+ params = nil
2629
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/downloads"
2630
+
2631
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2632
+
2633
+ if http_call.successful?
2634
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2635
+ else
2636
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2637
+ end
2638
+ end
2639
+
2640
+ # create a registration token for an organization
2641
+ #
2642
+ # @param org [String]
2643
+ #
2644
+ # @return ActionsResult, ActionsErrorResult
2645
+ def create_a_registration_token_for_an_organization(_org, _options)
2646
+ auth = nil
2647
+ body = nil
2648
+ headers = { accept: 'application/vnd.github.v3+json' }
2649
+ params = nil
2650
+ uri = "#{Gitabu::BASE_URL}./config.sh --url https://github.com/octo-org --token TOKEN
2651
+ "
2652
+
2653
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2654
+
2655
+ if http_call.successful?
2656
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2657
+ else
2658
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2659
+ end
2660
+ end
2661
+
2662
+ # create a remove token for an organization
2663
+ #
2664
+ # @param org [String]
2665
+ #
2666
+ # @return ActionsResult, ActionsErrorResult
2667
+ def create_a_remove_token_for_an_organization(_org, _options)
2668
+ auth = nil
2669
+ body = nil
2670
+ headers = { accept: 'application/vnd.github.v3+json' }
2671
+ params = nil
2672
+ uri = "#{Gitabu::BASE_URL}./config.sh remove --token TOKEN
2673
+ "
2674
+
2675
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2676
+
2677
+ if http_call.successful?
2678
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2679
+ else
2680
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2681
+ end
2682
+ end
2683
+
2684
+ # get a self-hosted runner for an organization
2685
+ #
2686
+ # @param org [String]
2687
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2688
+ #
2689
+ # @return ActionsResult, ActionsErrorResult
2690
+ def get_a_self_hosted_runner_for_an_organization(org, runner_id, _options)
2691
+ auth = nil
2692
+ body = nil
2693
+ headers = { accept: 'application/vnd.github.v3+json' }
2694
+ params = nil
2695
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/#{runner_id}"
2696
+
2697
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2698
+
2699
+ if http_call.successful?
2700
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2701
+ else
2702
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2703
+ end
2704
+ end
2705
+
2706
+ # delete a self-hosted runner from an organization
2707
+ #
2708
+ # @param org [String]
2709
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2710
+ #
2711
+ # @return ActionsResult, ActionsErrorResult
2712
+ def delete_a_self_hosted_runner_from_an_organization(org, runner_id, _options)
2713
+ auth = nil
2714
+ body = nil
2715
+ headers = { accept: 'application/vnd.github.v3+json' }
2716
+ params = nil
2717
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/#{runner_id}"
2718
+
2719
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2720
+
2721
+ if http_call.successful?
2722
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2723
+ else
2724
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2725
+ end
2726
+ end
2727
+
2728
+ # list labels for a self-hosted runner for an organization
2729
+ #
2730
+ # @param org [String]
2731
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2732
+ #
2733
+ # @return ActionsResult, ActionsErrorResult
2734
+ def list_labels_for_a_self_hosted_runner_for_an_organization(org, runner_id, _options)
2735
+ auth = nil
2736
+ body = nil
2737
+ headers = { accept: 'application/vnd.github.v3+json' }
2738
+ params = nil
2739
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/#{runner_id}/labels"
2740
+
2741
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2742
+
2743
+ if http_call.successful?
2744
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2745
+ else
2746
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2747
+ end
2748
+ end
2749
+
2750
+ # add custom labels to a self-hosted runner for an organization
2751
+ #
2752
+ # @param org [String]
2753
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2754
+ # @param labels [Array of strings] Required. The names of the custom labels to add to the runner.
2755
+ #
2756
+ # @return ActionsResult, ActionsErrorResult
2757
+ def add_custom_labels_to_a_self_hosted_runner_for_an_organization(org, runner_id, labels, _options)
2758
+ auth = nil
2759
+ body = { labels: labels }
2760
+ headers = { accept: 'application/vnd.github.v3+json' }
2761
+ params = nil
2762
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/#{runner_id}/labels"
2763
+
2764
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2765
+
2766
+ if http_call.successful?
2767
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2768
+ else
2769
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2770
+ end
2771
+ end
2772
+
2773
+ # set custom labels for a self-hosted runner for an organization
2774
+ #
2775
+ # @param org [String]
2776
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2777
+ # @param labels [Array of strings] Required. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.
2778
+ #
2779
+ # @return ActionsResult, ActionsErrorResult
2780
+ def set_custom_labels_for_a_self_hosted_runner_for_an_organization(org, runner_id, labels, _options)
2781
+ auth = nil
2782
+ body = { labels: labels }
2783
+ headers = { accept: 'application/vnd.github.v3+json' }
2784
+ params = nil
2785
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/#{runner_id}/labels"
2786
+
2787
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
2788
+
2789
+ if http_call.successful?
2790
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2791
+ else
2792
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2793
+ end
2794
+ end
2795
+
2796
+ # remove all custom labels from a self-hosted runner for an organization
2797
+ #
2798
+ # @param org [String]
2799
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2800
+ #
2801
+ # @return ActionsResult, ActionsErrorResult
2802
+ def remove_all_custom_labels_from_a_self_hosted_runner_for_an_organization(org, runner_id, _options)
2803
+ auth = nil
2804
+ body = nil
2805
+ headers = { accept: 'application/vnd.github.v3+json' }
2806
+ params = nil
2807
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/#{runner_id}/labels"
2808
+
2809
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2810
+
2811
+ if http_call.successful?
2812
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2813
+ else
2814
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2815
+ end
2816
+ end
2817
+
2818
+ # remove a custom label from a self-hosted runner for an organization
2819
+ #
2820
+ # @param org [String]
2821
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2822
+ # @param name [String] The name of a self-hosted runner's custom label.
2823
+ #
2824
+ # @return ActionsResult, ActionsErrorResult
2825
+ def remove_a_custom_label_from_a_self_hosted_runner_for_an_organization(org, runner_id, name, _options)
2826
+ auth = nil
2827
+ body = nil
2828
+ headers = { accept: 'application/vnd.github.v3+json' }
2829
+ params = nil
2830
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/actions/runners/#{runner_id}/labels/#{name}"
2831
+
2832
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2833
+
2834
+ if http_call.successful?
2835
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2836
+ else
2837
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2838
+ end
2839
+ end
2840
+
2841
+ # list self-hosted runners for a repository
2842
+ #
2843
+ # @param owner [String]
2844
+ # @param repo [String]
2845
+ #
2846
+ # @return ActionsResult, ActionsErrorResult
2847
+ def list_self_hosted_runners_for_a_repository(owner, repo, options)
2848
+ auth = nil
2849
+ body = nil
2850
+ headers = { accept: 'application/vnd.github.v3+json' }
2851
+ params = { per_page: options[:per_page], page: options[:page] }
2852
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners"
2853
+
2854
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2855
+
2856
+ if http_call.successful?
2857
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2858
+ else
2859
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2860
+ end
2861
+ end
2862
+
2863
+ # list runner applications for a repository
2864
+ #
2865
+ # @param owner [String]
2866
+ # @param repo [String]
2867
+ #
2868
+ # @return ActionsResult, ActionsErrorResult
2869
+ def list_runner_applications_for_a_repository(owner, repo, _options)
2870
+ auth = nil
2871
+ body = nil
2872
+ headers = { accept: 'application/vnd.github.v3+json' }
2873
+ params = nil
2874
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/downloads"
2875
+
2876
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2877
+
2878
+ if http_call.successful?
2879
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2880
+ else
2881
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2882
+ end
2883
+ end
2884
+
2885
+ # create a registration token for a repository
2886
+ #
2887
+ # @param owner [String]
2888
+ # @param repo [String]
2889
+ #
2890
+ # @return ActionsResult, ActionsErrorResult
2891
+ def create_a_registration_token_for_a_repository(_owner, _repo, _options)
2892
+ auth = nil
2893
+ body = nil
2894
+ headers = { accept: 'application/vnd.github.v3+json' }
2895
+ params = nil
2896
+ uri = "#{Gitabu::BASE_URL}./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN
2897
+ "
2898
+
2899
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2900
+
2901
+ if http_call.successful?
2902
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2903
+ else
2904
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2905
+ end
2906
+ end
2907
+
2908
+ # create a remove token for a repository
2909
+ #
2910
+ # @param owner [String]
2911
+ # @param repo [String]
2912
+ #
2913
+ # @return ActionsResult, ActionsErrorResult
2914
+ def create_a_remove_token_for_a_repository(_owner, _repo, _options)
2915
+ auth = nil
2916
+ body = nil
2917
+ headers = { accept: 'application/vnd.github.v3+json' }
2918
+ params = nil
2919
+ uri = "#{Gitabu::BASE_URL}./config.sh remove --token TOKEN
2920
+ "
2921
+
2922
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
2923
+
2924
+ if http_call.successful?
2925
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2926
+ else
2927
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2928
+ end
2929
+ end
2930
+
2931
+ # get a self-hosted runner for a repository
2932
+ #
2933
+ # @param owner [String]
2934
+ # @param repo [String]
2935
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2936
+ #
2937
+ # @return ActionsResult, ActionsErrorResult
2938
+ def get_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, _options)
2939
+ auth = nil
2940
+ body = nil
2941
+ headers = { accept: 'application/vnd.github.v3+json' }
2942
+ params = nil
2943
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/#{runner_id}"
2944
+
2945
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2946
+
2947
+ if http_call.successful?
2948
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2949
+ else
2950
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2951
+ end
2952
+ end
2953
+
2954
+ # delete a self-hosted runner from a repository
2955
+ #
2956
+ # @param owner [String]
2957
+ # @param repo [String]
2958
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2959
+ #
2960
+ # @return ActionsResult, ActionsErrorResult
2961
+ def delete_a_self_hosted_runner_from_a_repository(owner, repo, runner_id, _options)
2962
+ auth = nil
2963
+ body = nil
2964
+ headers = { accept: 'application/vnd.github.v3+json' }
2965
+ params = nil
2966
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/#{runner_id}"
2967
+
2968
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
2969
+
2970
+ if http_call.successful?
2971
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2972
+ else
2973
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2974
+ end
2975
+ end
2976
+
2977
+ # list labels for a self-hosted runner for a repository
2978
+ #
2979
+ # @param owner [String]
2980
+ # @param repo [String]
2981
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
2982
+ #
2983
+ # @return ActionsResult, ActionsErrorResult
2984
+ def list_labels_for_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, _options)
2985
+ auth = nil
2986
+ body = nil
2987
+ headers = { accept: 'application/vnd.github.v3+json' }
2988
+ params = nil
2989
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/#{runner_id}/labels"
2990
+
2991
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
2992
+
2993
+ if http_call.successful?
2994
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
2995
+ else
2996
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
2997
+ end
2998
+ end
2999
+
3000
+ # add custom labels to a self-hosted runner for a repository
3001
+ #
3002
+ # @param owner [String]
3003
+ # @param repo [String]
3004
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
3005
+ # @param labels [Array of strings] Required. The names of the custom labels to add to the runner.
3006
+ #
3007
+ # @return ActionsResult, ActionsErrorResult
3008
+ def add_custom_labels_to_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, labels, _options)
3009
+ auth = nil
3010
+ body = { labels: labels }
3011
+ headers = { accept: 'application/vnd.github.v3+json' }
3012
+ params = nil
3013
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/#{runner_id}/labels"
3014
+
3015
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3016
+
3017
+ if http_call.successful?
3018
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3019
+ else
3020
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3021
+ end
3022
+ end
3023
+
3024
+ # set custom labels for a self-hosted runner for a repository
3025
+ #
3026
+ # @param owner [String]
3027
+ # @param repo [String]
3028
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
3029
+ # @param labels [Array of strings] Required. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.
3030
+ #
3031
+ # @return ActionsResult, ActionsErrorResult
3032
+ def set_custom_labels_for_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, labels, _options)
3033
+ auth = nil
3034
+ body = { labels: labels }
3035
+ headers = { accept: 'application/vnd.github.v3+json' }
3036
+ params = nil
3037
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/#{runner_id}/labels"
3038
+
3039
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
3040
+
3041
+ if http_call.successful?
3042
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3043
+ else
3044
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3045
+ end
3046
+ end
3047
+
3048
+ # remove all custom labels from a self-hosted runner for a repository
3049
+ #
3050
+ # @param owner [String]
3051
+ # @param repo [String]
3052
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
3053
+ #
3054
+ # @return ActionsResult, ActionsErrorResult
3055
+ def remove_all_custom_labels_from_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, _options)
3056
+ auth = nil
3057
+ body = nil
3058
+ headers = { accept: 'application/vnd.github.v3+json' }
3059
+ params = nil
3060
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/#{runner_id}/labels"
3061
+
3062
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
3063
+
3064
+ if http_call.successful?
3065
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3066
+ else
3067
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3068
+ end
3069
+ end
3070
+
3071
+ # remove a custom label from a self-hosted runner for a repository
3072
+ #
3073
+ # @param owner [String]
3074
+ # @param repo [String]
3075
+ # @param runner_id [Integer] Unique identifier of the self-hosted runner.
3076
+ # @param name [String] The name of a self-hosted runner's custom label.
3077
+ #
3078
+ # @return ActionsResult, ActionsErrorResult
3079
+ def remove_a_custom_label_from_a_self_hosted_runner_for_a_repository(owner, repo, runner_id, name, _options)
3080
+ auth = nil
3081
+ body = nil
3082
+ headers = { accept: 'application/vnd.github.v3+json' }
3083
+ params = nil
3084
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runners/#{runner_id}/labels/#{name}"
3085
+
3086
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
3087
+
3088
+ if http_call.successful?
3089
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3090
+ else
3091
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3092
+ end
3093
+ end
3094
+
3095
+ # get a job for a workflow run
3096
+ #
3097
+ # @param owner [String]
3098
+ # @param repo [String]
3099
+ # @param job_id [Integer] job_id parameter
3100
+ #
3101
+ # @return ActionsResult, ActionsErrorResult
3102
+ def get_a_job_for_a_workflow_run(owner, repo, job_id, _options)
3103
+ auth = nil
3104
+ body = nil
3105
+ headers = { accept: 'application/vnd.github.v3+json' }
3106
+ params = nil
3107
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/jobs/#{job_id}"
3108
+
3109
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3110
+
3111
+ if http_call.successful?
3112
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3113
+ else
3114
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3115
+ end
3116
+ end
3117
+
3118
+ # download job logs for a workflow run
3119
+ #
3120
+ # @param owner [String]
3121
+ # @param repo [String]
3122
+ # @param job_id [Integer] job_id parameter
3123
+ #
3124
+ # @return ActionsResult, ActionsErrorResult
3125
+ def download_job_logs_for_a_workflow_run(owner, repo, job_id, _options)
3126
+ auth = nil
3127
+ body = nil
3128
+ headers = { accept: 'application/vnd.github.v3+json' }
3129
+ params = nil
3130
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/jobs/#{job_id}/logs"
3131
+
3132
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3133
+
3134
+ if http_call.successful?
3135
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3136
+ else
3137
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3138
+ end
3139
+ end
3140
+
3141
+ # list jobs for a workflow run attempt
3142
+ #
3143
+ # @param owner [String]
3144
+ # @param repo [String]
3145
+ # @param run_id [Integer] The id of the workflow run.
3146
+ # @param attempt_number [Integer] The attempt number of the workflow run.
3147
+ #
3148
+ # @return ActionsResult, ActionsErrorResult
3149
+ def list_jobs_for_a_workflow_run_attempt(owner, repo, run_id, attempt_number, options)
3150
+ auth = nil
3151
+ body = nil
3152
+ headers = { accept: 'application/vnd.github.v3+json' }
3153
+ params = { per_page: options[:per_page], page: options[:page] }
3154
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/attempts/#{attempt_number}/jobs"
3155
+
3156
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3157
+
3158
+ if http_call.successful?
3159
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3160
+ else
3161
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3162
+ end
3163
+ end
3164
+
3165
+ # list jobs for a workflow run
3166
+ #
3167
+ # @param owner [String]
3168
+ # @param repo [String]
3169
+ # @param run_id [Integer] The id of the workflow run.
3170
+ #
3171
+ # @return ActionsResult, ActionsErrorResult
3172
+ def list_jobs_for_a_workflow_run(owner, repo, run_id, options)
3173
+ auth = nil
3174
+ body = nil
3175
+ headers = { accept: 'application/vnd.github.v3+json' }
3176
+ params = { filter: options[:filter], per_page: options[:per_page], page: options[:page] }
3177
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/jobs"
3178
+
3179
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3180
+
3181
+ if http_call.successful?
3182
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3183
+ else
3184
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3185
+ end
3186
+ end
3187
+
3188
+ # re-run a job from a workflow run
3189
+ #
3190
+ # @param owner [String]
3191
+ # @param repo [String]
3192
+ # @param job_id [Integer] job_id parameter
3193
+ #
3194
+ # @return ActionsResult, ActionsErrorResult
3195
+ def re_run_a_job_from_a_workflow_run(owner, repo, job_id, _options)
3196
+ auth = nil
3197
+ body = nil
3198
+ headers = { accept: 'application/vnd.github.v3+json' }
3199
+ params = nil
3200
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/jobs/#{job_id}/rerun"
3201
+
3202
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3203
+
3204
+ if http_call.successful?
3205
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3206
+ else
3207
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3208
+ end
3209
+ end
3210
+
3211
+ # list workflow runs for a repository
3212
+ #
3213
+ # @param owner [String]
3214
+ # @param repo [String]
3215
+ #
3216
+ # @return ActionsResult, ActionsErrorResult
3217
+ def list_workflow_runs_for_a_repository(owner, repo, options)
3218
+ auth = nil
3219
+ body = nil
3220
+ headers = { accept: 'application/vnd.github.v3+json' }
3221
+ params = { actor: options[:actor], branch: options[:branch], event: options[:event], status: options[:status], per_page: options[:per_page], page: options[:page], created: options[:created], exclude_pull_requests: options[:exclude_pull_requests], check_suite_id: options[:check_suite_id] }
3222
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs"
3223
+
3224
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3225
+
3226
+ if http_call.successful?
3227
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3228
+ else
3229
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3230
+ end
3231
+ end
3232
+
3233
+ # get a workflow run
3234
+ #
3235
+ # @param owner [String]
3236
+ # @param repo [String]
3237
+ # @param run_id [Integer] The id of the workflow run.
3238
+ #
3239
+ # @return ActionsResult, ActionsErrorResult
3240
+ def get_a_workflow_run(owner, repo, run_id, options)
3241
+ auth = nil
3242
+ body = nil
3243
+ headers = { accept: 'application/vnd.github.v3+json' }
3244
+ params = { exclude_pull_requests: options[:exclude_pull_requests] }
3245
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}"
3246
+
3247
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3248
+
3249
+ if http_call.successful?
3250
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3251
+ else
3252
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3253
+ end
3254
+ end
3255
+
3256
+ # delete a workflow run
3257
+ #
3258
+ # @param owner [String]
3259
+ # @param repo [String]
3260
+ # @param run_id [Integer] The id of the workflow run.
3261
+ #
3262
+ # @return ActionsResult, ActionsErrorResult
3263
+ def delete_a_workflow_run(owner, repo, run_id, _options)
3264
+ auth = nil
3265
+ body = nil
3266
+ headers = { accept: 'application/vnd.github.v3+json' }
3267
+ params = nil
3268
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}"
3269
+
3270
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
3271
+
3272
+ if http_call.successful?
3273
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3274
+ else
3275
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3276
+ end
3277
+ end
3278
+
3279
+ # get the review history for a workflow run
3280
+ #
3281
+ # @param owner [String]
3282
+ # @param repo [String]
3283
+ # @param run_id [Integer] The id of the workflow run.
3284
+ #
3285
+ # @return ActionsResult, ActionsErrorResult
3286
+ def get_the_review_history_for_a_workflow_run(owner, repo, run_id, _options)
3287
+ auth = nil
3288
+ body = nil
3289
+ headers = { accept: 'application/vnd.github.v3+json' }
3290
+ params = nil
3291
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/approvals"
3292
+
3293
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3294
+
3295
+ if http_call.successful?
3296
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3297
+ else
3298
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3299
+ end
3300
+ end
3301
+
3302
+ # approve a workflow run for a fork pull request
3303
+ #
3304
+ # @param owner [String]
3305
+ # @param repo [String]
3306
+ # @param run_id [Integer] The id of the workflow run.
3307
+ #
3308
+ # @return ActionsResult, ActionsErrorResult
3309
+ def approve_a_workflow_run_for_a_fork_pull_request(owner, repo, run_id, _options)
3310
+ auth = nil
3311
+ body = nil
3312
+ headers = { accept: 'application/vnd.github.v3+json' }
3313
+ params = nil
3314
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/approve"
3315
+
3316
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3317
+
3318
+ if http_call.successful?
3319
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3320
+ else
3321
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3322
+ end
3323
+ end
3324
+
3325
+ # get a workflow run attempt
3326
+ #
3327
+ # @param owner [String]
3328
+ # @param repo [String]
3329
+ # @param run_id [Integer] The id of the workflow run.
3330
+ # @param attempt_number [Integer] The attempt number of the workflow run.
3331
+ #
3332
+ # @return ActionsResult, ActionsErrorResult
3333
+ def get_a_workflow_run_attempt(owner, repo, run_id, attempt_number, options)
3334
+ auth = nil
3335
+ body = nil
3336
+ headers = { accept: 'application/vnd.github.v3+json' }
3337
+ params = { exclude_pull_requests: options[:exclude_pull_requests] }
3338
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/attempts/#{attempt_number}"
3339
+
3340
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3341
+
3342
+ if http_call.successful?
3343
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3344
+ else
3345
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3346
+ end
3347
+ end
3348
+
3349
+ # download workflow run attempt logs
3350
+ #
3351
+ # @param owner [String]
3352
+ # @param repo [String]
3353
+ # @param run_id [Integer] The id of the workflow run.
3354
+ # @param attempt_number [Integer] The attempt number of the workflow run.
3355
+ #
3356
+ # @return ActionsResult, ActionsErrorResult
3357
+ def download_workflow_run_attempt_logs(owner, repo, run_id, attempt_number, _options)
3358
+ auth = nil
3359
+ body = nil
3360
+ headers = { accept: 'application/vnd.github.v3+json' }
3361
+ params = nil
3362
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/attempts/#{attempt_number}/logs"
3363
+
3364
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3365
+
3366
+ if http_call.successful?
3367
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3368
+ else
3369
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3370
+ end
3371
+ end
3372
+
3373
+ # cancel a workflow run
3374
+ #
3375
+ # @param owner [String]
3376
+ # @param repo [String]
3377
+ # @param run_id [Integer] The id of the workflow run.
3378
+ #
3379
+ # @return ActionsResult, ActionsErrorResult
3380
+ def cancel_a_workflow_run(owner, repo, run_id, _options)
3381
+ auth = nil
3382
+ body = nil
3383
+ headers = { accept: 'application/vnd.github.v3+json' }
3384
+ params = nil
3385
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/cancel"
3386
+
3387
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3388
+
3389
+ if http_call.successful?
3390
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3391
+ else
3392
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3393
+ end
3394
+ end
3395
+
3396
+ # download workflow run logs
3397
+ #
3398
+ # @param owner [String]
3399
+ # @param repo [String]
3400
+ # @param run_id [Integer] The id of the workflow run.
3401
+ #
3402
+ # @return ActionsResult, ActionsErrorResult
3403
+ def download_workflow_run_logs(owner, repo, run_id, _options)
3404
+ auth = nil
3405
+ body = nil
3406
+ headers = { accept: 'application/vnd.github.v3+json' }
3407
+ params = nil
3408
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/logs"
3409
+
3410
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3411
+
3412
+ if http_call.successful?
3413
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3414
+ else
3415
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3416
+ end
3417
+ end
3418
+
3419
+ # delete workflow run logs
3420
+ #
3421
+ # @param owner [String]
3422
+ # @param repo [String]
3423
+ # @param run_id [Integer] The id of the workflow run.
3424
+ #
3425
+ # @return ActionsResult, ActionsErrorResult
3426
+ def delete_workflow_run_logs(owner, repo, run_id, _options)
3427
+ auth = nil
3428
+ body = nil
3429
+ headers = { accept: 'application/vnd.github.v3+json' }
3430
+ params = nil
3431
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/logs"
3432
+
3433
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
3434
+
3435
+ if http_call.successful?
3436
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3437
+ else
3438
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3439
+ end
3440
+ end
3441
+
3442
+ # get pending deployments for a workflow run
3443
+ #
3444
+ # @param owner [String]
3445
+ # @param repo [String]
3446
+ # @param run_id [Integer] The id of the workflow run.
3447
+ #
3448
+ # @return ActionsResult, ActionsErrorResult
3449
+ def get_pending_deployments_for_a_workflow_run(owner, repo, run_id, _options)
3450
+ auth = nil
3451
+ body = nil
3452
+ headers = { accept: 'application/vnd.github.v3+json' }
3453
+ params = nil
3454
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/pending_deployments"
3455
+
3456
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3457
+
3458
+ if http_call.successful?
3459
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3460
+ else
3461
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3462
+ end
3463
+ end
3464
+
3465
+ # REVIEW: pending deployments for a workflow run
3466
+ #
3467
+ # @param owner [String]
3468
+ # @param repo [String]
3469
+ # @param run_id [Integer] The id of the workflow run.
3470
+ # @param environment_ids [Array of integers] Required. The list of environment ids to approve or reject
3471
+ # @param state [String] Required. Whether to approve or reject deployment to the specified environments. Must be one of: approved or rejected
3472
+ # @param comment [String] Required. A comment to accompany the deployment review
3473
+ #
3474
+ # @return ActionsResult, ActionsErrorResult
3475
+ def review_pending_deployments_for_a_workflow_run(owner, repo, run_id, environment_ids, state, comment, _options)
3476
+ auth = nil
3477
+ body = { environment_ids: environment_ids, state: state, comment: comment }
3478
+ headers = { accept: 'application/vnd.github.v3+json' }
3479
+ params = nil
3480
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/pending_deployments"
3481
+
3482
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3483
+
3484
+ if http_call.successful?
3485
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3486
+ else
3487
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3488
+ end
3489
+ end
3490
+
3491
+ # re-run a workflow
3492
+ #
3493
+ # @param owner [String]
3494
+ # @param repo [String]
3495
+ # @param run_id [Integer] The id of the workflow run.
3496
+ #
3497
+ # @return ActionsResult, ActionsErrorResult
3498
+ def re_run_a_workflow(owner, repo, run_id, _options)
3499
+ auth = nil
3500
+ body = nil
3501
+ headers = { accept: 'application/vnd.github.v3+json' }
3502
+ params = nil
3503
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/rerun"
3504
+
3505
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3506
+
3507
+ if http_call.successful?
3508
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3509
+ else
3510
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3511
+ end
3512
+ end
3513
+
3514
+ # re-run failed jobs from a workflow run
3515
+ #
3516
+ # @param owner [String]
3517
+ # @param repo [String]
3518
+ # @param run_id [Integer] The id of the workflow run.
3519
+ #
3520
+ # @return ActionsResult, ActionsErrorResult
3521
+ def re_run_failed_jobs_from_a_workflow_run(owner, repo, run_id, _options)
3522
+ auth = nil
3523
+ body = nil
3524
+ headers = { accept: 'application/vnd.github.v3+json' }
3525
+ params = nil
3526
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/rerun-failed-jobs"
3527
+
3528
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3529
+
3530
+ if http_call.successful?
3531
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3532
+ else
3533
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3534
+ end
3535
+ end
3536
+
3537
+ # get workflow run usage
3538
+ #
3539
+ # @param owner [String]
3540
+ # @param repo [String]
3541
+ # @param run_id [Integer] The id of the workflow run.
3542
+ #
3543
+ # @return ActionsResult, ActionsErrorResult
3544
+ def get_workflow_run_usage(owner, repo, run_id, _options)
3545
+ auth = nil
3546
+ body = nil
3547
+ headers = { accept: 'application/vnd.github.v3+json' }
3548
+ params = nil
3549
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/runs/#{run_id}/timing"
3550
+
3551
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3552
+
3553
+ if http_call.successful?
3554
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3555
+ else
3556
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3557
+ end
3558
+ end
3559
+
3560
+ # list workflow runs
3561
+ #
3562
+ # @param owner [String]
3563
+ # @param repo [String]
3564
+ # @param workflow_id [] The ID of the workflow. You can also pass the workflow file name as a string.
3565
+ #
3566
+ # @return ActionsResult, ActionsErrorResult
3567
+ def list_workflow_runs(owner, repo, workflow_id, options)
3568
+ auth = nil
3569
+ body = nil
3570
+ headers = { accept: 'application/vnd.github.v3+json' }
3571
+ params = { actor: options[:actor], branch: options[:branch], event: options[:event], status: options[:status], per_page: options[:per_page], page: options[:page], created: options[:created], exclude_pull_requests: options[:exclude_pull_requests], check_suite_id: options[:check_suite_id] }
3572
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/workflows/#{workflow_id}/runs"
3573
+
3574
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3575
+
3576
+ if http_call.successful?
3577
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3578
+ else
3579
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3580
+ end
3581
+ end
3582
+
3583
+ # list repository workflows
3584
+ #
3585
+ # @param owner [String]
3586
+ # @param repo [String]
3587
+ #
3588
+ # @return ActionsResult, ActionsErrorResult
3589
+ def list_repository_workflows(owner, repo, options)
3590
+ auth = nil
3591
+ body = nil
3592
+ headers = { accept: 'application/vnd.github.v3+json' }
3593
+ params = { per_page: options[:per_page], page: options[:page] }
3594
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/workflows"
3595
+
3596
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3597
+
3598
+ if http_call.successful?
3599
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3600
+ else
3601
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3602
+ end
3603
+ end
3604
+
3605
+ # get a workflow
3606
+ #
3607
+ # @param owner [String]
3608
+ # @param repo [String]
3609
+ # @param workflow_id [] The ID of the workflow. You can also pass the workflow file name as a string.
3610
+ #
3611
+ # @return ActionsResult, ActionsErrorResult
3612
+ def get_a_workflow(owner, repo, workflow_id, _options)
3613
+ auth = nil
3614
+ body = nil
3615
+ headers = { accept: 'application/vnd.github.v3+json' }
3616
+ params = nil
3617
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/workflows/#{workflow_id}"
3618
+
3619
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3620
+
3621
+ if http_call.successful?
3622
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3623
+ else
3624
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3625
+ end
3626
+ end
3627
+
3628
+ # disable a workflow
3629
+ #
3630
+ # @param owner [String]
3631
+ # @param repo [String]
3632
+ # @param workflow_id [] The ID of the workflow. You can also pass the workflow file name as a string.
3633
+ #
3634
+ # @return ActionsResult, ActionsErrorResult
3635
+ def disable_a_workflow(owner, repo, workflow_id, _options)
3636
+ auth = nil
3637
+ body = nil
3638
+ headers = { accept: 'application/vnd.github.v3+json' }
3639
+ params = nil
3640
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/workflows/#{workflow_id}/disable"
3641
+
3642
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
3643
+
3644
+ if http_call.successful?
3645
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3646
+ else
3647
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3648
+ end
3649
+ end
3650
+
3651
+ # create a workflow dispatch event
3652
+ #
3653
+ # @param owner [String]
3654
+ # @param repo [String]
3655
+ # @param workflow_id [] The ID of the workflow. You can also pass the workflow file name as a string.
3656
+ # @param ref [String] Required. The git reference for the workflow. The reference can be a branch or tag name.
3657
+ # @param inputs [Object] Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when inputs are omitted.
3658
+ #
3659
+ # @return ActionsResult, ActionsErrorResult
3660
+ def create_a_workflow_dispatch_event(owner, repo, workflow_id, ref, inputs, _options)
3661
+ auth = nil
3662
+ body = { ref: ref, inputs: inputs }
3663
+ headers = { accept: 'application/vnd.github.v3+json' }
3664
+ params = nil
3665
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/workflows/#{workflow_id}/dispatches"
3666
+
3667
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
3668
+
3669
+ if http_call.successful?
3670
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3671
+ else
3672
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3673
+ end
3674
+ end
3675
+
3676
+ # enable a workflow
3677
+ #
3678
+ # @param owner [String]
3679
+ # @param repo [String]
3680
+ # @param workflow_id [] The ID of the workflow. You can also pass the workflow file name as a string.
3681
+ #
3682
+ # @return ActionsResult, ActionsErrorResult
3683
+ def enable_a_workflow(owner, repo, workflow_id, _options)
3684
+ auth = nil
3685
+ body = nil
3686
+ headers = { accept: 'application/vnd.github.v3+json' }
3687
+ params = nil
3688
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/workflows/#{workflow_id}/enable"
3689
+
3690
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
3691
+
3692
+ if http_call.successful?
3693
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3694
+ else
3695
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3696
+ end
3697
+ end
3698
+
3699
+ # get workflow usage
3700
+ #
3701
+ # @param owner [String]
3702
+ # @param repo [String]
3703
+ # @param workflow_id [] The ID of the workflow. You can also pass the workflow file name as a string.
3704
+ #
3705
+ # @return ActionsResult, ActionsErrorResult
3706
+ def get_workflow_usage(owner, repo, workflow_id, _options)
3707
+ auth = nil
3708
+ body = nil
3709
+ headers = { accept: 'application/vnd.github.v3+json' }
3710
+ params = nil
3711
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/actions/workflows/#{workflow_id}/timing"
3712
+
3713
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
3714
+
3715
+ if http_call.successful?
3716
+ ActionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
3717
+ else
3718
+ ActionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
3719
+ end
3720
+ end
3721
+ end
3722
+ end
3723
+ end
3724
+ end