Class: WhopSDK::Models::ForumPost::Attachment

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/forum_post.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, attachments:, comment_count:, content:, created_at:, is_edited:, is_pinned:, is_poster_admin:, like_count:, parent_id:, title:, updated_at:, user:, view_count:) ⇒ Object

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

A post or comment in a forum feed, supporting rich text, attachments, polls, and reactions.

Parameters:

  • id (String)

    Represents a unique identifier that is Base64 obfuscated. It is often used to re

  • attachments (Array<WhopSDK::Models::ForumPost::Attachment>)

    All file attachments on this post, such as images, documents, and videos.

  • comment_count (Integer)

    The total number of direct comments on this post.

  • content (String, nil)

    The body of the forum post in Markdown format. Null if the post is paywalled and

  • created_at (Time)

    The time this post was created, as a Unix timestamp.

  • is_edited (Boolean)

    Whether this post has been edited after its initial creation.

  • is_pinned (Boolean)

    Whether this post is pinned to the top of the forum feed.

  • is_poster_admin (Boolean)

    Whether the author of this post is an admin of the company that owns the forum.

  • like_count (Integer, nil)

    The total number of like reactions this post has received.

  • parent_id (String, nil)

    The unique identifier of the parent post. Null if this is a top-level post.

  • title (String, nil)

    The headline of the forum post. Null if the post has no title.

  • updated_at (Time)

    The time this post was last updated, as a Unix timestamp.

  • user (WhopSDK::Models::ForumPost::User)

    The user who authored this forum post.

  • view_count (Integer, nil)

    The total number of times this post has been viewed by users.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/whop_sdk/models/forum_post.rb', line 130

class Attachment < WhopSDK::Internal::Type::BaseModel
  # @!attribute id
  #   Represents a unique identifier that is Base64 obfuscated. It is often used to
  #   refetch an object or as key for a cache. The ID type appears in a JSON response
  #   as a String; however, it is not intended to be human-readable. When expected as
  #   an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`)
  #   input value will be accepted as an ID.
  #
  #   @return [String]
  required :id, String

  # @!attribute content_type
  #   The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).
  #
  #   @return [String, nil]
  required :content_type, String, nil?: true

  # @!attribute filename
  #   The original filename of the uploaded attachment, including its file extension.
  #
  #   @return [String, nil]
  required :filename, String, nil?: true

  # @!attribute url
  #   A pre-optimized URL for rendering this attachment on the client. This should be
  #   used for displaying attachments in apps.
  #
  #   @return [String, nil]
  required :url, String, nil?: true

  # @!method initialize(id:, content_type:, filename:, url:)
  #   Some parameter documentations has been truncated, see
  #   {WhopSDK::Models::ForumPost::Attachment} for more details.
  #
  #   Represents an image attachment
  #
  #   @param id [String] Represents a unique identifier that is Base64 obfuscated. It is often used to re
  #
  #   @param content_type [String, nil] The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).
  #
  #   @param filename [String, nil] The original filename of the uploaded attachment, including its file extension.
  #
  #   @param url [String, nil] A pre-optimized URL for rendering this attachment on the client. This should be
end

Instance Attribute Details

#content_typeString?

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

Returns:

  • (String, nil)


145
# File 'lib/whop_sdk/models/forum_post.rb', line 145

required :content_type, String, nil?: true

#filenameString?

The original filename of the uploaded attachment, including its file extension.

Returns:

  • (String, nil)


151
# File 'lib/whop_sdk/models/forum_post.rb', line 151

required :filename, String, nil?: true

#idString

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as ‘“VXNlci0xMA==”`) or integer (such as `4`) input value will be accepted as an ID.

Returns:

  • (String)


139
# File 'lib/whop_sdk/models/forum_post.rb', line 139

required :id, String

#urlString?

A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps.

Returns:

  • (String, nil)


158
# File 'lib/whop_sdk/models/forum_post.rb', line 158

required :url, String, nil?: true