Class: Merge::Ats::CandidatesClient
- Inherits:
-
Object
- Object
- Merge::Ats::CandidatesClient
- Defined in:
- lib/merge_ruby_client/ats/candidates/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ats::CandidateResponse
Creates a ‘Candidate` object with the given values.
-
#ignore_create(model_id:, reason:, message: nil, request_options: nil) ⇒ Void
Ignores a specific row based on the ‘model_id` in the url.
- #initialize(request_client:) ⇒ Merge::Ats::CandidatesClient constructor
-
#list(created_after: nil, created_before: nil, cursor: nil, email_addresses: nil, expand: nil, first_name: nil, include_deleted_data: nil, include_remote_data: nil, last_name: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, tags: nil, request_options: nil) ⇒ Merge::Ats::PaginatedCandidateList
Returns a list of ‘Candidate` objects.
-
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Ats::MetaResponse
Returns metadata for ‘Candidate` PATCHs.
-
#meta_post_retrieve(request_options: nil) ⇒ Merge::Ats::MetaResponse
Returns metadata for ‘Candidate` POSTs.
-
#partial_update(id:, model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ats::CandidateResponse
Updates a ‘Candidate` object with the given `id`.
-
#retrieve(id:, expand: nil, include_remote_data: nil, request_options: nil) ⇒ Merge::Ats::Candidate
Returns a ‘Candidate` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Ats::CandidatesClient
24 25 26 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 24 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::RequestClient (readonly)
20 21 22 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 20 def request_client @request_client end |
Instance Method Details
#create(model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ats::CandidateResponse
Creates a ‘Candidate` object with the given values.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 126 def create(model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model, remote_user_id: remote_user_id }.compact req.url "#{@request_client.get_url(request_options: )}/ats/v1/candidates" end Merge::Ats::CandidateResponse.from_json(json_object: response.body) end |
#ignore_create(model_id:, reason:, message: nil, request_options: nil) ⇒ Void
Ignores a specific row based on the ‘model_id` in the url. These records will
have their properties set to null, and will not be updated in future syncs. The
"reason" and "message" fields in the request body will be stored for audit
purposes.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 269 def ignore_create(model_id:, reason:, message: nil, request_options: nil) @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), reason: reason, message: }.compact req.url "#{@request_client.get_url(request_options: )}/ats/v1/candidates/ignore/#{model_id}" end end |
#list(created_after: nil, created_before: nil, cursor: nil, email_addresses: nil, expand: nil, first_name: nil, include_deleted_data: nil, include_remote_data: nil, last_name: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, tags: nil, request_options: nil) ⇒ Merge::Ats::PaginatedCandidateList
Returns a list of ‘Candidate` objects.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 58 def list(created_after: nil, created_before: nil, cursor: nil, email_addresses: nil, expand: nil, first_name: nil, include_deleted_data: nil, include_remote_data: nil, last_name: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, tags: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "created_after": created_after, "created_before": created_before, "cursor": cursor, "email_addresses": email_addresses, "expand": , "first_name": first_name, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "last_name": last_name, "modified_after": modified_after, "modified_before": modified_before, "page_size": page_size, "remote_id": remote_id, "tags": }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ats/v1/candidates" end Merge::Ats::PaginatedCandidateList.from_json(json_object: response.body) end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Ats::MetaResponse
Returns metadata for ‘Candidate` PATCHs.
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 299 def (id:, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ats/v1/candidates/meta/patch/#{id}" end Merge::Ats::MetaResponse.from_json(json_object: response.body) end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Ats::MetaResponse
Returns metadata for ‘Candidate` POSTs.
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 331 def (request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ats/v1/candidates/meta/post" end Merge::Ats::MetaResponse.from_json(json_object: response.body) end |
#partial_update(id:, model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ats::CandidateResponse
Updates a ‘Candidate` object with the given `id`.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 227 def partial_update(id:, model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model, remote_user_id: remote_user_id }.compact req.url "#{@request_client.get_url(request_options: )}/ats/v1/candidates/#{id}" end Merge::Ats::CandidateResponse.from_json(json_object: response.body) end |
#retrieve(id:, expand: nil, include_remote_data: nil, request_options: nil) ⇒ Merge::Ats::Candidate
Returns a ‘Candidate` object with the given `id`.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 167 def retrieve(id:, expand: nil, include_remote_data: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "expand": , "include_remote_data": include_remote_data }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ats/v1/candidates/#{id}" end Merge::Ats::Candidate.from_json(json_object: response.body) end |