Class: Knockapi::Resources::Users::Bulk

Inherits:
Object
  • Object
show all
Defined in:
lib/knockapi/resources/users/bulk.rb,
sig/knockapi/resources/users/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:



89
90
91
# File 'lib/knockapi/resources/users/bulk.rb', line 89

def initialize(client:)
  @client = client
end

Instance Method Details

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

Permanently deletes up to 1,000 users at a time.

Parameters:

Returns:

See Also:



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

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

#identify(users:, request_options: {}) ⇒ Knockapi::Models::BulkOperation

Identifies multiple users in a single operation. Allows creating or updating up to 1,000 users in a single batch with various properties, preferences, and channel data.

Parameters:

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
# File 'lib/knockapi/resources/users/bulk.rb', line 44

def identify(params)
  parsed, options = Knockapi::Users::BulkIdentifyParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/users/bulk/identify",
    body: parsed,
    model: Knockapi::BulkOperation,
    options: options
  )
end

#set_preferences(preferences:, user_ids:, request_options: {}) ⇒ Knockapi::Models::BulkOperation

Some parameter documentations has been truncated, see Models::Users::BulkSetPreferencesParams for more details.

Bulk sets the preferences for up to 1,000 users at a time. The preference set :id can be either default or a tenant.id. Learn more about per-tenant preferences. Note that this is a destructive operation and will replace any existing users' preferences with the preferences sent.

Parameters:

Returns:

See Also:



75
76
77
78
79
80
81
82
83
84
# File 'lib/knockapi/resources/users/bulk.rb', line 75

def set_preferences(params)
  parsed, options = Knockapi::Users::BulkSetPreferencesParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/users/bulk/preferences",
    body: parsed,
    model: Knockapi::BulkOperation,
    options: options
  )
end