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:



61
62
63
# File 'lib/finch_api/resources/payroll/pay_groups.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

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

Read company pay groups and frequencies

Parameters:

  • entity_ids (Array<String>)

    The entity IDs to specify which entities’ data to access.

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

Returns:

See Also:



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/finch_api/resources/payroll/pay_groups.rb', line 46

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, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::Payroll::PayGroupRetrieveResponse

Read information from a single pay group

Parameters:

  • pay_group_id (String)
  • entity_ids (Array<String>)

    The entity IDs to specify which entities’ data to access.

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

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
# File 'lib/finch_api/resources/payroll/pay_groups.rb', line 20

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