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,734 @@
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 Reactions result
17
+ class ReactionsResult
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 ReactionsErrorResult
28
+ attr_accessor :result, :message
29
+
30
+ def initialize(result:, message:)
31
+ @result = result
32
+ @message = message
33
+ end
34
+ end
35
+
36
+ # Reactions endpoints.
37
+ class Reactions
38
+ def self.list_reactions_for_a_team_discussion_comment(org: nil, team_slug: nil, discussion_number: nil, comment_number: nil, options: nil)
39
+ new.list_reactions_for_a_team_discussion_comment(org, team_slug, discussion_number, comment_number, options)
40
+ end
41
+
42
+ def self.create_reaction_for_a_team_discussion_comment(org: nil, team_slug: nil, discussion_number: nil, comment_number: nil, content: nil, options: nil)
43
+ new.create_reaction_for_a_team_discussion_comment(org, team_slug, discussion_number, comment_number, content, options)
44
+ end
45
+
46
+ def self.delete_team_discussion_comment_reaction(org: nil, team_slug: nil, discussion_number: nil, comment_number: nil, reaction_id: nil, options: nil)
47
+ new.delete_team_discussion_comment_reaction(org, team_slug, discussion_number, comment_number, reaction_id, options)
48
+ end
49
+
50
+ def self.list_reactions_for_a_team_discussion(org: nil, team_slug: nil, discussion_number: nil, options: nil)
51
+ new.list_reactions_for_a_team_discussion(org, team_slug, discussion_number, options)
52
+ end
53
+
54
+ def self.create_reaction_for_a_team_discussion(org: nil, team_slug: nil, discussion_number: nil, content: nil, options: nil)
55
+ new.create_reaction_for_a_team_discussion(org, team_slug, discussion_number, content, options)
56
+ end
57
+
58
+ def self.delete_team_discussion_reaction(org: nil, team_slug: nil, discussion_number: nil, reaction_id: nil, options: nil)
59
+ new.delete_team_discussion_reaction(org, team_slug, discussion_number, reaction_id, options)
60
+ end
61
+
62
+ def self.list_reactions_for_a_commit_comment(owner: nil, repo: nil, comment_id: nil, options: nil)
63
+ new.list_reactions_for_a_commit_comment(owner, repo, comment_id, options)
64
+ end
65
+
66
+ def self.create_reaction_for_a_commit_comment(owner: nil, repo: nil, comment_id: nil, content: nil, options: nil)
67
+ new.create_reaction_for_a_commit_comment(owner, repo, comment_id, content, options)
68
+ end
69
+
70
+ def self.delete_a_commit_comment_reaction(owner: nil, repo: nil, comment_id: nil, reaction_id: nil, options: nil)
71
+ new.delete_a_commit_comment_reaction(owner, repo, comment_id, reaction_id, options)
72
+ end
73
+
74
+ def self.list_reactions_for_an_issue_comment(owner: nil, repo: nil, comment_id: nil, options: nil)
75
+ new.list_reactions_for_an_issue_comment(owner, repo, comment_id, options)
76
+ end
77
+
78
+ def self.create_reaction_for_an_issue_comment(owner: nil, repo: nil, comment_id: nil, content: nil, options: nil)
79
+ new.create_reaction_for_an_issue_comment(owner, repo, comment_id, content, options)
80
+ end
81
+
82
+ def self.delete_an_issue_comment_reaction(owner: nil, repo: nil, comment_id: nil, reaction_id: nil, options: nil)
83
+ new.delete_an_issue_comment_reaction(owner, repo, comment_id, reaction_id, options)
84
+ end
85
+
86
+ def self.list_reactions_for_an_issue(owner: nil, repo: nil, issue_number: nil, options: nil)
87
+ new.list_reactions_for_an_issue(owner, repo, issue_number, options)
88
+ end
89
+
90
+ def self.create_reaction_for_an_issue(owner: nil, repo: nil, issue_number: nil, content: nil, options: nil)
91
+ new.create_reaction_for_an_issue(owner, repo, issue_number, content, options)
92
+ end
93
+
94
+ def self.delete_an_issue_reaction(owner: nil, repo: nil, issue_number: nil, reaction_id: nil, options: nil)
95
+ new.delete_an_issue_reaction(owner, repo, issue_number, reaction_id, options)
96
+ end
97
+
98
+ def self.list_reactions_for_a_pull_request_review_comment(owner: nil, repo: nil, comment_id: nil, options: nil)
99
+ new.list_reactions_for_a_pull_request_review_comment(owner, repo, comment_id, options)
100
+ end
101
+
102
+ def self.create_reaction_for_a_pull_request_review_comment(owner: nil, repo: nil, comment_id: nil, content: nil, options: nil)
103
+ new.create_reaction_for_a_pull_request_review_comment(owner, repo, comment_id, content, options)
104
+ end
105
+
106
+ def self.delete_a_pull_request_comment_reaction(owner: nil, repo: nil, comment_id: nil, reaction_id: nil, options: nil)
107
+ new.delete_a_pull_request_comment_reaction(owner, repo, comment_id, reaction_id, options)
108
+ end
109
+
110
+ def self.list_reactions_for_a_release(owner: nil, repo: nil, release_id: nil, options: nil)
111
+ new.list_reactions_for_a_release(owner, repo, release_id, options)
112
+ end
113
+
114
+ def self.create_reaction_for_a_release(owner: nil, repo: nil, release_id: nil, content: nil, options: nil)
115
+ new.create_reaction_for_a_release(owner, repo, release_id, content, options)
116
+ end
117
+
118
+ def self.delete_a_release_reaction(owner: nil, repo: nil, release_id: nil, reaction_id: nil, options: nil)
119
+ new.delete_a_release_reaction(owner, repo, release_id, reaction_id, options)
120
+ end
121
+
122
+ def self.list_reactions_for_a_team_discussion_comment_legacy(team_id: nil, discussion_number: nil, comment_number: nil, options: nil)
123
+ new.list_reactions_for_a_team_discussion_comment_legacy(team_id, discussion_number, comment_number, options)
124
+ end
125
+
126
+ def self.create_reaction_for_a_team_discussion_comment_legacy(team_id: nil, discussion_number: nil, comment_number: nil, content: nil, options: nil)
127
+ new.create_reaction_for_a_team_discussion_comment_legacy(team_id, discussion_number, comment_number, content, options)
128
+ end
129
+
130
+ def self.list_reactions_for_a_team_discussion_legacy(team_id: nil, discussion_number: nil, options: nil)
131
+ new.list_reactions_for_a_team_discussion_legacy(team_id, discussion_number, options)
132
+ end
133
+
134
+ def self.create_reaction_for_a_team_discussion_legacy(team_id: nil, discussion_number: nil, content: nil, options: nil)
135
+ new.create_reaction_for_a_team_discussion_legacy(team_id, discussion_number, content, options)
136
+ end
137
+
138
+ private
139
+
140
+ # list reactions for a team discussion comment
141
+ #
142
+ # @param org [String]
143
+ # @param team_slug [String] team_slug parameter
144
+ # @param discussion_number [Integer]
145
+ # @param comment_number [Integer]
146
+ #
147
+ # @return ReactionsResult, ReactionsErrorResult
148
+ def list_reactions_for_a_team_discussion_comment(org, team_slug, discussion_number, comment_number, options)
149
+ auth = nil
150
+ body = nil
151
+ headers = { accept: 'application/vnd.github.v3+json' }
152
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
153
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/teams/#{team_slug}/discussions/#{discussion_number}/comments/#{comment_number}/reactions"
154
+
155
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
156
+
157
+ if http_call.successful?
158
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
159
+ else
160
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
161
+ end
162
+ end
163
+
164
+ # create reaction for a team discussion comment
165
+ #
166
+ # @param org [String]
167
+ # @param team_slug [String] team_slug parameter
168
+ # @param discussion_number [Integer]
169
+ # @param comment_number [Integer]
170
+ # @param content [String] Required. The reaction type to add to the team discussion comment.
171
+ #
172
+ # @return ReactionsResult, ReactionsErrorResult
173
+ def create_reaction_for_a_team_discussion_comment(org, team_slug, discussion_number, comment_number, content, _options)
174
+ auth = nil
175
+ body = { content: content }
176
+ headers = { accept: 'application/vnd.github.v3+json' }
177
+ params = nil
178
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/teams/#{team_slug}/discussions/#{discussion_number}/comments/#{comment_number}/reactions"
179
+
180
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
181
+
182
+ if http_call.successful?
183
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
184
+ else
185
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
186
+ end
187
+ end
188
+
189
+ # delete team discussion comment reaction
190
+ #
191
+ # @param org [String]
192
+ # @param team_slug [String] team_slug parameter
193
+ # @param discussion_number [Integer]
194
+ # @param comment_number [Integer]
195
+ # @param reaction_id [Integer]
196
+ #
197
+ # @return ReactionsResult, ReactionsErrorResult
198
+ def delete_team_discussion_comment_reaction(org, team_slug, discussion_number, comment_number, reaction_id, _options)
199
+ auth = nil
200
+ body = nil
201
+ headers = { accept: 'application/vnd.github.v3+json' }
202
+ params = nil
203
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/teams/#{team_slug}/discussions/#{discussion_number}/comments/#{comment_number}/reactions/#{reaction_id}"
204
+
205
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
206
+
207
+ if http_call.successful?
208
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
209
+ else
210
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
211
+ end
212
+ end
213
+
214
+ # list reactions for a team discussion
215
+ #
216
+ # @param org [String]
217
+ # @param team_slug [String] team_slug parameter
218
+ # @param discussion_number [Integer]
219
+ #
220
+ # @return ReactionsResult, ReactionsErrorResult
221
+ def list_reactions_for_a_team_discussion(org, team_slug, discussion_number, options)
222
+ auth = nil
223
+ body = nil
224
+ headers = { accept: 'application/vnd.github.v3+json' }
225
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
226
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/teams/#{team_slug}/discussions/#{discussion_number}/reactions"
227
+
228
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
229
+
230
+ if http_call.successful?
231
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
232
+ else
233
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
234
+ end
235
+ end
236
+
237
+ # create reaction for a team discussion
238
+ #
239
+ # @param org [String]
240
+ # @param team_slug [String] team_slug parameter
241
+ # @param discussion_number [Integer]
242
+ # @param content [String] Required. The reaction type to add to the team discussion.
243
+ #
244
+ # @return ReactionsResult, ReactionsErrorResult
245
+ def create_reaction_for_a_team_discussion(org, team_slug, discussion_number, content, _options)
246
+ auth = nil
247
+ body = { content: content }
248
+ headers = { accept: 'application/vnd.github.v3+json' }
249
+ params = nil
250
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/teams/#{team_slug}/discussions/#{discussion_number}/reactions"
251
+
252
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
253
+
254
+ if http_call.successful?
255
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
256
+ else
257
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
258
+ end
259
+ end
260
+
261
+ # delete team discussion reaction
262
+ #
263
+ # @param org [String]
264
+ # @param team_slug [String] team_slug parameter
265
+ # @param discussion_number [Integer]
266
+ # @param reaction_id [Integer]
267
+ #
268
+ # @return ReactionsResult, ReactionsErrorResult
269
+ def delete_team_discussion_reaction(org, team_slug, discussion_number, reaction_id, _options)
270
+ auth = nil
271
+ body = nil
272
+ headers = { accept: 'application/vnd.github.v3+json' }
273
+ params = nil
274
+ uri = "#{Gitabu::BASE_URL}/orgs/#{org}/teams/#{team_slug}/discussions/#{discussion_number}/reactions/#{reaction_id}"
275
+
276
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
277
+
278
+ if http_call.successful?
279
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
280
+ else
281
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
282
+ end
283
+ end
284
+
285
+ # list reactions for a commit comment
286
+ #
287
+ # @param owner [String]
288
+ # @param repo [String]
289
+ # @param comment_id [Integer] comment_id parameter
290
+ #
291
+ # @return ReactionsResult, ReactionsErrorResult
292
+ def list_reactions_for_a_commit_comment(owner, repo, comment_id, options)
293
+ auth = nil
294
+ body = nil
295
+ headers = { accept: 'application/vnd.github.v3+json' }
296
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
297
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/comments/#{comment_id}/reactions"
298
+
299
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
300
+
301
+ if http_call.successful?
302
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
303
+ else
304
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
305
+ end
306
+ end
307
+
308
+ # create reaction for a commit comment
309
+ #
310
+ # @param owner [String]
311
+ # @param repo [String]
312
+ # @param comment_id [Integer] comment_id parameter
313
+ # @param content [String] Required. The reaction type to add to the commit comment.
314
+ #
315
+ # @return ReactionsResult, ReactionsErrorResult
316
+ def create_reaction_for_a_commit_comment(owner, repo, comment_id, content, _options)
317
+ auth = nil
318
+ body = { content: content }
319
+ headers = { accept: 'application/vnd.github.v3+json' }
320
+ params = nil
321
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/comments/#{comment_id}/reactions"
322
+
323
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
324
+
325
+ if http_call.successful?
326
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
327
+ else
328
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
329
+ end
330
+ end
331
+
332
+ # delete a commit comment reaction
333
+ #
334
+ # @param owner [String]
335
+ # @param repo [String]
336
+ # @param comment_id [Integer] comment_id parameter
337
+ # @param reaction_id [Integer]
338
+ #
339
+ # @return ReactionsResult, ReactionsErrorResult
340
+ def delete_a_commit_comment_reaction(owner, repo, comment_id, reaction_id, _options)
341
+ auth = nil
342
+ body = nil
343
+ headers = { accept: 'application/vnd.github.v3+json' }
344
+ params = nil
345
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/comments/#{comment_id}/reactions/#{reaction_id}"
346
+
347
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
348
+
349
+ if http_call.successful?
350
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
351
+ else
352
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
353
+ end
354
+ end
355
+
356
+ # list reactions for an issue comment
357
+ #
358
+ # @param owner [String]
359
+ # @param repo [String]
360
+ # @param comment_id [Integer] comment_id parameter
361
+ #
362
+ # @return ReactionsResult, ReactionsErrorResult
363
+ def list_reactions_for_an_issue_comment(owner, repo, comment_id, options)
364
+ auth = nil
365
+ body = nil
366
+ headers = { accept: 'application/vnd.github.v3+json' }
367
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
368
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/issues/comments/#{comment_id}/reactions"
369
+
370
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
371
+
372
+ if http_call.successful?
373
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
374
+ else
375
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
376
+ end
377
+ end
378
+
379
+ # create reaction for an issue comment
380
+ #
381
+ # @param owner [String]
382
+ # @param repo [String]
383
+ # @param comment_id [Integer] comment_id parameter
384
+ # @param content [String] Required. The reaction type to add to the issue comment.
385
+ #
386
+ # @return ReactionsResult, ReactionsErrorResult
387
+ def create_reaction_for_an_issue_comment(owner, repo, comment_id, content, _options)
388
+ auth = nil
389
+ body = { content: content }
390
+ headers = { accept: 'application/vnd.github.v3+json' }
391
+ params = nil
392
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/issues/comments/#{comment_id}/reactions"
393
+
394
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
395
+
396
+ if http_call.successful?
397
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
398
+ else
399
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
400
+ end
401
+ end
402
+
403
+ # delete an issue comment reaction
404
+ #
405
+ # @param owner [String]
406
+ # @param repo [String]
407
+ # @param comment_id [Integer] comment_id parameter
408
+ # @param reaction_id [Integer]
409
+ #
410
+ # @return ReactionsResult, ReactionsErrorResult
411
+ def delete_an_issue_comment_reaction(owner, repo, comment_id, reaction_id, _options)
412
+ auth = nil
413
+ body = nil
414
+ headers = { accept: 'application/vnd.github.v3+json' }
415
+ params = nil
416
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/issues/comments/#{comment_id}/reactions/#{reaction_id}"
417
+
418
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
419
+
420
+ if http_call.successful?
421
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
422
+ else
423
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
424
+ end
425
+ end
426
+
427
+ # list reactions for an issue
428
+ #
429
+ # @param owner [String]
430
+ # @param repo [String]
431
+ # @param issue_number [Integer] issue_number parameter
432
+ #
433
+ # @return ReactionsResult, ReactionsErrorResult
434
+ def list_reactions_for_an_issue(owner, repo, issue_number, options)
435
+ auth = nil
436
+ body = nil
437
+ headers = { accept: 'application/vnd.github.v3+json' }
438
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
439
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/issues/#{issue_number}/reactions"
440
+
441
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
442
+
443
+ if http_call.successful?
444
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
445
+ else
446
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
447
+ end
448
+ end
449
+
450
+ # create reaction for an issue
451
+ #
452
+ # @param owner [String]
453
+ # @param repo [String]
454
+ # @param issue_number [Integer] issue_number parameter
455
+ # @param content [String] Required. The reaction type to add to the issue.
456
+ #
457
+ # @return ReactionsResult, ReactionsErrorResult
458
+ def create_reaction_for_an_issue(owner, repo, issue_number, content, _options)
459
+ auth = nil
460
+ body = { content: content }
461
+ headers = { accept: 'application/vnd.github.v3+json' }
462
+ params = nil
463
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/issues/#{issue_number}/reactions"
464
+
465
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
466
+
467
+ if http_call.successful?
468
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
469
+ else
470
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
471
+ end
472
+ end
473
+
474
+ # delete an issue reaction
475
+ #
476
+ # @param owner [String]
477
+ # @param repo [String]
478
+ # @param issue_number [Integer] issue_number parameter
479
+ # @param reaction_id [Integer]
480
+ #
481
+ # @return ReactionsResult, ReactionsErrorResult
482
+ def delete_an_issue_reaction(owner, repo, issue_number, reaction_id, _options)
483
+ auth = nil
484
+ body = nil
485
+ headers = { accept: 'application/vnd.github.v3+json' }
486
+ params = nil
487
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/issues/#{issue_number}/reactions/#{reaction_id}"
488
+
489
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
490
+
491
+ if http_call.successful?
492
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
493
+ else
494
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
495
+ end
496
+ end
497
+
498
+ # list reactions for a pull request review comment
499
+ #
500
+ # @param owner [String]
501
+ # @param repo [String]
502
+ # @param comment_id [Integer] comment_id parameter
503
+ #
504
+ # @return ReactionsResult, ReactionsErrorResult
505
+ def list_reactions_for_a_pull_request_review_comment(owner, repo, comment_id, options)
506
+ auth = nil
507
+ body = nil
508
+ headers = { accept: 'application/vnd.github.v3+json' }
509
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
510
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/pulls/comments/#{comment_id}/reactions"
511
+
512
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
513
+
514
+ if http_call.successful?
515
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
516
+ else
517
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
518
+ end
519
+ end
520
+
521
+ # create reaction for a pull request review comment
522
+ #
523
+ # @param owner [String]
524
+ # @param repo [String]
525
+ # @param comment_id [Integer] comment_id parameter
526
+ # @param content [String] Required. The reaction type to add to the pull request review comment.
527
+ #
528
+ # @return ReactionsResult, ReactionsErrorResult
529
+ def create_reaction_for_a_pull_request_review_comment(owner, repo, comment_id, content, _options)
530
+ auth = nil
531
+ body = { content: content }
532
+ headers = { accept: 'application/vnd.github.v3+json' }
533
+ params = nil
534
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/pulls/comments/#{comment_id}/reactions"
535
+
536
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
537
+
538
+ if http_call.successful?
539
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
540
+ else
541
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
542
+ end
543
+ end
544
+
545
+ # delete a pull request comment reaction
546
+ #
547
+ # @param owner [String]
548
+ # @param repo [String]
549
+ # @param comment_id [Integer] comment_id parameter
550
+ # @param reaction_id [Integer]
551
+ #
552
+ # @return ReactionsResult, ReactionsErrorResult
553
+ def delete_a_pull_request_comment_reaction(owner, repo, comment_id, reaction_id, _options)
554
+ auth = nil
555
+ body = nil
556
+ headers = { accept: 'application/vnd.github.v3+json' }
557
+ params = nil
558
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/pulls/comments/#{comment_id}/reactions/#{reaction_id}"
559
+
560
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
561
+
562
+ if http_call.successful?
563
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
564
+ else
565
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
566
+ end
567
+ end
568
+
569
+ # list reactions for a release
570
+ #
571
+ # @param owner [String]
572
+ # @param repo [String]
573
+ # @param release_id [Integer] release_id parameter
574
+ #
575
+ # @return ReactionsResult, ReactionsErrorResult
576
+ def list_reactions_for_a_release(owner, repo, release_id, options)
577
+ auth = nil
578
+ body = nil
579
+ headers = { accept: 'application/vnd.github.v3+json' }
580
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
581
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/releases/#{release_id}/reactions"
582
+
583
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
584
+
585
+ if http_call.successful?
586
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
587
+ else
588
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
589
+ end
590
+ end
591
+
592
+ # create reaction for a release
593
+ #
594
+ # @param owner [String]
595
+ # @param repo [String]
596
+ # @param release_id [Integer] release_id parameter
597
+ # @param content [String] Required. The reaction type to add to the release.
598
+ #
599
+ # @return ReactionsResult, ReactionsErrorResult
600
+ def create_reaction_for_a_release(owner, repo, release_id, content, _options)
601
+ auth = nil
602
+ body = { content: content }
603
+ headers = { accept: 'application/vnd.github.v3+json' }
604
+ params = nil
605
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/releases/#{release_id}/reactions"
606
+
607
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
608
+
609
+ if http_call.successful?
610
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
611
+ else
612
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
613
+ end
614
+ end
615
+
616
+ # delete a release reaction
617
+ #
618
+ # @param owner [String]
619
+ # @param repo [String]
620
+ # @param release_id [Integer] release_id parameter
621
+ # @param reaction_id [Integer]
622
+ #
623
+ # @return ReactionsResult, ReactionsErrorResult
624
+ def delete_a_release_reaction(owner, repo, release_id, reaction_id, _options)
625
+ auth = nil
626
+ body = nil
627
+ headers = { accept: 'application/vnd.github.v3+json' }
628
+ params = nil
629
+ uri = "#{Gitabu::BASE_URL}/repos/#{owner}/#{repo}/releases/#{release_id}/reactions/#{reaction_id}"
630
+
631
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
632
+
633
+ if http_call.successful?
634
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
635
+ else
636
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
637
+ end
638
+ end
639
+
640
+ # list reactions for a team discussion comment legacy
641
+ #
642
+ # @param team_id [Integer]
643
+ # @param discussion_number [Integer]
644
+ # @param comment_number [Integer]
645
+ #
646
+ # @return ReactionsResult, ReactionsErrorResult
647
+ def list_reactions_for_a_team_discussion_comment_legacy(team_id, discussion_number, comment_number, options)
648
+ auth = nil
649
+ body = nil
650
+ headers = { accept: 'application/vnd.github.v3+json' }
651
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
652
+ uri = "#{Gitabu::BASE_URL}/teams/#{team_id}/discussions/#{discussion_number}/comments/#{comment_number}/reactions"
653
+
654
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
655
+
656
+ if http_call.successful?
657
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
658
+ else
659
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
660
+ end
661
+ end
662
+
663
+ # create reaction for a team discussion comment legacy
664
+ #
665
+ # @param team_id [Integer]
666
+ # @param discussion_number [Integer]
667
+ # @param comment_number [Integer]
668
+ # @param content [String] Required. The reaction type to add to the team discussion comment.
669
+ #
670
+ # @return ReactionsResult, ReactionsErrorResult
671
+ def create_reaction_for_a_team_discussion_comment_legacy(team_id, discussion_number, comment_number, content, _options)
672
+ auth = nil
673
+ body = { content: content }
674
+ headers = { accept: 'application/vnd.github.v3+json' }
675
+ params = nil
676
+ uri = "#{Gitabu::BASE_URL}/teams/#{team_id}/discussions/#{discussion_number}/comments/#{comment_number}/reactions"
677
+
678
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
679
+
680
+ if http_call.successful?
681
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
682
+ else
683
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
684
+ end
685
+ end
686
+
687
+ # list reactions for a team discussion legacy
688
+ #
689
+ # @param team_id [Integer]
690
+ # @param discussion_number [Integer]
691
+ #
692
+ # @return ReactionsResult, ReactionsErrorResult
693
+ def list_reactions_for_a_team_discussion_legacy(team_id, discussion_number, options)
694
+ auth = nil
695
+ body = nil
696
+ headers = { accept: 'application/vnd.github.v3+json' }
697
+ params = { content: options[:content], per_page: options[:per_page], page: options[:page] }
698
+ uri = "#{Gitabu::BASE_URL}/teams/#{team_id}/discussions/#{discussion_number}/reactions"
699
+
700
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
701
+
702
+ if http_call.successful?
703
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
704
+ else
705
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
706
+ end
707
+ end
708
+
709
+ # create reaction for a team discussion legacy
710
+ #
711
+ # @param team_id [Integer]
712
+ # @param discussion_number [Integer]
713
+ # @param content [String] Required. The reaction type to add to the team discussion.
714
+ #
715
+ # @return ReactionsResult, ReactionsErrorResult
716
+ def create_reaction_for_a_team_discussion_legacy(team_id, discussion_number, content, _options)
717
+ auth = nil
718
+ body = { content: content }
719
+ headers = { accept: 'application/vnd.github.v3+json' }
720
+ params = nil
721
+ uri = "#{Gitabu::BASE_URL}/teams/#{team_id}/discussions/#{discussion_number}/reactions"
722
+
723
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
724
+
725
+ if http_call.successful?
726
+ ReactionsResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
727
+ else
728
+ ReactionsErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
729
+ end
730
+ end
731
+ end
732
+ end
733
+ end
734
+ end