Class: VitableConnect::Resources::Employees

Inherits:
Object
  • Object
show all
Defined in:
lib/vitable_connect/resources/employees.rb

Instance Method Summary collapse

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.

Parameters:



60
61
62
# File 'lib/vitable_connect/resources/employees.rb', line 60

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.

Parameters:

  • employee_id (String)

    Unique employee identifier (empl_*)

  • limit (Integer)

    Items per page (default: 20, max: 100)

  • page (Integer)

    Page number (default: 1)

  • request_options (VitableConnect::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/vitable_connect/resources/employees.rb', line 44

def list_enrollments(employee_id, params = {})
  parsed, options = 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: 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, 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.

Parameters:

Returns:

See Also:



20
21
22
23
24
25
26
27
# File 'lib/vitable_connect/resources/employees.rb', line 20

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