Class: OursprivacyIngest::Resources::Batch

Inherits:
Object
  • Object
show all
Defined in:
lib/oursprivacy_ingest/resources/batch.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Batch

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 Batch.

Parameters:



36
37
38
# File 'lib/oursprivacy_ingest/resources/batch.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#create(token:, events:, request_options: {}) ⇒ OursprivacyIngest::Models::BatchCreateResponse

Send multiple ‘/track`-shaped events in a single request. The top-level token is authorized once for the full batch. Each batch row must include `distinctId`, and mixed validation or queue outcomes are reported per row.

Parameters:

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/oursprivacy_ingest/resources/batch.rb', line 21

def create(params)
  parsed, options = OursprivacyIngest::BatchCreateParams.dump_request(params)
  path = @client.base_url_overridden? ? "batch" : "https://api.oursprivacy.com/api/v1/batch"
  @client.request(
    method: :post,
    path: path,
    body: parsed,
    model: OursprivacyIngest::Models::BatchCreateResponse,
    options: options
  )
end