Class: Merge::Ats::AsyncCandidatesClient
- Inherits:
-
Object
- Object
- Merge::Ats::AsyncCandidatesClient
- 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::AsyncCandidatesClient 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::AsyncCandidatesClient
359 360 361 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 359 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
355 356 357 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 355 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.
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 463 def create(model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) Async do 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 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.
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 612 def ignore_create(model_id:, reason:, message: nil, request_options: nil) Async do @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 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.
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 393 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) Async do 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 end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Ats::MetaResponse
Returns metadata for ‘Candidate` PATCHs.
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 648 def (id:, request_options: nil) Async do 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 end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Ats::MetaResponse
Returns metadata for ‘Candidate` POSTs.
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 682 def (request_options: nil) Async do 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 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`.
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 568 def partial_update(id:, model:, remote_user_id:, is_debug_mode: nil, run_async: nil, request_options: nil) Async do 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 end |
#retrieve(id:, expand: nil, include_remote_data: nil, request_options: nil) ⇒ Merge::Ats::Candidate
Returns a ‘Candidate` object with the given `id`.
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/merge_ruby_client/ats/candidates/client.rb', line 506 def retrieve(id:, expand: nil, include_remote_data: nil, request_options: nil) Async do 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 end |