Class: WhopSDK::Resources::Notifications

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

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:



48
49
50
# File 'lib/whop_sdk/resources/notifications.rb', line 48

def initialize(client:)
  @client = client
end

Instance Method Details

#create(company_id: , content: , title: , experience_id: , icon_user_id: nil, rest_path: nil, subtitle: nil, user_ids: nil, request_options: {}) ⇒ WhopSDK::Models::NotificationCreateResponse

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

Queues a notification to be sent to users in an experience or company team

Parameters:

  • company_id (String)

    The id of the company to target. Only team members of this company will receive

  • content (String)

    The content of the notification

  • title (String)

    The title of the notification

  • experience_id (String)

    The id of the experience to target. All users with access to this experience (cu

  • icon_user_id (String, nil)

    Optional: ID of a Whop user whose profile picture will be used as the notificati

  • rest_path (String, nil)

    The rest path to append to the generated deep link that opens your app. Use [res

  • subtitle (String, nil)

    The subtitle of the notification

  • user_ids (Array<String>, nil)

    If provided, this will only send to these users if they are also in the main sco

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



34
35
36
37
38
39
40
41
42
43
# File 'lib/whop_sdk/resources/notifications.rb', line 34

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