Class: VitableConnect::Resources::Employees
- Inherits:
-
Object
- Object
- VitableConnect::Resources::Employees
- Defined in:
- lib/vitable_connect/resources/employees.rb,
sig/vitable_connect/resources/employees.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ Employees
constructor
private
A new instance of Employees.
-
#list_enrollments(employee_id, limit: nil, page: nil, request_options: {}) ⇒ VitableConnect::Internal::PageNumberPage<VitableConnect::Models::Enrollment>
Retrieves a paginated list of benefit enrollments for an employee.
-
#retrieve(employee_id, request_options: {}) ⇒ VitableConnect::Models::EmployeeRetrieveResponse
Retrieves detailed information for a specific employee by ID.
-
#update(employee_id, effective_date:, address: nil, compensation_type: nil, email: nil, employee_class: nil, gender: nil, phone: nil, start_date: nil, request_options: {}) ⇒ VitableConnect::Models::EmployeeUpdateResponse
Some parameter documentations has been truncated, see Models::EmployeeUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Employees
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Employees.
106 107 108 |
# File 'lib/vitable_connect/resources/employees.rb', line 106 def initialize(client:) @client = client end |
Instance Method Details
#list_enrollments(employee_id, limit: nil, page: nil, request_options: {}) ⇒ VitableConnect::Internal::PageNumberPage<VitableConnect::Models::Enrollment>
Retrieves a paginated list of benefit enrollments for an employee.
90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/vitable_connect/resources/employees.rb', line 90 def list_enrollments(employee_id, params = {}) parsed, = VitableConnect::EmployeeListEnrollmentsParams.dump_request(params) query = VitableConnect::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/employees/%1$s/enrollments", employee_id], query: query, page: VitableConnect::Internal::PageNumberPage, model: VitableConnect::Enrollment, options: ) end |
#retrieve(employee_id, request_options: {}) ⇒ VitableConnect::Models::EmployeeRetrieveResponse
Retrieves detailed information for a specific employee by ID. Returns employee details including personal information, employment status, classification and compensation-type effective dates, compensation type, and payroll deductions from the most recent statement period. Deductions reflect a snapshot of the current period and are replaced when a new statement is generated.
21 22 23 24 25 26 27 28 |
# File 'lib/vitable_connect/resources/employees.rb', line 21 def retrieve(employee_id, params = {}) @client.request( method: :get, path: ["v1/employees/%1$s", employee_id], model: VitableConnect::Models::EmployeeRetrieveResponse, options: params[:request_options] ) end |
#update(employee_id, effective_date:, address: nil, compensation_type: nil, email: nil, employee_class: nil, gender: nil, phone: nil, start_date: nil, request_options: {}) ⇒ VitableConnect::Models::EmployeeUpdateResponse
Some parameter documentations has been truncated, see Models::EmployeeUpdateParams for more details.
Updates employee personal, contact, address, and employment fields. This endpoint currently supports email, phone, gender, address, employee_class, start_date, and compensation_type. effective_date is required and applies to employee_class and compensation_type when those fields are included in the request.
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/vitable_connect/resources/employees.rb', line 64 def update(employee_id, params) parsed, = VitableConnect::EmployeeUpdateParams.dump_request(params) @client.request( method: :patch, path: ["v1/employees/%1$s", employee_id], body: parsed, model: VitableConnect::Models::EmployeeUpdateResponse, options: ) end |