whop_sdk 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +4 -0
  5. data/lib/whop_sdk/models/app_build_create_params.rb +53 -29
  6. data/lib/whop_sdk/models/app_update_params.rb +53 -29
  7. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +115 -39
  8. data/lib/whop_sdk/models/company.rb +13 -1
  9. data/lib/whop_sdk/models/company_create_params.rb +46 -0
  10. data/lib/whop_sdk/models/company_list_params.rb +62 -0
  11. data/lib/whop_sdk/models/company_list_response.rb +175 -0
  12. data/lib/whop_sdk/models/course_create_params.rb +75 -30
  13. data/lib/whop_sdk/models/course_lesson_update_params.rb +204 -83
  14. data/lib/whop_sdk/models/course_student_list_params.rb +62 -0
  15. data/lib/whop_sdk/models/course_student_list_response.rb +97 -0
  16. data/lib/whop_sdk/models/course_student_retrieve_params.rb +14 -0
  17. data/lib/whop_sdk/models/course_student_retrieve_response.rb +149 -0
  18. data/lib/whop_sdk/models/course_update_params.rb +51 -27
  19. data/lib/whop_sdk/models/experience_update_params.rb +53 -29
  20. data/lib/whop_sdk/models/forum_post_create_params.rb +51 -27
  21. data/lib/whop_sdk/models/forum_post_update_params.rb +51 -27
  22. data/lib/whop_sdk/models/invoice_create_params.rb +48 -32
  23. data/lib/whop_sdk/models/lesson.rb +16 -8
  24. data/lib/whop_sdk/models/message_create_params.rb +51 -27
  25. data/lib/whop_sdk/models/message_update_params.rb +51 -27
  26. data/lib/whop_sdk/models/payment.rb +10 -1
  27. data/lib/whop_sdk/models/payment_list_response.rb +10 -1
  28. data/lib/whop_sdk/models/payment_method_types.rb +2 -1
  29. data/lib/whop_sdk/models/plan.rb +48 -1
  30. data/lib/whop_sdk/models/plan_create_params.rb +97 -22
  31. data/lib/whop_sdk/models/plan_list_response.rb +51 -1
  32. data/lib/whop_sdk/models/plan_update_params.rb +97 -22
  33. data/lib/whop_sdk/models/product_update_params.rb +53 -29
  34. data/lib/whop_sdk/models/transfer.rb +9 -1
  35. data/lib/whop_sdk/models/transfer_create_params.rb +9 -1
  36. data/lib/whop_sdk/models/transfer_list_response.rb +9 -1
  37. data/lib/whop_sdk/models.rb +8 -0
  38. data/lib/whop_sdk/resources/app_builds.rb +1 -1
  39. data/lib/whop_sdk/resources/apps.rb +1 -1
  40. data/lib/whop_sdk/resources/checkout_configurations.rb +6 -6
  41. data/lib/whop_sdk/resources/companies.rb +70 -0
  42. data/lib/whop_sdk/resources/course_lesson_interactions.rb +2 -2
  43. data/lib/whop_sdk/resources/course_lessons.rb +7 -3
  44. data/lib/whop_sdk/resources/course_students.rb +76 -0
  45. data/lib/whop_sdk/resources/courses.rb +10 -3
  46. data/lib/whop_sdk/resources/experiences.rb +1 -1
  47. data/lib/whop_sdk/resources/forum_posts.rb +2 -2
  48. data/lib/whop_sdk/resources/invoices.rb +11 -11
  49. data/lib/whop_sdk/resources/messages.rb +2 -2
  50. data/lib/whop_sdk/resources/plans.rb +8 -4
  51. data/lib/whop_sdk/resources/products.rb +1 -1
  52. data/lib/whop_sdk/resources/transfers.rb +3 -1
  53. data/lib/whop_sdk/version.rb +1 -1
  54. data/lib/whop_sdk.rb +8 -1
  55. data/rbi/whop_sdk/client.rbi +3 -0
  56. data/rbi/whop_sdk/models/app_build_create_params.rbi +80 -40
  57. data/rbi/whop_sdk/models/app_update_params.rbi +86 -37
  58. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +192 -64
  59. data/rbi/whop_sdk/models/company.rbi +10 -0
  60. data/rbi/whop_sdk/models/company_create_params.rbi +67 -0
  61. data/rbi/whop_sdk/models/company_list_params.rbi +83 -0
  62. data/rbi/whop_sdk/models/company_list_response.rbi +235 -0
  63. data/rbi/whop_sdk/models/course_create_params.rbi +104 -38
  64. data/rbi/whop_sdk/models/course_lesson_update_params.rbi +326 -114
  65. data/rbi/whop_sdk/models/course_student_list_params.rbi +83 -0
  66. data/rbi/whop_sdk/models/course_student_list_response.rbi +142 -0
  67. data/rbi/whop_sdk/models/course_student_retrieve_params.rbi +30 -0
  68. data/rbi/whop_sdk/models/course_student_retrieve_response.rbi +250 -0
  69. data/rbi/whop_sdk/models/course_update_params.rbi +84 -38
  70. data/rbi/whop_sdk/models/experience_update_params.rbi +84 -38
  71. data/rbi/whop_sdk/models/forum_post_create_params.rbi +85 -32
  72. data/rbi/whop_sdk/models/forum_post_update_params.rbi +85 -32
  73. data/rbi/whop_sdk/models/invoice_create_params.rbi +58 -44
  74. data/rbi/whop_sdk/models/lesson.rbi +14 -10
  75. data/rbi/whop_sdk/models/message_create_params.rbi +85 -32
  76. data/rbi/whop_sdk/models/message_update_params.rbi +85 -32
  77. data/rbi/whop_sdk/models/payment.rbi +10 -0
  78. data/rbi/whop_sdk/models/payment_list_response.rbi +10 -0
  79. data/rbi/whop_sdk/models/payment_method_types.rbi +3 -1
  80. data/rbi/whop_sdk/models/plan.rbi +82 -0
  81. data/rbi/whop_sdk/models/plan_create_params.rbi +174 -32
  82. data/rbi/whop_sdk/models/plan_list_response.rbi +94 -0
  83. data/rbi/whop_sdk/models/plan_update_params.rbi +174 -32
  84. data/rbi/whop_sdk/models/product_update_params.rbi +83 -39
  85. data/rbi/whop_sdk/models/transfer.rbi +8 -0
  86. data/rbi/whop_sdk/models/transfer_create_params.rbi +8 -0
  87. data/rbi/whop_sdk/models/transfer_list_response.rbi +8 -0
  88. data/rbi/whop_sdk/models.rbi +8 -0
  89. data/rbi/whop_sdk/resources/app_builds.rbi +5 -1
  90. data/rbi/whop_sdk/resources/apps.rbi +7 -1
  91. data/rbi/whop_sdk/resources/checkout_configurations.rbi +6 -7
  92. data/rbi/whop_sdk/resources/companies.rbi +63 -0
  93. data/rbi/whop_sdk/resources/course_lesson_interactions.rbi +2 -2
  94. data/rbi/whop_sdk/resources/course_lessons.rbi +21 -2
  95. data/rbi/whop_sdk/resources/course_students.rbi +65 -0
  96. data/rbi/whop_sdk/resources/courses.rbi +22 -2
  97. data/rbi/whop_sdk/resources/experiences.rbi +7 -1
  98. data/rbi/whop_sdk/resources/forum_posts.rbi +12 -2
  99. data/rbi/whop_sdk/resources/invoices.rbi +18 -18
  100. data/rbi/whop_sdk/resources/messages.rbi +12 -2
  101. data/rbi/whop_sdk/resources/plans.rbi +28 -2
  102. data/rbi/whop_sdk/resources/products.rbi +6 -1
  103. data/rbi/whop_sdk/resources/transfers.rbi +3 -0
  104. data/sig/whop_sdk/client.rbs +2 -0
  105. data/sig/whop_sdk/models/app_build_create_params.rbs +29 -10
  106. data/sig/whop_sdk/models/app_update_params.rbs +29 -10
  107. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +72 -21
  108. data/sig/whop_sdk/models/company.rbs +5 -0
  109. data/sig/whop_sdk/models/company_create_params.rbs +41 -0
  110. data/sig/whop_sdk/models/company_list_params.rbs +51 -0
  111. data/sig/whop_sdk/models/company_list_response.rbs +109 -0
  112. data/sig/whop_sdk/models/course_create_params.rbs +39 -10
  113. data/sig/whop_sdk/models/course_lesson_update_params.rbs +116 -30
  114. data/sig/whop_sdk/models/course_student_list_params.rbs +51 -0
  115. data/sig/whop_sdk/models/course_student_list_response.rbs +64 -0
  116. data/sig/whop_sdk/models/course_student_retrieve_params.rbs +15 -0
  117. data/sig/whop_sdk/models/course_student_retrieve_response.rbs +106 -0
  118. data/sig/whop_sdk/models/course_update_params.rbs +29 -10
  119. data/sig/whop_sdk/models/experience_update_params.rbs +29 -10
  120. data/sig/whop_sdk/models/forum_post_create_params.rbs +29 -10
  121. data/sig/whop_sdk/models/forum_post_update_params.rbs +29 -10
  122. data/sig/whop_sdk/models/invoice_create_params.rbs +28 -18
  123. data/sig/whop_sdk/models/lesson.rbs +8 -8
  124. data/sig/whop_sdk/models/message_create_params.rbs +29 -10
  125. data/sig/whop_sdk/models/message_update_params.rbs +29 -10
  126. data/sig/whop_sdk/models/payment.rbs +5 -0
  127. data/sig/whop_sdk/models/payment_list_response.rbs +5 -0
  128. data/sig/whop_sdk/models/payment_method_types.rbs +4 -2
  129. data/sig/whop_sdk/models/plan.rbs +32 -0
  130. data/sig/whop_sdk/models/plan_create_params.rbs +61 -10
  131. data/sig/whop_sdk/models/plan_list_response.rbs +32 -0
  132. data/sig/whop_sdk/models/plan_update_params.rbs +61 -10
  133. data/sig/whop_sdk/models/product_update_params.rbs +29 -10
  134. data/sig/whop_sdk/models/transfer.rbs +5 -0
  135. data/sig/whop_sdk/models/transfer_create_params.rbs +5 -0
  136. data/sig/whop_sdk/models/transfer_list_response.rbs +5 -0
  137. data/sig/whop_sdk/models.rbs +8 -0
  138. data/sig/whop_sdk/resources/app_builds.rbs +1 -1
  139. data/sig/whop_sdk/resources/apps.rbs +1 -1
  140. data/sig/whop_sdk/resources/checkout_configurations.rbs +2 -2
  141. data/sig/whop_sdk/resources/companies.rbs +18 -0
  142. data/sig/whop_sdk/resources/course_lessons.rbs +4 -2
  143. data/sig/whop_sdk/resources/course_students.rbs +22 -0
  144. data/sig/whop_sdk/resources/courses.rbs +4 -2
  145. data/sig/whop_sdk/resources/experiences.rbs +1 -1
  146. data/sig/whop_sdk/resources/forum_posts.rbs +2 -2
  147. data/sig/whop_sdk/resources/invoices.rbs +5 -5
  148. data/sig/whop_sdk/resources/messages.rbs +2 -2
  149. data/sig/whop_sdk/resources/plans.rbs +4 -2
  150. data/sig/whop_sdk/resources/products.rbs +1 -1
  151. data/sig/whop_sdk/resources/transfers.rbs +1 -0
  152. metadata +26 -5
  153. data/lib/whop_sdk/models/invoice_create_response.rb +0 -27
  154. data/rbi/whop_sdk/models/invoice_create_response.rbi +0 -49
  155. data/sig/whop_sdk/models/invoice_create_response.rbs +0 -19
@@ -20,15 +20,17 @@ module WhopSDK
20
20
  attr_accessor :access_level
21
21
 
22
22
  # The logo for the experience
23
- sig { returns(T.nilable(WhopSDK::ExperienceUpdateParams::Logo)) }
24
- attr_reader :logo
25
-
26
23
  sig do
27
- params(
28
- logo: T.nilable(WhopSDK::ExperienceUpdateParams::Logo::OrHash)
29
- ).void
24
+ returns(
25
+ T.nilable(
26
+ T.any(
27
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithDirectUploadID,
28
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithID
29
+ )
30
+ )
31
+ )
30
32
  end
31
- attr_writer :logo
33
+ attr_accessor :logo
32
34
 
33
35
  # The name of the experience.
34
36
  sig { returns(T.nilable(String)) }
@@ -46,7 +48,13 @@ module WhopSDK
46
48
  params(
47
49
  access_level:
48
50
  T.nilable(WhopSDK::ExperienceUpdateParams::AccessLevel::OrSymbol),
49
- logo: T.nilable(WhopSDK::ExperienceUpdateParams::Logo::OrHash),
51
+ logo:
52
+ T.nilable(
53
+ T.any(
54
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithDirectUploadID::OrHash,
55
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithID::OrHash
56
+ )
57
+ ),
50
58
  name: T.nilable(String),
51
59
  order: T.nilable(String),
52
60
  section_id: T.nilable(String),
@@ -73,7 +81,13 @@ module WhopSDK
73
81
  {
74
82
  access_level:
75
83
  T.nilable(WhopSDK::ExperienceUpdateParams::AccessLevel::OrSymbol),
76
- logo: T.nilable(WhopSDK::ExperienceUpdateParams::Logo),
84
+ logo:
85
+ T.nilable(
86
+ T.any(
87
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithDirectUploadID,
88
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithID
89
+ )
90
+ ),
77
91
  name: T.nilable(String),
78
92
  order: T.nilable(String),
79
93
  section_id: T.nilable(String),
@@ -114,52 +128,84 @@ module WhopSDK
114
128
  end
115
129
  end
116
130
 
117
- class Logo < WhopSDK::Internal::Type::BaseModel
118
- OrHash =
131
+ # The logo for the experience
132
+ module Logo
133
+ extend WhopSDK::Internal::Type::Union
134
+
135
+ Variants =
119
136
  T.type_alias do
120
137
  T.any(
121
- WhopSDK::ExperienceUpdateParams::Logo,
122
- WhopSDK::Internal::AnyHash
138
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithDirectUploadID,
139
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithID
123
140
  )
124
141
  end
125
142
 
126
- # The ID of an existing attachment object. Use this when updating a resource and
127
- # keeping a subset of the attachments. Don't use this unless you know what you're
128
- # doing.
129
- sig { returns(T.nilable(String)) }
130
- attr_accessor :id
143
+ class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
144
+ OrHash =
145
+ T.type_alias do
146
+ T.any(
147
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithDirectUploadID,
148
+ WhopSDK::Internal::AnyHash
149
+ )
150
+ end
131
151
 
132
- # This ID should be used the first time you upload an attachment. It is the ID of
133
- # the direct upload that was created when uploading the file to S3 via the
134
- # mediaDirectUpload mutation.
135
- sig { returns(T.nilable(String)) }
136
- attr_accessor :direct_upload_id
152
+ # This ID should be used the first time you upload an attachment. It is the ID of
153
+ # the direct upload that was created when uploading the file to S3 via the
154
+ # mediaDirectUpload mutation.
155
+ sig { returns(String) }
156
+ attr_accessor :direct_upload_id
157
+
158
+ # Input for an attachment
159
+ sig { params(direct_upload_id: String).returns(T.attached_class) }
160
+ def self.new(
161
+ # This ID should be used the first time you upload an attachment. It is the ID of
162
+ # the direct upload that was created when uploading the file to S3 via the
163
+ # mediaDirectUpload mutation.
164
+ direct_upload_id:
165
+ )
166
+ end
137
167
 
138
- # The logo for the experience
139
- sig do
140
- params(
141
- id: T.nilable(String),
142
- direct_upload_id: T.nilable(String)
143
- ).returns(T.attached_class)
168
+ sig { override.returns({ direct_upload_id: String }) }
169
+ def to_hash
170
+ end
144
171
  end
145
- def self.new(
172
+
173
+ class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
174
+ OrHash =
175
+ T.type_alias do
176
+ T.any(
177
+ WhopSDK::ExperienceUpdateParams::Logo::AttachmentInputWithID,
178
+ WhopSDK::Internal::AnyHash
179
+ )
180
+ end
181
+
146
182
  # The ID of an existing attachment object. Use this when updating a resource and
147
183
  # keeping a subset of the attachments. Don't use this unless you know what you're
148
184
  # doing.
149
- id: nil,
150
- # This ID should be used the first time you upload an attachment. It is the ID of
151
- # the direct upload that was created when uploading the file to S3 via the
152
- # mediaDirectUpload mutation.
153
- direct_upload_id: nil
154
- )
185
+ sig { returns(String) }
186
+ attr_accessor :id
187
+
188
+ # Input for an attachment
189
+ sig { params(id: String).returns(T.attached_class) }
190
+ def self.new(
191
+ # The ID of an existing attachment object. Use this when updating a resource and
192
+ # keeping a subset of the attachments. Don't use this unless you know what you're
193
+ # doing.
194
+ id:
195
+ )
196
+ end
197
+
198
+ sig { override.returns({ id: String }) }
199
+ def to_hash
200
+ end
155
201
  end
156
202
 
157
203
  sig do
158
204
  override.returns(
159
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
205
+ T::Array[WhopSDK::ExperienceUpdateParams::Logo::Variants]
160
206
  )
161
207
  end
162
- def to_hash
208
+ def self.variants
163
209
  end
164
210
  end
165
211
  end
@@ -17,7 +17,16 @@ module WhopSDK
17
17
 
18
18
  # The attachments for this post
19
19
  sig do
20
- returns(T.nilable(T::Array[WhopSDK::ForumPostCreateParams::Attachment]))
20
+ returns(
21
+ T.nilable(
22
+ T::Array[
23
+ T.any(
24
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithDirectUploadID,
25
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithID
26
+ )
27
+ ]
28
+ )
29
+ )
21
30
  end
22
31
  attr_accessor :attachments
23
32
 
@@ -70,7 +79,12 @@ module WhopSDK
70
79
  experience_id: String,
71
80
  attachments:
72
81
  T.nilable(
73
- T::Array[WhopSDK::ForumPostCreateParams::Attachment::OrHash]
82
+ T::Array[
83
+ T.any(
84
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithDirectUploadID::OrHash,
85
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithID::OrHash
86
+ )
87
+ ]
74
88
  ),
75
89
  content: T.nilable(String),
76
90
  is_mention: T.nilable(T::Boolean),
@@ -118,7 +132,14 @@ module WhopSDK
118
132
  {
119
133
  experience_id: String,
120
134
  attachments:
121
- T.nilable(T::Array[WhopSDK::ForumPostCreateParams::Attachment]),
135
+ T.nilable(
136
+ T::Array[
137
+ T.any(
138
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithDirectUploadID,
139
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithID
140
+ )
141
+ ]
142
+ ),
122
143
  content: T.nilable(String),
123
144
  is_mention: T.nilable(T::Boolean),
124
145
  parent_id: T.nilable(String),
@@ -134,52 +155,84 @@ module WhopSDK
134
155
  def to_hash
135
156
  end
136
157
 
137
- class Attachment < WhopSDK::Internal::Type::BaseModel
138
- OrHash =
158
+ # Input for an attachment
159
+ module Attachment
160
+ extend WhopSDK::Internal::Type::Union
161
+
162
+ Variants =
139
163
  T.type_alias do
140
164
  T.any(
141
- WhopSDK::ForumPostCreateParams::Attachment,
142
- WhopSDK::Internal::AnyHash
165
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithDirectUploadID,
166
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithID
143
167
  )
144
168
  end
145
169
 
146
- # The ID of an existing attachment object. Use this when updating a resource and
147
- # keeping a subset of the attachments. Don't use this unless you know what you're
148
- # doing.
149
- sig { returns(T.nilable(String)) }
150
- attr_accessor :id
170
+ class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
171
+ OrHash =
172
+ T.type_alias do
173
+ T.any(
174
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithDirectUploadID,
175
+ WhopSDK::Internal::AnyHash
176
+ )
177
+ end
151
178
 
152
- # This ID should be used the first time you upload an attachment. It is the ID of
153
- # the direct upload that was created when uploading the file to S3 via the
154
- # mediaDirectUpload mutation.
155
- sig { returns(T.nilable(String)) }
156
- attr_accessor :direct_upload_id
179
+ # This ID should be used the first time you upload an attachment. It is the ID of
180
+ # the direct upload that was created when uploading the file to S3 via the
181
+ # mediaDirectUpload mutation.
182
+ sig { returns(String) }
183
+ attr_accessor :direct_upload_id
157
184
 
158
- # Input for an attachment
159
- sig do
160
- params(
161
- id: T.nilable(String),
162
- direct_upload_id: T.nilable(String)
163
- ).returns(T.attached_class)
185
+ # Input for an attachment
186
+ sig { params(direct_upload_id: String).returns(T.attached_class) }
187
+ def self.new(
188
+ # This ID should be used the first time you upload an attachment. It is the ID of
189
+ # the direct upload that was created when uploading the file to S3 via the
190
+ # mediaDirectUpload mutation.
191
+ direct_upload_id:
192
+ )
193
+ end
194
+
195
+ sig { override.returns({ direct_upload_id: String }) }
196
+ def to_hash
197
+ end
164
198
  end
165
- def self.new(
199
+
200
+ class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
201
+ OrHash =
202
+ T.type_alias do
203
+ T.any(
204
+ WhopSDK::ForumPostCreateParams::Attachment::AttachmentInputWithID,
205
+ WhopSDK::Internal::AnyHash
206
+ )
207
+ end
208
+
166
209
  # The ID of an existing attachment object. Use this when updating a resource and
167
210
  # keeping a subset of the attachments. Don't use this unless you know what you're
168
211
  # doing.
169
- id: nil,
170
- # This ID should be used the first time you upload an attachment. It is the ID of
171
- # the direct upload that was created when uploading the file to S3 via the
172
- # mediaDirectUpload mutation.
173
- direct_upload_id: nil
174
- )
212
+ sig { returns(String) }
213
+ attr_accessor :id
214
+
215
+ # Input for an attachment
216
+ sig { params(id: String).returns(T.attached_class) }
217
+ def self.new(
218
+ # The ID of an existing attachment object. Use this when updating a resource and
219
+ # keeping a subset of the attachments. Don't use this unless you know what you're
220
+ # doing.
221
+ id:
222
+ )
223
+ end
224
+
225
+ sig { override.returns({ id: String }) }
226
+ def to_hash
227
+ end
175
228
  end
176
229
 
177
230
  sig do
178
231
  override.returns(
179
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
232
+ T::Array[WhopSDK::ForumPostCreateParams::Attachment::Variants]
180
233
  )
181
234
  end
182
- def to_hash
235
+ def self.variants
183
236
  end
184
237
  end
185
238
 
@@ -13,7 +13,16 @@ module WhopSDK
13
13
 
14
14
  # The attachments for this post
15
15
  sig do
16
- returns(T.nilable(T::Array[WhopSDK::ForumPostUpdateParams::Attachment]))
16
+ returns(
17
+ T.nilable(
18
+ T::Array[
19
+ T.any(
20
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
21
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithID
22
+ )
23
+ ]
24
+ )
25
+ )
17
26
  end
18
27
  attr_accessor :attachments
19
28
 
@@ -34,7 +43,12 @@ module WhopSDK
34
43
  params(
35
44
  attachments:
36
45
  T.nilable(
37
- T::Array[WhopSDK::ForumPostUpdateParams::Attachment::OrHash]
46
+ T::Array[
47
+ T.any(
48
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithDirectUploadID::OrHash,
49
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithID::OrHash
50
+ )
51
+ ]
38
52
  ),
39
53
  content: T.nilable(String),
40
54
  is_pinned: T.nilable(T::Boolean),
@@ -60,7 +74,14 @@ module WhopSDK
60
74
  override.returns(
61
75
  {
62
76
  attachments:
63
- T.nilable(T::Array[WhopSDK::ForumPostUpdateParams::Attachment]),
77
+ T.nilable(
78
+ T::Array[
79
+ T.any(
80
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
81
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithID
82
+ )
83
+ ]
84
+ ),
64
85
  content: T.nilable(String),
65
86
  is_pinned: T.nilable(T::Boolean),
66
87
  title: T.nilable(String),
@@ -71,52 +92,84 @@ module WhopSDK
71
92
  def to_hash
72
93
  end
73
94
 
74
- class Attachment < WhopSDK::Internal::Type::BaseModel
75
- OrHash =
95
+ # Input for an attachment
96
+ module Attachment
97
+ extend WhopSDK::Internal::Type::Union
98
+
99
+ Variants =
76
100
  T.type_alias do
77
101
  T.any(
78
- WhopSDK::ForumPostUpdateParams::Attachment,
79
- WhopSDK::Internal::AnyHash
102
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
103
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithID
80
104
  )
81
105
  end
82
106
 
83
- # The ID of an existing attachment object. Use this when updating a resource and
84
- # keeping a subset of the attachments. Don't use this unless you know what you're
85
- # doing.
86
- sig { returns(T.nilable(String)) }
87
- attr_accessor :id
107
+ class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
108
+ OrHash =
109
+ T.type_alias do
110
+ T.any(
111
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
112
+ WhopSDK::Internal::AnyHash
113
+ )
114
+ end
88
115
 
89
- # This ID should be used the first time you upload an attachment. It is the ID of
90
- # the direct upload that was created when uploading the file to S3 via the
91
- # mediaDirectUpload mutation.
92
- sig { returns(T.nilable(String)) }
93
- attr_accessor :direct_upload_id
116
+ # This ID should be used the first time you upload an attachment. It is the ID of
117
+ # the direct upload that was created when uploading the file to S3 via the
118
+ # mediaDirectUpload mutation.
119
+ sig { returns(String) }
120
+ attr_accessor :direct_upload_id
94
121
 
95
- # Input for an attachment
96
- sig do
97
- params(
98
- id: T.nilable(String),
99
- direct_upload_id: T.nilable(String)
100
- ).returns(T.attached_class)
122
+ # Input for an attachment
123
+ sig { params(direct_upload_id: String).returns(T.attached_class) }
124
+ def self.new(
125
+ # This ID should be used the first time you upload an attachment. It is the ID of
126
+ # the direct upload that was created when uploading the file to S3 via the
127
+ # mediaDirectUpload mutation.
128
+ direct_upload_id:
129
+ )
130
+ end
131
+
132
+ sig { override.returns({ direct_upload_id: String }) }
133
+ def to_hash
134
+ end
101
135
  end
102
- def self.new(
136
+
137
+ class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
138
+ OrHash =
139
+ T.type_alias do
140
+ T.any(
141
+ WhopSDK::ForumPostUpdateParams::Attachment::AttachmentInputWithID,
142
+ WhopSDK::Internal::AnyHash
143
+ )
144
+ end
145
+
103
146
  # The ID of an existing attachment object. Use this when updating a resource and
104
147
  # keeping a subset of the attachments. Don't use this unless you know what you're
105
148
  # doing.
106
- id: nil,
107
- # This ID should be used the first time you upload an attachment. It is the ID of
108
- # the direct upload that was created when uploading the file to S3 via the
109
- # mediaDirectUpload mutation.
110
- direct_upload_id: nil
111
- )
149
+ sig { returns(String) }
150
+ attr_accessor :id
151
+
152
+ # Input for an attachment
153
+ sig { params(id: String).returns(T.attached_class) }
154
+ def self.new(
155
+ # The ID of an existing attachment object. Use this when updating a resource and
156
+ # keeping a subset of the attachments. Don't use this unless you know what you're
157
+ # doing.
158
+ id:
159
+ )
160
+ end
161
+
162
+ sig { override.returns({ id: String }) }
163
+ def to_hash
164
+ end
112
165
  end
113
166
 
114
167
  sig do
115
168
  override.returns(
116
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
169
+ T::Array[WhopSDK::ForumPostUpdateParams::Attachment::Variants]
117
170
  )
118
171
  end
119
- def to_hash
172
+ def self.variants
120
173
  end
121
174
  end
122
175
  end