Class: Knockapi::Resources::Tenants::Bulk

Inherits:
Object
  • Object
show all
Defined in:
lib/knockapi/resources/tenants/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:



55
56
57
# File 'lib/knockapi/resources/tenants/bulk.rb', line 55

def initialize(client:)
  @client = client
end

Instance Method Details

#delete(tenant_ids:, request_options: {}) ⇒ Knockapi::Models::BulkOperation

Delete up to 1,000 tenants at a time in a single operation. This operation cannot be undone.

Parameters:

Returns:

See Also:



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

def delete(params)
  parsed, options = Knockapi::Tenants::BulkDeleteParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/tenants/bulk/delete",
    query: parsed,
    model: Knockapi::BulkOperation,
    options: options
  )
end

#set(tenants:, request_options: {}) ⇒ Knockapi::Models::BulkOperation

Set or update up to 1,000 tenants in a single operation.

Parameters:

Returns:

See Also:



41
42
43
44
45
46
47
48
49
50
# File 'lib/knockapi/resources/tenants/bulk.rb', line 41

def set(params)
  parsed, options = Knockapi::Tenants::BulkSetParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/tenants/bulk/set",
    body: parsed,
    model: Knockapi::BulkOperation,
    options: options
  )
end