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

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

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:



34
35
36
# File 'lib/knockapi/resources/schedules/bulk.rb', line 34

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](/managing-recipients/identifying-recipients#inline-identifying-recipients) for the ‘actor`, `recipient`, and `tenant` fields.

Parameters:

Returns:

See Also:



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

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