Class: Knockapi::Resources::Schedules::Bulk

Inherits:
Object
  • Object
show all
Defined in:
lib/knockapi/resources/schedules/bulk.rb,
sig/knockapi/resources/schedules/bulk.rbs

Overview

A bulk operation is a set of changes applied across zero or more records triggered via a call to the Knock API and performed asynchronously.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Bulk

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

Parameters:



36
37
38
# File 'lib/knockapi/resources/schedules/bulk.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#create(schedules:, request_options: {}) ⇒ Knockapi::Models::BulkOperation

Bulk creates up to 1,000 schedules at a time. This endpoint also handles inline identifications for the actor, recipient, and tenant fields.

Parameters:

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/knockapi/resources/schedules/bulk.rb', line 22

def create(params)
  parsed, options = Knockapi::Schedules::BulkCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/schedules/bulk/create",
    body: parsed,
    model: Knockapi::BulkOperation,
    options: options
  )
end