Class: FinchAPI::Resources::Payroll::PayGroups

Inherits:
Object
  • Object
show all
Defined in:
lib/finch_api/resources/payroll/pay_groups.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PayGroups

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 PayGroups.

Parameters:



52
53
54
# File 'lib/finch_api/resources/payroll/pay_groups.rb', line 52

def initialize(client:)
  @client = client
end

Instance Method Details

#list(individual_id: nil, pay_frequencies: nil, request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::Payroll::PayGroupListResponse>

Read company pay groups and frequencies

Parameters:

  • individual_id (String)
  • pay_frequencies (Array<String>)
  • request_options (FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/finch_api/resources/payroll/pay_groups.rb', line 37

def list(params = {})
  parsed, options = FinchAPI::Payroll::PayGroupListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "employer/pay-groups",
    query: parsed,
    page: FinchAPI::Internal::SinglePage,
    model: FinchAPI::Models::Payroll::PayGroupListResponse,
    options: options
  )
end

#retrieve(pay_group_id, request_options: {}) ⇒ FinchAPI::Models::Payroll::PayGroupRetrieveResponse

Read information from a single pay group

Parameters:

Returns:

See Also:



17
18
19
20
21
22
23
24
# File 'lib/finch_api/resources/payroll/pay_groups.rb', line 17

def retrieve(pay_group_id, params = {})
  @client.request(
    method: :get,
    path: ["employer/pay-groups/%1$s", pay_group_id],
    model: FinchAPI::Models::Payroll::PayGroupRetrieveResponse,
    options: params[:request_options]
  )
end