pescheck 0.0.1

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 (143) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +193 -0
  4. data/Rakefile +10 -0
  5. data/docs/AuthenticationApi.md +217 -0
  6. data/docs/ChecksApi.md +147 -0
  7. data/docs/CustomTokenObtainPair.md +20 -0
  8. data/docs/DivisionReadOnly.md +46 -0
  9. data/docs/DivisionWrite.md +40 -0
  10. data/docs/DivisionsApi.md +369 -0
  11. data/docs/JWTGeneration.md +24 -0
  12. data/docs/JWTResponse.md +28 -0
  13. data/docs/OAuthApi.md +213 -0
  14. data/docs/OAuthApplication.md +26 -0
  15. data/docs/OAuthApplicationResponse.md +32 -0
  16. data/docs/PaginatedDivisionReadOnlyList.md +24 -0
  17. data/docs/PaginatedV2ProfileListItemList.md +24 -0
  18. data/docs/PaginatedV2ScreeningListItemList.md +24 -0
  19. data/docs/PatchedDivisionWrite.md +40 -0
  20. data/docs/PatchedV2ProfilePartialUpdate.md +20 -0
  21. data/docs/ProfilesApi.md +438 -0
  22. data/docs/ScreeningsApi.md +293 -0
  23. data/docs/TokenRefresh.md +20 -0
  24. data/docs/V2Candidate.md +36 -0
  25. data/docs/V2CheckField.md +26 -0
  26. data/docs/V2CheckInfo.md +40 -0
  27. data/docs/V2Document.md +28 -0
  28. data/docs/V2DocumentContent.md +20 -0
  29. data/docs/V2Money.md +20 -0
  30. data/docs/V2ProfileCheck.md +20 -0
  31. data/docs/V2ProfileCheckEntry.md +30 -0
  32. data/docs/V2ProfileCreate.md +22 -0
  33. data/docs/V2ProfileDetail.md +38 -0
  34. data/docs/V2ProfileListItem.md +30 -0
  35. data/docs/V2ProfileUpdate.md +22 -0
  36. data/docs/V2ProfileUpdateCheck.md +22 -0
  37. data/docs/V2ScreeningCheck.md +24 -0
  38. data/docs/V2ScreeningCheckEntry.md +34 -0
  39. data/docs/V2ScreeningCheckListItem.md +22 -0
  40. data/docs/V2ScreeningCreate.md +22 -0
  41. data/docs/V2ScreeningDetail.md +34 -0
  42. data/docs/V2ScreeningDetailProfile.md +20 -0
  43. data/docs/V2ScreeningListItem.md +34 -0
  44. data/docs/VerifyWebhook.md +18 -0
  45. data/docs/Webhook.md +26 -0
  46. data/docs/WebhookResponse.md +36 -0
  47. data/docs/WebhooksApi.md +290 -0
  48. data/git_push.sh +57 -0
  49. data/lib/pescheck/api/authentication_api.rb +220 -0
  50. data/lib/pescheck/api/checks_api.rb +144 -0
  51. data/lib/pescheck/api/divisions_api.rb +365 -0
  52. data/lib/pescheck/api/o_auth_api.rb +202 -0
  53. data/lib/pescheck/api/profiles_api.rb +432 -0
  54. data/lib/pescheck/api/screenings_api.rb +288 -0
  55. data/lib/pescheck/api/webhooks_api.rb +278 -0
  56. data/lib/pescheck/api_client.rb +441 -0
  57. data/lib/pescheck/api_error.rb +58 -0
  58. data/lib/pescheck/api_model_base.rb +88 -0
  59. data/lib/pescheck/configuration.rb +429 -0
  60. data/lib/pescheck/models/custom_token_obtain_pair.rb +191 -0
  61. data/lib/pescheck/models/division_read_only.rb +469 -0
  62. data/lib/pescheck/models/division_write.rb +436 -0
  63. data/lib/pescheck/models/jwt_generation.rb +213 -0
  64. data/lib/pescheck/models/jwt_response.rb +285 -0
  65. data/lib/pescheck/models/o_auth_application.rb +265 -0
  66. data/lib/pescheck/models/o_auth_application_response.rb +379 -0
  67. data/lib/pescheck/models/paginated_division_read_only_list.rb +216 -0
  68. data/lib/pescheck/models/paginated_v2_profile_list_item_list.rb +216 -0
  69. data/lib/pescheck/models/paginated_v2_screening_list_item_list.rb +216 -0
  70. data/lib/pescheck/models/patched_division_write.rb +360 -0
  71. data/lib/pescheck/models/patched_v2_profile_partial_update.rb +176 -0
  72. data/lib/pescheck/models/token_refresh.rb +173 -0
  73. data/lib/pescheck/models/v2_candidate.rb +390 -0
  74. data/lib/pescheck/models/v2_check_field.rb +246 -0
  75. data/lib/pescheck/models/v2_check_info.rb +438 -0
  76. data/lib/pescheck/models/v2_document.rb +308 -0
  77. data/lib/pescheck/models/v2_document_content.rb +175 -0
  78. data/lib/pescheck/models/v2_money.rb +210 -0
  79. data/lib/pescheck/models/v2_profile_check.rb +201 -0
  80. data/lib/pescheck/models/v2_profile_check_entry.rb +349 -0
  81. data/lib/pescheck/models/v2_profile_create.rb +212 -0
  82. data/lib/pescheck/models/v2_profile_detail.rb +401 -0
  83. data/lib/pescheck/models/v2_profile_list_item.rb +291 -0
  84. data/lib/pescheck/models/v2_profile_update.rb +213 -0
  85. data/lib/pescheck/models/v2_profile_update_check.rb +210 -0
  86. data/lib/pescheck/models/v2_screening_check.rb +221 -0
  87. data/lib/pescheck/models/v2_screening_check_entry.rb +376 -0
  88. data/lib/pescheck/models/v2_screening_check_list_item.rb +242 -0
  89. data/lib/pescheck/models/v2_screening_create.rb +201 -0
  90. data/lib/pescheck/models/v2_screening_detail.rb +348 -0
  91. data/lib/pescheck/models/v2_screening_detail_profile.rb +156 -0
  92. data/lib/pescheck/models/v2_screening_list_item.rb +330 -0
  93. data/lib/pescheck/models/verify_webhook.rb +166 -0
  94. data/lib/pescheck/models/webhook.rb +265 -0
  95. data/lib/pescheck/models/webhook_response.rb +353 -0
  96. data/lib/pescheck/version.rb +15 -0
  97. data/lib/pescheck.rb +83 -0
  98. data/pescheck.gemspec +41 -0
  99. data/spec/api/authentication_api_spec.rb +68 -0
  100. data/spec/api/checks_api_spec.rb +56 -0
  101. data/spec/api/divisions_api_spec.rb +94 -0
  102. data/spec/api/o_auth_api_spec.rb +67 -0
  103. data/spec/api/profiles_api_spec.rb +105 -0
  104. data/spec/api/screenings_api_spec.rb +81 -0
  105. data/spec/api/webhooks_api_spec.rb +81 -0
  106. data/spec/models/custom_token_obtain_pair_spec.rb +42 -0
  107. data/spec/models/division_read_only_spec.rb +120 -0
  108. data/spec/models/division_write_spec.rb +102 -0
  109. data/spec/models/jwt_generation_spec.rb +54 -0
  110. data/spec/models/jwt_response_spec.rb +66 -0
  111. data/spec/models/o_auth_application_response_spec.rb +86 -0
  112. data/spec/models/o_auth_application_spec.rb +68 -0
  113. data/spec/models/paginated_division_read_only_list_spec.rb +54 -0
  114. data/spec/models/paginated_v2_profile_list_item_list_spec.rb +54 -0
  115. data/spec/models/paginated_v2_screening_list_item_list_spec.rb +54 -0
  116. data/spec/models/patched_division_write_spec.rb +102 -0
  117. data/spec/models/patched_v2_profile_partial_update_spec.rb +42 -0
  118. data/spec/models/token_refresh_spec.rb +42 -0
  119. data/spec/models/v2_candidate_spec.rb +94 -0
  120. data/spec/models/v2_check_field_spec.rb +60 -0
  121. data/spec/models/v2_check_info_spec.rb +102 -0
  122. data/spec/models/v2_document_content_spec.rb +42 -0
  123. data/spec/models/v2_document_spec.rb +70 -0
  124. data/spec/models/v2_money_spec.rb +42 -0
  125. data/spec/models/v2_profile_check_entry_spec.rb +76 -0
  126. data/spec/models/v2_profile_check_spec.rb +46 -0
  127. data/spec/models/v2_profile_create_spec.rb +48 -0
  128. data/spec/models/v2_profile_detail_spec.rb +96 -0
  129. data/spec/models/v2_profile_list_item_spec.rb +72 -0
  130. data/spec/models/v2_profile_update_check_spec.rb +52 -0
  131. data/spec/models/v2_profile_update_spec.rb +48 -0
  132. data/spec/models/v2_screening_check_entry_spec.rb +88 -0
  133. data/spec/models/v2_screening_check_list_item_spec.rb +52 -0
  134. data/spec/models/v2_screening_check_spec.rb +58 -0
  135. data/spec/models/v2_screening_create_spec.rb +48 -0
  136. data/spec/models/v2_screening_detail_profile_spec.rb +42 -0
  137. data/spec/models/v2_screening_detail_spec.rb +84 -0
  138. data/spec/models/v2_screening_list_item_spec.rb +84 -0
  139. data/spec/models/verify_webhook_spec.rb +36 -0
  140. data/spec/models/webhook_response_spec.rb +90 -0
  141. data/spec/models/webhook_spec.rb +64 -0
  142. data/spec/spec_helper.rb +111 -0
  143. metadata +302 -0
@@ -0,0 +1,288 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #API for Pescheck ## Authentication This API supports three authentication methods: 1. **OAuth2** (recommended for API clients) - Use client credentials flow 2. **JWT Bearer** (for user-based access) - Obtain tokens via /api/jwt/ endpoint 3. **Cookie** (for browser-based access) - Session authentication via web login ## Quick Start for API Clients 1. Select your environment from the servers dropdown 2. Use OAuth2 with client credentials flow 3. Scopes are automatically included: read:api, create:api, update:api
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Pescheck
16
+ class ScreeningsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # @param v2_screening_create [V2ScreeningCreate]
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [V2ScreeningDetail]
25
+ def v2_screenings_create(v2_screening_create, opts = {})
26
+ data, _status_code, _headers = v2_screenings_create_with_http_info(v2_screening_create, opts)
27
+ data
28
+ end
29
+
30
+ # @param v2_screening_create [V2ScreeningCreate]
31
+ # @param [Hash] opts the optional parameters
32
+ # @return [Array<(V2ScreeningDetail, Integer, Hash)>] V2ScreeningDetail data, response status code and response headers
33
+ def v2_screenings_create_with_http_info(v2_screening_create, opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: ScreeningsApi.v2_screenings_create ...'
36
+ end
37
+ # verify the required parameter 'v2_screening_create' is set
38
+ if @api_client.config.client_side_validation && v2_screening_create.nil?
39
+ fail ArgumentError, "Missing the required parameter 'v2_screening_create' when calling ScreeningsApi.v2_screenings_create"
40
+ end
41
+ # resource path
42
+ local_var_path = '/api/v2/screenings/'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
+ # HTTP header 'Content-Type'
52
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
53
+ if !content_type.nil?
54
+ header_params['Content-Type'] = content_type
55
+ end
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(v2_screening_create)
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'V2ScreeningDetail'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || ['oauth2']
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"ScreeningsApi.v2_screenings_create",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: ScreeningsApi#v2_screenings_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Retrieve screening documents
87
+ # Documents attached to the screening's checks. Files are delivered inline as Base64 in `content`. Narrow the result with `check_id` or `check_type`.
88
+ # @param id [String]
89
+ # @param [Hash] opts the optional parameters
90
+ # @option opts [String] :check_id Only documents from the check with this id.
91
+ # @option opts [String] :check_type Only documents from checks of this type.
92
+ # @return [Array<V2Document>]
93
+ def v2_screenings_documents_list(id, opts = {})
94
+ data, _status_code, _headers = v2_screenings_documents_list_with_http_info(id, opts)
95
+ data
96
+ end
97
+
98
+ # Retrieve screening documents
99
+ # Documents attached to the screening&#39;s checks. Files are delivered inline as Base64 in &#x60;content&#x60;. Narrow the result with &#x60;check_id&#x60; or &#x60;check_type&#x60;.
100
+ # @param id [String]
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [String] :check_id Only documents from the check with this id.
103
+ # @option opts [String] :check_type Only documents from checks of this type.
104
+ # @return [Array<(Array<V2Document>, Integer, Hash)>] Array<V2Document> data, response status code and response headers
105
+ def v2_screenings_documents_list_with_http_info(id, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: ScreeningsApi.v2_screenings_documents_list ...'
108
+ end
109
+ # verify the required parameter 'id' is set
110
+ if @api_client.config.client_side_validation && id.nil?
111
+ fail ArgumentError, "Missing the required parameter 'id' when calling ScreeningsApi.v2_screenings_documents_list"
112
+ end
113
+ # resource path
114
+ local_var_path = '/api/v2/screenings/{id}/documents/'.sub('{id}', CGI.escape(id.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+ query_params[:'check_id'] = opts[:'check_id'] if !opts[:'check_id'].nil?
119
+ query_params[:'check_type'] = opts[:'check_type'] if !opts[:'check_type'].nil?
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:debug_body]
131
+
132
+ # return_type
133
+ return_type = opts[:debug_return_type] || 'Array<V2Document>'
134
+
135
+ # auth_names
136
+ auth_names = opts[:debug_auth_names] || ['oauth2']
137
+
138
+ new_options = opts.merge(
139
+ :operation => :"ScreeningsApi.v2_screenings_documents_list",
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "API called: ScreeningsApi#v2_screenings_documents_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # @param [Hash] opts the optional parameters
156
+ # @option opts [Integer] :page A page number within the paginated result set. (default to 1)
157
+ # @option opts [Integer] :page_size Number of results to return per page. (default to 50)
158
+ # @option opts [Boolean] :paginate Enable/disable pagination. When false, max 500 records returned. (default to true)
159
+ # @return [PaginatedV2ScreeningListItemList]
160
+ def v2_screenings_list(opts = {})
161
+ data, _status_code, _headers = v2_screenings_list_with_http_info(opts)
162
+ data
163
+ end
164
+
165
+ # @param [Hash] opts the optional parameters
166
+ # @option opts [Integer] :page A page number within the paginated result set. (default to 1)
167
+ # @option opts [Integer] :page_size Number of results to return per page. (default to 50)
168
+ # @option opts [Boolean] :paginate Enable/disable pagination. When false, max 500 records returned. (default to true)
169
+ # @return [Array<(PaginatedV2ScreeningListItemList, Integer, Hash)>] PaginatedV2ScreeningListItemList data, response status code and response headers
170
+ def v2_screenings_list_with_http_info(opts = {})
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug 'Calling API: ScreeningsApi.v2_screenings_list ...'
173
+ end
174
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
175
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ScreeningsApi.v2_screenings_list, must be greater than or equal to 1.'
176
+ end
177
+
178
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
179
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ScreeningsApi.v2_screenings_list, must be smaller than or equal to 100.'
180
+ end
181
+
182
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
183
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ScreeningsApi.v2_screenings_list, must be greater than or equal to 1.'
184
+ end
185
+
186
+ # resource path
187
+ local_var_path = '/api/v2/screenings/'
188
+
189
+ # query parameters
190
+ query_params = opts[:query_params] || {}
191
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
192
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
193
+ query_params[:'paginate'] = opts[:'paginate'] if !opts[:'paginate'].nil?
194
+
195
+ # header parameters
196
+ header_params = opts[:header_params] || {}
197
+ # HTTP header 'Accept' (if needed)
198
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
199
+
200
+ # form parameters
201
+ form_params = opts[:form_params] || {}
202
+
203
+ # http body (model)
204
+ post_body = opts[:debug_body]
205
+
206
+ # return_type
207
+ return_type = opts[:debug_return_type] || 'PaginatedV2ScreeningListItemList'
208
+
209
+ # auth_names
210
+ auth_names = opts[:debug_auth_names] || ['oauth2']
211
+
212
+ new_options = opts.merge(
213
+ :operation => :"ScreeningsApi.v2_screenings_list",
214
+ :header_params => header_params,
215
+ :query_params => query_params,
216
+ :form_params => form_params,
217
+ :body => post_body,
218
+ :auth_names => auth_names,
219
+ :return_type => return_type
220
+ )
221
+
222
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
223
+ if @api_client.config.debugging
224
+ @api_client.config.logger.debug "API called: ScreeningsApi#v2_screenings_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
225
+ end
226
+ return data, status_code, headers
227
+ end
228
+
229
+ # @param id [String] A UUID string identifying this screening.
230
+ # @param [Hash] opts the optional parameters
231
+ # @return [V2ScreeningDetail]
232
+ def v2_screenings_retrieve(id, opts = {})
233
+ data, _status_code, _headers = v2_screenings_retrieve_with_http_info(id, opts)
234
+ data
235
+ end
236
+
237
+ # @param id [String] A UUID string identifying this screening.
238
+ # @param [Hash] opts the optional parameters
239
+ # @return [Array<(V2ScreeningDetail, Integer, Hash)>] V2ScreeningDetail data, response status code and response headers
240
+ def v2_screenings_retrieve_with_http_info(id, opts = {})
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug 'Calling API: ScreeningsApi.v2_screenings_retrieve ...'
243
+ end
244
+ # verify the required parameter 'id' is set
245
+ if @api_client.config.client_side_validation && id.nil?
246
+ fail ArgumentError, "Missing the required parameter 'id' when calling ScreeningsApi.v2_screenings_retrieve"
247
+ end
248
+ # resource path
249
+ local_var_path = '/api/v2/screenings/{id}/'.sub('{id}', CGI.escape(id.to_s))
250
+
251
+ # query parameters
252
+ query_params = opts[:query_params] || {}
253
+
254
+ # header parameters
255
+ header_params = opts[:header_params] || {}
256
+ # HTTP header 'Accept' (if needed)
257
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
258
+
259
+ # form parameters
260
+ form_params = opts[:form_params] || {}
261
+
262
+ # http body (model)
263
+ post_body = opts[:debug_body]
264
+
265
+ # return_type
266
+ return_type = opts[:debug_return_type] || 'V2ScreeningDetail'
267
+
268
+ # auth_names
269
+ auth_names = opts[:debug_auth_names] || ['oauth2']
270
+
271
+ new_options = opts.merge(
272
+ :operation => :"ScreeningsApi.v2_screenings_retrieve",
273
+ :header_params => header_params,
274
+ :query_params => query_params,
275
+ :form_params => form_params,
276
+ :body => post_body,
277
+ :auth_names => auth_names,
278
+ :return_type => return_type
279
+ )
280
+
281
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
282
+ if @api_client.config.debugging
283
+ @api_client.config.logger.debug "API called: ScreeningsApi#v2_screenings_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
284
+ end
285
+ return data, status_code, headers
286
+ end
287
+ end
288
+ end
@@ -0,0 +1,278 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #API for Pescheck ## Authentication This API supports three authentication methods: 1. **OAuth2** (recommended for API clients) - Use client credentials flow 2. **JWT Bearer** (for user-based access) - Obtain tokens via /api/jwt/ endpoint 3. **Cookie** (for browser-based access) - Session authentication via web login ## Quick Start for API Clients 1. Select your environment from the servers dropdown 2. Use OAuth2 with client credentials flow 3. Scopes are automatically included: read:api, create:api, update:api
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Pescheck
16
+ class WebhooksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create webhook for event notifications. **Authentication Notes:** - OAuth2: Organization is automatically determined from the OAuth application - If your OAuth app has no organization set, pass it via `X-Organization-Id` header or `organization_id` query parameter **Valid Events:** - `check.started` - Check has been initiated - `check.completed` - Check has been completed successfully - `check.failed` - Check has failed - `screening.created` - New screening has been created - `screening.completed` - Screening has been completed - `screening.archived` - Screening has been archived - `package.created` - New package has been created - `package.updated` - Package has been updated - `division.created` - New division has been created - `division.updated` - Division has been updated Limited to 5 webhooks per organization/division.
23
+ # @param webhook [Webhook]
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :x_organization_id Organization ID (for JWT/Session auth only)
26
+ # @option opts [String] :organization_id Organization ID (for JWT/Session auth only)
27
+ # @return [WebhookResponse]
28
+ def create_webhook2(webhook, opts = {})
29
+ data, _status_code, _headers = create_webhook2_with_http_info(webhook, opts)
30
+ data
31
+ end
32
+
33
+ # Create webhook for event notifications. **Authentication Notes:** - OAuth2: Organization is automatically determined from the OAuth application - If your OAuth app has no organization set, pass it via &#x60;X-Organization-Id&#x60; header or &#x60;organization_id&#x60; query parameter **Valid Events:** - &#x60;check.started&#x60; - Check has been initiated - &#x60;check.completed&#x60; - Check has been completed successfully - &#x60;check.failed&#x60; - Check has failed - &#x60;screening.created&#x60; - New screening has been created - &#x60;screening.completed&#x60; - Screening has been completed - &#x60;screening.archived&#x60; - Screening has been archived - &#x60;package.created&#x60; - New package has been created - &#x60;package.updated&#x60; - Package has been updated - &#x60;division.created&#x60; - New division has been created - &#x60;division.updated&#x60; - Division has been updated Limited to 5 webhooks per organization/division.
34
+ # @param webhook [Webhook]
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [String] :x_organization_id Organization ID (for JWT/Session auth only)
37
+ # @option opts [String] :organization_id Organization ID (for JWT/Session auth only)
38
+ # @return [Array<(WebhookResponse, Integer, Hash)>] WebhookResponse data, response status code and response headers
39
+ def create_webhook2_with_http_info(webhook, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.create_webhook2 ...'
42
+ end
43
+ # verify the required parameter 'webhook' is set
44
+ if @api_client.config.client_side_validation && webhook.nil?
45
+ fail ArgumentError, "Missing the required parameter 'webhook' when calling WebhooksApi.create_webhook2"
46
+ end
47
+ # resource path
48
+ local_var_path = '/api/v2/webhooks/'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+ query_params[:'organization_id'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?
53
+
54
+ # header parameters
55
+ header_params = opts[:header_params] || {}
56
+ # HTTP header 'Accept' (if needed)
57
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
58
+ # HTTP header 'Content-Type'
59
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
60
+ if !content_type.nil?
61
+ header_params['Content-Type'] = content_type
62
+ end
63
+ header_params[:'X-Organization-Id'] = opts[:'x_organization_id'] if !opts[:'x_organization_id'].nil?
64
+
65
+ # form parameters
66
+ form_params = opts[:form_params] || {}
67
+
68
+ # http body (model)
69
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook)
70
+
71
+ # return_type
72
+ return_type = opts[:debug_return_type] || 'WebhookResponse'
73
+
74
+ # auth_names
75
+ auth_names = opts[:debug_auth_names] || ['oauth2']
76
+
77
+ new_options = opts.merge(
78
+ :operation => :"WebhooksApi.create_webhook2",
79
+ :header_params => header_params,
80
+ :query_params => query_params,
81
+ :form_params => form_params,
82
+ :body => post_body,
83
+ :auth_names => auth_names,
84
+ :return_type => return_type
85
+ )
86
+
87
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug "API called: WebhooksApi#create_webhook2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
+ end
91
+ return data, status_code, headers
92
+ end
93
+
94
+ # Delete a webhook
95
+ # @param webhook_id [String] Webhook ID to delete
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [nil]
98
+ def delete_webhook2(webhook_id, opts = {})
99
+ delete_webhook2_with_http_info(webhook_id, opts)
100
+ nil
101
+ end
102
+
103
+ # Delete a webhook
104
+ # @param webhook_id [String] Webhook ID to delete
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
107
+ def delete_webhook2_with_http_info(webhook_id, opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.delete_webhook2 ...'
110
+ end
111
+ # verify the required parameter 'webhook_id' is set
112
+ if @api_client.config.client_side_validation && webhook_id.nil?
113
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.delete_webhook2"
114
+ end
115
+ # resource path
116
+ local_var_path = '/api/v2/webhooks/{webhook_id}/'.sub('{webhook_id}', CGI.escape(webhook_id.to_s))
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type]
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['oauth2']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"WebhooksApi.delete_webhook2",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: WebhooksApi#delete_webhook2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # List webhooks for the organization
154
+ # @param [Hash] opts the optional parameters
155
+ # @return [Array<WebhookResponse>]
156
+ def list_webhooks2(opts = {})
157
+ data, _status_code, _headers = list_webhooks2_with_http_info(opts)
158
+ data
159
+ end
160
+
161
+ # List webhooks for the organization
162
+ # @param [Hash] opts the optional parameters
163
+ # @return [Array<(Array<WebhookResponse>, Integer, Hash)>] Array<WebhookResponse> data, response status code and response headers
164
+ def list_webhooks2_with_http_info(opts = {})
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.list_webhooks2 ...'
167
+ end
168
+ # resource path
169
+ local_var_path = '/api/v2/webhooks/list/'
170
+
171
+ # query parameters
172
+ query_params = opts[:query_params] || {}
173
+
174
+ # header parameters
175
+ header_params = opts[:header_params] || {}
176
+ # HTTP header 'Accept' (if needed)
177
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
178
+
179
+ # form parameters
180
+ form_params = opts[:form_params] || {}
181
+
182
+ # http body (model)
183
+ post_body = opts[:debug_body]
184
+
185
+ # return_type
186
+ return_type = opts[:debug_return_type] || 'Array<WebhookResponse>'
187
+
188
+ # auth_names
189
+ auth_names = opts[:debug_auth_names] || ['oauth2']
190
+
191
+ new_options = opts.merge(
192
+ :operation => :"WebhooksApi.list_webhooks2",
193
+ :header_params => header_params,
194
+ :query_params => query_params,
195
+ :form_params => form_params,
196
+ :body => post_body,
197
+ :auth_names => auth_names,
198
+ :return_type => return_type
199
+ )
200
+
201
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug "API called: WebhooksApi#list_webhooks2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
+ end
205
+ return data, status_code, headers
206
+ end
207
+
208
+ # Verify webhook ownership
209
+ # @param webhook_id [String] Webhook ID
210
+ # @param verify_webhook [VerifyWebhook]
211
+ # @param [Hash] opts the optional parameters
212
+ # @return [nil]
213
+ def verify_webhook2(webhook_id, verify_webhook, opts = {})
214
+ verify_webhook2_with_http_info(webhook_id, verify_webhook, opts)
215
+ nil
216
+ end
217
+
218
+ # Verify webhook ownership
219
+ # @param webhook_id [String] Webhook ID
220
+ # @param verify_webhook [VerifyWebhook]
221
+ # @param [Hash] opts the optional parameters
222
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
223
+ def verify_webhook2_with_http_info(webhook_id, verify_webhook, opts = {})
224
+ if @api_client.config.debugging
225
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.verify_webhook2 ...'
226
+ end
227
+ # verify the required parameter 'webhook_id' is set
228
+ if @api_client.config.client_side_validation && webhook_id.nil?
229
+ fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.verify_webhook2"
230
+ end
231
+ # verify the required parameter 'verify_webhook' is set
232
+ if @api_client.config.client_side_validation && verify_webhook.nil?
233
+ fail ArgumentError, "Missing the required parameter 'verify_webhook' when calling WebhooksApi.verify_webhook2"
234
+ end
235
+ # resource path
236
+ local_var_path = '/api/v2/webhooks/{webhook_id}/verify/'.sub('{webhook_id}', CGI.escape(webhook_id.to_s))
237
+
238
+ # query parameters
239
+ query_params = opts[:query_params] || {}
240
+
241
+ # header parameters
242
+ header_params = opts[:header_params] || {}
243
+ # HTTP header 'Content-Type'
244
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
245
+ if !content_type.nil?
246
+ header_params['Content-Type'] = content_type
247
+ end
248
+
249
+ # form parameters
250
+ form_params = opts[:form_params] || {}
251
+
252
+ # http body (model)
253
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(verify_webhook)
254
+
255
+ # return_type
256
+ return_type = opts[:debug_return_type]
257
+
258
+ # auth_names
259
+ auth_names = opts[:debug_auth_names] || ['oauth2']
260
+
261
+ new_options = opts.merge(
262
+ :operation => :"WebhooksApi.verify_webhook2",
263
+ :header_params => header_params,
264
+ :query_params => query_params,
265
+ :form_params => form_params,
266
+ :body => post_body,
267
+ :auth_names => auth_names,
268
+ :return_type => return_type
269
+ )
270
+
271
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
272
+ if @api_client.config.debugging
273
+ @api_client.config.logger.debug "API called: WebhooksApi#verify_webhook2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
274
+ end
275
+ return data, status_code, headers
276
+ end
277
+ end
278
+ end