Class: WhopSDK::Resources::ForumPosts
- Inherits:
-
Object
- Object
- WhopSDK::Resources::ForumPosts
- Defined in:
- lib/whop_sdk/resources/forum_posts.rb
Overview
Forum posts
Instance Method Summary collapse
-
#create(experience_id:, attachments: nil, company_id: nil, content: nil, is_mention: nil, parent_id: nil, paywall_amount: nil, paywall_currency: nil, pinned: nil, poll: nil, rich_content: nil, title: nil, visibility: nil, request_options: {}) ⇒ WhopSDK::Models::ForumPost
Some parameter documentations has been truncated, see Models::ForumPostCreateParams for more details.
-
#initialize(client:) ⇒ ForumPosts
constructor
private
A new instance of ForumPosts.
-
#list(experience_id:, after: nil, before: nil, first: nil, last: nil, parent_id: nil, pinned: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ForumPostListResponse>
Some parameter documentations has been truncated, see Models::ForumPostListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::ForumPost
Retrieves the details of an existing forum post.
-
#update(id, attachments: nil, content: nil, is_pinned: nil, title: nil, visibility: nil, request_options: {}) ⇒ WhopSDK::Models::ForumPost
Some parameter documentations has been truncated, see Models::ForumPostUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ ForumPosts
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 ForumPosts.
171 172 173 |
# File 'lib/whop_sdk/resources/forum_posts.rb', line 171 def initialize(client:) @client = client end |
Instance Method Details
#create(experience_id:, attachments: nil, company_id: nil, content: nil, is_mention: nil, parent_id: nil, paywall_amount: nil, paywall_currency: nil, pinned: nil, poll: nil, rich_content: nil, title: nil, visibility: nil, request_options: {}) ⇒ WhopSDK::Models::ForumPost
Some parameter documentations has been truncated, see Models::ForumPostCreateParams for more details.
Create a new forum post or comment within an experience. Supports text content, attachments, polls, paywalling, and pinning. Pass experience_id ‘public’ with a company_id to post to a company’s public forum.
Required permissions:
-
‘forum:post:create`
**upd
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/whop_sdk/resources/forum_posts.rb', line 52 def create(params) parsed, = WhopSDK::ForumPostCreateParams.dump_request(params) @client.request( method: :post, path: "forum_posts", body: parsed, model: WhopSDK::ForumPost, options: ) end |
#list(experience_id:, after: nil, before: nil, first: nil, last: nil, parent_id: nil, pinned: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ForumPostListResponse>
Some parameter documentations has been truncated, see Models::ForumPostListParams for more details.
Returns a paginated list of forum posts within a specific experience, with optional filtering by parent post or pinned status.
Required permissions:
-
‘forum:read`
155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/whop_sdk/resources/forum_posts.rb', line 155 def list(params) parsed, = WhopSDK::ForumPostListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "forum_posts", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::ForumPostListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::ForumPost
Retrieves the details of an existing forum post.
Required permissions:
-
‘forum:read`
78 79 80 81 82 83 84 85 |
# File 'lib/whop_sdk/resources/forum_posts.rb', line 78 def retrieve(id, params = {}) @client.request( method: :get, path: ["forum_posts/%1$s", id], model: WhopSDK::ForumPost, options: params[:request_options] ) end |
#update(id, attachments: nil, content: nil, is_pinned: nil, title: nil, visibility: nil, request_options: {}) ⇒ WhopSDK::Models::ForumPost
Some parameter documentations has been truncated, see Models::ForumPostUpdateParams for more details.
Edit the content, attachments, pinned status, or visibility of an existing forum post or comment.
**
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/whop_sdk/resources/forum_posts.rb', line 113 def update(id, params = {}) parsed, = WhopSDK::ForumPostUpdateParams.dump_request(params) @client.request( method: :patch, path: ["forum_posts/%1$s", id], body: parsed, model: WhopSDK::ForumPost, options: ) end |