pescheck-client 0.0.5

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 +182 -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-client/api/authentication_api.rb +220 -0
  50. data/lib/pescheck-client/api/checks_api.rb +144 -0
  51. data/lib/pescheck-client/api/divisions_api.rb +365 -0
  52. data/lib/pescheck-client/api/o_auth_api.rb +202 -0
  53. data/lib/pescheck-client/api/profiles_api.rb +432 -0
  54. data/lib/pescheck-client/api/screenings_api.rb +288 -0
  55. data/lib/pescheck-client/api/webhooks_api.rb +278 -0
  56. data/lib/pescheck-client/api_client.rb +441 -0
  57. data/lib/pescheck-client/api_error.rb +58 -0
  58. data/lib/pescheck-client/api_model_base.rb +88 -0
  59. data/lib/pescheck-client/configuration.rb +429 -0
  60. data/lib/pescheck-client/models/custom_token_obtain_pair.rb +191 -0
  61. data/lib/pescheck-client/models/division_read_only.rb +469 -0
  62. data/lib/pescheck-client/models/division_write.rb +436 -0
  63. data/lib/pescheck-client/models/jwt_generation.rb +213 -0
  64. data/lib/pescheck-client/models/jwt_response.rb +285 -0
  65. data/lib/pescheck-client/models/o_auth_application.rb +265 -0
  66. data/lib/pescheck-client/models/o_auth_application_response.rb +379 -0
  67. data/lib/pescheck-client/models/paginated_division_read_only_list.rb +216 -0
  68. data/lib/pescheck-client/models/paginated_v2_profile_list_item_list.rb +216 -0
  69. data/lib/pescheck-client/models/paginated_v2_screening_list_item_list.rb +216 -0
  70. data/lib/pescheck-client/models/patched_division_write.rb +360 -0
  71. data/lib/pescheck-client/models/patched_v2_profile_partial_update.rb +176 -0
  72. data/lib/pescheck-client/models/token_refresh.rb +173 -0
  73. data/lib/pescheck-client/models/v2_candidate.rb +390 -0
  74. data/lib/pescheck-client/models/v2_check_field.rb +246 -0
  75. data/lib/pescheck-client/models/v2_check_info.rb +438 -0
  76. data/lib/pescheck-client/models/v2_document.rb +308 -0
  77. data/lib/pescheck-client/models/v2_document_content.rb +175 -0
  78. data/lib/pescheck-client/models/v2_money.rb +210 -0
  79. data/lib/pescheck-client/models/v2_profile_check.rb +201 -0
  80. data/lib/pescheck-client/models/v2_profile_check_entry.rb +349 -0
  81. data/lib/pescheck-client/models/v2_profile_create.rb +212 -0
  82. data/lib/pescheck-client/models/v2_profile_detail.rb +401 -0
  83. data/lib/pescheck-client/models/v2_profile_list_item.rb +291 -0
  84. data/lib/pescheck-client/models/v2_profile_update.rb +213 -0
  85. data/lib/pescheck-client/models/v2_profile_update_check.rb +210 -0
  86. data/lib/pescheck-client/models/v2_screening_check.rb +221 -0
  87. data/lib/pescheck-client/models/v2_screening_check_entry.rb +376 -0
  88. data/lib/pescheck-client/models/v2_screening_check_list_item.rb +242 -0
  89. data/lib/pescheck-client/models/v2_screening_create.rb +201 -0
  90. data/lib/pescheck-client/models/v2_screening_detail.rb +348 -0
  91. data/lib/pescheck-client/models/v2_screening_detail_profile.rb +156 -0
  92. data/lib/pescheck-client/models/v2_screening_list_item.rb +330 -0
  93. data/lib/pescheck-client/models/verify_webhook.rb +166 -0
  94. data/lib/pescheck-client/models/webhook.rb +265 -0
  95. data/lib/pescheck-client/models/webhook_response.rb +353 -0
  96. data/lib/pescheck-client/version.rb +15 -0
  97. data/lib/pescheck-client.rb +83 -0
  98. data/pescheck-client.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 +299 -0
@@ -0,0 +1,365 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
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 DivisionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
23
+ # @param division_write [DivisionWrite]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [DivisionWrite]
26
+ def v2_organisations_divisions_create(division_write, opts = {})
27
+ data, _status_code, _headers = v2_organisations_divisions_create_with_http_info(division_write, opts)
28
+ data
29
+ end
30
+
31
+ # Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
32
+ # @param division_write [DivisionWrite]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(DivisionWrite, Integer, Hash)>] DivisionWrite data, response status code and response headers
35
+ def v2_organisations_divisions_create_with_http_info(division_write, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: DivisionsApi.v2_organisations_divisions_create ...'
38
+ end
39
+ # verify the required parameter 'division_write' is set
40
+ if @api_client.config.client_side_validation && division_write.nil?
41
+ fail ArgumentError, "Missing the required parameter 'division_write' when calling DivisionsApi.v2_organisations_divisions_create"
42
+ end
43
+ # resource path
44
+ local_var_path = '/api/v2/organisations/divisions/'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
55
+ if !content_type.nil?
56
+ header_params['Content-Type'] = content_type
57
+ end
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(division_write)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'DivisionWrite'
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || ['oauth2']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"DivisionsApi.v2_organisations_divisions_create",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: DivisionsApi#v2_organisations_divisions_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
89
+ # @param [Hash] opts the optional parameters
90
+ # @option opts [Integer] :page A page number within the paginated result set. (default to 1)
91
+ # @option opts [Integer] :page_size Number of results to return per page. (default to 50)
92
+ # @option opts [Boolean] :paginate Enable/disable pagination. When false, max 500 records returned. (default to true)
93
+ # @return [PaginatedDivisionReadOnlyList]
94
+ def v2_organisations_divisions_list(opts = {})
95
+ data, _status_code, _headers = v2_organisations_divisions_list_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
100
+ # @param [Hash] opts the optional parameters
101
+ # @option opts [Integer] :page A page number within the paginated result set. (default to 1)
102
+ # @option opts [Integer] :page_size Number of results to return per page. (default to 50)
103
+ # @option opts [Boolean] :paginate Enable/disable pagination. When false, max 500 records returned. (default to true)
104
+ # @return [Array<(PaginatedDivisionReadOnlyList, Integer, Hash)>] PaginatedDivisionReadOnlyList data, response status code and response headers
105
+ def v2_organisations_divisions_list_with_http_info(opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: DivisionsApi.v2_organisations_divisions_list ...'
108
+ end
109
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
110
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DivisionsApi.v2_organisations_divisions_list, must be greater than or equal to 1.'
111
+ end
112
+
113
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
114
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DivisionsApi.v2_organisations_divisions_list, must be smaller than or equal to 100.'
115
+ end
116
+
117
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
118
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DivisionsApi.v2_organisations_divisions_list, must be greater than or equal to 1.'
119
+ end
120
+
121
+ # resource path
122
+ local_var_path = '/api/v2/organisations/divisions/'
123
+
124
+ # query parameters
125
+ query_params = opts[:query_params] || {}
126
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
127
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
128
+ query_params[:'paginate'] = opts[:'paginate'] if !opts[:'paginate'].nil?
129
+
130
+ # header parameters
131
+ header_params = opts[:header_params] || {}
132
+ # HTTP header 'Accept' (if needed)
133
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
134
+
135
+ # form parameters
136
+ form_params = opts[:form_params] || {}
137
+
138
+ # http body (model)
139
+ post_body = opts[:debug_body]
140
+
141
+ # return_type
142
+ return_type = opts[:debug_return_type] || 'PaginatedDivisionReadOnlyList'
143
+
144
+ # auth_names
145
+ auth_names = opts[:debug_auth_names] || ['oauth2']
146
+
147
+ new_options = opts.merge(
148
+ :operation => :"DivisionsApi.v2_organisations_divisions_list",
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => return_type
155
+ )
156
+
157
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug "API called: DivisionsApi#v2_organisations_divisions_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
160
+ end
161
+ return data, status_code, headers
162
+ end
163
+
164
+ # A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
165
+ # @param id [String] A UUID string identifying this organisation.
166
+ # @param [Hash] opts the optional parameters
167
+ # @option opts [PatchedDivisionWrite] :patched_division_write
168
+ # @return [DivisionWrite]
169
+ def v2_organisations_divisions_partial_update(id, opts = {})
170
+ data, _status_code, _headers = v2_organisations_divisions_partial_update_with_http_info(id, opts)
171
+ data
172
+ end
173
+
174
+ # A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
175
+ # @param id [String] A UUID string identifying this organisation.
176
+ # @param [Hash] opts the optional parameters
177
+ # @option opts [PatchedDivisionWrite] :patched_division_write
178
+ # @return [Array<(DivisionWrite, Integer, Hash)>] DivisionWrite data, response status code and response headers
179
+ def v2_organisations_divisions_partial_update_with_http_info(id, opts = {})
180
+ if @api_client.config.debugging
181
+ @api_client.config.logger.debug 'Calling API: DivisionsApi.v2_organisations_divisions_partial_update ...'
182
+ end
183
+ # verify the required parameter 'id' is set
184
+ if @api_client.config.client_side_validation && id.nil?
185
+ fail ArgumentError, "Missing the required parameter 'id' when calling DivisionsApi.v2_organisations_divisions_partial_update"
186
+ end
187
+ # resource path
188
+ local_var_path = '/api/v2/organisations/divisions/{id}/'.sub('{id}', CGI.escape(id.to_s))
189
+
190
+ # query parameters
191
+ query_params = opts[:query_params] || {}
192
+
193
+ # header parameters
194
+ header_params = opts[:header_params] || {}
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
197
+ # HTTP header 'Content-Type'
198
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
199
+ if !content_type.nil?
200
+ header_params['Content-Type'] = content_type
201
+ end
202
+
203
+ # form parameters
204
+ form_params = opts[:form_params] || {}
205
+
206
+ # http body (model)
207
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'patched_division_write'])
208
+
209
+ # return_type
210
+ return_type = opts[:debug_return_type] || 'DivisionWrite'
211
+
212
+ # auth_names
213
+ auth_names = opts[:debug_auth_names] || ['oauth2']
214
+
215
+ new_options = opts.merge(
216
+ :operation => :"DivisionsApi.v2_organisations_divisions_partial_update",
217
+ :header_params => header_params,
218
+ :query_params => query_params,
219
+ :form_params => form_params,
220
+ :body => post_body,
221
+ :auth_names => auth_names,
222
+ :return_type => return_type
223
+ )
224
+
225
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: DivisionsApi#v2_organisations_divisions_partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+
232
+ # A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
233
+ # @param id [String] A UUID string identifying this organisation.
234
+ # @param [Hash] opts the optional parameters
235
+ # @return [DivisionReadOnly]
236
+ def v2_organisations_divisions_retrieve(id, opts = {})
237
+ data, _status_code, _headers = v2_organisations_divisions_retrieve_with_http_info(id, opts)
238
+ data
239
+ end
240
+
241
+ # A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
242
+ # @param id [String] A UUID string identifying this organisation.
243
+ # @param [Hash] opts the optional parameters
244
+ # @return [Array<(DivisionReadOnly, Integer, Hash)>] DivisionReadOnly data, response status code and response headers
245
+ def v2_organisations_divisions_retrieve_with_http_info(id, opts = {})
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug 'Calling API: DivisionsApi.v2_organisations_divisions_retrieve ...'
248
+ end
249
+ # verify the required parameter 'id' is set
250
+ if @api_client.config.client_side_validation && id.nil?
251
+ fail ArgumentError, "Missing the required parameter 'id' when calling DivisionsApi.v2_organisations_divisions_retrieve"
252
+ end
253
+ # resource path
254
+ local_var_path = '/api/v2/organisations/divisions/{id}/'.sub('{id}', CGI.escape(id.to_s))
255
+
256
+ # query parameters
257
+ query_params = opts[:query_params] || {}
258
+
259
+ # header parameters
260
+ header_params = opts[:header_params] || {}
261
+ # HTTP header 'Accept' (if needed)
262
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
263
+
264
+ # form parameters
265
+ form_params = opts[:form_params] || {}
266
+
267
+ # http body (model)
268
+ post_body = opts[:debug_body]
269
+
270
+ # return_type
271
+ return_type = opts[:debug_return_type] || 'DivisionReadOnly'
272
+
273
+ # auth_names
274
+ auth_names = opts[:debug_auth_names] || ['oauth2']
275
+
276
+ new_options = opts.merge(
277
+ :operation => :"DivisionsApi.v2_organisations_divisions_retrieve",
278
+ :header_params => header_params,
279
+ :query_params => query_params,
280
+ :form_params => form_params,
281
+ :body => post_body,
282
+ :auth_names => auth_names,
283
+ :return_type => return_type
284
+ )
285
+
286
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug "API called: DivisionsApi#v2_organisations_divisions_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
+ end
290
+ return data, status_code, headers
291
+ end
292
+
293
+ # Update an existing division's contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
294
+ # @param id [String] A UUID string identifying this organisation.
295
+ # @param division_write [DivisionWrite]
296
+ # @param [Hash] opts the optional parameters
297
+ # @return [DivisionWrite]
298
+ def v2_organisations_divisions_update(id, division_write, opts = {})
299
+ data, _status_code, _headers = v2_organisations_divisions_update_with_http_info(id, division_write, opts)
300
+ data
301
+ end
302
+
303
+ # Update an existing division&#39;s contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
304
+ # @param id [String] A UUID string identifying this organisation.
305
+ # @param division_write [DivisionWrite]
306
+ # @param [Hash] opts the optional parameters
307
+ # @return [Array<(DivisionWrite, Integer, Hash)>] DivisionWrite data, response status code and response headers
308
+ def v2_organisations_divisions_update_with_http_info(id, division_write, opts = {})
309
+ if @api_client.config.debugging
310
+ @api_client.config.logger.debug 'Calling API: DivisionsApi.v2_organisations_divisions_update ...'
311
+ end
312
+ # verify the required parameter 'id' is set
313
+ if @api_client.config.client_side_validation && id.nil?
314
+ fail ArgumentError, "Missing the required parameter 'id' when calling DivisionsApi.v2_organisations_divisions_update"
315
+ end
316
+ # verify the required parameter 'division_write' is set
317
+ if @api_client.config.client_side_validation && division_write.nil?
318
+ fail ArgumentError, "Missing the required parameter 'division_write' when calling DivisionsApi.v2_organisations_divisions_update"
319
+ end
320
+ # resource path
321
+ local_var_path = '/api/v2/organisations/divisions/{id}/'.sub('{id}', CGI.escape(id.to_s))
322
+
323
+ # query parameters
324
+ query_params = opts[:query_params] || {}
325
+
326
+ # header parameters
327
+ header_params = opts[:header_params] || {}
328
+ # HTTP header 'Accept' (if needed)
329
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
330
+ # HTTP header 'Content-Type'
331
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
332
+ if !content_type.nil?
333
+ header_params['Content-Type'] = content_type
334
+ end
335
+
336
+ # form parameters
337
+ form_params = opts[:form_params] || {}
338
+
339
+ # http body (model)
340
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(division_write)
341
+
342
+ # return_type
343
+ return_type = opts[:debug_return_type] || 'DivisionWrite'
344
+
345
+ # auth_names
346
+ auth_names = opts[:debug_auth_names] || ['oauth2']
347
+
348
+ new_options = opts.merge(
349
+ :operation => :"DivisionsApi.v2_organisations_divisions_update",
350
+ :header_params => header_params,
351
+ :query_params => query_params,
352
+ :form_params => form_params,
353
+ :body => post_body,
354
+ :auth_names => auth_names,
355
+ :return_type => return_type
356
+ )
357
+
358
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
359
+ if @api_client.config.debugging
360
+ @api_client.config.logger.debug "API called: DivisionsApi#v2_organisations_divisions_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
361
+ end
362
+ return data, status_code, headers
363
+ end
364
+ end
365
+ end
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #Pescheck API
3
+
4
+ #Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
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 OAuthApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create OAuth application for API access
23
+ # @param o_auth_application [OAuthApplication]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [OAuthApplicationResponse]
26
+ def create_o_auth_application2(o_auth_application, opts = {})
27
+ data, _status_code, _headers = create_o_auth_application2_with_http_info(o_auth_application, opts)
28
+ data
29
+ end
30
+
31
+ # Create OAuth application for API access
32
+ # @param o_auth_application [OAuthApplication]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(OAuthApplicationResponse, Integer, Hash)>] OAuthApplicationResponse data, response status code and response headers
35
+ def create_o_auth_application2_with_http_info(o_auth_application, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: OAuthApi.create_o_auth_application2 ...'
38
+ end
39
+ # verify the required parameter 'o_auth_application' is set
40
+ if @api_client.config.client_side_validation && o_auth_application.nil?
41
+ fail ArgumentError, "Missing the required parameter 'o_auth_application' when calling OAuthApi.create_o_auth_application2"
42
+ end
43
+ # resource path
44
+ local_var_path = '/api/v2/oauth/applications/'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
55
+ if !content_type.nil?
56
+ header_params['Content-Type'] = content_type
57
+ end
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(o_auth_application)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'OAuthApplicationResponse'
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || ['oauth2']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"OAuthApi.create_o_auth_application2",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: OAuthApi#create_o_auth_application2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # Delete an OAuth application
89
+ # @param application_id [String] Application ID to delete
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [nil]
92
+ def delete_o_auth_application2(application_id, opts = {})
93
+ delete_o_auth_application2_with_http_info(application_id, opts)
94
+ nil
95
+ end
96
+
97
+ # Delete an OAuth application
98
+ # @param application_id [String] Application ID to delete
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
101
+ def delete_o_auth_application2_with_http_info(application_id, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: OAuthApi.delete_o_auth_application2 ...'
104
+ end
105
+ # verify the required parameter 'application_id' is set
106
+ if @api_client.config.client_side_validation && application_id.nil?
107
+ fail ArgumentError, "Missing the required parameter 'application_id' when calling OAuthApi.delete_o_auth_application2"
108
+ end
109
+ # resource path
110
+ local_var_path = '/api/v2/oauth/applications/{application_id}/'.sub('{application_id}', CGI.escape(application_id.to_s))
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:debug_body]
123
+
124
+ # return_type
125
+ return_type = opts[:debug_return_type]
126
+
127
+ # auth_names
128
+ auth_names = opts[:debug_auth_names] || ['oauth2']
129
+
130
+ new_options = opts.merge(
131
+ :operation => :"OAuthApi.delete_o_auth_application2",
132
+ :header_params => header_params,
133
+ :query_params => query_params,
134
+ :form_params => form_params,
135
+ :body => post_body,
136
+ :auth_names => auth_names,
137
+ :return_type => return_type
138
+ )
139
+
140
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: OAuthApi#delete_o_auth_application2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+
147
+ # List OAuth applications for the organization
148
+ # @param [Hash] opts the optional parameters
149
+ # @return [Array<OAuthApplicationResponse>]
150
+ def list_o_auth_applications2(opts = {})
151
+ data, _status_code, _headers = list_o_auth_applications2_with_http_info(opts)
152
+ data
153
+ end
154
+
155
+ # List OAuth applications for the organization
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [Array<(Array<OAuthApplicationResponse>, Integer, Hash)>] Array<OAuthApplicationResponse> data, response status code and response headers
158
+ def list_o_auth_applications2_with_http_info(opts = {})
159
+ if @api_client.config.debugging
160
+ @api_client.config.logger.debug 'Calling API: OAuthApi.list_o_auth_applications2 ...'
161
+ end
162
+ # resource path
163
+ local_var_path = '/api/v2/oauth/applications/list/'
164
+
165
+ # query parameters
166
+ query_params = opts[:query_params] || {}
167
+
168
+ # header parameters
169
+ header_params = opts[:header_params] || {}
170
+ # HTTP header 'Accept' (if needed)
171
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
172
+
173
+ # form parameters
174
+ form_params = opts[:form_params] || {}
175
+
176
+ # http body (model)
177
+ post_body = opts[:debug_body]
178
+
179
+ # return_type
180
+ return_type = opts[:debug_return_type] || 'Array<OAuthApplicationResponse>'
181
+
182
+ # auth_names
183
+ auth_names = opts[:debug_auth_names] || ['oauth2']
184
+
185
+ new_options = opts.merge(
186
+ :operation => :"OAuthApi.list_o_auth_applications2",
187
+ :header_params => header_params,
188
+ :query_params => query_params,
189
+ :form_params => form_params,
190
+ :body => post_body,
191
+ :auth_names => auth_names,
192
+ :return_type => return_type
193
+ )
194
+
195
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
196
+ if @api_client.config.debugging
197
+ @api_client.config.logger.debug "API called: OAuthApi#list_o_auth_applications2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
198
+ end
199
+ return data, status_code, headers
200
+ end
201
+ end
202
+ end