gitabu 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +33 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +65 -0
- data/LICENSE.txt +21 -0
- data/README.md +42 -0
- data/Rakefile +12 -0
- data/gitabu.gemspec +41 -0
- data/lib/gitabu/api/v3/actions.rb +3724 -0
- data/lib/gitabu/api/v3/activity.rb +835 -0
- data/lib/gitabu/api/v3/apps.rb +961 -0
- data/lib/gitabu/api/v3/billing.rb +217 -0
- data/lib/gitabu/api/v3/branches.rb +1098 -0
- data/lib/gitabu/api/v3/checks.rb +384 -0
- data/lib/gitabu/api/v3/code_scanning.rb +315 -0
- data/lib/gitabu/api/v3/codes_of_conduct.rb +92 -0
- data/lib/gitabu/api/v3/codespaces.rb +650 -0
- data/lib/gitabu/api/v3/collaborators.rb +341 -0
- data/lib/gitabu/api/v3/commits.rb +428 -0
- data/lib/gitabu/api/v3/dependabot.rb +419 -0
- data/lib/gitabu/api/v3/deploy_keys.rb +152 -0
- data/lib/gitabu/api/v3/deployments.rb +356 -0
- data/lib/gitabu/api/v3/emojis.rb +67 -0
- data/lib/gitabu/api/v3/enterprise_admin.rb +495 -0
- data/lib/gitabu/api/v3/gists.rb +552 -0
- data/lib/gitabu/api/v3/git.rb +409 -0
- data/lib/gitabu/api/v3/gitignore.rb +92 -0
- data/lib/gitabu/api/v3/interactions.rb +275 -0
- data/lib/gitabu/api/v3/issues.rb +1119 -0
- data/lib/gitabu/api/v3/licenses.rb +118 -0
- data/lib/gitabu/api/v3/markdown.rb +94 -0
- data/lib/gitabu/api/v3/meta.rb +142 -0
- data/lib/gitabu/api/v3/metrics.rb +302 -0
- data/lib/gitabu/api/v3/migrations.rb +631 -0
- data/lib/gitabu/api/v3/orgs.rb +1291 -0
- data/lib/gitabu/api/v3/packages.rb +686 -0
- data/lib/gitabu/api/v3/pages.rb +282 -0
- data/lib/gitabu/api/v3/projects.rb +693 -0
- data/lib/gitabu/api/v3/pulls.rb +816 -0
- data/lib/gitabu/api/v3/rate_limit.rb +67 -0
- data/lib/gitabu/api/v3/reactions.rb +734 -0
- data/lib/gitabu/api/v3/releases.rb +411 -0
- data/lib/gitabu/api/v3/repos.rb +1136 -0
- data/lib/gitabu/api/v3/scim.rb +214 -0
- data/lib/gitabu/api/v3/search.rb +217 -0
- data/lib/gitabu/api/v3/secret_scanning.rb +201 -0
- data/lib/gitabu/api/v3/teams.rb +1963 -0
- data/lib/gitabu/api/v3/users.rb +851 -0
- data/lib/gitabu/api/v3/webhooks.rb +379 -0
- data/lib/gitabu/builder.rb +37 -0
- data/lib/gitabu/client.rb +8 -0
- data/lib/gitabu/generator.rb +75 -0
- data/lib/gitabu/http_client.rb +96 -0
- data/lib/gitabu/items.rb +110 -0
- data/lib/gitabu/public/api/v3/actions.json +5779 -0
- data/lib/gitabu/public/api/v3/activity.json +1248 -0
- data/lib/gitabu/public/api/v3/apps.json +1174 -0
- data/lib/gitabu/public/api/v3/billing.json +183 -0
- data/lib/gitabu/public/api/v3/branches.json +1886 -0
- data/lib/gitabu/public/api/v3/checks.json +856 -0
- data/lib/gitabu/public/api/v3/code_scanning.json +666 -0
- data/lib/gitabu/public/api/v3/codes_of_conduct.json +41 -0
- data/lib/gitabu/public/api/v3/codespaces.json +884 -0
- data/lib/gitabu/public/api/v3/collaborators.json +464 -0
- data/lib/gitabu/public/api/v3/commits.json +830 -0
- data/lib/gitabu/public/api/v3/dependabot.json +596 -0
- data/lib/gitabu/public/api/v3/deploy_keys.json +195 -0
- data/lib/gitabu/public/api/v3/deployments.json +698 -0
- data/lib/gitabu/public/api/v3/emojis.json +18 -0
- data/lib/gitabu/public/api/v3/enterprise_admin.json +881 -0
- data/lib/gitabu/public/api/v3/gists.json +689 -0
- data/lib/gitabu/public/api/v3/git.json +735 -0
- data/lib/gitabu/public/api/v3/gitignore.json +41 -0
- data/lib/gitabu/public/api/v3/interactions.json +265 -0
- data/lib/gitabu/public/api/v3/issues.json +2359 -0
- data/lib/gitabu/public/api/v3/licenses.json +100 -0
- data/lib/gitabu/public/api/v3/markdown.json +59 -0
- data/lib/gitabu/public/api/v3/meta.json +69 -0
- data/lib/gitabu/public/api/v3/metrics.json +342 -0
- data/lib/gitabu/public/api/v3/migrations.json +960 -0
- data/lib/gitabu/public/api/v3/orgs.json +1989 -0
- data/lib/gitabu/public/api/v3/packages.json +1078 -0
- data/lib/gitabu/public/api/v3/pages.json +373 -0
- data/lib/gitabu/public/api/v3/projects.json +966 -0
- data/lib/gitabu/public/api/v3/pulls.json +1768 -0
- data/lib/gitabu/public/api/v3/rate_limit.json +18 -0
- data/lib/gitabu/public/api/v3/reactions.json +1425 -0
- data/lib/gitabu/public/api/v3/releases.json +753 -0
- data/lib/gitabu/public/api/v3/repos.json +2314 -0
- data/lib/gitabu/public/api/v3/scim.json +412 -0
- data/lib/gitabu/public/api/v3/search.json +408 -0
- data/lib/gitabu/public/api/v3/secret_scanning.json +385 -0
- data/lib/gitabu/public/api/v3/teams.json +3126 -0
- data/lib/gitabu/public/api/v3/users.json +956 -0
- data/lib/gitabu/public/api/v3/webhooks.json +667 -0
- data/lib/gitabu/run.rb +237 -0
- data/lib/gitabu/scraper.rb +86 -0
- data/lib/gitabu/templates/template.rb.erb +70 -0
- data/lib/gitabu/version.rb +6 -0
- data/lib/gitabu.rb +57 -0
- data/sig/gitabu.rbs +4 -0
- metadata +177 -0
|
@@ -0,0 +1,275 @@
|
|
|
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 Interactions result
|
|
17
|
+
class InteractionsResult
|
|
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 InteractionsErrorResult
|
|
28
|
+
attr_accessor :result, :message
|
|
29
|
+
|
|
30
|
+
def initialize(result:, message:)
|
|
31
|
+
@result = result
|
|
32
|
+
@message = message
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Interactions endpoints.
|
|
37
|
+
class Interactions
|
|
38
|
+
def self.get_interaction_restrictions_for_an_organization(org: nil, options: nil)
|
|
39
|
+
new.get_interaction_restrictions_for_an_organization(org, options)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.set_interaction_restrictions_for_an_organization(org: nil, limit: nil, expiry: nil, options: nil)
|
|
43
|
+
new.set_interaction_restrictions_for_an_organization(org, limit, expiry, options)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def self.remove_interaction_restrictions_for_an_organization(org: nil, options: nil)
|
|
47
|
+
new.remove_interaction_restrictions_for_an_organization(org, options)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def self.get_interaction_restrictions_for_a_repository(owner: nil, repo: nil, options: nil)
|
|
51
|
+
new.get_interaction_restrictions_for_a_repository(owner, repo, options)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def self.set_interaction_restrictions_for_a_repository(owner: nil, repo: nil, limit: nil, expiry: nil, options: nil)
|
|
55
|
+
new.set_interaction_restrictions_for_a_repository(owner, repo, limit, expiry, options)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.remove_interaction_restrictions_for_a_repository(owner: nil, repo: nil, options: nil)
|
|
59
|
+
new.remove_interaction_restrictions_for_a_repository(owner, repo, options)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def self.get_interaction_restrictions_for_your_public_repositories(options: nil)
|
|
63
|
+
new.get_interaction_restrictions_for_your_public_repositories(options)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def self.set_interaction_restrictions_for_your_public_repositories(limit: nil, expiry: nil, options: nil)
|
|
67
|
+
new.set_interaction_restrictions_for_your_public_repositories(limit, expiry, options)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def self.remove_interaction_restrictions_from_your_public_repositories(options: nil)
|
|
71
|
+
new.remove_interaction_restrictions_from_your_public_repositories(options)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
private
|
|
75
|
+
|
|
76
|
+
# get interaction restrictions for an organization
|
|
77
|
+
#
|
|
78
|
+
# @param org [String]
|
|
79
|
+
#
|
|
80
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
81
|
+
def get_interaction_restrictions_for_an_organization(org, _options)
|
|
82
|
+
auth = nil
|
|
83
|
+
body = nil
|
|
84
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
85
|
+
params = nil
|
|
86
|
+
uri = "#{Gitabu::BASE_URL}/orgs/#{org}/interaction-limits"
|
|
87
|
+
|
|
88
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
|
|
89
|
+
|
|
90
|
+
if http_call.successful?
|
|
91
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
92
|
+
else
|
|
93
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# set interaction restrictions for an organization
|
|
98
|
+
#
|
|
99
|
+
# @param org [String]
|
|
100
|
+
# @param limit [String] Required. The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: existing_users, contributors_only, collaborators_only.
|
|
101
|
+
# @param expiry [String] The duration of the interaction restriction. Can be one of: one_day, three_days, one_week, one_month, six_months. Default: one_day.
|
|
102
|
+
#
|
|
103
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
104
|
+
def set_interaction_restrictions_for_an_organization(org, limit, expiry, _options)
|
|
105
|
+
auth = nil
|
|
106
|
+
body = { limit: limit, expiry: expiry }
|
|
107
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
108
|
+
params = nil
|
|
109
|
+
uri = "#{Gitabu::BASE_URL}/orgs/#{org}/interaction-limits"
|
|
110
|
+
|
|
111
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
|
|
112
|
+
|
|
113
|
+
if http_call.successful?
|
|
114
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
115
|
+
else
|
|
116
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# remove interaction restrictions for an organization
|
|
121
|
+
#
|
|
122
|
+
# @param org [String]
|
|
123
|
+
#
|
|
124
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
125
|
+
def remove_interaction_restrictions_for_an_organization(org, _options)
|
|
126
|
+
auth = nil
|
|
127
|
+
body = nil
|
|
128
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
129
|
+
params = nil
|
|
130
|
+
uri = "#{Gitabu::BASE_URL}/orgs/#{org}/interaction-limits"
|
|
131
|
+
|
|
132
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
|
|
133
|
+
|
|
134
|
+
if http_call.successful?
|
|
135
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
136
|
+
else
|
|
137
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# get interaction restrictions for a repository
|
|
142
|
+
#
|
|
143
|
+
# @param owner [String]
|
|
144
|
+
# @param repo [String]
|
|
145
|
+
#
|
|
146
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
147
|
+
def get_interaction_restrictions_for_a_repository(owner, repo, _options)
|
|
148
|
+
auth = nil
|
|
149
|
+
body = nil
|
|
150
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
151
|
+
params = nil
|
|
152
|
+
uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/interaction-limits"
|
|
153
|
+
|
|
154
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
|
|
155
|
+
|
|
156
|
+
if http_call.successful?
|
|
157
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
158
|
+
else
|
|
159
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# set interaction restrictions for a repository
|
|
164
|
+
#
|
|
165
|
+
# @param owner [String]
|
|
166
|
+
# @param repo [String]
|
|
167
|
+
# @param limit [String] Required. The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: existing_users, contributors_only, collaborators_only.
|
|
168
|
+
# @param expiry [String] The duration of the interaction restriction. Can be one of: one_day, three_days, one_week, one_month, six_months. Default: one_day.
|
|
169
|
+
#
|
|
170
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
171
|
+
def set_interaction_restrictions_for_a_repository(owner, repo, limit, expiry, _options)
|
|
172
|
+
auth = nil
|
|
173
|
+
body = { limit: limit, expiry: expiry }
|
|
174
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
175
|
+
params = nil
|
|
176
|
+
uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/interaction-limits"
|
|
177
|
+
|
|
178
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
|
|
179
|
+
|
|
180
|
+
if http_call.successful?
|
|
181
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
182
|
+
else
|
|
183
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# remove interaction restrictions for a repository
|
|
188
|
+
#
|
|
189
|
+
# @param owner [String]
|
|
190
|
+
# @param repo [String]
|
|
191
|
+
#
|
|
192
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
193
|
+
def remove_interaction_restrictions_for_a_repository(owner, repo, _options)
|
|
194
|
+
auth = nil
|
|
195
|
+
body = nil
|
|
196
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
197
|
+
params = nil
|
|
198
|
+
uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/interaction-limits"
|
|
199
|
+
|
|
200
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
|
|
201
|
+
|
|
202
|
+
if http_call.successful?
|
|
203
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
204
|
+
else
|
|
205
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# get interaction restrictions for your public repositories
|
|
210
|
+
#
|
|
211
|
+
# @params options [Hash]
|
|
212
|
+
#
|
|
213
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
214
|
+
def get_interaction_restrictions_for_your_public_repositories(_options)
|
|
215
|
+
auth = nil
|
|
216
|
+
body = nil
|
|
217
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
218
|
+
params = nil
|
|
219
|
+
uri = "#{Gitabu::BASE_URL}/user/interaction-limits"
|
|
220
|
+
|
|
221
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
|
|
222
|
+
|
|
223
|
+
if http_call.successful?
|
|
224
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
225
|
+
else
|
|
226
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# set interaction restrictions for your public repositories
|
|
231
|
+
#
|
|
232
|
+
# @param limit [String] Required. The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: existing_users, contributors_only, collaborators_only.
|
|
233
|
+
# @param expiry [String] The duration of the interaction restriction. Can be one of: one_day, three_days, one_week, one_month, six_months. Default: one_day.
|
|
234
|
+
#
|
|
235
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
236
|
+
def set_interaction_restrictions_for_your_public_repositories(limit, expiry, _options)
|
|
237
|
+
auth = nil
|
|
238
|
+
body = { limit: limit, expiry: expiry }
|
|
239
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
240
|
+
params = nil
|
|
241
|
+
uri = "#{Gitabu::BASE_URL}/user/interaction-limits"
|
|
242
|
+
|
|
243
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
|
|
244
|
+
|
|
245
|
+
if http_call.successful?
|
|
246
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
247
|
+
else
|
|
248
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# remove interaction restrictions from your public repositories
|
|
253
|
+
#
|
|
254
|
+
# @params options [Hash]
|
|
255
|
+
#
|
|
256
|
+
# @return InteractionsResult, InteractionsErrorResult
|
|
257
|
+
def remove_interaction_restrictions_from_your_public_repositories(_options)
|
|
258
|
+
auth = nil
|
|
259
|
+
body = nil
|
|
260
|
+
headers = { accept: 'application/vnd.github.v3+json' }
|
|
261
|
+
params = nil
|
|
262
|
+
uri = "#{Gitabu::BASE_URL}/user/interaction-limits"
|
|
263
|
+
|
|
264
|
+
http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
|
|
265
|
+
|
|
266
|
+
if http_call.successful?
|
|
267
|
+
InteractionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
|
|
268
|
+
else
|
|
269
|
+
InteractionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
end
|