Class: WhopSDK::Resources::Forums
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Forums
- Defined in:
- lib/whop_sdk/resources/forums.rb
Overview
Forums
Instance Method Summary collapse
-
#initialize(client:) ⇒ Forums
constructor
private
A new instance of Forums.
-
#list(company_id:, after: nil, before: nil, first: nil, last: nil, product_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ForumListResponse>
Some parameter documentations has been truncated, see Models::ForumListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Forum
Retrieves the details of an existing forum.
-
#update(id, banned_words: nil, banner_image: nil, email_notification_preference: nil, who_can_comment: nil, who_can_post: nil, request_options: {}) ⇒ WhopSDK::Models::Forum
Some parameter documentations has been truncated, see Models::ForumUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Forums
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 Forums.
116 117 118 |
# File 'lib/whop_sdk/resources/forums.rb', line 116 def initialize(client:) @client = client end |
Instance Method Details
#list(company_id:, after: nil, before: nil, first: nil, last: nil, product_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ForumListResponse>
Some parameter documentations has been truncated, see Models::ForumListParams for more details.
Returns a paginated list of forums within a specific company, with optional filtering by product.
Required permissions:
-
‘forum:read`
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/whop_sdk/resources/forums.rb', line 100 def list(params) parsed, = WhopSDK::ForumListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "forums", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::ForumListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Forum
Retrieves the details of an existing forum.
Required permissions:
-
‘forum:read`
22 23 24 25 26 27 28 29 |
# File 'lib/whop_sdk/resources/forums.rb', line 22 def retrieve(id, params = {}) @client.request( method: :get, path: ["forums/%1$s", id], model: WhopSDK::Forum, options: params[:request_options] ) end |
#update(id, banned_words: nil, banner_image: nil, email_notification_preference: nil, who_can_comment: nil, who_can_post: nil, request_options: {}) ⇒ WhopSDK::Models::Forum
Some parameter documentations has been truncated, see Models::ForumUpdateParams for more details.
Update moderation and notification settings for a forum, such as who can post, who can comment, and email notification preferences.
Required permissions:
-
‘forum:moderate`
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/whop_sdk/resources/forums.rb', line 60 def update(id, params = {}) parsed, = WhopSDK::ForumUpdateParams.dump_request(params) @client.request( method: :patch, path: ["forums/%1$s", id], body: parsed, model: WhopSDK::Forum, options: ) end |