Class: FinchAPI::Resources::HRIS::Directory

Inherits:
Object
  • Object
show all
Defined in:
lib/finch_api/resources/hris/directory.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Directory

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

Parameters:



42
43
44
# File 'lib/finch_api/resources/hris/directory.rb', line 42

def initialize(client:)
  @client = client
end

Instance Method Details

#list(entity_ids: nil, limit: nil, offset: nil, request_options: {}) ⇒ FinchAPI::Internal::IndividualsPage<FinchAPI::Models::HRIS::IndividualInDirectory> Also known as: list_individuals

Read company directory and organization structure

Parameters:

  • entity_ids (Array<String>)

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

  • limit (Integer)

    Number of employees to return (defaults to all)

  • offset (Integer)

    Index to start from (defaults to 0)

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

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/finch_api/resources/hris/directory.rb', line 22

def list(params = {})
  parsed, options = FinchAPI::HRIS::DirectoryListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "employer/directory",
    query: parsed,
    page: FinchAPI::Internal::IndividualsPage,
    model: FinchAPI::HRIS::IndividualInDirectory,
    options: options
  )
end