Class: WhopSDK::Resources::Notifications

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/notifications.rb

Overview

Notifications

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Notifications

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

Parameters:



37
38
39
# File 'lib/whop_sdk/resources/notifications.rb', line 37

def initialize(client:)
  @client = client
end

Instance Method Details

#create(body:, request_options: {}) ⇒ WhopSDK::Models::NotificationCreateResponse

Send a push notification to users in an experience or company team. The notification is processed asynchronously and supports targeting specific users.

Required permissions:

  • ‘notification:create`



23
24
25
26
27
28
29
30
31
32
# File 'lib/whop_sdk/resources/notifications.rb', line 23

def create(params)
  parsed, options = WhopSDK::NotificationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "notifications",
    body: parsed[:body],
    model: WhopSDK::Models::NotificationCreateResponse,
    options: options
  )
end