Class: WhopSDK::Resources::Events
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Events
- Defined in:
- lib/whop_sdk/resources/events.rb,
sig/whop_sdk/resources/events.rbs
Overview
An Event records conversion or engagement activity for an account, such as page views, purchases, or leads. Each event ties the action to the person who took it, so activity can be attributed to the ads and links that drove it.
Use the Events API to send new tracking events and list the events recorded for a person.
Instance Method Summary collapse
-
#create(account_id:, event_name:, action_source: nil, context: nil, currency: nil, custom_name: nil, duration: nil, event_id: nil, event_time: nil, plan_id: nil, product_id: nil, referrer_url: nil, resumed: nil, source: nil, title: nil, url: nil, user: nil, value: nil, request_options: {}) ⇒ WhopSDK::Models::EventCreateResponse
Some parameter documentations has been truncated, see Models::EventCreateParams for more details.
-
#initialize(client:) ⇒ Events
constructor
private
A new instance of Events.
-
#list(person_id:, account_id: nil, after: nil, before: nil, first: nil, from: nil, to: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::EventListResponse>
Some parameter documentations has been truncated, see Models::EventListParams for more details.
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.
116 117 118 |
# File 'lib/whop_sdk/resources/events.rb', line 116 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id:, event_name:, action_source: nil, context: nil, currency: nil, custom_name: nil, duration: nil, event_id: nil, event_time: nil, plan_id: nil, product_id: nil, referrer_url: nil, resumed: nil, source: nil, title: nil, url: nil, user: nil, value: nil, request_options: {}) ⇒ WhopSDK::Models::EventCreateResponse
Some parameter documentations has been truncated, see Models::EventCreateParams for more details.
Tracks a conversion or engagement event for an account.
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/whop_sdk/resources/events.rb', line 61 def create(params) parsed, = WhopSDK::EventCreateParams.dump_request(params) @client.request( method: :post, path: "events", body: parsed, model: WhopSDK::Models::EventCreateResponse, options: ) end |
#list(person_id:, account_id: nil, after: nil, before: nil, first: nil, from: nil, to: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::EventListResponse>
Some parameter documentations has been truncated, see Models::EventListParams for more details.
Lists pixel events for a person, most recent first. Events are shaped like the POST /events intake: attribution in context, identity in user.
acco
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/whop_sdk/resources/events.rb', line 100 def list(params) parsed, = WhopSDK::EventListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "events", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::EventListResponse, options: ) end |