carbon_ruby_sdk 0.2.38 → 0.2.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +310 -2
  4. data/lib/carbon_ruby_sdk/api/github_api.rb +825 -0
  5. data/lib/carbon_ruby_sdk/models/comments_input.rb +330 -0
  6. data/lib/carbon_ruby_sdk/models/comments_order_by.rb +36 -0
  7. data/lib/carbon_ruby_sdk/models/comments_response.rb +232 -0
  8. data/lib/carbon_ruby_sdk/models/commit.rb +282 -0
  9. data/lib/carbon_ruby_sdk/models/commit_user.rb +234 -0
  10. data/lib/carbon_ruby_sdk/models/commit_user_nullable.rb +234 -0
  11. data/lib/carbon_ruby_sdk/models/commits_input.rb +307 -0
  12. data/lib/carbon_ruby_sdk/models/commits_response.rb +232 -0
  13. data/lib/carbon_ruby_sdk/models/file_status.rb +41 -0
  14. data/lib/carbon_ruby_sdk/models/files_input.rb +307 -0
  15. data/lib/carbon_ruby_sdk/models/files_response.rb +232 -0
  16. data/lib/carbon_ruby_sdk/models/head_or_base.rb +248 -0
  17. data/lib/carbon_ruby_sdk/models/issue.rb +434 -0
  18. data/lib/carbon_ruby_sdk/models/issue_pr.rb +230 -0
  19. data/lib/carbon_ruby_sdk/models/issue_pr_nullable.rb +230 -0
  20. data/lib/carbon_ruby_sdk/models/issues_filter.rb +217 -0
  21. data/lib/carbon_ruby_sdk/models/issues_input.rb +325 -0
  22. data/lib/carbon_ruby_sdk/models/issues_order_by.rb +37 -0
  23. data/lib/carbon_ruby_sdk/models/issues_response.rb +232 -0
  24. data/lib/carbon_ruby_sdk/models/label.rb +234 -0
  25. data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +29 -1
  26. data/lib/carbon_ruby_sdk/models/pr_comment.rb +358 -0
  27. data/lib/carbon_ruby_sdk/models/pr_commit.rb +264 -0
  28. data/lib/carbon_ruby_sdk/models/pr_file.rb +342 -0
  29. data/lib/carbon_ruby_sdk/models/pr_order_by.rb +37 -0
  30. data/lib/carbon_ruby_sdk/models/pr_state.rb +36 -0
  31. data/lib/carbon_ruby_sdk/models/pr_state_input.rb +37 -0
  32. data/lib/carbon_ruby_sdk/models/pull_request.rb +438 -0
  33. data/lib/carbon_ruby_sdk/models/pull_request_extended.rb +536 -0
  34. data/lib/carbon_ruby_sdk/models/pull_request_filters.rb +239 -0
  35. data/lib/carbon_ruby_sdk/models/pull_request_response.rb +232 -0
  36. data/lib/carbon_ruby_sdk/models/pull_requests_input.rb +325 -0
  37. data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +2 -2
  38. data/lib/carbon_ruby_sdk/models/team.rb +234 -0
  39. data/lib/carbon_ruby_sdk/models/tree.rb +234 -0
  40. data/lib/carbon_ruby_sdk/models/user.rb +234 -0
  41. data/lib/carbon_ruby_sdk/models/user_file.rb +11 -1
  42. data/lib/carbon_ruby_sdk/models/user_nullable.rb +234 -0
  43. data/lib/carbon_ruby_sdk/version.rb +1 -1
  44. data/lib/carbon_ruby_sdk.rb +38 -0
  45. data/spec/api/github_api_spec.rb +112 -0
  46. data/spec/models/comments_input_spec.rb +76 -0
  47. data/spec/models/comments_order_by_spec.rb +22 -0
  48. data/spec/models/comments_response_spec.rb +34 -0
  49. data/spec/models/commit_spec.rb +58 -0
  50. data/spec/models/commit_user_nullable_spec.rb +34 -0
  51. data/spec/models/commit_user_spec.rb +34 -0
  52. data/spec/models/commits_input_spec.rb +64 -0
  53. data/spec/models/commits_response_spec.rb +34 -0
  54. data/spec/models/file_status_spec.rb +22 -0
  55. data/spec/models/files_input_spec.rb +64 -0
  56. data/spec/models/files_response_spec.rb +34 -0
  57. data/spec/models/head_or_base_spec.rb +40 -0
  58. data/spec/models/issue_pr_nullable_spec.rb +34 -0
  59. data/spec/models/issue_pr_spec.rb +34 -0
  60. data/spec/models/issue_spec.rb +124 -0
  61. data/spec/models/issues_filter_spec.rb +28 -0
  62. data/spec/models/issues_input_spec.rb +76 -0
  63. data/spec/models/issues_order_by_spec.rb +22 -0
  64. data/spec/models/issues_response_spec.rb +34 -0
  65. data/spec/models/label_spec.rb +34 -0
  66. data/spec/models/organization_user_files_to_sync_filters_spec.rb +6 -0
  67. data/spec/models/pr_comment_spec.rb +94 -0
  68. data/spec/models/pr_commit_spec.rb +52 -0
  69. data/spec/models/pr_file_spec.rb +82 -0
  70. data/spec/models/pr_order_by_spec.rb +22 -0
  71. data/spec/models/pr_state_input_spec.rb +22 -0
  72. data/spec/models/pr_state_spec.rb +22 -0
  73. data/spec/models/pull_request_extended_spec.rb +166 -0
  74. data/spec/models/pull_request_filters_spec.rb +40 -0
  75. data/spec/models/pull_request_response_spec.rb +34 -0
  76. data/spec/models/pull_request_spec.rb +124 -0
  77. data/spec/models/pull_requests_input_spec.rb +76 -0
  78. data/spec/models/sent_webhook_payload_spec.rb +1 -1
  79. data/spec/models/team_spec.rb +34 -0
  80. data/spec/models/tree_spec.rb +34 -0
  81. data/spec/models/user_file_spec.rb +6 -0
  82. data/spec/models/user_nullable_spec.rb +34 -0
  83. data/spec/models/user_spec.rb +34 -0
  84. metadata +301 -193
@@ -0,0 +1,825 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'cgi'
10
+
11
+ module Carbon
12
+ class GithubApi
13
+ attr_accessor :api_client
14
+
15
+ def initialize(api_client = ApiClient.default)
16
+ @api_client = api_client
17
+ end
18
+
19
+ # Issue
20
+ #
21
+ # @param issue_number [Integer]
22
+ # @param include_remote_data [Boolean]
23
+ # @param data_source_id [Integer]
24
+ # @param repository [String]
25
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
26
+ def get_issue(issue_number:, include_remote_data: false, data_source_id: SENTINEL, repository: SENTINEL, extra: {})
27
+ extra[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
28
+ extra[:data_source_id] = data_source_id if data_source_id != SENTINEL
29
+ extra[:repository] = repository if repository != SENTINEL
30
+ api_response = get_issue_with_http_info_impl(issue_number, extra)
31
+ api_response.data
32
+ end
33
+
34
+ # Issue
35
+ #
36
+ # @param issue_number [Integer]
37
+ # @param include_remote_data [Boolean]
38
+ # @param data_source_id [Integer]
39
+ # @param repository [String]
40
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
41
+ def get_issue_with_http_info(issue_number:, include_remote_data: false, data_source_id: SENTINEL, repository: SENTINEL, extra: {})
42
+ extra[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
43
+ extra[:data_source_id] = data_source_id if data_source_id != SENTINEL
44
+ extra[:repository] = repository if repository != SENTINEL
45
+ get_issue_with_http_info_impl(issue_number, extra)
46
+ end
47
+
48
+ # Issue
49
+ # @param issue_number [Integer]
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [Boolean] :include_remote_data (default to false)
52
+ # @option opts [Integer] :data_source_id
53
+ # @option opts [String] :repository
54
+ # @return [Issue]
55
+ private def get_issue_impl(issue_number, opts = {})
56
+ data, _status_code, _headers = get_issue_with_http_info(issue_number, opts)
57
+ data
58
+ end
59
+
60
+ # Issue
61
+ # @param issue_number [Integer]
62
+ # @param [Hash] opts the optional parameters
63
+ # @option opts [Boolean] :include_remote_data (default to false)
64
+ # @option opts [Integer] :data_source_id
65
+ # @option opts [String] :repository
66
+ # @return [APIResponse] data is Issue, status code, headers and response
67
+ private def get_issue_with_http_info_impl(issue_number, opts = {})
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug 'Calling API: GithubApi.get_issue ...'
70
+ end
71
+ # verify the required parameter 'issue_number' is set
72
+ if @api_client.config.client_side_validation && issue_number.nil?
73
+ fail ArgumentError, "Missing the required parameter 'issue_number' when calling GithubApi.get_issue"
74
+ end
75
+ # resource path
76
+ local_var_path = '/integrations/data/github/issues/{issue_number}'.sub('{' + 'issue_number' + '}', CGI.escape(issue_number.to_s))
77
+
78
+ # query parameters
79
+ query_params = opts[:query_params] || {}
80
+ query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
81
+ query_params[:'data_source_id'] = opts[:'data_source_id'] if !opts[:'data_source_id'].nil?
82
+ query_params[:'repository'] = opts[:'repository'] if !opts[:'repository'].nil?
83
+
84
+ # header parameters
85
+ header_params = opts[:header_params] || {}
86
+ # HTTP header 'Accept' (if needed)
87
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
88
+
89
+ # form parameters
90
+ form_params = opts[:form_params] || {}
91
+
92
+ # http body (model)
93
+ post_body = opts[:debug_body]
94
+
95
+ # return_type
96
+ return_type = opts[:debug_return_type] || 'Issue'
97
+
98
+ # auth_names
99
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
100
+
101
+ new_options = opts.merge(
102
+ :operation => :"GithubApi.get_issue",
103
+ :header_params => header_params,
104
+ :query_params => query_params,
105
+ :form_params => form_params,
106
+ :body => post_body,
107
+ :auth_names => auth_names,
108
+ :return_type => return_type
109
+ )
110
+
111
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug "API called: GithubApi#get_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
114
+ end
115
+ APIResponse::new(data, status_code, headers, response)
116
+ end
117
+
118
+
119
+ # Issues
120
+ #
121
+ # @param data_source_id [Integer]
122
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
123
+ # @param include_remote_data [Boolean]
124
+ # @param page [Integer]
125
+ # @param page_size [Integer]
126
+ # @param next_cursor [String]
127
+ # @param filters [IssuesFilter]
128
+ # @param order_by [IssuesOrderBy]
129
+ # @param order_dir [OrderDirV2Nullable]
130
+ # @param body [IssuesInput]
131
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
132
+ def get_issues(data_source_id:, repository:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, filters: SENTINEL, order_by: 'created', order_dir: 'asc', extra: {})
133
+ _body = {}
134
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
135
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
136
+ _body[:repository] = repository if repository != SENTINEL
137
+ _body[:page] = page if page != SENTINEL
138
+ _body[:page_size] = page_size if page_size != SENTINEL
139
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
140
+ _body[:filters] = filters if filters != SENTINEL
141
+ _body[:order_by] = order_by if order_by != SENTINEL
142
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
143
+ issues_input = _body
144
+ api_response = get_issues_with_http_info_impl(issues_input, extra)
145
+ api_response.data
146
+ end
147
+
148
+ # Issues
149
+ #
150
+ # @param data_source_id [Integer]
151
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
152
+ # @param include_remote_data [Boolean]
153
+ # @param page [Integer]
154
+ # @param page_size [Integer]
155
+ # @param next_cursor [String]
156
+ # @param filters [IssuesFilter]
157
+ # @param order_by [IssuesOrderBy]
158
+ # @param order_dir [OrderDirV2Nullable]
159
+ # @param body [IssuesInput]
160
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
161
+ def get_issues_with_http_info(data_source_id:, repository:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, filters: SENTINEL, order_by: 'created', order_dir: 'asc', extra: {})
162
+ _body = {}
163
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
164
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
165
+ _body[:repository] = repository if repository != SENTINEL
166
+ _body[:page] = page if page != SENTINEL
167
+ _body[:page_size] = page_size if page_size != SENTINEL
168
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
169
+ _body[:filters] = filters if filters != SENTINEL
170
+ _body[:order_by] = order_by if order_by != SENTINEL
171
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
172
+ issues_input = _body
173
+ get_issues_with_http_info_impl(issues_input, extra)
174
+ end
175
+
176
+ # Issues
177
+ # @param issues_input [IssuesInput]
178
+ # @param [Hash] opts the optional parameters
179
+ # @return [IssuesResponse]
180
+ private def get_issues_impl(issues_input, opts = {})
181
+ data, _status_code, _headers = get_issues_with_http_info(issues_input, opts)
182
+ data
183
+ end
184
+
185
+ # Issues
186
+ # @param issues_input [IssuesInput]
187
+ # @param [Hash] opts the optional parameters
188
+ # @return [APIResponse] data is IssuesResponse, status code, headers and response
189
+ private def get_issues_with_http_info_impl(issues_input, opts = {})
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug 'Calling API: GithubApi.get_issues ...'
192
+ end
193
+ # verify the required parameter 'issues_input' is set
194
+ if @api_client.config.client_side_validation && issues_input.nil?
195
+ fail ArgumentError, "Missing the required parameter 'issues_input' when calling GithubApi.get_issues"
196
+ end
197
+ # resource path
198
+ local_var_path = '/integrations/data/github/issues'
199
+
200
+ # query parameters
201
+ query_params = opts[:query_params] || {}
202
+
203
+ # header parameters
204
+ header_params = opts[:header_params] || {}
205
+ # HTTP header 'Accept' (if needed)
206
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
207
+ # HTTP header 'Content-Type'
208
+ content_type = @api_client.select_header_content_type(['application/json'])
209
+ if !content_type.nil?
210
+ header_params['Content-Type'] = content_type
211
+ end
212
+
213
+ # form parameters
214
+ form_params = opts[:form_params] || {}
215
+
216
+ # http body (model)
217
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(issues_input)
218
+
219
+ # return_type
220
+ return_type = opts[:debug_return_type] || 'IssuesResponse'
221
+
222
+ # auth_names
223
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
224
+
225
+ new_options = opts.merge(
226
+ :operation => :"GithubApi.get_issues",
227
+ :header_params => header_params,
228
+ :query_params => query_params,
229
+ :form_params => form_params,
230
+ :body => post_body,
231
+ :auth_names => auth_names,
232
+ :return_type => return_type
233
+ )
234
+
235
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called: GithubApi#get_issues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
+ end
239
+ APIResponse::new(data, status_code, headers, response)
240
+ end
241
+
242
+
243
+ # Get Pr
244
+ #
245
+ # @param pull_number [Integer]
246
+ # @param include_remote_data [Boolean]
247
+ # @param data_source_id [Integer]
248
+ # @param repository [String]
249
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
250
+ def get_pr(pull_number:, include_remote_data: false, data_source_id: SENTINEL, repository: SENTINEL, extra: {})
251
+ extra[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
252
+ extra[:data_source_id] = data_source_id if data_source_id != SENTINEL
253
+ extra[:repository] = repository if repository != SENTINEL
254
+ api_response = get_pr_with_http_info_impl(pull_number, extra)
255
+ api_response.data
256
+ end
257
+
258
+ # Get Pr
259
+ #
260
+ # @param pull_number [Integer]
261
+ # @param include_remote_data [Boolean]
262
+ # @param data_source_id [Integer]
263
+ # @param repository [String]
264
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
265
+ def get_pr_with_http_info(pull_number:, include_remote_data: false, data_source_id: SENTINEL, repository: SENTINEL, extra: {})
266
+ extra[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
267
+ extra[:data_source_id] = data_source_id if data_source_id != SENTINEL
268
+ extra[:repository] = repository if repository != SENTINEL
269
+ get_pr_with_http_info_impl(pull_number, extra)
270
+ end
271
+
272
+ # Get Pr
273
+ # @param pull_number [Integer]
274
+ # @param [Hash] opts the optional parameters
275
+ # @option opts [Boolean] :include_remote_data (default to false)
276
+ # @option opts [Integer] :data_source_id
277
+ # @option opts [String] :repository
278
+ # @return [PullRequestExtended]
279
+ private def get_pr_impl(pull_number, opts = {})
280
+ data, _status_code, _headers = get_pr_with_http_info(pull_number, opts)
281
+ data
282
+ end
283
+
284
+ # Get Pr
285
+ # @param pull_number [Integer]
286
+ # @param [Hash] opts the optional parameters
287
+ # @option opts [Boolean] :include_remote_data (default to false)
288
+ # @option opts [Integer] :data_source_id
289
+ # @option opts [String] :repository
290
+ # @return [APIResponse] data is PullRequestExtended, status code, headers and response
291
+ private def get_pr_with_http_info_impl(pull_number, opts = {})
292
+ if @api_client.config.debugging
293
+ @api_client.config.logger.debug 'Calling API: GithubApi.get_pr ...'
294
+ end
295
+ # verify the required parameter 'pull_number' is set
296
+ if @api_client.config.client_side_validation && pull_number.nil?
297
+ fail ArgumentError, "Missing the required parameter 'pull_number' when calling GithubApi.get_pr"
298
+ end
299
+ # resource path
300
+ local_var_path = '/integrations/data/github/pull_requests/{pull_number}'.sub('{' + 'pull_number' + '}', CGI.escape(pull_number.to_s))
301
+
302
+ # query parameters
303
+ query_params = opts[:query_params] || {}
304
+ query_params[:'include_remote_data'] = opts[:'include_remote_data'] if !opts[:'include_remote_data'].nil?
305
+ query_params[:'data_source_id'] = opts[:'data_source_id'] if !opts[:'data_source_id'].nil?
306
+ query_params[:'repository'] = opts[:'repository'] if !opts[:'repository'].nil?
307
+
308
+ # header parameters
309
+ header_params = opts[:header_params] || {}
310
+ # HTTP header 'Accept' (if needed)
311
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
312
+
313
+ # form parameters
314
+ form_params = opts[:form_params] || {}
315
+
316
+ # http body (model)
317
+ post_body = opts[:debug_body]
318
+
319
+ # return_type
320
+ return_type = opts[:debug_return_type] || 'PullRequestExtended'
321
+
322
+ # auth_names
323
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
324
+
325
+ new_options = opts.merge(
326
+ :operation => :"GithubApi.get_pr",
327
+ :header_params => header_params,
328
+ :query_params => query_params,
329
+ :form_params => form_params,
330
+ :body => post_body,
331
+ :auth_names => auth_names,
332
+ :return_type => return_type
333
+ )
334
+
335
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
336
+ if @api_client.config.debugging
337
+ @api_client.config.logger.debug "API called: GithubApi#get_pr\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
338
+ end
339
+ APIResponse::new(data, status_code, headers, response)
340
+ end
341
+
342
+
343
+ # Pr Comments
344
+ #
345
+ # @param data_source_id [Integer]
346
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
347
+ # @param pull_number [Integer]
348
+ # @param include_remote_data [Boolean]
349
+ # @param page [Integer]
350
+ # @param page_size [Integer]
351
+ # @param next_cursor [String]
352
+ # @param order_by [CommentsOrderBy]
353
+ # @param order_dir [OrderDirV2Nullable]
354
+ # @param body [CommentsInput]
355
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
356
+ def get_pr_comments(data_source_id:, repository:, pull_number:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, order_by: 'created', order_dir: 'asc', extra: {})
357
+ _body = {}
358
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
359
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
360
+ _body[:repository] = repository if repository != SENTINEL
361
+ _body[:page] = page if page != SENTINEL
362
+ _body[:page_size] = page_size if page_size != SENTINEL
363
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
364
+ _body[:pull_number] = pull_number if pull_number != SENTINEL
365
+ _body[:order_by] = order_by if order_by != SENTINEL
366
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
367
+ comments_input = _body
368
+ api_response = get_pr_comments_with_http_info_impl(comments_input, extra)
369
+ api_response.data
370
+ end
371
+
372
+ # Pr Comments
373
+ #
374
+ # @param data_source_id [Integer]
375
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
376
+ # @param pull_number [Integer]
377
+ # @param include_remote_data [Boolean]
378
+ # @param page [Integer]
379
+ # @param page_size [Integer]
380
+ # @param next_cursor [String]
381
+ # @param order_by [CommentsOrderBy]
382
+ # @param order_dir [OrderDirV2Nullable]
383
+ # @param body [CommentsInput]
384
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
385
+ def get_pr_comments_with_http_info(data_source_id:, repository:, pull_number:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, order_by: 'created', order_dir: 'asc', extra: {})
386
+ _body = {}
387
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
388
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
389
+ _body[:repository] = repository if repository != SENTINEL
390
+ _body[:page] = page if page != SENTINEL
391
+ _body[:page_size] = page_size if page_size != SENTINEL
392
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
393
+ _body[:pull_number] = pull_number if pull_number != SENTINEL
394
+ _body[:order_by] = order_by if order_by != SENTINEL
395
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
396
+ comments_input = _body
397
+ get_pr_comments_with_http_info_impl(comments_input, extra)
398
+ end
399
+
400
+ # Pr Comments
401
+ # @param comments_input [CommentsInput]
402
+ # @param [Hash] opts the optional parameters
403
+ # @return [CommentsResponse]
404
+ private def get_pr_comments_impl(comments_input, opts = {})
405
+ data, _status_code, _headers = get_pr_comments_with_http_info(comments_input, opts)
406
+ data
407
+ end
408
+
409
+ # Pr Comments
410
+ # @param comments_input [CommentsInput]
411
+ # @param [Hash] opts the optional parameters
412
+ # @return [APIResponse] data is CommentsResponse, status code, headers and response
413
+ private def get_pr_comments_with_http_info_impl(comments_input, opts = {})
414
+ if @api_client.config.debugging
415
+ @api_client.config.logger.debug 'Calling API: GithubApi.get_pr_comments ...'
416
+ end
417
+ # verify the required parameter 'comments_input' is set
418
+ if @api_client.config.client_side_validation && comments_input.nil?
419
+ fail ArgumentError, "Missing the required parameter 'comments_input' when calling GithubApi.get_pr_comments"
420
+ end
421
+ # resource path
422
+ local_var_path = '/integrations/data/github/pull_requests/comments'
423
+
424
+ # query parameters
425
+ query_params = opts[:query_params] || {}
426
+
427
+ # header parameters
428
+ header_params = opts[:header_params] || {}
429
+ # HTTP header 'Accept' (if needed)
430
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
431
+ # HTTP header 'Content-Type'
432
+ content_type = @api_client.select_header_content_type(['application/json'])
433
+ if !content_type.nil?
434
+ header_params['Content-Type'] = content_type
435
+ end
436
+
437
+ # form parameters
438
+ form_params = opts[:form_params] || {}
439
+
440
+ # http body (model)
441
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(comments_input)
442
+
443
+ # return_type
444
+ return_type = opts[:debug_return_type] || 'CommentsResponse'
445
+
446
+ # auth_names
447
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
448
+
449
+ new_options = opts.merge(
450
+ :operation => :"GithubApi.get_pr_comments",
451
+ :header_params => header_params,
452
+ :query_params => query_params,
453
+ :form_params => form_params,
454
+ :body => post_body,
455
+ :auth_names => auth_names,
456
+ :return_type => return_type
457
+ )
458
+
459
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
460
+ if @api_client.config.debugging
461
+ @api_client.config.logger.debug "API called: GithubApi#get_pr_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
462
+ end
463
+ APIResponse::new(data, status_code, headers, response)
464
+ end
465
+
466
+
467
+ # Pr Commits
468
+ #
469
+ # @param data_source_id [Integer]
470
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
471
+ # @param pull_number [Integer]
472
+ # @param include_remote_data [Boolean]
473
+ # @param page [Integer]
474
+ # @param page_size [Integer]
475
+ # @param next_cursor [String]
476
+ # @param body [CommitsInput]
477
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
478
+ def get_pr_commits(data_source_id:, repository:, pull_number:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, extra: {})
479
+ _body = {}
480
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
481
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
482
+ _body[:repository] = repository if repository != SENTINEL
483
+ _body[:page] = page if page != SENTINEL
484
+ _body[:page_size] = page_size if page_size != SENTINEL
485
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
486
+ _body[:pull_number] = pull_number if pull_number != SENTINEL
487
+ commits_input = _body
488
+ api_response = get_pr_commits_with_http_info_impl(commits_input, extra)
489
+ api_response.data
490
+ end
491
+
492
+ # Pr Commits
493
+ #
494
+ # @param data_source_id [Integer]
495
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
496
+ # @param pull_number [Integer]
497
+ # @param include_remote_data [Boolean]
498
+ # @param page [Integer]
499
+ # @param page_size [Integer]
500
+ # @param next_cursor [String]
501
+ # @param body [CommitsInput]
502
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
503
+ def get_pr_commits_with_http_info(data_source_id:, repository:, pull_number:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, extra: {})
504
+ _body = {}
505
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
506
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
507
+ _body[:repository] = repository if repository != SENTINEL
508
+ _body[:page] = page if page != SENTINEL
509
+ _body[:page_size] = page_size if page_size != SENTINEL
510
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
511
+ _body[:pull_number] = pull_number if pull_number != SENTINEL
512
+ commits_input = _body
513
+ get_pr_commits_with_http_info_impl(commits_input, extra)
514
+ end
515
+
516
+ # Pr Commits
517
+ # @param commits_input [CommitsInput]
518
+ # @param [Hash] opts the optional parameters
519
+ # @return [CommitsResponse]
520
+ private def get_pr_commits_impl(commits_input, opts = {})
521
+ data, _status_code, _headers = get_pr_commits_with_http_info(commits_input, opts)
522
+ data
523
+ end
524
+
525
+ # Pr Commits
526
+ # @param commits_input [CommitsInput]
527
+ # @param [Hash] opts the optional parameters
528
+ # @return [APIResponse] data is CommitsResponse, status code, headers and response
529
+ private def get_pr_commits_with_http_info_impl(commits_input, opts = {})
530
+ if @api_client.config.debugging
531
+ @api_client.config.logger.debug 'Calling API: GithubApi.get_pr_commits ...'
532
+ end
533
+ # verify the required parameter 'commits_input' is set
534
+ if @api_client.config.client_side_validation && commits_input.nil?
535
+ fail ArgumentError, "Missing the required parameter 'commits_input' when calling GithubApi.get_pr_commits"
536
+ end
537
+ # resource path
538
+ local_var_path = '/integrations/data/github/pull_requests/commits'
539
+
540
+ # query parameters
541
+ query_params = opts[:query_params] || {}
542
+
543
+ # header parameters
544
+ header_params = opts[:header_params] || {}
545
+ # HTTP header 'Accept' (if needed)
546
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
547
+ # HTTP header 'Content-Type'
548
+ content_type = @api_client.select_header_content_type(['application/json'])
549
+ if !content_type.nil?
550
+ header_params['Content-Type'] = content_type
551
+ end
552
+
553
+ # form parameters
554
+ form_params = opts[:form_params] || {}
555
+
556
+ # http body (model)
557
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(commits_input)
558
+
559
+ # return_type
560
+ return_type = opts[:debug_return_type] || 'CommitsResponse'
561
+
562
+ # auth_names
563
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
564
+
565
+ new_options = opts.merge(
566
+ :operation => :"GithubApi.get_pr_commits",
567
+ :header_params => header_params,
568
+ :query_params => query_params,
569
+ :form_params => form_params,
570
+ :body => post_body,
571
+ :auth_names => auth_names,
572
+ :return_type => return_type
573
+ )
574
+
575
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
576
+ if @api_client.config.debugging
577
+ @api_client.config.logger.debug "API called: GithubApi#get_pr_commits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
578
+ end
579
+ APIResponse::new(data, status_code, headers, response)
580
+ end
581
+
582
+
583
+ # Pr Files
584
+ #
585
+ # @param data_source_id [Integer]
586
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
587
+ # @param pull_number [Integer]
588
+ # @param include_remote_data [Boolean]
589
+ # @param page [Integer]
590
+ # @param page_size [Integer]
591
+ # @param next_cursor [String]
592
+ # @param body [FilesInput]
593
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
594
+ def get_pr_files(data_source_id:, repository:, pull_number:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, extra: {})
595
+ _body = {}
596
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
597
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
598
+ _body[:repository] = repository if repository != SENTINEL
599
+ _body[:page] = page if page != SENTINEL
600
+ _body[:page_size] = page_size if page_size != SENTINEL
601
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
602
+ _body[:pull_number] = pull_number if pull_number != SENTINEL
603
+ files_input = _body
604
+ api_response = get_pr_files_with_http_info_impl(files_input, extra)
605
+ api_response.data
606
+ end
607
+
608
+ # Pr Files
609
+ #
610
+ # @param data_source_id [Integer]
611
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
612
+ # @param pull_number [Integer]
613
+ # @param include_remote_data [Boolean]
614
+ # @param page [Integer]
615
+ # @param page_size [Integer]
616
+ # @param next_cursor [String]
617
+ # @param body [FilesInput]
618
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
619
+ def get_pr_files_with_http_info(data_source_id:, repository:, pull_number:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, extra: {})
620
+ _body = {}
621
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
622
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
623
+ _body[:repository] = repository if repository != SENTINEL
624
+ _body[:page] = page if page != SENTINEL
625
+ _body[:page_size] = page_size if page_size != SENTINEL
626
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
627
+ _body[:pull_number] = pull_number if pull_number != SENTINEL
628
+ files_input = _body
629
+ get_pr_files_with_http_info_impl(files_input, extra)
630
+ end
631
+
632
+ # Pr Files
633
+ # @param files_input [FilesInput]
634
+ # @param [Hash] opts the optional parameters
635
+ # @return [FilesResponse]
636
+ private def get_pr_files_impl(files_input, opts = {})
637
+ data, _status_code, _headers = get_pr_files_with_http_info(files_input, opts)
638
+ data
639
+ end
640
+
641
+ # Pr Files
642
+ # @param files_input [FilesInput]
643
+ # @param [Hash] opts the optional parameters
644
+ # @return [APIResponse] data is FilesResponse, status code, headers and response
645
+ private def get_pr_files_with_http_info_impl(files_input, opts = {})
646
+ if @api_client.config.debugging
647
+ @api_client.config.logger.debug 'Calling API: GithubApi.get_pr_files ...'
648
+ end
649
+ # verify the required parameter 'files_input' is set
650
+ if @api_client.config.client_side_validation && files_input.nil?
651
+ fail ArgumentError, "Missing the required parameter 'files_input' when calling GithubApi.get_pr_files"
652
+ end
653
+ # resource path
654
+ local_var_path = '/integrations/data/github/pull_requests/files'
655
+
656
+ # query parameters
657
+ query_params = opts[:query_params] || {}
658
+
659
+ # header parameters
660
+ header_params = opts[:header_params] || {}
661
+ # HTTP header 'Accept' (if needed)
662
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
663
+ # HTTP header 'Content-Type'
664
+ content_type = @api_client.select_header_content_type(['application/json'])
665
+ if !content_type.nil?
666
+ header_params['Content-Type'] = content_type
667
+ end
668
+
669
+ # form parameters
670
+ form_params = opts[:form_params] || {}
671
+
672
+ # http body (model)
673
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(files_input)
674
+
675
+ # return_type
676
+ return_type = opts[:debug_return_type] || 'FilesResponse'
677
+
678
+ # auth_names
679
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
680
+
681
+ new_options = opts.merge(
682
+ :operation => :"GithubApi.get_pr_files",
683
+ :header_params => header_params,
684
+ :query_params => query_params,
685
+ :form_params => form_params,
686
+ :body => post_body,
687
+ :auth_names => auth_names,
688
+ :return_type => return_type
689
+ )
690
+
691
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
692
+ if @api_client.config.debugging
693
+ @api_client.config.logger.debug "API called: GithubApi#get_pr_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
694
+ end
695
+ APIResponse::new(data, status_code, headers, response)
696
+ end
697
+
698
+
699
+ # Get Prs
700
+ #
701
+ # @param data_source_id [Integer]
702
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
703
+ # @param include_remote_data [Boolean]
704
+ # @param page [Integer]
705
+ # @param page_size [Integer]
706
+ # @param next_cursor [String]
707
+ # @param filters [PullRequestFilters]
708
+ # @param order_by [PROrderBy]
709
+ # @param order_dir [OrderDirV2Nullable]
710
+ # @param body [PullRequestsInput]
711
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
712
+ def get_pull_requests(data_source_id:, repository:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, filters: SENTINEL, order_by: 'created', order_dir: 'asc', extra: {})
713
+ _body = {}
714
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
715
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
716
+ _body[:repository] = repository if repository != SENTINEL
717
+ _body[:page] = page if page != SENTINEL
718
+ _body[:page_size] = page_size if page_size != SENTINEL
719
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
720
+ _body[:filters] = filters if filters != SENTINEL
721
+ _body[:order_by] = order_by if order_by != SENTINEL
722
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
723
+ pull_requests_input = _body
724
+ api_response = get_pull_requests_with_http_info_impl(pull_requests_input, extra)
725
+ api_response.data
726
+ end
727
+
728
+ # Get Prs
729
+ #
730
+ # @param data_source_id [Integer]
731
+ # @param repository [String] Full name of the repository, denoted as {owner}/{repo}
732
+ # @param include_remote_data [Boolean]
733
+ # @param page [Integer]
734
+ # @param page_size [Integer]
735
+ # @param next_cursor [String]
736
+ # @param filters [PullRequestFilters]
737
+ # @param order_by [PROrderBy]
738
+ # @param order_dir [OrderDirV2Nullable]
739
+ # @param body [PullRequestsInput]
740
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
741
+ def get_pull_requests_with_http_info(data_source_id:, repository:, include_remote_data: false, page: 1, page_size: 30, next_cursor: SENTINEL, filters: SENTINEL, order_by: 'created', order_dir: 'asc', extra: {})
742
+ _body = {}
743
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
744
+ _body[:include_remote_data] = include_remote_data if include_remote_data != SENTINEL
745
+ _body[:repository] = repository if repository != SENTINEL
746
+ _body[:page] = page if page != SENTINEL
747
+ _body[:page_size] = page_size if page_size != SENTINEL
748
+ _body[:next_cursor] = next_cursor if next_cursor != SENTINEL
749
+ _body[:filters] = filters if filters != SENTINEL
750
+ _body[:order_by] = order_by if order_by != SENTINEL
751
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
752
+ pull_requests_input = _body
753
+ get_pull_requests_with_http_info_impl(pull_requests_input, extra)
754
+ end
755
+
756
+ # Get Prs
757
+ # @param pull_requests_input [PullRequestsInput]
758
+ # @param [Hash] opts the optional parameters
759
+ # @return [PullRequestResponse]
760
+ private def get_pull_requests_impl(pull_requests_input, opts = {})
761
+ data, _status_code, _headers = get_pull_requests_with_http_info(pull_requests_input, opts)
762
+ data
763
+ end
764
+
765
+ # Get Prs
766
+ # @param pull_requests_input [PullRequestsInput]
767
+ # @param [Hash] opts the optional parameters
768
+ # @return [APIResponse] data is PullRequestResponse, status code, headers and response
769
+ private def get_pull_requests_with_http_info_impl(pull_requests_input, opts = {})
770
+ if @api_client.config.debugging
771
+ @api_client.config.logger.debug 'Calling API: GithubApi.get_pull_requests ...'
772
+ end
773
+ # verify the required parameter 'pull_requests_input' is set
774
+ if @api_client.config.client_side_validation && pull_requests_input.nil?
775
+ fail ArgumentError, "Missing the required parameter 'pull_requests_input' when calling GithubApi.get_pull_requests"
776
+ end
777
+ # resource path
778
+ local_var_path = '/integrations/data/github/pull_requests'
779
+
780
+ # query parameters
781
+ query_params = opts[:query_params] || {}
782
+
783
+ # header parameters
784
+ header_params = opts[:header_params] || {}
785
+ # HTTP header 'Accept' (if needed)
786
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
787
+ # HTTP header 'Content-Type'
788
+ content_type = @api_client.select_header_content_type(['application/json'])
789
+ if !content_type.nil?
790
+ header_params['Content-Type'] = content_type
791
+ end
792
+
793
+ # form parameters
794
+ form_params = opts[:form_params] || {}
795
+
796
+ # http body (model)
797
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(pull_requests_input)
798
+
799
+ # return_type
800
+ return_type = opts[:debug_return_type] || 'PullRequestResponse'
801
+
802
+ # auth_names
803
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
804
+
805
+ new_options = opts.merge(
806
+ :operation => :"GithubApi.get_pull_requests",
807
+ :header_params => header_params,
808
+ :query_params => query_params,
809
+ :form_params => form_params,
810
+ :body => post_body,
811
+ :auth_names => auth_names,
812
+ :return_type => return_type
813
+ )
814
+
815
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
816
+ if @api_client.config.debugging
817
+ @api_client.config.logger.debug "API called: GithubApi#get_pull_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
818
+ end
819
+ APIResponse::new(data, status_code, headers, response)
820
+ end
821
+ end
822
+
823
+ # top-level client access to avoid having the user to insantiate their own API instances
824
+ Github = GithubApi::new
825
+ end