Class: Merge::Ats::AsyncJobsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/ats/jobs/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ Merge::Ats::AsyncJobsClient

Parameters:



200
201
202
# File 'lib/merge_ruby_client/ats/jobs/client.rb', line 200

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientMerge::AsyncRequestClient (readonly)



196
197
198
# File 'lib/merge_ruby_client/ats/jobs/client.rb', line 196

def request_client
  @request_client
end

Instance Method Details

#list(code: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, modified_after: nil, modified_before: nil, offices: nil, page_size: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, status: nil, request_options: nil) ⇒ Merge::Ats::PaginatedJobList

Returns a list of ‘Job` objects.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ats.jobs.list

Parameters:

  • code (String) (defaults to: nil)

    If provided, will only return jobs with this code.

  • created_after (DateTime) (defaults to: nil)

    If provided, will only return objects created after this datetime.

  • created_before (DateTime) (defaults to: nil)

    If provided, will only return objects created before this datetime.

  • cursor (String) (defaults to: nil)

    The pagination cursor value.

  • expand (Merge::Ats::Jobs::JobsListRequestExpand) (defaults to: nil)

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

  • include_deleted_data (Boolean) (defaults to: nil)

    Whether to include data that was marked as deleted by third party webhooks.

  • include_remote_data (Boolean) (defaults to: nil)

    Whether to include the original data Merge fetched from the third-party to produce these models.

  • modified_after (DateTime) (defaults to: nil)

    If provided, only objects synced by Merge after this date time will be returned.

  • modified_before (DateTime) (defaults to: nil)

    If provided, only objects synced by Merge before this date time will be returned.

  • offices (String) (defaults to: nil)

    If provided, will only return jobs for this office; multiple offices can be separated by commas.

  • page_size (Integer) (defaults to: nil)

    Number of results to return per page.

  • remote_fields (String) (defaults to: nil)

    Deprecated. Use show_enum_origins.

  • remote_id (String) (defaults to: nil)

    The API provider’s ID for the given object.

  • show_enum_origins (String) (defaults to: nil)

    A comma separated list of enum field names for which you’d like the original values to be returned, instead of Merge’s normalized enum values. [Learn e](help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)

  • status (Merge::Ats::Jobs::JobsListRequestStatus) (defaults to: nil)

    If provided, will only return jobs with this status. Options: (‘OPEN’, ‘CLOSED’, ‘DRAFT’, ‘ARCHIVED’, ‘PENDING’)

    • ‘OPEN` - OPEN

    • ‘CLOSED` - CLOSED

    • ‘DRAFT` - DRAFT

    • ‘ARCHIVED` - ARCHIVED

    • ‘PENDING` - PENDING

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/merge_ruby_client/ats/jobs/client.rb', line 242

def list(code: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil,
         include_remote_data: nil, modified_after: nil, modified_before: nil, offices: nil, page_size: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, status: nil, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
      req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "code": code,
        "created_after": created_after,
        "created_before": created_before,
        "cursor": cursor,
        "expand": expand,
        "include_deleted_data": include_deleted_data,
        "include_remote_data": include_remote_data,
        "modified_after": modified_after,
        "modified_before": modified_before,
        "offices": offices,
        "page_size": page_size,
        "remote_fields": remote_fields,
        "remote_id": remote_id,
        "show_enum_origins": show_enum_origins,
        "status": status
      }.compact
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: request_options)}/ats/v1/jobs"
    end
    Merge::Ats::PaginatedJobList.from_json(json_object: response.body)
  end
end

#retrieve(id:, expand: nil, include_remote_data: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Ats::Job

Returns a ‘Job` object with the given `id`.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ats.jobs.retrieve(id: "id")

Parameters:

  • id (String)
  • expand (Merge::Ats::Jobs::JobsRetrieveRequestExpand) (defaults to: nil)

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

  • include_remote_data (Boolean) (defaults to: nil)

    Whether to include the original data Merge fetched from the third-party to produce these models.

  • remote_fields (String) (defaults to: nil)

    Deprecated. Use show_enum_origins.

  • show_enum_origins (String) (defaults to: nil)

    A comma separated list of enum field names for which you’d like the original values to be returned, instead of Merge’s normalized enum values. [Learn e](help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/merge_ruby_client/ats/jobs/client.rb', line 301

def retrieve(id:, expand: nil, include_remote_data: nil, remote_fields: nil, show_enum_origins: nil,
             request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
      req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "expand": expand,
        "include_remote_data": include_remote_data,
        "remote_fields": remote_fields,
        "show_enum_origins": show_enum_origins
      }.compact
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: request_options)}/ats/v1/jobs/#{id}"
    end
    Merge::Ats::Job.from_json(json_object: response.body)
  end
end

#screening_questions_list(job_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Ats::PaginatedScreeningQuestionList

Returns a list of ‘ScreeningQuestion` objects.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ats.jobs.screening_questions_list(job_id: "job_id")

Parameters:

  • job_id (String)
  • cursor (String) (defaults to: nil)

    The pagination cursor value.

  • expand (Merge::Ats::Jobs::JobsScreeningQuestionsListRequestExpand) (defaults to: nil)

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

  • include_deleted_data (Boolean) (defaults to: nil)

    Whether to include data that was marked as deleted by third party webhooks.

  • include_remote_data (Boolean) (defaults to: nil)

    Whether to include the original data Merge fetched from the third-party to produce these models.

  • page_size (Integer) (defaults to: nil)

    Number of results to return per page.

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/merge_ruby_client/ats/jobs/client.rb', line 348

def screening_questions_list(job_id:, cursor: nil, expand: nil, include_deleted_data: nil,
                             include_remote_data: nil, page_size: nil, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
      req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "cursor": cursor,
        "expand": expand,
        "include_deleted_data": include_deleted_data,
        "include_remote_data": include_remote_data,
        "page_size": page_size
      }.compact
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: request_options)}/ats/v1/jobs/#{job_id}/screening-questions"
    end
    Merge::Ats::PaginatedScreeningQuestionList.from_json(json_object: response.body)
  end
end