Class: FinchAPI::Resources::Jobs::Automated
- Inherits:
-
Object
- Object
- FinchAPI::Resources::Jobs::Automated
- Defined in:
- lib/finch_api/resources/jobs/automated.rb,
sig/finch_api/resources/jobs/automated.rbs
Instance Method Summary collapse
-
#create(body:, request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedCreateResponse
Enqueue an automated job.
-
#initialize(client:) ⇒ Automated
constructor
private
A new instance of Automated.
-
#list(limit: nil, offset: nil, request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedListResponse
Get all automated jobs.
-
#retrieve(job_id, request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedAsyncJob
Get an automated job by
job_id.
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.
93 94 95 |
# File 'lib/finch_api/resources/jobs/automated.rb', line 93 def initialize(client:) @client = client end |
Instance Method Details
#create(body:, 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.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/finch_api/resources/jobs/automated.rb', line 30 def create(params) parsed, = FinchAPI::Jobs::AutomatedCreateParams.dump_request(params) @client.request( method: :post, path: "jobs/automated", body: parsed[:body], model: FinchAPI::Models::Jobs::AutomatedCreateResponse, security: {bearer_auth: true}, options: ) end |
#list(limit: nil, offset: nil, request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedListResponse
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.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/finch_api/resources/jobs/automated.rb', line 77 def list(params = {}) parsed, = FinchAPI::Jobs::AutomatedListParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "jobs/automated", query: query, model: FinchAPI::Models::Jobs::AutomatedListResponse, security: {bearer_auth: true}, options: ) end |
#retrieve(job_id, request_options: {}) ⇒ FinchAPI::Models::Jobs::AutomatedAsyncJob
Get an automated job by job_id.
52 53 54 55 56 57 58 59 60 |
# File 'lib/finch_api/resources/jobs/automated.rb', line 52 def retrieve(job_id, params = {}) @client.request( method: :get, path: ["jobs/automated/%1$s", job_id], model: FinchAPI::Jobs::AutomatedAsyncJob, security: {bearer_auth: true}, options: params[:request_options] ) end |