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.
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,495 @@
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 Enterprise admin result
17
+ class EnterpriseAdminResult
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 EnterpriseAdminErrorResult
28
+ attr_accessor :result, :message
29
+
30
+ def initialize(result:, message:)
31
+ @result = result
32
+ @message = message
33
+ end
34
+ end
35
+
36
+ # EnterpriseAdmin endpoints.
37
+ class EnterpriseAdmin
38
+ def self.get_the_audit_log_for_an_enterprise(enterprise: nil, options: nil)
39
+ new.get_the_audit_log_for_an_enterprise(enterprise, options)
40
+ end
41
+
42
+ def self.get_github_actions_billing_for_an_enterprise(enterprise: nil, options: nil)
43
+ new.get_github_actions_billing_for_an_enterprise(enterprise, options)
44
+ end
45
+
46
+ def self.get_github_advanced_security_active_committers_for_an_enterprise(enterprise: nil, options: nil)
47
+ new.get_github_advanced_security_active_committers_for_an_enterprise(enterprise, options)
48
+ end
49
+
50
+ def self.get_github_packages_billing_for_an_enterprise(enterprise: nil, options: nil)
51
+ new.get_github_packages_billing_for_an_enterprise(enterprise, options)
52
+ end
53
+
54
+ def self.get_shared_storage_billing_for_an_enterprise(enterprise: nil, options: nil)
55
+ new.get_shared_storage_billing_for_an_enterprise(enterprise, options)
56
+ end
57
+
58
+ def self.list_provisioned_scim_groups_for_an_enterprise(enterprise: nil, options: nil)
59
+ new.list_provisioned_scim_groups_for_an_enterprise(enterprise, options)
60
+ end
61
+
62
+ def self.provision_a_scim_enterprise_group_and_invite_users(enterprise: nil, schemas: nil, displayname: nil, members: nil, options: nil)
63
+ new.provision_a_scim_enterprise_group_and_invite_users(enterprise, schemas, displayname, members, options)
64
+ end
65
+
66
+ def self.get_scim_provisioning_information_for_an_enterprise_group(enterprise: nil, scim_group_id: nil, options: nil)
67
+ new.get_scim_provisioning_information_for_an_enterprise_group(enterprise, scim_group_id, options)
68
+ end
69
+
70
+ def self.set_scim_information_for_a_provisioned_enterprise_group(enterprise: nil, scim_group_id: nil, schemas: nil, displayname: nil, members: nil, options: nil)
71
+ new.set_scim_information_for_a_provisioned_enterprise_group(enterprise, scim_group_id, schemas, displayname, members, options)
72
+ end
73
+
74
+ def self.update_an_attribute_for_a_scim_enterprise_group(enterprise: nil, scim_group_id: nil, schemas: nil, operations: nil, options: nil)
75
+ new.update_an_attribute_for_a_scim_enterprise_group(enterprise, scim_group_id, schemas, operations, options)
76
+ end
77
+
78
+ def self.delete_a_scim_group_from_an_enterprise(enterprise: nil, scim_group_id: nil, options: nil)
79
+ new.delete_a_scim_group_from_an_enterprise(enterprise, scim_group_id, options)
80
+ end
81
+
82
+ def self.list_scim_provisioned_identities_for_an_enterprise(enterprise: nil, options: nil)
83
+ new.list_scim_provisioned_identities_for_an_enterprise(enterprise, options)
84
+ end
85
+
86
+ def self.provision_and_invite_a_scim_enterprise_user(enterprise: nil, schemas: nil, username: nil, name: nil, emails: nil, groups: nil, options: nil)
87
+ new.provision_and_invite_a_scim_enterprise_user(enterprise, schemas, username, name, emails, groups, options)
88
+ end
89
+
90
+ def self.get_scim_provisioning_information_for_an_enterprise_user(enterprise: nil, scim_user_id: nil, options: nil)
91
+ new.get_scim_provisioning_information_for_an_enterprise_user(enterprise, scim_user_id, options)
92
+ end
93
+
94
+ def self.set_scim_information_for_a_provisioned_enterprise_user(enterprise: nil, scim_user_id: nil, schemas: nil, username: nil, name: nil, emails: nil, groups: nil, options: nil)
95
+ new.set_scim_information_for_a_provisioned_enterprise_user(enterprise, scim_user_id, schemas, username, name, emails, groups, options)
96
+ end
97
+
98
+ def self.update_an_attribute_for_a_scim_enterprise_user(enterprise: nil, scim_user_id: nil, schemas: nil, operations: nil, options: nil)
99
+ new.update_an_attribute_for_a_scim_enterprise_user(enterprise, scim_user_id, schemas, operations, options)
100
+ end
101
+
102
+ def self.delete_a_scim_user_from_an_enterprise(enterprise: nil, scim_user_id: nil, options: nil)
103
+ new.delete_a_scim_user_from_an_enterprise(enterprise, scim_user_id, options)
104
+ end
105
+
106
+ private
107
+
108
+ # get the audit log for an enterprise
109
+ #
110
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
111
+ #
112
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
113
+ def get_the_audit_log_for_an_enterprise(enterprise, options)
114
+ auth = nil
115
+ body = nil
116
+ headers = { accept: 'application/vnd.github.v3+json' }
117
+ params = { phrase: options[:phrase], include: options[:include], after: options[:after], before: options[:before], order: options[:order], page: options[:page], per_page: options[:per_page] }
118
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/audit-log"
119
+
120
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
121
+
122
+ if http_call.successful?
123
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
124
+ else
125
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
126
+ end
127
+ end
128
+
129
+ # get github actions billing for an enterprise
130
+ #
131
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
132
+ #
133
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
134
+ def get_github_actions_billing_for_an_enterprise(enterprise, _options)
135
+ auth = nil
136
+ body = nil
137
+ headers = { accept: 'application/vnd.github.v3+json' }
138
+ params = nil
139
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/settings/billing/actions"
140
+
141
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
142
+
143
+ if http_call.successful?
144
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
145
+ else
146
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
147
+ end
148
+ end
149
+
150
+ # get github advanced security active committers for an enterprise
151
+ #
152
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
153
+ #
154
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
155
+ def get_github_advanced_security_active_committers_for_an_enterprise(enterprise, options)
156
+ auth = nil
157
+ body = nil
158
+ headers = { accept: 'application/vnd.github.v3+json' }
159
+ params = { per_page: options[:per_page], page: options[:page] }
160
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/settings/billing/advanced-security"
161
+
162
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
163
+
164
+ if http_call.successful?
165
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
166
+ else
167
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
168
+ end
169
+ end
170
+
171
+ # get github packages billing for an enterprise
172
+ #
173
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
174
+ #
175
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
176
+ def get_github_packages_billing_for_an_enterprise(enterprise, _options)
177
+ auth = nil
178
+ body = nil
179
+ headers = { accept: 'application/vnd.github.v3+json' }
180
+ params = nil
181
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/settings/billing/packages"
182
+
183
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
184
+
185
+ if http_call.successful?
186
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
187
+ else
188
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
189
+ end
190
+ end
191
+
192
+ # get shared storage billing for an enterprise
193
+ #
194
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
195
+ #
196
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
197
+ def get_shared_storage_billing_for_an_enterprise(enterprise, _options)
198
+ auth = nil
199
+ body = nil
200
+ headers = { accept: 'application/vnd.github.v3+json' }
201
+ params = nil
202
+ uri = "#{Gitabu::BASE_URL}/enterprises/#{enterprise}/settings/billing/shared-storage"
203
+
204
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
205
+
206
+ if http_call.successful?
207
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
208
+ else
209
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
210
+ end
211
+ end
212
+
213
+ # list provisioned scim groups for an enterprise
214
+ #
215
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
216
+ #
217
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
218
+ def list_provisioned_scim_groups_for_an_enterprise(enterprise, options)
219
+ auth = nil
220
+ body = nil
221
+ headers = { accept: 'application/vnd.github.v3+json' }
222
+ params = { startIndex: options[:startIndex], count: options[:count], filter: options[:filter], excludedAttributes: options[:excludedAttributes] }
223
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Groups"
224
+
225
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
226
+
227
+ if http_call.successful?
228
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
229
+ else
230
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
231
+ end
232
+ end
233
+
234
+ # provision a scim enterprise group and invite users
235
+ #
236
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
237
+ # @param schemas [Array of strings] Required. The SCIM schema URIs.
238
+ # @param displayname [String] Required. The name of the SCIM group. This must match the GitHub organization that the group maps to.
239
+ # @param members [Array of objects]
240
+ #
241
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
242
+ def provision_a_scim_enterprise_group_and_invite_users(enterprise, schemas, displayname, members, _options)
243
+ auth = nil
244
+ body = { schemas: schemas, displayname: displayname, members: members }
245
+ headers = { accept: 'application/vnd.github.v3+json' }
246
+ params = nil
247
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Groups"
248
+
249
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
250
+
251
+ if http_call.successful?
252
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
253
+ else
254
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
255
+ end
256
+ end
257
+
258
+ # get scim provisioning information for an enterprise group
259
+ #
260
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
261
+ # @param scim_group_id [String] Identifier generated by the GitHub SCIM endpoint.
262
+ #
263
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
264
+ def get_scim_provisioning_information_for_an_enterprise_group(enterprise, scim_group_id, options)
265
+ auth = nil
266
+ body = nil
267
+ headers = { accept: 'application/vnd.github.v3+json' }
268
+ params = { excludedAttributes: options[:excludedAttributes] }
269
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Groups/#{scim_group_id}"
270
+
271
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
272
+
273
+ if http_call.successful?
274
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
275
+ else
276
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
277
+ end
278
+ end
279
+
280
+ # set scim information for a provisioned enterprise group
281
+ #
282
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
283
+ # @param scim_group_id [String] Identifier generated by the GitHub SCIM endpoint.
284
+ # @param schemas [Array of strings] Required. The SCIM schema URIs.
285
+ # @param displayname [String] Required. The name of the SCIM group. This must match the GitHub organization that the group maps to.
286
+ # @param members [Array of objects]
287
+ #
288
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
289
+ def set_scim_information_for_a_provisioned_enterprise_group(enterprise, scim_group_id, schemas, displayname, members, _options)
290
+ auth = nil
291
+ body = { schemas: schemas, displayname: displayname, members: members }
292
+ headers = { accept: 'application/vnd.github.v3+json' }
293
+ params = nil
294
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Groups/#{scim_group_id}"
295
+
296
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
297
+
298
+ if http_call.successful?
299
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
300
+ else
301
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
302
+ end
303
+ end
304
+
305
+ # update an attribute for a scim enterprise group
306
+ #
307
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
308
+ # @param scim_group_id [String] Identifier generated by the GitHub SCIM endpoint.
309
+ # @param schemas [Array of strings] Required. The SCIM schema URIs.
310
+ # @param operations [Array of objects] Required. Array of SCIM operations.
311
+ #
312
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
313
+ def update_an_attribute_for_a_scim_enterprise_group(enterprise, scim_group_id, schemas, operations, _options)
314
+ auth = nil
315
+ body = { schemas: schemas, operations: operations }
316
+ headers = { accept: 'application/vnd.github.v3+json' }
317
+ params = nil
318
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Groups/#{scim_group_id}"
319
+
320
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :patch, params: params, uri: uri)
321
+
322
+ if http_call.successful?
323
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
324
+ else
325
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
326
+ end
327
+ end
328
+
329
+ # delete a scim group from an enterprise
330
+ #
331
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
332
+ # @param scim_group_id [String] Identifier generated by the GitHub SCIM endpoint.
333
+ #
334
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
335
+ def delete_a_scim_group_from_an_enterprise(enterprise, scim_group_id, _options)
336
+ auth = nil
337
+ body = nil
338
+ headers = { accept: 'application/vnd.github.v3+json' }
339
+ params = nil
340
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Groups/#{scim_group_id}"
341
+
342
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
343
+
344
+ if http_call.successful?
345
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
346
+ else
347
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
348
+ end
349
+ end
350
+
351
+ # list scim provisioned identities for an enterprise
352
+ #
353
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
354
+ #
355
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
356
+ def list_scim_provisioned_identities_for_an_enterprise(enterprise, options)
357
+ auth = nil
358
+ body = nil
359
+ headers = { accept: 'application/vnd.github.v3+json' }
360
+ params = { startIndex: options[:startIndex], count: options[:count], filter: options[:filter] }
361
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Users"
362
+
363
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
364
+
365
+ if http_call.successful?
366
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
367
+ else
368
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
369
+ end
370
+ end
371
+
372
+ # provision and invite a scim enterprise user
373
+ #
374
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
375
+ # @param schemas [Array of strings] Required. The SCIM schema URIs.
376
+ # @param username [String] Required. The username for the user.
377
+ # @param name [Object] Required.
378
+ # @param emails [Array of objects] Required. List of user emails.
379
+ # @param groups [Array of objects] List of SCIM group IDs the user is a member of.
380
+ #
381
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
382
+ def provision_and_invite_a_scim_enterprise_user(enterprise, schemas, username, name, emails, groups, _options)
383
+ auth = nil
384
+ body = { schemas: schemas, username: username, name: name, emails: emails, groups: groups }
385
+ headers = { accept: 'application/vnd.github.v3+json' }
386
+ params = nil
387
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Users"
388
+
389
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :post, params: params, uri: uri)
390
+
391
+ if http_call.successful?
392
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
393
+ else
394
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
395
+ end
396
+ end
397
+
398
+ # get scim provisioning information for an enterprise user
399
+ #
400
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
401
+ # @param scim_user_id [String] scim_user_id parameter
402
+ #
403
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
404
+ def get_scim_provisioning_information_for_an_enterprise_user(enterprise, scim_user_id, _options)
405
+ auth = nil
406
+ body = nil
407
+ headers = { accept: 'application/vnd.github.v3+json' }
408
+ params = nil
409
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Users/#{scim_user_id}"
410
+
411
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :get, params: params, uri: uri)
412
+
413
+ if http_call.successful?
414
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
415
+ else
416
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
417
+ end
418
+ end
419
+
420
+ # set scim information for a provisioned enterprise user
421
+ #
422
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
423
+ # @param scim_user_id [String] scim_user_id parameter
424
+ # @param schemas [Array of strings] Required. The SCIM schema URIs.
425
+ # @param username [String] Required. The username for the user.
426
+ # @param name [Object] Required.
427
+ # @param emails [Array of objects] Required. List of user emails.
428
+ # @param groups [Array of objects] List of SCIM group IDs the user is a member of.
429
+ #
430
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
431
+ def set_scim_information_for_a_provisioned_enterprise_user(enterprise, scim_user_id, schemas, username, name, emails, groups, _options)
432
+ auth = nil
433
+ body = { schemas: schemas, username: username, name: name, emails: emails, groups: groups }
434
+ headers = { accept: 'application/vnd.github.v3+json' }
435
+ params = nil
436
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Users/#{scim_user_id}"
437
+
438
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :put, params: params, uri: uri)
439
+
440
+ if http_call.successful?
441
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
442
+ else
443
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
444
+ end
445
+ end
446
+
447
+ # update an attribute for a scim enterprise user
448
+ #
449
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
450
+ # @param scim_user_id [String] scim_user_id parameter
451
+ # @param schemas [Array of strings] Required. The SCIM schema URIs.
452
+ # @param operations [Array of objects] Required. Array of SCIM operations.
453
+ #
454
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
455
+ def update_an_attribute_for_a_scim_enterprise_user(enterprise, scim_user_id, schemas, operations, _options)
456
+ auth = nil
457
+ body = { schemas: schemas, operations: operations }
458
+ headers = { accept: 'application/vnd.github.v3+json' }
459
+ params = nil
460
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Users/#{scim_user_id}"
461
+
462
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :patch, params: params, uri: uri)
463
+
464
+ if http_call.successful?
465
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
466
+ else
467
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
468
+ end
469
+ end
470
+
471
+ # delete a scim user from an enterprise
472
+ #
473
+ # @param enterprise [String] The slug version of the enterprise name. You can also substitute this value with the enterprise id.
474
+ # @param scim_user_id [String] scim_user_id parameter
475
+ #
476
+ # @return EnterpriseAdminResult, EnterpriseAdminErrorResult
477
+ def delete_a_scim_user_from_an_enterprise(enterprise, scim_user_id, _options)
478
+ auth = nil
479
+ body = nil
480
+ headers = { accept: 'application/vnd.github.v3+json' }
481
+ params = nil
482
+ uri = "#{Gitabu::BASE_URL}/scim/v2/enterprises/#{enterprise}/Users/#{scim_user_id}"
483
+
484
+ http_call = Gitabu::HttpClient.call(auth: auth, body: body, headers: headers, method: :delete, params: params, uri: uri)
485
+
486
+ if http_call.successful?
487
+ EnterpriseAdminResult.new(result: http_call, message: "Successful call to endpoint. #{http_call.result.message}")
488
+ else
489
+ EnterpriseAdminErrorResult.new(result: http_call, message: "Failure while calling endpoint. #{http_call.result.message}")
490
+ end
491
+ end
492
+ end
493
+ end
494
+ end
495
+ end