Class: FinchAPI::Resources::HRIS::Documents

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Documents

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

Parameters:



69
70
71
# File 'lib/finch_api/resources/hris/documents.rb', line 69

def initialize(client:)
  @client = client
end

Instance Method Details

#list(entity_ids: nil, individual_ids: nil, limit: nil, offset: nil, types: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::DocumentListResponse

Some parameter documentations has been truncated, see Models::HRIS::DocumentListParams for more details.

Beta: This endpoint is in beta and may change. Retrieve a list of company-wide documents.

Parameters:

  • entity_ids (Array<String>)

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

  • individual_ids (Array<String>)

    Comma-delimited list of stable Finch uuids for each individual. If empty, defaul

  • limit (Integer)

    Number of documents to return (defaults to all)

  • offset (Integer)

    Index to start from (defaults to 0)

  • types (Array<Symbol, FinchAPI::Models::HRIS::DocumentListParams::Type>)

    Comma-delimited list of document types to filter on. If empty, defaults to all t

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

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
# File 'lib/finch_api/resources/hris/documents.rb', line 30

def list(params = {})
  parsed, options = FinchAPI::HRIS::DocumentListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "employer/documents",
    query: parsed,
    model: FinchAPI::Models::HRIS::DocumentListResponse,
    options: options
  )
end

#retreive(document_id, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::W42020, FinchAPI::Models::HRIS::W42005

Beta: This endpoint is in beta and may change. Retrieve details of a specific document by its ID.

Parameters:

  • document_id (String)

    The unique identifier of the document.

  • 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:



55
56
57
58
59
60
61
62
63
64
# File 'lib/finch_api/resources/hris/documents.rb', line 55

def retreive(document_id, params = {})
  parsed, options = FinchAPI::HRIS::DocumentRetreiveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["employer/documents/%1$s", document_id],
    query: parsed,
    model: FinchAPI::Models::HRIS::DocumentRetreiveResponse,
    options: options
  )
end