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

Returns a new instance of PayGroups.

Parameters:



49
50
51
# File 'lib/finch-api/resources/payroll/pay_groups.rb', line 49

def initialize(client:)
  @client = client
end

Instance Method Details

#list(params = {}) ⇒ FinchAPI::SinglePage<FinchAPI::Models::Payroll::PayGroupListResponse>

Read company pay groups and frequencies

Parameters:

  • params (FinchAPI::Models::Payroll::PayGroupListParams, Hash{Symbol=>Object}) (defaults to: {})

    .

    @option params [String] :individual_id

    @option params [Array<String>] :pay_frequencies

    @option params [FinchAPI::RequestOptions, HashSymbol=>Object, nil] :request_options

Returns:



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/finch-api/resources/payroll/pay_groups.rb', line 36

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

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

Read information from a single pay group

Parameters:

Returns:



16
17
18
19
20
21
22
23
# File 'lib/finch-api/resources/payroll/pay_groups.rb', line 16

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