open_api_smart_recruiters_sdk 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +13 -0
  4. data/Gemfile +16 -0
  5. data/Gemfile.lock +65 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +35 -0
  8. data/Rakefile +12 -0
  9. data/lib/smart_recruiters/api/application_api_api.rb +188 -0
  10. data/lib/smart_recruiters/api/candidates_api.rb +2417 -0
  11. data/lib/smart_recruiters/api/configuration_api.rb +2504 -0
  12. data/lib/smart_recruiters/api/job_applications_api.rb +63 -0
  13. data/lib/smart_recruiters/api/jobs_api.rb +1851 -0
  14. data/lib/smart_recruiters/api/subscriptions_api.rb +469 -0
  15. data/lib/smart_recruiters/api_client.rb +379 -0
  16. data/lib/smart_recruiters/api_error.rb +46 -0
  17. data/lib/smart_recruiters/authorization.rb +66 -0
  18. data/lib/smart_recruiters/configuration.rb +214 -0
  19. data/lib/smart_recruiters/models/action.rb +248 -0
  20. data/lib/smart_recruiters/models/actions.rb +190 -0
  21. data/lib/smart_recruiters/models/all_of_candidate_details_primary_assignment.rb +262 -0
  22. data/lib/smart_recruiters/models/all_of_candidate_details_secondary_assignments_items.rb +262 -0
  23. data/lib/smart_recruiters/models/answer_field.rb +227 -0
  24. data/lib/smart_recruiters/models/answer_field_value.rb +216 -0
  25. data/lib/smart_recruiters/models/answer_record.rb +197 -0
  26. data/lib/smart_recruiters/models/application.rb +260 -0
  27. data/lib/smart_recruiters/models/application_attachment_webhook_payload.rb +248 -0
  28. data/lib/smart_recruiters/models/application_status_info.rb +231 -0
  29. data/lib/smart_recruiters/models/application_url.rb +198 -0
  30. data/lib/smart_recruiters/models/application_webhook_payload.rb +230 -0
  31. data/lib/smart_recruiters/models/apply_api_error.rb +259 -0
  32. data/lib/smart_recruiters/models/apply_api_request.rb +386 -0
  33. data/lib/smart_recruiters/models/apply_api_response.rb +224 -0
  34. data/lib/smart_recruiters/models/apply_configuration.rb +229 -0
  35. data/lib/smart_recruiters/models/apply_settings.rb +197 -0
  36. data/lib/smart_recruiters/models/assignment.rb +251 -0
  37. data/lib/smart_recruiters/models/assignment_actions.rb +197 -0
  38. data/lib/smart_recruiters/models/attachment.rb +230 -0
  39. data/lib/smart_recruiters/models/attachment_actions.rb +202 -0
  40. data/lib/smart_recruiters/models/attachments.rb +218 -0
  41. data/lib/smart_recruiters/models/callback_authentication.rb +188 -0
  42. data/lib/smart_recruiters/models/callback_basic_auth.rb +249 -0
  43. data/lib/smart_recruiters/models/callback_header_auth.rb +250 -0
  44. data/lib/smart_recruiters/models/callback_o_auth2_auth.rb +262 -0
  45. data/lib/smart_recruiters/models/callback_request.rb +216 -0
  46. data/lib/smart_recruiters/models/callback_request_request_details.rb +219 -0
  47. data/lib/smart_recruiters/models/callback_request_status.rb +19 -0
  48. data/lib/smart_recruiters/models/callback_requests.rb +192 -0
  49. data/lib/smart_recruiters/models/callback_url.rb +188 -0
  50. data/lib/smart_recruiters/models/candidate.rb +349 -0
  51. data/lib/smart_recruiters/models/candidate_actions.rb +216 -0
  52. data/lib/smart_recruiters/models/candidate_attachment_for_job.rb +253 -0
  53. data/lib/smart_recruiters/models/candidate_attachment_for_job_actions.rb +216 -0
  54. data/lib/smart_recruiters/models/candidate_attachments_for_job.rb +218 -0
  55. data/lib/smart_recruiters/models/candidate_consent.rb +197 -0
  56. data/lib/smart_recruiters/models/candidate_consent_decisions.rb +213 -0
  57. data/lib/smart_recruiters/models/candidate_consent_status.rb +212 -0
  58. data/lib/smart_recruiters/models/candidate_details.rb +349 -0
  59. data/lib/smart_recruiters/models/candidate_details_actions.rb +229 -0
  60. data/lib/smart_recruiters/models/candidate_input.rb +308 -0
  61. data/lib/smart_recruiters/models/candidate_job.rb +216 -0
  62. data/lib/smart_recruiters/models/candidate_location.rb +251 -0
  63. data/lib/smart_recruiters/models/candidate_primary_assignment.rb +225 -0
  64. data/lib/smart_recruiters/models/candidate_primary_assignment_job.rb +230 -0
  65. data/lib/smart_recruiters/models/candidate_primary_assignment_job_actions.rb +202 -0
  66. data/lib/smart_recruiters/models/candidate_properties.rb +199 -0
  67. data/lib/smart_recruiters/models/candidate_property.rb +268 -0
  68. data/lib/smart_recruiters/models/candidate_property_actions.rb +202 -0
  69. data/lib/smart_recruiters/models/candidate_property_availability.rb +253 -0
  70. data/lib/smart_recruiters/models/candidate_property_definition.rb +233 -0
  71. data/lib/smart_recruiters/models/candidate_property_definition_list.rb +208 -0
  72. data/lib/smart_recruiters/models/candidate_property_filter.rb +215 -0
  73. data/lib/smart_recruiters/models/candidate_property_filter_values.rb +208 -0
  74. data/lib/smart_recruiters/models/candidate_property_input_value.rb +198 -0
  75. data/lib/smart_recruiters/models/candidate_property_type.rb +27 -0
  76. data/lib/smart_recruiters/models/candidate_property_value.rb +212 -0
  77. data/lib/smart_recruiters/models/candidate_property_value_label.rb +202 -0
  78. data/lib/smart_recruiters/models/candidate_property_value_list.rb +208 -0
  79. data/lib/smart_recruiters/models/candidate_secondary_assignments.rb +202 -0
  80. data/lib/smart_recruiters/models/candidate_source.rb +225 -0
  81. data/lib/smart_recruiters/models/candidate_status.rb +230 -0
  82. data/lib/smart_recruiters/models/candidate_status_enum.rb +26 -0
  83. data/lib/smart_recruiters/models/candidate_status_history_list.rb +208 -0
  84. data/lib/smart_recruiters/models/candidate_status_history_list_elem.rb +224 -0
  85. data/lib/smart_recruiters/models/candidate_tags.rb +204 -0
  86. data/lib/smart_recruiters/models/candidate_webhook_payload.rb +202 -0
  87. data/lib/smart_recruiters/models/candidates.rb +255 -0
  88. data/lib/smart_recruiters/models/company_configuration.rb +246 -0
  89. data/lib/smart_recruiters/models/compensation.rb +215 -0
  90. data/lib/smart_recruiters/models/consent_decision.rb +226 -0
  91. data/lib/smart_recruiters/models/consent_decision_status.rb +20 -0
  92. data/lib/smart_recruiters/models/consent_request.rb +203 -0
  93. data/lib/smart_recruiters/models/consent_request_scheduled.rb +250 -0
  94. data/lib/smart_recruiters/models/consent_request_scheduled_body.rb +197 -0
  95. data/lib/smart_recruiters/models/consent_request_unavailable.rb +245 -0
  96. data/lib/smart_recruiters/models/consent_requests_results.rb +204 -0
  97. data/lib/smart_recruiters/models/consent_scope.rb +22 -0
  98. data/lib/smart_recruiters/models/consent_status.rb +20 -0
  99. data/lib/smart_recruiters/models/department.rb +220 -0
  100. data/lib/smart_recruiters/models/departments.rb +208 -0
  101. data/lib/smart_recruiters/models/dependent_job_properties.rb +218 -0
  102. data/lib/smart_recruiters/models/dependent_job_properties_ids.rb +204 -0
  103. data/lib/smart_recruiters/models/dependent_job_property.rb +216 -0
  104. data/lib/smart_recruiters/models/dependent_job_property_value.rb +220 -0
  105. data/lib/smart_recruiters/models/dependent_job_property_values.rb +208 -0
  106. data/lib/smart_recruiters/models/dependent_job_property_values_relation.rb +218 -0
  107. data/lib/smart_recruiters/models/dependent_job_property_values_relations.rb +218 -0
  108. data/lib/smart_recruiters/models/education.rb +270 -0
  109. data/lib/smart_recruiters/models/email_address.rb +188 -0
  110. data/lib/smart_recruiters/models/employment.rb +261 -0
  111. data/lib/smart_recruiters/models/error.rb +211 -0
  112. data/lib/smart_recruiters/models/error_response.rb +208 -0
  113. data/lib/smart_recruiters/models/event.rb +206 -0
  114. data/lib/smart_recruiters/models/event_name.rb +64 -0
  115. data/lib/smart_recruiters/models/experience.rb +251 -0
  116. data/lib/smart_recruiters/models/field_value.rb +216 -0
  117. data/lib/smart_recruiters/models/headcount_patch_request.rb +197 -0
  118. data/lib/smart_recruiters/models/headcount_update_accepted.rb +231 -0
  119. data/lib/smart_recruiters/models/hiring_process.rb +224 -0
  120. data/lib/smart_recruiters/models/hiring_process_sub_statuses.rb +221 -0
  121. data/lib/smart_recruiters/models/hiring_processes.rb +218 -0
  122. data/lib/smart_recruiters/models/hiring_team_member.rb +220 -0
  123. data/lib/smart_recruiters/models/hiring_team_member_response.rb +215 -0
  124. data/lib/smart_recruiters/models/hiring_team_member_response_actions.rb +202 -0
  125. data/lib/smart_recruiters/models/hiring_team_member_role.rb +22 -0
  126. data/lib/smart_recruiters/models/hiring_team_members.rb +208 -0
  127. data/lib/smart_recruiters/models/id_attachments_body.rb +249 -0
  128. data/lib/smart_recruiters/models/identifiable.rb +202 -0
  129. data/lib/smart_recruiters/models/industry.rb +207 -0
  130. data/lib/smart_recruiters/models/job.rb +197 -0
  131. data/lib/smart_recruiters/models/job_ad.rb +206 -0
  132. data/lib/smart_recruiters/models/job_ad_content.rb +220 -0
  133. data/lib/smart_recruiters/models/job_ad_input.rb +206 -0
  134. data/lib/smart_recruiters/models/job_ad_item.rb +397 -0
  135. data/lib/smart_recruiters/models/job_ad_item_actions.rb +202 -0
  136. data/lib/smart_recruiters/models/job_ad_language.rb +202 -0
  137. data/lib/smart_recruiters/models/job_ad_postings_webhook_payload.rb +216 -0
  138. data/lib/smart_recruiters/models/job_ad_publication_scheduled.rb +231 -0
  139. data/lib/smart_recruiters/models/job_ad_section.rb +206 -0
  140. data/lib/smart_recruiters/models/job_ad_sections.rb +233 -0
  141. data/lib/smart_recruiters/models/job_ad_unpublish_scheduled.rb +231 -0
  142. data/lib/smart_recruiters/models/job_ad_videos.rb +199 -0
  143. data/lib/smart_recruiters/models/job_ad_webhook_payload.rb +216 -0
  144. data/lib/smart_recruiters/models/job_ads.rb +192 -0
  145. data/lib/smart_recruiters/models/job_application.rb +242 -0
  146. data/lib/smart_recruiters/models/job_application_status.rb +26 -0
  147. data/lib/smart_recruiters/models/job_approval.rb +217 -0
  148. data/lib/smart_recruiters/models/job_approval_position.rb +251 -0
  149. data/lib/smart_recruiters/models/job_approval_webhook_payload.rb +216 -0
  150. data/lib/smart_recruiters/models/job_details.rb +394 -0
  151. data/lib/smart_recruiters/models/job_details_actions.rb +233 -0
  152. data/lib/smart_recruiters/models/job_id_attachments_body.rb +249 -0
  153. data/lib/smart_recruiters/models/job_input.rb +341 -0
  154. data/lib/smart_recruiters/models/job_job.rb +215 -0
  155. data/lib/smart_recruiters/models/job_job_actions.rb +211 -0
  156. data/lib/smart_recruiters/models/job_location_input.rb +252 -0
  157. data/lib/smart_recruiters/models/job_note.rb +202 -0
  158. data/lib/smart_recruiters/models/job_position.rb +256 -0
  159. data/lib/smart_recruiters/models/job_position_input.rb +282 -0
  160. data/lib/smart_recruiters/models/job_positions.rb +218 -0
  161. data/lib/smart_recruiters/models/job_property.rb +225 -0
  162. data/lib/smart_recruiters/models/job_property_definition.rb +300 -0
  163. data/lib/smart_recruiters/models/job_property_definition_creation_request.rb +282 -0
  164. data/lib/smart_recruiters/models/job_property_definition_list.rb +208 -0
  165. data/lib/smart_recruiters/models/job_property_input.rb +220 -0
  166. data/lib/smart_recruiters/models/job_property_value.rb +206 -0
  167. data/lib/smart_recruiters/models/job_property_value_definition.rb +220 -0
  168. data/lib/smart_recruiters/models/job_property_value_definition_list.rb +208 -0
  169. data/lib/smart_recruiters/models/job_status.rb +25 -0
  170. data/lib/smart_recruiters/models/job_status_history.rb +216 -0
  171. data/lib/smart_recruiters/models/job_status_history_actions.rb +202 -0
  172. data/lib/smart_recruiters/models/job_status_history_content.rb +220 -0
  173. data/lib/smart_recruiters/models/job_status_update.rb +202 -0
  174. data/lib/smart_recruiters/models/job_summary.rb +302 -0
  175. data/lib/smart_recruiters/models/job_webhook_payload.rb +202 -0
  176. data/lib/smart_recruiters/models/jobs.rb +235 -0
  177. data/lib/smart_recruiters/models/json_patch.rb +192 -0
  178. data/lib/smart_recruiters/models/json_pointer.rb +188 -0
  179. data/lib/smart_recruiters/models/label_translation.rb +216 -0
  180. data/lib/smart_recruiters/models/label_translations.rb +192 -0
  181. data/lib/smart_recruiters/models/labeled.rb +202 -0
  182. data/lib/smart_recruiters/models/language.rb +220 -0
  183. data/lib/smart_recruiters/models/language_code.rb +87 -0
  184. data/lib/smart_recruiters/models/location.rb +251 -0
  185. data/lib/smart_recruiters/models/model_when.rb +189 -0
  186. data/lib/smart_recruiters/models/offer_approval_webhook_payload.rb +244 -0
  187. data/lib/smart_recruiters/models/offer_properties_category.rb +208 -0
  188. data/lib/smart_recruiters/models/offer_properties_definition.rb +199 -0
  189. data/lib/smart_recruiters/models/offer_property_definition.rb +258 -0
  190. data/lib/smart_recruiters/models/offer_webhook_payload.rb +230 -0
  191. data/lib/smart_recruiters/models/onboarding_assignments_completed_webhook_payload.rb +216 -0
  192. data/lib/smart_recruiters/models/onboarding_high_priority_assignments_completed_webhook_payload.rb +216 -0
  193. data/lib/smart_recruiters/models/onboarding_process_webhook_payload.rb +216 -0
  194. data/lib/smart_recruiters/models/onboarding_status.rb +236 -0
  195. data/lib/smart_recruiters/models/one_of_candidate_property_value.rb +188 -0
  196. data/lib/smart_recruiters/models/one_of_consent_requests_results_results_items.rb +188 -0
  197. data/lib/smart_recruiters/models/one_of_json_patch_items.rb +188 -0
  198. data/lib/smart_recruiters/models/path.rb +202 -0
  199. data/lib/smart_recruiters/models/personal_details.rb +242 -0
  200. data/lib/smart_recruiters/models/position_webhook_payload.rb +216 -0
  201. data/lib/smart_recruiters/models/posting_status.rb +21 -0
  202. data/lib/smart_recruiters/models/privacy_policy.rb +206 -0
  203. data/lib/smart_recruiters/models/properties.rb +208 -0
  204. data/lib/smart_recruiters/models/property.rb +211 -0
  205. data/lib/smart_recruiters/models/publication.rb +244 -0
  206. data/lib/smart_recruiters/models/publication_list.rb +204 -0
  207. data/lib/smart_recruiters/models/publication_list_item.rb +239 -0
  208. data/lib/smart_recruiters/models/relation_job_property_value.rb +211 -0
  209. data/lib/smart_recruiters/models/review_webhook_payload.rb +216 -0
  210. data/lib/smart_recruiters/models/salary_range.rb +215 -0
  211. data/lib/smart_recruiters/models/screening_answer.rb +313 -0
  212. data/lib/smart_recruiters/models/screening_answers.rb +218 -0
  213. data/lib/smart_recruiters/models/screening_question.rb +246 -0
  214. data/lib/smart_recruiters/models/screening_question_answer.rb +218 -0
  215. data/lib/smart_recruiters/models/screening_question_field.rb +315 -0
  216. data/lib/smart_recruiters/models/screening_questions_answers_webhook_payload.rb +230 -0
  217. data/lib/smart_recruiters/models/secret_key_payload.rb +197 -0
  218. data/lib/smart_recruiters/models/source.rb +244 -0
  219. data/lib/smart_recruiters/models/source_actions.rb +202 -0
  220. data/lib/smart_recruiters/models/source_definition.rb +230 -0
  221. data/lib/smart_recruiters/models/source_details.rb +225 -0
  222. data/lib/smart_recruiters/models/source_types.rb +218 -0
  223. data/lib/smart_recruiters/models/source_types_actions.rb +202 -0
  224. data/lib/smart_recruiters/models/source_types_content.rb +246 -0
  225. data/lib/smart_recruiters/models/sources.rb +246 -0
  226. data/lib/smart_recruiters/models/subscription.rb +270 -0
  227. data/lib/smart_recruiters/models/subscription_request.rb +236 -0
  228. data/lib/smart_recruiters/models/subscriptions.rb +192 -0
  229. data/lib/smart_recruiters/models/user_identity.rb +215 -0
  230. data/lib/smart_recruiters/models/uuid.rb +188 -0
  231. data/lib/smart_recruiters/models/valid_job_status.rb +24 -0
  232. data/lib/smart_recruiters/models/web.rb +233 -0
  233. data/lib/smart_recruiters/models/web_profile.rb +233 -0
  234. data/lib/smart_recruiters/version.rb +5 -0
  235. data/lib/smart_recruiters.rb +46 -0
  236. data/open_api_smart_recruiters_sdk.gemspec +45 -0
  237. data/sig/smart_recruiters.rbs +4 -0
  238. metadata +367 -0
@@ -0,0 +1,469 @@
1
+ module SmartRecruiters
2
+ class SubscriptionsApi
3
+ attr_accessor :api_client
4
+
5
+ def initialize(api_client = ApiClient.default)
6
+ @api_client = api_client
7
+ end
8
+ # Activate webhook subscription.
9
+ # To ensure that target server is ready to consume notifications, we require you to implement the initial handshake. Having subscription with `callbackUrl`: `https://example.org/hook`, during activation we will make `POST` request with `X-Hook-Secret` header: ``` POST https://example.com/hook X-Hook-Secret: 4jn8fs9011jj8 ``` We expect your server to respond within the time of 20 seconds with HTTP `200` response containing `X-Hook-Secret` header with same value. ``` Response 200 X-Hook-Secret: 4jn8fs9011jj8 ```
10
+ # @param id subscription identifier
11
+ # @param [Hash] opts the optional parameters
12
+ # @return [nil]
13
+ def subscriptions_activate(id, opts = {})
14
+ subscriptions_activate_with_http_info(id, opts)
15
+ nil
16
+ end
17
+
18
+ # Activate webhook subscription.
19
+ # To ensure that target server is ready to consume notifications, we require you to implement the initial handshake. Having subscription with `callbackUrl`: `https://example.org/hook`, during activation we will make `POST` request with `X-Hook-Secret` header: ``` POST https://example.com/hook X-Hook-Secret: 4jn8fs9011jj8 ``` We expect your server to respond within the time of 20 seconds with HTTP `200` response containing `X-Hook-Secret` header with same value. ``` Response 200 X-Hook-Secret: 4jn8fs9011jj8 ```
20
+ # @param id subscription identifier
21
+ # @param [Hash] opts the optional parameters
22
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
23
+ def subscriptions_activate_with_http_info(id, opts = {})
24
+ if @api_client.config.debugging
25
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_activate ...'
26
+ end
27
+ # verify the required parameter 'id' is set
28
+ if @api_client.config.client_side_validation && id.nil?
29
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_activate"
30
+ end
31
+ # resource path
32
+ local_var_path = '/subscriptions/{id}/activation'.sub('{' + 'id' + '}', id.to_s)
33
+
34
+ # query parameters
35
+ query_params = opts[:query_params] || {}
36
+
37
+ # header parameters
38
+ header_params = opts[:header_params] || {}
39
+ # HTTP header 'Accept' (if needed)
40
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
41
+
42
+ # form parameters
43
+ form_params = opts[:form_params] || {}
44
+
45
+ # http body (model)
46
+ post_body = opts[:body]
47
+
48
+ return_type = opts[:return_type]
49
+
50
+ auth_names = opts[:auth_names] || ['key', 'oauth']
51
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
52
+ :header_params => header_params,
53
+ :query_params => query_params,
54
+ :form_params => form_params,
55
+ :body => post_body,
56
+ :auth_names => auth_names,
57
+ :return_type => return_type)
58
+
59
+ if @api_client.config.debugging
60
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_activate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
61
+ end
62
+ return data, status_code, headers
63
+ end
64
+ # Subscribe to a webhook.
65
+ # Please be aware that before any event is delivered each subscription needs to be activated. See [subscription activation](subscriptionsactivate-1). We do limit number of subscriptions each subscriber can register. It means that: * individual user can register up to 20 subscriptions * OAuth application can register up to 20 subscriptions on behalf of a single user Alerting email address and callback authentication properties are optional.
66
+ # @param body
67
+ # @param [Hash] opts the optional parameters
68
+ # @return [Subscription]
69
+ def subscriptions_create(body, opts = {})
70
+ data, _status_code, _headers = subscriptions_create_with_http_info(body, opts)
71
+ data
72
+ end
73
+
74
+ # Subscribe to a webhook.
75
+ # Please be aware that before any event is delivered each subscription needs to be activated. See [subscription activation](subscriptionsactivate-1). We do limit number of subscriptions each subscriber can register. It means that: * individual user can register up to 20 subscriptions * OAuth application can register up to 20 subscriptions on behalf of a single user Alerting email address and callback authentication properties are optional.
76
+ # @param body
77
+ # @param [Hash] opts the optional parameters
78
+ # @return [Array<(Subscription, Integer, Hash)>] Subscription data, response status code and response headers
79
+ def subscriptions_create_with_http_info(body, opts = {})
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_create ...'
82
+ end
83
+ # verify the required parameter 'body' is set
84
+ if @api_client.config.client_side_validation && body.nil?
85
+ fail ArgumentError, "Missing the required parameter 'body' when calling SubscriptionsApi.subscriptions_create"
86
+ end
87
+ # resource path
88
+ local_var_path = '/subscriptions'
89
+
90
+ # query parameters
91
+ query_params = opts[:query_params] || {}
92
+
93
+ # header parameters
94
+ header_params = opts[:header_params] || {}
95
+ # HTTP header 'Accept' (if needed)
96
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
97
+ # HTTP header 'Content-Type'
98
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
99
+
100
+ # form parameters
101
+ form_params = opts[:form_params] || {}
102
+
103
+ # http body (model)
104
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
105
+
106
+ return_type = opts[:return_type] || 'Subscription'
107
+
108
+ auth_names = opts[:auth_names] || ['key', 'oauth']
109
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
110
+ :header_params => header_params,
111
+ :query_params => query_params,
112
+ :form_params => form_params,
113
+ :body => post_body,
114
+ :auth_names => auth_names,
115
+ :return_type => return_type)
116
+
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
119
+ end
120
+ return data, status_code, headers
121
+ end
122
+ # Delete webhook subscription.
123
+ # @param id subscription identifier
124
+ # @param [Hash] opts the optional parameters
125
+ # @return [nil]
126
+ def subscriptions_delete(id, opts = {})
127
+ subscriptions_delete_with_http_info(id, opts)
128
+ nil
129
+ end
130
+
131
+ # Delete webhook subscription.
132
+ # @param id subscription identifier
133
+ # @param [Hash] opts the optional parameters
134
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
135
+ def subscriptions_delete_with_http_info(id, opts = {})
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_delete ...'
138
+ end
139
+ # verify the required parameter 'id' is set
140
+ if @api_client.config.client_side_validation && id.nil?
141
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_delete"
142
+ end
143
+ # resource path
144
+ local_var_path = '/subscriptions/{id}'.sub('{' + 'id' + '}', id.to_s)
145
+
146
+ # query parameters
147
+ query_params = opts[:query_params] || {}
148
+
149
+ # header parameters
150
+ header_params = opts[:header_params] || {}
151
+ # HTTP header 'Accept' (if needed)
152
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
153
+
154
+ # form parameters
155
+ form_params = opts[:form_params] || {}
156
+
157
+ # http body (model)
158
+ post_body = opts[:body]
159
+
160
+ return_type = opts[:return_type]
161
+
162
+ auth_names = opts[:auth_names] || ['key', 'oauth']
163
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
164
+ :header_params => header_params,
165
+ :query_params => query_params,
166
+ :form_params => form_params,
167
+ :body => post_body,
168
+ :auth_names => auth_names,
169
+ :return_type => return_type)
170
+
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
173
+ end
174
+ return data, status_code, headers
175
+ end
176
+ # Generate secret key for a webhook subscription.
177
+ # We allow you to generate a secret key for the subscription. You can use it to verify the author of callback messages. When you have a secret key already defined - a creation of new one will make old one deprecated - it will be still active for 24 hours though. You can have up to 16 non-expired secret keys. A signature will be included in header `smartrecruiters-signature` of callback request. Additionally we will send `smartrecruiters-timestamp` header with timestamp (seconds) of request. `smartrecruiters-signature` header value has the following format: ``` $SIGNATURE_SCHEMA=$SIGNATURE_1;$SIGNATURE_SCHEMA=$SIGNATURE_2... ``` As you may notice there may be multiple signatures included in the header. It can be caused by one or both: * having multiple active keys * smartrecruiters providing multiple signatures per key with different signature schemes. We may use it in the future to deliver new algorithm of signature creation without breaking backward compability. Every segment of header value is delimited by `;` character Currently, we support and sent following signature (`$SIGNATURE_SCHEMA`): #### 1) `v1` Signature calculated using HMAC with SHA256 algorithm. Hash should be calculated from following elements concatenated by the `.` character: * `smartrecruiters-timestamp` header value * request body * `event-id` header value * `event-name` header value * `event-version` header value * `link` header value Order of this elements is important. In absence of header please use an empty string as its value. For example assume we have: * One active secret key: HeBVky2bccvvkcXPimH8c * Callback request: * headers: * content-type: application/json * smartrecruiters-signature: \"v1=2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f\" * smartrecruiters-timestamp = \"1574080897\" * event-id = \"123\" * link = \"<http://smartrecruiters.com/endpoint>; rel=self\" * event-name = \"application.created\" * event-version = \"v201910\" * body: {\"job_id\":\"jid\",\"candidate_id\": \"cid\"} hash should be calculated from value: ``` 1574080897.{\"job_id\":\"jid\",\"candidate_id\":\"cid\"}.123.application.created.v201910.<http://smartrecruiters.com/endpoint>; rel=self ``` and after using HMAC and SHA256 it should give you hash : 2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f, so that `smartrecruiters-signature` header in the callback request will have value: `v1=2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f`
178
+ # @param id subscription identifier
179
+ # @param [Hash] opts the optional parameters
180
+ # @return [SecretKeyPayload]
181
+ def subscriptions_generate_secret_key(id, opts = {})
182
+ data, _status_code, _headers = subscriptions_generate_secret_key_with_http_info(id, opts)
183
+ data
184
+ end
185
+
186
+ # Generate secret key for a webhook subscription.
187
+ # We allow you to generate a secret key for the subscription. You can use it to verify the author of callback messages. When you have a secret key already defined - a creation of new one will make old one deprecated - it will be still active for 24 hours though. You can have up to 16 non-expired secret keys. A signature will be included in header &#x60;smartrecruiters-signature&#x60; of callback request. Additionally we will send &#x60;smartrecruiters-timestamp&#x60; header with timestamp (seconds) of request. &#x60;smartrecruiters-signature&#x60; header value has the following format: &#x60;&#x60;&#x60; $SIGNATURE_SCHEMA&#x3D;$SIGNATURE_1;$SIGNATURE_SCHEMA&#x3D;$SIGNATURE_2... &#x60;&#x60;&#x60; As you may notice there may be multiple signatures included in the header. It can be caused by one or both: * having multiple active keys * smartrecruiters providing multiple signatures per key with different signature schemes. We may use it in the future to deliver new algorithm of signature creation without breaking backward compability. Every segment of header value is delimited by &#x60;;&#x60; character Currently, we support and sent following signature (&#x60;$SIGNATURE_SCHEMA&#x60;): #### 1) &#x60;v1&#x60; Signature calculated using HMAC with SHA256 algorithm. Hash should be calculated from following elements concatenated by the &#x60;.&#x60; character: * &#x60;smartrecruiters-timestamp&#x60; header value * request body * &#x60;event-id&#x60; header value * &#x60;event-name&#x60; header value * &#x60;event-version&#x60; header value * &#x60;link&#x60; header value Order of this elements is important. In absence of header please use an empty string as its value. For example assume we have: * One active secret key: HeBVky2bccvvkcXPimH8c * Callback request: * headers: * content-type: application/json * smartrecruiters-signature: \&quot;v1&#x3D;2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f\&quot; * smartrecruiters-timestamp &#x3D; \&quot;1574080897\&quot; * event-id &#x3D; \&quot;123\&quot; * link &#x3D; \&quot;&lt;http://smartrecruiters.com/endpoint&gt;; rel&#x3D;self\&quot; * event-name &#x3D; \&quot;application.created\&quot; * event-version &#x3D; \&quot;v201910\&quot; * body: {\&quot;job_id\&quot;:\&quot;jid\&quot;,\&quot;candidate_id\&quot;: \&quot;cid\&quot;} hash should be calculated from value: &#x60;&#x60;&#x60; 1574080897.{\&quot;job_id\&quot;:\&quot;jid\&quot;,\&quot;candidate_id\&quot;:\&quot;cid\&quot;}.123.application.created.v201910.&lt;http://smartrecruiters.com/endpoint&gt;; rel&#x3D;self &#x60;&#x60;&#x60; and after using HMAC and SHA256 it should give you hash : 2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f, so that &#x60;smartrecruiters-signature&#x60; header in the callback request will have value: &#x60;v1&#x3D;2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f&#x60;
188
+ # @param id subscription identifier
189
+ # @param [Hash] opts the optional parameters
190
+ # @return [Array<(SecretKeyPayload, Integer, Hash)>] SecretKeyPayload data, response status code and response headers
191
+ def subscriptions_generate_secret_key_with_http_info(id, opts = {})
192
+ if @api_client.config.debugging
193
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_generate_secret_key ...'
194
+ end
195
+ # verify the required parameter 'id' is set
196
+ if @api_client.config.client_side_validation && id.nil?
197
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_generate_secret_key"
198
+ end
199
+ # resource path
200
+ local_var_path = '/subscriptions/{id}/secret-key'.sub('{' + 'id' + '}', id.to_s)
201
+
202
+ # query parameters
203
+ query_params = opts[:query_params] || {}
204
+
205
+ # header parameters
206
+ header_params = opts[:header_params] || {}
207
+ # HTTP header 'Accept' (if needed)
208
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
209
+
210
+ # form parameters
211
+ form_params = opts[:form_params] || {}
212
+
213
+ # http body (model)
214
+ post_body = opts[:body]
215
+
216
+ return_type = opts[:return_type] || 'SecretKeyPayload'
217
+
218
+ auth_names = opts[:auth_names] || ['key', 'oauth']
219
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
220
+ :header_params => header_params,
221
+ :query_params => query_params,
222
+ :form_params => form_params,
223
+ :body => post_body,
224
+ :auth_names => auth_names,
225
+ :return_type => return_type)
226
+
227
+ if @api_client.config.debugging
228
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_generate_secret_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
229
+ end
230
+ return data, status_code, headers
231
+ end
232
+ # Retrieve single webhook subscription.
233
+ # @param id subscription identifier
234
+ # @param [Hash] opts the optional parameters
235
+ # @return [Subscription]
236
+ def subscriptions_get(id, opts = {})
237
+ data, _status_code, _headers = subscriptions_get_with_http_info(id, opts)
238
+ data
239
+ end
240
+
241
+ # Retrieve single webhook subscription.
242
+ # @param id subscription identifier
243
+ # @param [Hash] opts the optional parameters
244
+ # @return [Array<(Subscription, Integer, Hash)>] Subscription data, response status code and response headers
245
+ def subscriptions_get_with_http_info(id, opts = {})
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_get ...'
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 SubscriptionsApi.subscriptions_get"
252
+ end
253
+ # resource path
254
+ local_var_path = '/subscriptions/{id}'.sub('{' + 'id' + '}', 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'])
263
+
264
+ # form parameters
265
+ form_params = opts[:form_params] || {}
266
+
267
+ # http body (model)
268
+ post_body = opts[:body]
269
+
270
+ return_type = opts[:return_type] || 'Subscription'
271
+
272
+ auth_names = opts[:auth_names] || ['key', 'oauth']
273
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type)
280
+
281
+ if @api_client.config.debugging
282
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
283
+ end
284
+ return data, status_code, headers
285
+ end
286
+ # Retrieve webhook subscriptions.
287
+ # @param [Hash] opts the optional parameters
288
+ # @option opts [String] :page_id identifier of the next page of subscriptions
289
+ # @option opts [Integer] :limit number of elements to return (default to 10)
290
+ # @return [Subscriptions]
291
+ def subscriptions_get_all(opts = {})
292
+ data, _status_code, _headers = subscriptions_get_all_with_http_info(opts)
293
+ data
294
+ end
295
+
296
+ # Retrieve webhook subscriptions.
297
+ # @param [Hash] opts the optional parameters
298
+ # @option opts [String] :page_id identifier of the next page of subscriptions
299
+ # @option opts [Integer] :limit number of elements to return
300
+ # @return [Array<(Subscriptions, Integer, Hash)>] Subscriptions data, response status code and response headers
301
+ def subscriptions_get_all_with_http_info(opts = {})
302
+ if @api_client.config.debugging
303
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_get_all ...'
304
+ end
305
+ # resource path
306
+ local_var_path = '/subscriptions'
307
+
308
+ # query parameters
309
+ query_params = opts[:query_params] || {}
310
+ query_params[:'page_id'] = opts[:'page_id'] if !opts[:'page_id'].nil?
311
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
312
+
313
+ # header parameters
314
+ header_params = opts[:header_params] || {}
315
+ # HTTP header 'Accept' (if needed)
316
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
317
+
318
+ # form parameters
319
+ form_params = opts[:form_params] || {}
320
+
321
+ # http body (model)
322
+ post_body = opts[:body]
323
+
324
+ return_type = opts[:return_type] || 'Subscriptions'
325
+
326
+ auth_names = opts[:auth_names] || ['key', 'oauth']
327
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
328
+ :header_params => header_params,
329
+ :query_params => query_params,
330
+ :form_params => form_params,
331
+ :body => post_body,
332
+ :auth_names => auth_names,
333
+ :return_type => return_type)
334
+
335
+ if @api_client.config.debugging
336
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_get_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
337
+ end
338
+ return data, status_code, headers
339
+ end
340
+ # Retrieve subscription secret key
341
+ # Retrieves the last secret key for webhook subscription.
342
+ # @param id subscription identifier
343
+ # @param [Hash] opts the optional parameters
344
+ # @return [SecretKeyPayload]
345
+ def subscriptions_get_secret_key(id, opts = {})
346
+ data, _status_code, _headers = subscriptions_get_secret_key_with_http_info(id, opts)
347
+ data
348
+ end
349
+
350
+ # Retrieve subscription secret key
351
+ # Retrieves the last secret key for webhook subscription.
352
+ # @param id subscription identifier
353
+ # @param [Hash] opts the optional parameters
354
+ # @return [Array<(SecretKeyPayload, Integer, Hash)>] SecretKeyPayload data, response status code and response headers
355
+ def subscriptions_get_secret_key_with_http_info(id, opts = {})
356
+ if @api_client.config.debugging
357
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_get_secret_key ...'
358
+ end
359
+ # verify the required parameter 'id' is set
360
+ if @api_client.config.client_side_validation && id.nil?
361
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_get_secret_key"
362
+ end
363
+ # resource path
364
+ local_var_path = '/subscriptions/{id}/secret-key'.sub('{' + 'id' + '}', id.to_s)
365
+
366
+ # query parameters
367
+ query_params = opts[:query_params] || {}
368
+
369
+ # header parameters
370
+ header_params = opts[:header_params] || {}
371
+ # HTTP header 'Accept' (if needed)
372
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
373
+
374
+ # form parameters
375
+ form_params = opts[:form_params] || {}
376
+
377
+ # http body (model)
378
+ post_body = opts[:body]
379
+
380
+ return_type = opts[:return_type] || 'SecretKeyPayload'
381
+
382
+ auth_names = opts[:auth_names] || ['key', 'oauth']
383
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
384
+ :header_params => header_params,
385
+ :query_params => query_params,
386
+ :form_params => form_params,
387
+ :body => post_body,
388
+ :auth_names => auth_names,
389
+ :return_type => return_type)
390
+
391
+ if @api_client.config.debugging
392
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_get_secret_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
393
+ end
394
+ return data, status_code, headers
395
+ end
396
+ # Retrieve callback request details starting from newest.
397
+ # @param id subscription identifier
398
+ # @param [Hash] opts the optional parameters
399
+ # @option opts [String] :page_id identifier of the next page of subscriptions
400
+ # @option opts [Integer] :limit number of elements to return (default to 10)
401
+ # @option opts [String] :callback_status status of callback, whan absent all statuses will be returned
402
+ # @option opts [DateTime] :after Requests sent after timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ
403
+ # @option opts [DateTime] :before Requests sent before timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ
404
+ # @return [CallbackRequests]
405
+ def subscriptions_search_callback_log(id, opts = {})
406
+ data, _status_code, _headers = subscriptions_search_callback_log_with_http_info(id, opts)
407
+ data
408
+ end
409
+
410
+ # Retrieve callback request details starting from newest.
411
+ # @param id subscription identifier
412
+ # @param [Hash] opts the optional parameters
413
+ # @option opts [String] :page_id identifier of the next page of subscriptions
414
+ # @option opts [Integer] :limit number of elements to return
415
+ # @option opts [String] :callback_status status of callback, whan absent all statuses will be returned
416
+ # @option opts [DateTime] :after Requests sent after timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ
417
+ # @option opts [DateTime] :before Requests sent before timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ
418
+ # @return [Array<(CallbackRequests, Integer, Hash)>] CallbackRequests data, response status code and response headers
419
+ def subscriptions_search_callback_log_with_http_info(id, opts = {})
420
+ if @api_client.config.debugging
421
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_search_callback_log ...'
422
+ end
423
+ # verify the required parameter 'id' is set
424
+ if @api_client.config.client_side_validation && id.nil?
425
+ fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_search_callback_log"
426
+ end
427
+ if @api_client.config.client_side_validation && opts[:'callback_status'] && !['successful', 'failed'].include?(opts[:'callback_status'])
428
+ fail ArgumentError, 'invalid value for "callback_status", must be one of successful, failed'
429
+ end
430
+ # resource path
431
+ local_var_path = '/subscriptions/{id}/callbacks-log'.sub('{' + 'id' + '}', id.to_s)
432
+
433
+ # query parameters
434
+ query_params = opts[:query_params] || {}
435
+ query_params[:'page_id'] = opts[:'page_id'] if !opts[:'page_id'].nil?
436
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
437
+ query_params[:'callbackStatus'] = opts[:'callback_status'] if !opts[:'callback_status'].nil?
438
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
439
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
440
+
441
+ # header parameters
442
+ header_params = opts[:header_params] || {}
443
+ # HTTP header 'Accept' (if needed)
444
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
445
+
446
+ # form parameters
447
+ form_params = opts[:form_params] || {}
448
+
449
+ # http body (model)
450
+ post_body = opts[:body]
451
+
452
+ return_type = opts[:return_type] || 'CallbackRequests'
453
+
454
+ auth_names = opts[:auth_names] || ['key', 'oauth']
455
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
456
+ :header_params => header_params,
457
+ :query_params => query_params,
458
+ :form_params => form_params,
459
+ :body => post_body,
460
+ :auth_names => auth_names,
461
+ :return_type => return_type)
462
+
463
+ if @api_client.config.debugging
464
+ @api_client.config.logger.debug "API called: SubscriptionsApi#subscriptions_search_callback_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
465
+ end
466
+ return data, status_code, headers
467
+ end
468
+ end
469
+ end