Class: FinchAPI::Resources::Jobs::Automated

Inherits:
Object
  • Object
show all
Defined in:
lib/finch_api/resources/jobs/automated.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Automated

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

Parameters:



105
106
107
# File 'lib/finch_api/resources/jobs/automated.rb', line 105

def initialize(client:)
  @client = client
end

Instance Method Details

#create(type: , params: , request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedCreateResponse

Enqueue an automated job.

‘data_sync_all`: Enqueue a job to re-sync all data for a connection. `data_sync_all` has a concurrency limit of 1 job at a time per connection. This means that if this endpoint is called while a job is already in progress for this connection, Finch will return the `job_id` of the job that is currently in progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection.

‘w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for Scale tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager.



33
34
35
36
37
38
39
40
41
42
# File 'lib/finch_api/resources/jobs/automated.rb', line 33

def create(params)
  parsed, options = FinchAPI::Jobs::AutomatedCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "jobs/automated",
    body: parsed,
    model: FinchAPI::Models::Jobs::AutomatedCreateResponse,
    options: options
  )
end

#list(entity_id: nil, limit: nil, offset: nil, request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedListResponse

Some parameter documentations has been truncated, see Models::Jobs::AutomatedListParams for more details.

Get all automated jobs. Automated jobs are completed by a machine. By default, jobs are sorted in descending order by submission time. For scheduled jobs such as data syncs, only the next scheduled job is shown.

Parameters:

  • entity_id (String)

    The entity ID to use when authenticating with a multi-account token. Required wh

  • limit (Integer)

    Number of items to return

  • offset (Integer)

    Index to start from (defaults to 0)

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

Returns:

See Also:



91
92
93
94
95
96
97
98
99
100
# File 'lib/finch_api/resources/jobs/automated.rb', line 91

def list(params = {})
  parsed, options = FinchAPI::Jobs::AutomatedListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "jobs/automated",
    query: parsed,
    model: FinchAPI::Models::Jobs::AutomatedListResponse,
    options: options
  )
end

#retrieve(job_id, entity_id: nil, request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedAsyncJob

Some parameter documentations has been truncated, see Models::Jobs::AutomatedRetrieveParams for more details.

Get an automated job by ‘job_id`.

Parameters:

  • job_id (String)
  • entity_id (String)

    The entity ID to use when authenticating with a multi-account token. Required wh

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

Returns:

See Also:



60
61
62
63
64
65
66
67
68
69
# File 'lib/finch_api/resources/jobs/automated.rb', line 60

def retrieve(job_id, params = {})
  parsed, options = FinchAPI::Jobs::AutomatedRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["jobs/automated/%1$s", job_id],
    query: parsed,
    model: FinchAPI::Jobs::AutomatedAsyncJob,
    options: options
  )
end