Class: WhopSDK::Resources::Forums
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Forums
- Defined in:
- lib/whop_sdk/resources/forums.rb
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>
Lists forums inside a company.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Forum
Retrieves a forum.
-
#update(id, email_notification_preference: nil, who_can_comment: nil, who_can_post: nil, request_options: {}) ⇒ WhopSDK::Models::Forum
Updates a forum.
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.
102 103 104 |
# File 'lib/whop_sdk/resources/forums.rb', line 102 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>
Lists forums inside a company
Required permissions:
-
‘forum:read`
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/whop_sdk/resources/forums.rb', line 87 def list(params) parsed, = WhopSDK::ForumListParams.dump_request(params) @client.request( method: :get, path: "forums", query: parsed, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::ForumListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Forum
Retrieves a forum
Required permissions:
-
‘forum:read`
21 22 23 24 25 26 27 28 |
# File 'lib/whop_sdk/resources/forums.rb', line 21 def retrieve(id, params = {}) @client.request( method: :get, path: ["forums/%1$s", id], model: WhopSDK::Forum, options: params[:request_options] ) end |
#update(id, email_notification_preference: nil, who_can_comment: nil, who_can_post: nil, request_options: {}) ⇒ WhopSDK::Models::Forum
Updates a forum
Required permissions:
-
‘forum:moderate`
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/whop_sdk/resources/forums.rb', line 51 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 |