Class: OursprivacyIngest::Resources::Batch
- Inherits:
-
Object
- Object
- OursprivacyIngest::Resources::Batch
- Defined in:
- lib/oursprivacy_ingest/resources/batch.rb
Instance Method Summary collapse
-
#create(token:, events:, request_options: {}) ⇒ OursprivacyIngest::Models::BatchCreateResponse
Send multiple ‘/track`-shaped events in a single request.
-
#initialize(client:) ⇒ Batch
constructor
private
A new instance of Batch.
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.
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.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/oursprivacy_ingest/resources/batch.rb', line 21 def create(params) parsed, = 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: ) end |