Class: Knockapi::Resources::Tenants::Bulk
- Inherits:
-
Object
- Object
- Knockapi::Resources::Tenants::Bulk
- Defined in:
- lib/knockapi/resources/tenants/bulk.rb,
sig/knockapi/resources/tenants/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
-
#delete(tenant_ids:, request_options: {}) ⇒ Knockapi::Models::BulkOperation
Delete up to 1,000 tenants at a time in a single operation.
-
#initialize(client:) ⇒ Bulk
constructor
private
A new instance of Bulk.
-
#set(tenants:, request_options: {}) ⇒ Knockapi::Models::BulkOperation
Set or update up to 1,000 tenants in a single operation.
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.
58 59 60 |
# File 'lib/knockapi/resources/tenants/bulk.rb', line 58 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.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/knockapi/resources/tenants/bulk.rb', line 21 def delete(params) parsed, = Knockapi::Tenants::BulkDeleteParams.dump_request(params) query = Knockapi::Internal::Util.encode_query_params(parsed) @client.request( method: :post, path: "v1/tenants/bulk/delete", query: query, model: Knockapi::BulkOperation, options: ) end |
#set(tenants:, request_options: {}) ⇒ Knockapi::Models::BulkOperation
Set or update up to 1,000 tenants in a single operation.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/knockapi/resources/tenants/bulk.rb', line 44 def set(params) parsed, = Knockapi::Tenants::BulkSetParams.dump_request(params) @client.request( method: :post, path: "v1/tenants/bulk/set", body: parsed, model: Knockapi::BulkOperation, options: ) end |