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:



63
64
65
# File 'lib/finch_api/resources/hris/documents.rb', line 63

def initialize(client:)
  @client = client
end

Instance Method Details

#list(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:

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



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

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

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

Returns:

See Also:



51
52
53
54
55
56
57
58
# File 'lib/finch_api/resources/hris/documents.rb', line 51

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