Class: Gusto::AsyncEmployeesClient
- Inherits:
-
Object
- Object
- Gusto::AsyncEmployeesClient
- Defined in:
- lib/fern_gusto/employees/client.rb
Instance Attribute Summary collapse
- #adresses ⇒ Gusto::Employees::AdressesClient readonly
- #benefits ⇒ Gusto::Employees::BenefitsClient readonly
- #employments ⇒ Gusto::Employees::EmploymentsClient readonly
- #forms ⇒ Gusto::Employees::FormsClient readonly
- #garnishments ⇒ Gusto::Employees::GarnishmentsClient readonly
- #jobs_and_compensations ⇒ Gusto::Employees::JobsAndCompensationsClient readonly
- #payment_method ⇒ Gusto::Employees::PaymentMethodClient readonly
- #request_client ⇒ Gusto::AsyncRequestClient readonly
- #tax_setup ⇒ Gusto::Employees::TaxSetupClient readonly
Instance Method Summary collapse
-
#delete(employee_id:, request_options: nil) ⇒ Object
api.employees.delete(employee_id: “employee_id”).
-
#get(employee_id:, include: nil, request_options: nil) ⇒ Object
api.employees.get(employee_id: “employee_id”).
-
#get_custom_fields(employee_id:, page: nil, per: nil, request_options: nil) ⇒ Object
api.employees.get_custom_fields(employee_id: “employee_id”).
-
#get_onboarding_status(employee_id:, request_options: nil) ⇒ Object
api.employees.get_onboarding_status(employee_id: “employee_id”).
-
#get_time_off_activities(employee_uuid:, time_off_type:, request_options: nil) ⇒ Object
api.employees.get_time_off_activities(employee_uuid: “employee_uuid”, time_off_type: “time_off_type”).
- #initialize(request_client:) ⇒ Gusto::AsyncEmployeesClient constructor
-
#update(employee_id:, version:, first_name: nil, middle_initial: nil, last_name: nil, preferred_first_name: nil, date_of_birth: nil, email: nil, ssn: nil, two_percent_shareholder: nil, request_options: nil) ⇒ Object
).
-
#update_onboarding_status(employee_id:, onboarding_status:, request_options: nil) ⇒ Object
api.employees.update_onboarding_status(employee_id: “employee_id”, onboarding_status: “onboarding_status”).
Constructor Details
#initialize(request_client:) ⇒ Gusto::AsyncEmployeesClient
440 441 442 443 444 445 446 447 448 449 450 |
# File 'lib/fern_gusto/employees/client.rb', line 440 def initialize(request_client:) @request_client = request_client @employments = Gusto::Employees::AsyncEmploymentsClient.new(request_client: request_client) @adresses = Gusto::Employees::AsyncAdressesClient.new(request_client: request_client) @tax_setup = Gusto::Employees::AsyncTaxSetupClient.new(request_client: request_client) @payment_method = Gusto::Employees::AsyncPaymentMethodClient.new(request_client: request_client) @jobs_and_compensations = Gusto::Employees::AsyncJobsAndCompensationsClient.new(request_client: request_client) @forms = Gusto::Employees::AsyncFormsClient.new(request_client: request_client) @benefits = Gusto::Employees::AsyncBenefitsClient.new(request_client: request_client) @garnishments = Gusto::Employees::AsyncGarnishmentsClient.new(request_client: request_client) end |
Instance Attribute Details
#adresses ⇒ Gusto::Employees::AdressesClient (readonly)
423 424 425 |
# File 'lib/fern_gusto/employees/client.rb', line 423 def adresses @adresses end |
#benefits ⇒ Gusto::Employees::BenefitsClient (readonly)
433 434 435 |
# File 'lib/fern_gusto/employees/client.rb', line 433 def benefits @benefits end |
#employments ⇒ Gusto::Employees::EmploymentsClient (readonly)
421 422 423 |
# File 'lib/fern_gusto/employees/client.rb', line 421 def employments @employments end |
#forms ⇒ Gusto::Employees::FormsClient (readonly)
431 432 433 |
# File 'lib/fern_gusto/employees/client.rb', line 431 def forms @forms end |
#garnishments ⇒ Gusto::Employees::GarnishmentsClient (readonly)
435 436 437 |
# File 'lib/fern_gusto/employees/client.rb', line 435 def garnishments @garnishments end |
#jobs_and_compensations ⇒ Gusto::Employees::JobsAndCompensationsClient (readonly)
429 430 431 |
# File 'lib/fern_gusto/employees/client.rb', line 429 def jobs_and_compensations @jobs_and_compensations end |
#payment_method ⇒ Gusto::Employees::PaymentMethodClient (readonly)
427 428 429 |
# File 'lib/fern_gusto/employees/client.rb', line 427 def payment_method @payment_method end |
#request_client ⇒ Gusto::AsyncRequestClient (readonly)
419 420 421 |
# File 'lib/fern_gusto/employees/client.rb', line 419 def request_client @request_client end |
#tax_setup ⇒ Gusto::Employees::TaxSetupClient (readonly)
425 426 427 |
# File 'lib/fern_gusto/employees/client.rb', line 425 def tax_setup @tax_setup end |
Instance Method Details
#delete(employee_id:, request_options: nil) ⇒ Object
api.employees.delete(employee_id: “employee_id”)
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
# File 'lib/fern_gusto/employees/client.rb', line 565 def delete(employee_id:, request_options: nil) Async do response = @request_client.conn.delete do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end 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: )}/v1/employees/#{employee_id}" end end end |
#get(employee_id:, include: nil, request_options: nil) ⇒ Object
api.employees.get(employee_id: “employee_id”)
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/fern_gusto/employees/client.rb', line 469 def get(employee_id:, include: nil, request_options: nil) Async do response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "include": include }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}" end Gusto::Employees::Employee.from_json(json_object: response.body) end end |
#get_custom_fields(employee_id:, page: nil, per: nil, request_options: nil) ⇒ Object
api.employees.get_custom_fields(employee_id: “employee_id”)
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 |
# File 'lib/fern_gusto/employees/client.rb', line 604 def get_custom_fields(employee_id:, page: nil, per: nil, request_options: nil) Async do response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "page": page, "per": per }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}/custom_fields" end Gusto::Employees::EmployeesGetCustomFieldsResponse.from_json(json_object: response.body) end end |
#get_onboarding_status(employee_id:, request_options: nil) ⇒ Object
api.employees.get_onboarding_status(employee_id: “employee_id”)
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 |
# File 'lib/fern_gusto/employees/client.rb', line 703 def get_onboarding_status(employee_id:, request_options: nil) Async do response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end 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: )}/v1/employees/#{employee_id}/onboarding_status" end Gusto::Employees::EmployeeOnboardingInfo.from_json(json_object: response.body) end end |
#get_time_off_activities(employee_uuid:, time_off_type:, request_options: nil) ⇒ Object
api.employees.get_time_off_activities(employee_uuid: “employee_uuid”, time_off_type: “time_off_type”)
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 |
# File 'lib/fern_gusto/employees/client.rb', line 799 def get_time_off_activities(employee_uuid:, time_off_type:, request_options: nil) Async do response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "time_off_type": time_off_type }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_uuid}/time_off_activities" end Gusto::TimeOffActivity.from_json(json_object: response.body) end end |
#update(employee_id:, version:, first_name: nil, middle_initial: nil, last_name: nil, preferred_first_name: nil, date_of_birth: nil, email: nil, ssn: nil, two_percent_shareholder: nil, request_options: nil) ⇒ Object
)
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/fern_gusto/employees/client.rb', line 527 def update(employee_id:, version:, first_name: nil, middle_initial: nil, last_name: nil, preferred_first_name: nil, date_of_birth: nil, email: nil, ssn: nil, two_percent_shareholder: nil, request_options: nil) Async do response = @request_client.conn.put do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end 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 || {}), version: version, first_name: first_name, middle_initial: middle_initial, last_name: last_name, preferred_first_name: preferred_first_name, date_of_birth: date_of_birth, email: email, ssn: ssn, two_percent_shareholder: two_percent_shareholder }.compact req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}" end Gusto::Employees::Employee.from_json(json_object: response.body) end end |
#update_onboarding_status(employee_id:, onboarding_status:, request_options: nil) ⇒ Object
api.employees.update_onboarding_status(employee_id: “employee_id”, onboarding_status: “onboarding_status”)
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 |
# File 'lib/fern_gusto/employees/client.rb', line 763 def update_onboarding_status(employee_id:, onboarding_status:, request_options: nil) Async do response = @request_client.conn.put do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end 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 || {}), onboarding_status: onboarding_status }.compact req.url "#{@request_client.get_url(request_options: )}/v1/employees/#{employee_id}/onboarding_status" end Gusto::Employees::EmployeeOnboardingInfo.from_json(json_object: response.body) end end |