open_api_smart_recruiters_sdk 0.2.3 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/Gemfile.lock +1 -1
  4. data/lib/.DS_Store +0 -0
  5. data/lib/smart_recruiters/.DS_Store +0 -0
  6. data/lib/smart_recruiters/api/interview_types_api.rb +169 -0
  7. data/lib/smart_recruiters/api/interviews_api.rb +296 -0
  8. data/lib/smart_recruiters/api/messages_api.rb +187 -0
  9. data/lib/smart_recruiters/api/statuses_api.rb +215 -0
  10. data/lib/smart_recruiters/api/timeslots_api.rb +261 -0
  11. data/lib/smart_recruiters/api_client.rb +1 -2
  12. data/lib/smart_recruiters/authorization.rb +11 -1
  13. data/lib/smart_recruiters/configuration.rb +1 -1
  14. data/lib/smart_recruiters/models/applications.rb +192 -0
  15. data/lib/smart_recruiters/models/attendee_status.rb +202 -0
  16. data/lib/smart_recruiters/models/attendee_status_value.rb +21 -0
  17. data/lib/smart_recruiters/models/candidate_attendee_status_value.rb +22 -0
  18. data/lib/smart_recruiters/models/context.rb +197 -0
  19. data/lib/smart_recruiters/models/interview.rb +305 -0
  20. data/lib/smart_recruiters/models/interview_to_update_input.rb +216 -0
  21. data/lib/smart_recruiters/models/interview_type.rb +188 -0
  22. data/lib/smart_recruiters/models/interview_types.rb +192 -0
  23. data/lib/smart_recruiters/models/interviewer.rb +216 -0
  24. data/lib/smart_recruiters/models/interviewers.rb +192 -0
  25. data/lib/smart_recruiters/models/interviews_list.rb +199 -0
  26. data/lib/smart_recruiters/models/message.rb +222 -0
  27. data/lib/smart_recruiters/models/message_details.rb +206 -0
  28. data/lib/smart_recruiters/models/message_view.rb +233 -0
  29. data/lib/smart_recruiters/models/messages_view.rb +192 -0
  30. data/lib/smart_recruiters/models/share_with.rb +233 -0
  31. data/lib/smart_recruiters/models/timeslot.rb +275 -0
  32. data/lib/smart_recruiters/models/timeslots.rb +192 -0
  33. data/lib/smart_recruiters/models/user_id.rb +189 -0
  34. data/lib/smart_recruiters/models/uuid_read_only.rb +188 -0
  35. data/lib/smart_recruiters/models/visibility.rb +21 -0
  36. data/lib/smart_recruiters/version.rb +1 -1
  37. data/lib/smart_recruiters.rb +2 -19
  38. metadata +32 -2
@@ -0,0 +1,215 @@
1
+
2
+
3
+ module SmartRecruiters
4
+ class StatusesApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # Changes a candidate's status.
11
+ # @param body New candidate's status
12
+ # @param interview_id ID of the interview
13
+ # @param [Hash] opts the optional parameters
14
+ # @return [nil]
15
+ def statuses_candidate_put(body, interview_id, opts = {})
16
+ statuses_candidate_put_with_http_info(body, interview_id, opts)
17
+ nil
18
+ end
19
+
20
+ # Changes a candidate's status.
21
+ # @param body New candidate's status
22
+ # @param interview_id ID of the interview
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
25
+ def statuses_candidate_put_with_http_info(body, interview_id, opts = {})
26
+ if @api_client.config.debugging
27
+ @api_client.config.logger.debug 'Calling API: StatusesApi.statuses_candidate_put ...'
28
+ end
29
+ # verify the required parameter 'body' is set
30
+ if @api_client.config.client_side_validation && body.nil?
31
+ fail ArgumentError, "Missing the required parameter 'body' when calling StatusesApi.statuses_candidate_put"
32
+ end
33
+ # verify the required parameter 'interview_id' is set
34
+ if @api_client.config.client_side_validation && interview_id.nil?
35
+ fail ArgumentError, "Missing the required parameter 'interview_id' when calling StatusesApi.statuses_candidate_put"
36
+ end
37
+ # resource path
38
+ local_var_path = '/interviews/{interviewId}/candidate/status'.sub('{' + 'interviewId' + '}', interview_id.to_s)
39
+
40
+ # query parameters
41
+ query_params = opts[:query_params] || {}
42
+
43
+ # header parameters
44
+ header_params = opts[:header_params] || {}
45
+ # HTTP header 'Accept' (if needed)
46
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
47
+ # HTTP header 'Content-Type'
48
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
55
+
56
+ return_type = opts[:return_type]
57
+
58
+ auth_names = opts[:auth_names] || ['key', 'oauth']
59
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
60
+ :header_params => header_params,
61
+ :query_params => query_params,
62
+ :form_params => form_params,
63
+ :body => post_body,
64
+ :auth_names => auth_names,
65
+ :return_type => return_type)
66
+
67
+ if @api_client.config.debugging
68
+ @api_client.config.logger.debug "API called: StatusesApi#statuses_candidate_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
69
+ end
70
+ return data, status_code, headers
71
+ end
72
+ # Changes a interviewer's status in given timeslot
73
+ # @param body New interviewer&#x27;s status
74
+ # @param interview_id ID of the interview
75
+ # @param timeslot_id ID of the timeslot
76
+ # @param user_id ID of the user
77
+ # @param [Hash] opts the optional parameters
78
+ # @return [nil]
79
+ def statuses_interviewer_put(body, interview_id, timeslot_id, user_id, opts = {})
80
+ statuses_interviewer_put_with_http_info(body, interview_id, timeslot_id, user_id, opts)
81
+ nil
82
+ end
83
+
84
+ # Changes a interviewer&#x27;s status in given timeslot
85
+ # @param body New interviewer&#x27;s status
86
+ # @param interview_id ID of the interview
87
+ # @param timeslot_id ID of the timeslot
88
+ # @param user_id ID of the user
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
91
+ def statuses_interviewer_put_with_http_info(body, interview_id, timeslot_id, user_id, opts = {})
92
+ if @api_client.config.debugging
93
+ @api_client.config.logger.debug 'Calling API: StatusesApi.statuses_interviewer_put ...'
94
+ end
95
+ # verify the required parameter 'body' is set
96
+ if @api_client.config.client_side_validation && body.nil?
97
+ fail ArgumentError, "Missing the required parameter 'body' when calling StatusesApi.statuses_interviewer_put"
98
+ end
99
+ # verify the required parameter 'interview_id' is set
100
+ if @api_client.config.client_side_validation && interview_id.nil?
101
+ fail ArgumentError, "Missing the required parameter 'interview_id' when calling StatusesApi.statuses_interviewer_put"
102
+ end
103
+ # verify the required parameter 'timeslot_id' is set
104
+ if @api_client.config.client_side_validation && timeslot_id.nil?
105
+ fail ArgumentError, "Missing the required parameter 'timeslot_id' when calling StatusesApi.statuses_interviewer_put"
106
+ end
107
+ # verify the required parameter 'user_id' is set
108
+ if @api_client.config.client_side_validation && user_id.nil?
109
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling StatusesApi.statuses_interviewer_put"
110
+ end
111
+ # resource path
112
+ local_var_path = '/interviews/{interviewId}/timeslots/{timeslotId}/interviewers/{userId}/status'.sub('{' + 'interviewId' + '}', interview_id.to_s).sub('{' + 'timeslotId' + '}', timeslot_id.to_s).sub('{' + 'userId' + '}', user_id.to_s)
113
+
114
+ # query parameters
115
+ query_params = opts[:query_params] || {}
116
+
117
+ # header parameters
118
+ header_params = opts[:header_params] || {}
119
+ # HTTP header 'Accept' (if needed)
120
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
121
+ # HTTP header 'Content-Type'
122
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
129
+
130
+ return_type = opts[:return_type]
131
+
132
+ auth_names = opts[:auth_names] || ['key', 'oauth']
133
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
134
+ :header_params => header_params,
135
+ :query_params => query_params,
136
+ :form_params => form_params,
137
+ :body => post_body,
138
+ :auth_names => auth_names,
139
+ :return_type => return_type)
140
+
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: StatusesApi#statuses_interviewer_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+ # Changes a candidate's status in given timeslot
147
+ # @param body New candidate&#x27;s status
148
+ # @param interview_id ID of the interview
149
+ # @param timeslot_id ID of the timeslot
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [nil]
152
+ def statuses_timeslot_candidate_put(body, interview_id, timeslot_id, opts = {})
153
+ statuses_timeslot_candidate_put_with_http_info(body, interview_id, timeslot_id, opts)
154
+ nil
155
+ end
156
+
157
+ # Changes a candidate&#x27;s status in given timeslot
158
+ # @param body New candidate&#x27;s status
159
+ # @param interview_id ID of the interview
160
+ # @param timeslot_id ID of the timeslot
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
163
+ def statuses_timeslot_candidate_put_with_http_info(body, interview_id, timeslot_id, opts = {})
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug 'Calling API: StatusesApi.statuses_timeslot_candidate_put ...'
166
+ end
167
+ # verify the required parameter 'body' is set
168
+ if @api_client.config.client_side_validation && body.nil?
169
+ fail ArgumentError, "Missing the required parameter 'body' when calling StatusesApi.statuses_timeslot_candidate_put"
170
+ end
171
+ # verify the required parameter 'interview_id' is set
172
+ if @api_client.config.client_side_validation && interview_id.nil?
173
+ fail ArgumentError, "Missing the required parameter 'interview_id' when calling StatusesApi.statuses_timeslot_candidate_put"
174
+ end
175
+ # verify the required parameter 'timeslot_id' is set
176
+ if @api_client.config.client_side_validation && timeslot_id.nil?
177
+ fail ArgumentError, "Missing the required parameter 'timeslot_id' when calling StatusesApi.statuses_timeslot_candidate_put"
178
+ end
179
+ # resource path
180
+ local_var_path = '/interviews/{interviewId}/timeslots/{timeslotId}/candidateStatus'.sub('{' + 'interviewId' + '}', interview_id.to_s).sub('{' + 'timeslotId' + '}', timeslot_id.to_s)
181
+
182
+ # query parameters
183
+ query_params = opts[:query_params] || {}
184
+
185
+ # header parameters
186
+ header_params = opts[:header_params] || {}
187
+ # HTTP header 'Accept' (if needed)
188
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
189
+ # HTTP header 'Content-Type'
190
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
191
+
192
+ # form parameters
193
+ form_params = opts[:form_params] || {}
194
+
195
+ # http body (model)
196
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
197
+
198
+ return_type = opts[:return_type]
199
+
200
+ auth_names = opts[:auth_names] || ['key', 'oauth']
201
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
202
+ :header_params => header_params,
203
+ :query_params => query_params,
204
+ :form_params => form_params,
205
+ :body => post_body,
206
+ :auth_names => auth_names,
207
+ :return_type => return_type)
208
+
209
+ if @api_client.config.debugging
210
+ @api_client.config.logger.debug "API called: StatusesApi#statuses_timeslot_candidate_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
211
+ end
212
+ return data, status_code, headers
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,261 @@
1
+
2
+
3
+ module SmartRecruiters
4
+ class TimeslotsApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # Creates a timeslot
11
+ # @param body Timeslot to be added
12
+ # @param interview_id ID of the interview
13
+ # @param [Hash] opts the optional parameters
14
+ # @return [Timeslot]
15
+ def timeslots_create(body, interview_id, opts = {})
16
+ data, _status_code, _headers = timeslots_create_with_http_info(body, interview_id, opts)
17
+ data
18
+ end
19
+
20
+ # Creates a timeslot
21
+ # @param body Timeslot to be added
22
+ # @param interview_id ID of the interview
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [Array<(Timeslot, Integer, Hash)>] Timeslot data, response status code and response headers
25
+ def timeslots_create_with_http_info(body, interview_id, opts = {})
26
+ if @api_client.config.debugging
27
+ @api_client.config.logger.debug 'Calling API: TimeslotsApi.timeslots_create ...'
28
+ end
29
+ # verify the required parameter 'body' is set
30
+ if @api_client.config.client_side_validation && body.nil?
31
+ fail ArgumentError, "Missing the required parameter 'body' when calling TimeslotsApi.timeslots_create"
32
+ end
33
+ # verify the required parameter 'interview_id' is set
34
+ if @api_client.config.client_side_validation && interview_id.nil?
35
+ fail ArgumentError, "Missing the required parameter 'interview_id' when calling TimeslotsApi.timeslots_create"
36
+ end
37
+ # resource path
38
+ local_var_path = '/interviews/{interviewId}/timeslots'.sub('{' + 'interviewId' + '}', interview_id.to_s)
39
+
40
+ # query parameters
41
+ query_params = opts[:query_params] || {}
42
+
43
+ # header parameters
44
+ header_params = opts[:header_params] || {}
45
+ # HTTP header 'Accept' (if needed)
46
+ header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8', 'application/json'])
47
+ # HTTP header 'Content-Type'
48
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
55
+
56
+ return_type = opts[:return_type] || 'Timeslot'
57
+
58
+ auth_names = opts[:auth_names] || ['key', 'oauth']
59
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
60
+ :header_params => header_params,
61
+ :query_params => query_params,
62
+ :form_params => form_params,
63
+ :body => post_body,
64
+ :auth_names => auth_names,
65
+ :return_type => return_type)
66
+
67
+ if @api_client.config.debugging
68
+ @api_client.config.logger.debug "API called: TimeslotsApi#timeslots_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
69
+ end
70
+ return data, status_code, headers
71
+ end
72
+ # Deletes a timeslot
73
+ # @param interview_id ID of the interview
74
+ # @param timeslot_id ID of the timeslot
75
+ # @param [Hash] opts the optional parameters
76
+ # @return [nil]
77
+ def timeslots_delete(interview_id, timeslot_id, opts = {})
78
+ timeslots_delete_with_http_info(interview_id, timeslot_id, opts)
79
+ nil
80
+ end
81
+
82
+ # Deletes a timeslot
83
+ # @param interview_id ID of the interview
84
+ # @param timeslot_id ID of the timeslot
85
+ # @param [Hash] opts the optional parameters
86
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
87
+ def timeslots_delete_with_http_info(interview_id, timeslot_id, opts = {})
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug 'Calling API: TimeslotsApi.timeslots_delete ...'
90
+ end
91
+ # verify the required parameter 'interview_id' is set
92
+ if @api_client.config.client_side_validation && interview_id.nil?
93
+ fail ArgumentError, "Missing the required parameter 'interview_id' when calling TimeslotsApi.timeslots_delete"
94
+ end
95
+ # verify the required parameter 'timeslot_id' is set
96
+ if @api_client.config.client_side_validation && timeslot_id.nil?
97
+ fail ArgumentError, "Missing the required parameter 'timeslot_id' when calling TimeslotsApi.timeslots_delete"
98
+ end
99
+ # resource path
100
+ local_var_path = '/interviews/{interviewId}/timeslots/{timeslotId}'.sub('{' + 'interviewId' + '}', interview_id.to_s).sub('{' + 'timeslotId' + '}', timeslot_id.to_s)
101
+
102
+ # query parameters
103
+ query_params = opts[:query_params] || {}
104
+
105
+ # header parameters
106
+ header_params = opts[:header_params] || {}
107
+ # HTTP header 'Accept' (if needed)
108
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
109
+
110
+ # form parameters
111
+ form_params = opts[:form_params] || {}
112
+
113
+ # http body (model)
114
+ post_body = opts[:body]
115
+
116
+ return_type = opts[:return_type]
117
+
118
+ auth_names = opts[:auth_names] || ['key', 'oauth']
119
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
120
+ :header_params => header_params,
121
+ :query_params => query_params,
122
+ :form_params => form_params,
123
+ :body => post_body,
124
+ :auth_names => auth_names,
125
+ :return_type => return_type)
126
+
127
+ if @api_client.config.debugging
128
+ @api_client.config.logger.debug "API called: TimeslotsApi#timeslots_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
129
+ end
130
+ return data, status_code, headers
131
+ end
132
+ # Retrieves a timeslot
133
+ # @param interview_id ID of the interview
134
+ # @param timeslot_id ID of the timeslot
135
+ # @param [Hash] opts the optional parameters
136
+ # @return [Timeslot]
137
+ def timeslots_get(interview_id, timeslot_id, opts = {})
138
+ data, _status_code, _headers = timeslots_get_with_http_info(interview_id, timeslot_id, opts)
139
+ data
140
+ end
141
+
142
+ # Retrieves a timeslot
143
+ # @param interview_id ID of the interview
144
+ # @param timeslot_id ID of the timeslot
145
+ # @param [Hash] opts the optional parameters
146
+ # @return [Array<(Timeslot, Integer, Hash)>] Timeslot data, response status code and response headers
147
+ def timeslots_get_with_http_info(interview_id, timeslot_id, opts = {})
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug 'Calling API: TimeslotsApi.timeslots_get ...'
150
+ end
151
+ # verify the required parameter 'interview_id' is set
152
+ if @api_client.config.client_side_validation && interview_id.nil?
153
+ fail ArgumentError, "Missing the required parameter 'interview_id' when calling TimeslotsApi.timeslots_get"
154
+ end
155
+ # verify the required parameter 'timeslot_id' is set
156
+ if @api_client.config.client_side_validation && timeslot_id.nil?
157
+ fail ArgumentError, "Missing the required parameter 'timeslot_id' when calling TimeslotsApi.timeslots_get"
158
+ end
159
+ # resource path
160
+ local_var_path = '/interviews/{interviewId}/timeslots/{timeslotId}'.sub('{' + 'interviewId' + '}', interview_id.to_s).sub('{' + 'timeslotId' + '}', timeslot_id.to_s)
161
+
162
+ # query parameters
163
+ query_params = opts[:query_params] || {}
164
+
165
+ # header parameters
166
+ header_params = opts[:header_params] || {}
167
+ # HTTP header 'Accept' (if needed)
168
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
169
+
170
+ # form parameters
171
+ form_params = opts[:form_params] || {}
172
+
173
+ # http body (model)
174
+ post_body = opts[:body]
175
+
176
+ return_type = opts[:return_type] || 'Timeslot'
177
+
178
+ auth_names = opts[:auth_names] || ['key', 'oauth']
179
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
180
+ :header_params => header_params,
181
+ :query_params => query_params,
182
+ :form_params => form_params,
183
+ :body => post_body,
184
+ :auth_names => auth_names,
185
+ :return_type => return_type)
186
+
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug "API called: TimeslotsApi#timeslots_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
+ end
190
+ return data, status_code, headers
191
+ end
192
+ # Modifies a timeslot
193
+ # @param body Timeslot to be updated
194
+ # @param interview_id ID of the interview
195
+ # @param timeslot_id ID of the timeslot
196
+ # @param [Hash] opts the optional parameters
197
+ # @return [nil]
198
+ def timeslots_update(body, interview_id, timeslot_id, opts = {})
199
+ timeslots_update_with_http_info(body, interview_id, timeslot_id, opts)
200
+ nil
201
+ end
202
+
203
+ # Modifies a timeslot
204
+ # @param body Timeslot to be updated
205
+ # @param interview_id ID of the interview
206
+ # @param timeslot_id ID of the timeslot
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
209
+ def timeslots_update_with_http_info(body, interview_id, timeslot_id, opts = {})
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug 'Calling API: TimeslotsApi.timeslots_update ...'
212
+ end
213
+ # verify the required parameter 'body' is set
214
+ if @api_client.config.client_side_validation && body.nil?
215
+ fail ArgumentError, "Missing the required parameter 'body' when calling TimeslotsApi.timeslots_update"
216
+ end
217
+ # verify the required parameter 'interview_id' is set
218
+ if @api_client.config.client_side_validation && interview_id.nil?
219
+ fail ArgumentError, "Missing the required parameter 'interview_id' when calling TimeslotsApi.timeslots_update"
220
+ end
221
+ # verify the required parameter 'timeslot_id' is set
222
+ if @api_client.config.client_side_validation && timeslot_id.nil?
223
+ fail ArgumentError, "Missing the required parameter 'timeslot_id' when calling TimeslotsApi.timeslots_update"
224
+ end
225
+ # resource path
226
+ local_var_path = '/interviews/{interviewId}/timeslots/{timeslotId}'.sub('{' + 'interviewId' + '}', interview_id.to_s).sub('{' + 'timeslotId' + '}', timeslot_id.to_s)
227
+
228
+ # query parameters
229
+ query_params = opts[:query_params] || {}
230
+
231
+ # header parameters
232
+ header_params = opts[:header_params] || {}
233
+ # HTTP header 'Accept' (if needed)
234
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
235
+ # HTTP header 'Content-Type'
236
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
237
+
238
+ # form parameters
239
+ form_params = opts[:form_params] || {}
240
+
241
+ # http body (model)
242
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
243
+
244
+ return_type = opts[:return_type]
245
+
246
+ auth_names = opts[:auth_names] || ['key', 'oauth']
247
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
248
+ :header_params => header_params,
249
+ :query_params => query_params,
250
+ :form_params => form_params,
251
+ :body => post_body,
252
+ :auth_names => auth_names,
253
+ :return_type => return_type)
254
+
255
+ if @api_client.config.debugging
256
+ @api_client.config.logger.debug "API called: TimeslotsApi#timeslots_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
257
+ end
258
+ return data, status_code, headers
259
+ end
260
+ end
261
+ end
@@ -17,9 +17,8 @@ module SmartRecruiters
17
17
 
18
18
  # Initializes the ApiClient
19
19
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
20
- def initialize(access_token, config = Configuration.default)
20
+ def initialize(config = Configuration.default)
21
21
  @config = config
22
- @config.access_token = access_token
23
22
  @user_agent = "SmartRecruiters/#{VERSION}/ruby"
24
23
  @default_headers = {
25
24
  'Content-Type' => 'application/json',
@@ -53,9 +53,19 @@ module SmartRecruiters
53
53
  }
54
54
  )
55
55
 
56
- token.refresh!({ client_id: config.client_id, client_secret: config.client_secret }) if token.expired?
56
+ if token.expired?
57
+ token.refresh!({ client_id: config.client_id, client_secret: config.client_secret })
58
+
59
+ load_token(token)
60
+ end
57
61
 
58
62
  token
59
63
  end
64
+
65
+ def load_token(token)
66
+ SmartRecruiters::Configuration.default.access_token = token.token
67
+ SmartRecruiters::Configuration.default.token_expires_at = token.expires_at
68
+ SmartRecruiters::Configuration.default.refresh_token = token.refresh_token
69
+ end
60
70
  end
61
71
  end
@@ -132,7 +132,7 @@ module SmartRecruiters
132
132
  def initialize
133
133
  @scheme = 'https'
134
134
  @host = 'api.smartrecruiters.com'
135
- @base_path = 'https://api.smartrecruiters.com'
135
+ @base_path = ''
136
136
  @api_key = {}
137
137
  @api_key_prefix = {}
138
138
  @client_id = nil