Class: SafetyKit::Resources::Beta::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/safety_kit/resources/beta/events.rb

Overview

Beta. Send backend events for account, content, and user interaction activity.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Events

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

Parameters:



39
40
41
# File 'lib/safety_kit/resources/beta/events.rb', line 39

def initialize(client:)
  @client = client
end

Instance Method Details

#create(body:, request_options: {}) ⇒ SafetyKit::Models::Beta::EventCreateResponse

Some parameter documentations has been truncated, see Models::Beta::EventCreateParams for more details.

Beta. Send a backend event after a meaningful product action happens in your system. Use events for durable server-side context such as account creation, account updates, user-to-user contact, and content uploads. Do not send browser pageviews, button clicks, or other client-only telemetry through this endpoint.



25
26
27
28
29
30
31
32
33
34
# File 'lib/safety_kit/resources/beta/events.rb', line 25

def create(params)
  parsed, options = SafetyKit::Beta::EventCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/events",
    body: parsed[:body],
    model: SafetyKit::Models::Beta::EventCreateResponse,
    options: options
  )
end