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

Returns a new instance of Documents.

Parameters:



56
57
58
# File 'lib/finch-api/resources/hris/documents.rb', line 56

def initialize(client:)
  @client = client
end

Instance Method Details

#list(params = {}) ⇒ FinchAPI::Models::HRIS::DocumentListResponse

Beta: This endpoint is in beta and may change. Retrieve a list of

company-wide documents.

Parameters:

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

    .

    @option params [Array<String>] :individual_ids Comma-delimited list of stable Finch uuids for each individual. If empty,

    defaults to all individuals
    

    @option params [Integer] :limit Number of documents to return (defaults to all)

    @option params [Integer] :offset Index to start from (defaults to 0)

    @option params [Array<Symbol, FinchAPI::Models::HRIS::DocumentListParams::Type>] :types Comma-delimited list of document types to filter on. If empty, defaults to all

    types
    

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

Returns:



25
26
27
28
29
30
31
32
33
34
# File 'lib/finch-api/resources/hris/documents.rb', line 25

def list(params = {})
  parsed, options = FinchAPI::Models::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, params = {}) ⇒ 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.

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

    .

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

Returns:



46
47
48
49
50
51
52
53
# File 'lib/finch-api/resources/hris/documents.rb', line 46

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