Class: Knockapi::Resources::Channels::Bulk

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



62
63
64
# File 'lib/knockapi/resources/channels/bulk.rb', line 62

def initialize(client:)
  @client = client
end

Instance Method Details

#update_message_status(channel_id, action, archived: nil, delivery_status: nil, engagement_status: nil, has_tenant: nil, newer_than: nil, older_than: nil, recipient_ids: nil, tenants: nil, trigger_data: nil, workflows: nil, request_options: {}) ⇒ Knockapi::Models::BulkOperation

Some parameter documentations has been truncated, see Models::Channels::BulkUpdateMessageStatusParams for more details.

Bulk update the status of messages for a specific channel. The channel is specified by the channel_id parameter. The action to perform is specified by the action parameter, where the action is a status change action (e.g. archive, unarchive).

Parameters:

Returns:

See Also:



48
49
50
51
52
53
54
55
56
57
# File 'lib/knockapi/resources/channels/bulk.rb', line 48

def update_message_status(channel_id, action, params = {})
  parsed, options = Knockapi::Channels::BulkUpdateMessageStatusParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/channels/%1$s/messages/bulk/%2$s", channel_id, action],
    body: parsed,
    model: Knockapi::BulkOperation,
    options: options
  )
end