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
@@ -0,0 +1,142 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class CourseStudentListResponse < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ WhopSDK::Models::CourseStudentListResponse,
10
+ WhopSDK::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The ID of the course student. Looks like crsi_XXX
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # The number of lessons the student has completed
19
+ sig { returns(Integer) }
20
+ attr_accessor :completed_lessons_count
21
+
22
+ # The percentage of lessons completed (0-100)
23
+ sig { returns(Float) }
24
+ attr_accessor :completion_rate
25
+
26
+ # When the student first interacted with the course
27
+ sig { returns(Time) }
28
+ attr_accessor :first_interaction_at
29
+
30
+ # When the student last interacted with the course
31
+ sig { returns(Time) }
32
+ attr_accessor :last_interaction_at
33
+
34
+ # The total number of lessons the student has access to
35
+ sig { returns(Integer) }
36
+ attr_accessor :total_lessons_count
37
+
38
+ # The user who is enrolled in the course
39
+ sig { returns(WhopSDK::Models::CourseStudentListResponse::User) }
40
+ attr_reader :user
41
+
42
+ sig do
43
+ params(
44
+ user: WhopSDK::Models::CourseStudentListResponse::User::OrHash
45
+ ).void
46
+ end
47
+ attr_writer :user
48
+
49
+ # A course student (enrollment of a student in a course)
50
+ sig do
51
+ params(
52
+ id: String,
53
+ completed_lessons_count: Integer,
54
+ completion_rate: Float,
55
+ first_interaction_at: Time,
56
+ last_interaction_at: Time,
57
+ total_lessons_count: Integer,
58
+ user: WhopSDK::Models::CourseStudentListResponse::User::OrHash
59
+ ).returns(T.attached_class)
60
+ end
61
+ def self.new(
62
+ # The ID of the course student. Looks like crsi_XXX
63
+ id:,
64
+ # The number of lessons the student has completed
65
+ completed_lessons_count:,
66
+ # The percentage of lessons completed (0-100)
67
+ completion_rate:,
68
+ # When the student first interacted with the course
69
+ first_interaction_at:,
70
+ # When the student last interacted with the course
71
+ last_interaction_at:,
72
+ # The total number of lessons the student has access to
73
+ total_lessons_count:,
74
+ # The user who is enrolled in the course
75
+ user:
76
+ )
77
+ end
78
+
79
+ sig do
80
+ override.returns(
81
+ {
82
+ id: String,
83
+ completed_lessons_count: Integer,
84
+ completion_rate: Float,
85
+ first_interaction_at: Time,
86
+ last_interaction_at: Time,
87
+ total_lessons_count: Integer,
88
+ user: WhopSDK::Models::CourseStudentListResponse::User
89
+ }
90
+ )
91
+ end
92
+ def to_hash
93
+ end
94
+
95
+ class User < WhopSDK::Internal::Type::BaseModel
96
+ OrHash =
97
+ T.type_alias do
98
+ T.any(
99
+ WhopSDK::Models::CourseStudentListResponse::User,
100
+ WhopSDK::Internal::AnyHash
101
+ )
102
+ end
103
+
104
+ # The internal ID of the user.
105
+ sig { returns(String) }
106
+ attr_accessor :id
107
+
108
+ # The name of the user from their Whop account.
109
+ sig { returns(T.nilable(String)) }
110
+ attr_accessor :name
111
+
112
+ # The username of the user from their Whop account.
113
+ sig { returns(String) }
114
+ attr_accessor :username
115
+
116
+ # The user who is enrolled in the course
117
+ sig do
118
+ params(id: String, name: T.nilable(String), username: String).returns(
119
+ T.attached_class
120
+ )
121
+ end
122
+ def self.new(
123
+ # The internal ID of the user.
124
+ id:,
125
+ # The name of the user from their Whop account.
126
+ name:,
127
+ # The username of the user from their Whop account.
128
+ username:
129
+ )
130
+ end
131
+
132
+ sig do
133
+ override.returns(
134
+ { id: String, name: T.nilable(String), username: String }
135
+ )
136
+ end
137
+ def to_hash
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,30 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class CourseStudentRetrieveParams < WhopSDK::Internal::Type::BaseModel
6
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
7
+ include WhopSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ WhopSDK::CourseStudentRetrieveParams,
13
+ WhopSDK::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig do
18
+ params(request_options: WhopSDK::RequestOptions::OrHash).returns(
19
+ T.attached_class
20
+ )
21
+ end
22
+ def self.new(request_options: {})
23
+ end
24
+
25
+ sig { override.returns({ request_options: WhopSDK::RequestOptions }) }
26
+ def to_hash
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,250 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class CourseStudentRetrieveResponse < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ WhopSDK::Models::CourseStudentRetrieveResponse,
10
+ WhopSDK::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The ID of the course student. Looks like crsi_XXX
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # The number of lessons the student has completed
19
+ sig { returns(Integer) }
20
+ attr_accessor :completed_lessons_count
21
+
22
+ # The percentage of lessons completed (0-100)
23
+ sig { returns(Float) }
24
+ attr_accessor :completion_rate
25
+
26
+ # The course the student is enrolled in
27
+ sig { returns(WhopSDK::Models::CourseStudentRetrieveResponse::Course) }
28
+ attr_reader :course
29
+
30
+ sig do
31
+ params(
32
+ course: WhopSDK::Models::CourseStudentRetrieveResponse::Course::OrHash
33
+ ).void
34
+ end
35
+ attr_writer :course
36
+
37
+ # When the student first interacted with the course
38
+ sig { returns(Time) }
39
+ attr_accessor :first_interaction_at
40
+
41
+ # When the student last interacted with the course
42
+ sig { returns(Time) }
43
+ attr_accessor :last_interaction_at
44
+
45
+ # The total number of lessons the student has access to
46
+ sig { returns(Integer) }
47
+ attr_accessor :total_lessons_count
48
+
49
+ # The user who is enrolled in the course
50
+ sig { returns(WhopSDK::Models::CourseStudentRetrieveResponse::User) }
51
+ attr_reader :user
52
+
53
+ sig do
54
+ params(
55
+ user: WhopSDK::Models::CourseStudentRetrieveResponse::User::OrHash
56
+ ).void
57
+ end
58
+ attr_writer :user
59
+
60
+ # A course student (enrollment of a student in a course)
61
+ sig do
62
+ params(
63
+ id: String,
64
+ completed_lessons_count: Integer,
65
+ completion_rate: Float,
66
+ course:
67
+ WhopSDK::Models::CourseStudentRetrieveResponse::Course::OrHash,
68
+ first_interaction_at: Time,
69
+ last_interaction_at: Time,
70
+ total_lessons_count: Integer,
71
+ user: WhopSDK::Models::CourseStudentRetrieveResponse::User::OrHash
72
+ ).returns(T.attached_class)
73
+ end
74
+ def self.new(
75
+ # The ID of the course student. Looks like crsi_XXX
76
+ id:,
77
+ # The number of lessons the student has completed
78
+ completed_lessons_count:,
79
+ # The percentage of lessons completed (0-100)
80
+ completion_rate:,
81
+ # The course the student is enrolled in
82
+ course:,
83
+ # When the student first interacted with the course
84
+ first_interaction_at:,
85
+ # When the student last interacted with the course
86
+ last_interaction_at:,
87
+ # The total number of lessons the student has access to
88
+ total_lessons_count:,
89
+ # The user who is enrolled in the course
90
+ user:
91
+ )
92
+ end
93
+
94
+ sig do
95
+ override.returns(
96
+ {
97
+ id: String,
98
+ completed_lessons_count: Integer,
99
+ completion_rate: Float,
100
+ course: WhopSDK::Models::CourseStudentRetrieveResponse::Course,
101
+ first_interaction_at: Time,
102
+ last_interaction_at: Time,
103
+ total_lessons_count: Integer,
104
+ user: WhopSDK::Models::CourseStudentRetrieveResponse::User
105
+ }
106
+ )
107
+ end
108
+ def to_hash
109
+ end
110
+
111
+ class Course < WhopSDK::Internal::Type::BaseModel
112
+ OrHash =
113
+ T.type_alias do
114
+ T.any(
115
+ WhopSDK::Models::CourseStudentRetrieveResponse::Course,
116
+ WhopSDK::Internal::AnyHash
117
+ )
118
+ end
119
+
120
+ # The ID of the course. Looks like cors_XXX
121
+ sig { returns(String) }
122
+ attr_accessor :id
123
+
124
+ # The experience that the course belongs to
125
+ sig do
126
+ returns(
127
+ WhopSDK::Models::CourseStudentRetrieveResponse::Course::Experience
128
+ )
129
+ end
130
+ attr_reader :experience
131
+
132
+ sig do
133
+ params(
134
+ experience:
135
+ WhopSDK::Models::CourseStudentRetrieveResponse::Course::Experience::OrHash
136
+ ).void
137
+ end
138
+ attr_writer :experience
139
+
140
+ # The title of the course
141
+ sig { returns(T.nilable(String)) }
142
+ attr_accessor :title
143
+
144
+ # The course the student is enrolled in
145
+ sig do
146
+ params(
147
+ id: String,
148
+ experience:
149
+ WhopSDK::Models::CourseStudentRetrieveResponse::Course::Experience::OrHash,
150
+ title: T.nilable(String)
151
+ ).returns(T.attached_class)
152
+ end
153
+ def self.new(
154
+ # The ID of the course. Looks like cors_XXX
155
+ id:,
156
+ # The experience that the course belongs to
157
+ experience:,
158
+ # The title of the course
159
+ title:
160
+ )
161
+ end
162
+
163
+ sig do
164
+ override.returns(
165
+ {
166
+ id: String,
167
+ experience:
168
+ WhopSDK::Models::CourseStudentRetrieveResponse::Course::Experience,
169
+ title: T.nilable(String)
170
+ }
171
+ )
172
+ end
173
+ def to_hash
174
+ end
175
+
176
+ class Experience < WhopSDK::Internal::Type::BaseModel
177
+ OrHash =
178
+ T.type_alias do
179
+ T.any(
180
+ WhopSDK::Models::CourseStudentRetrieveResponse::Course::Experience,
181
+ WhopSDK::Internal::AnyHash
182
+ )
183
+ end
184
+
185
+ # The unique ID representing this experience
186
+ sig { returns(String) }
187
+ attr_accessor :id
188
+
189
+ # The experience that the course belongs to
190
+ sig { params(id: String).returns(T.attached_class) }
191
+ def self.new(
192
+ # The unique ID representing this experience
193
+ id:
194
+ )
195
+ end
196
+
197
+ sig { override.returns({ id: String }) }
198
+ def to_hash
199
+ end
200
+ end
201
+ end
202
+
203
+ class User < WhopSDK::Internal::Type::BaseModel
204
+ OrHash =
205
+ T.type_alias do
206
+ T.any(
207
+ WhopSDK::Models::CourseStudentRetrieveResponse::User,
208
+ WhopSDK::Internal::AnyHash
209
+ )
210
+ end
211
+
212
+ # The internal ID of the user.
213
+ sig { returns(String) }
214
+ attr_accessor :id
215
+
216
+ # The name of the user from their Whop account.
217
+ sig { returns(T.nilable(String)) }
218
+ attr_accessor :name
219
+
220
+ # The username of the user from their Whop account.
221
+ sig { returns(String) }
222
+ attr_accessor :username
223
+
224
+ # The user who is enrolled in the course
225
+ sig do
226
+ params(id: String, name: T.nilable(String), username: String).returns(
227
+ T.attached_class
228
+ )
229
+ end
230
+ def self.new(
231
+ # The internal ID of the user.
232
+ id:,
233
+ # The name of the user from their Whop account.
234
+ name:,
235
+ # The username of the user from their Whop account.
236
+ username:
237
+ )
238
+ end
239
+
240
+ sig do
241
+ override.returns(
242
+ { id: String, name: T.nilable(String), username: String }
243
+ )
244
+ end
245
+ def to_hash
246
+ end
247
+ end
248
+ end
249
+ end
250
+ end
@@ -42,15 +42,17 @@ module WhopSDK
42
42
  attr_accessor :tagline
43
43
 
44
44
  # The thumbnail for the course in png, jpeg, or gif format
45
- sig { returns(T.nilable(WhopSDK::CourseUpdateParams::Thumbnail)) }
46
- attr_reader :thumbnail
47
-
48
45
  sig do
49
- params(
50
- thumbnail: T.nilable(WhopSDK::CourseUpdateParams::Thumbnail::OrHash)
51
- ).void
46
+ returns(
47
+ T.nilable(
48
+ T.any(
49
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithDirectUploadID,
50
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithID
51
+ )
52
+ )
53
+ )
52
54
  end
53
- attr_writer :thumbnail
55
+ attr_accessor :thumbnail
54
56
 
55
57
  # The title of the course
56
58
  sig { returns(T.nilable(String)) }
@@ -66,7 +68,13 @@ module WhopSDK
66
68
  language: T.nilable(WhopSDK::Languages::OrSymbol),
67
69
  require_completing_lessons_in_order: T.nilable(T::Boolean),
68
70
  tagline: T.nilable(String),
69
- thumbnail: T.nilable(WhopSDK::CourseUpdateParams::Thumbnail::OrHash),
71
+ thumbnail:
72
+ T.nilable(
73
+ T.any(
74
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithDirectUploadID::OrHash,
75
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithID::OrHash
76
+ )
77
+ ),
70
78
  title: T.nilable(String),
71
79
  request_options: WhopSDK::RequestOptions::OrHash
72
80
  ).returns(T.attached_class)
@@ -106,7 +114,13 @@ module WhopSDK
106
114
  language: T.nilable(WhopSDK::Languages::OrSymbol),
107
115
  require_completing_lessons_in_order: T.nilable(T::Boolean),
108
116
  tagline: T.nilable(String),
109
- thumbnail: T.nilable(WhopSDK::CourseUpdateParams::Thumbnail),
117
+ thumbnail:
118
+ T.nilable(
119
+ T.any(
120
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithDirectUploadID,
121
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithID
122
+ )
123
+ ),
110
124
  title: T.nilable(String),
111
125
  request_options: WhopSDK::RequestOptions
112
126
  }
@@ -240,52 +254,84 @@ module WhopSDK
240
254
  end
241
255
  end
242
256
 
243
- class Thumbnail < WhopSDK::Internal::Type::BaseModel
244
- OrHash =
257
+ # The thumbnail for the course in png, jpeg, or gif format
258
+ module Thumbnail
259
+ extend WhopSDK::Internal::Type::Union
260
+
261
+ Variants =
245
262
  T.type_alias do
246
263
  T.any(
247
- WhopSDK::CourseUpdateParams::Thumbnail,
248
- WhopSDK::Internal::AnyHash
264
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithDirectUploadID,
265
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithID
249
266
  )
250
267
  end
251
268
 
252
- # The ID of an existing attachment object. Use this when updating a resource and
253
- # keeping a subset of the attachments. Don't use this unless you know what you're
254
- # doing.
255
- sig { returns(T.nilable(String)) }
256
- attr_accessor :id
269
+ class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
270
+ OrHash =
271
+ T.type_alias do
272
+ T.any(
273
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithDirectUploadID,
274
+ WhopSDK::Internal::AnyHash
275
+ )
276
+ end
257
277
 
258
- # This ID should be used the first time you upload an attachment. It is the ID of
259
- # the direct upload that was created when uploading the file to S3 via the
260
- # mediaDirectUpload mutation.
261
- sig { returns(T.nilable(String)) }
262
- attr_accessor :direct_upload_id
278
+ # This ID should be used the first time you upload an attachment. It is the ID of
279
+ # the direct upload that was created when uploading the file to S3 via the
280
+ # mediaDirectUpload mutation.
281
+ sig { returns(String) }
282
+ attr_accessor :direct_upload_id
263
283
 
264
- # The thumbnail for the course in png, jpeg, or gif format
265
- sig do
266
- params(
267
- id: T.nilable(String),
268
- direct_upload_id: T.nilable(String)
269
- ).returns(T.attached_class)
284
+ # Input for an attachment
285
+ sig { params(direct_upload_id: String).returns(T.attached_class) }
286
+ def self.new(
287
+ # This ID should be used the first time you upload an attachment. It is the ID of
288
+ # the direct upload that was created when uploading the file to S3 via the
289
+ # mediaDirectUpload mutation.
290
+ direct_upload_id:
291
+ )
292
+ end
293
+
294
+ sig { override.returns({ direct_upload_id: String }) }
295
+ def to_hash
296
+ end
270
297
  end
271
- def self.new(
298
+
299
+ class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
300
+ OrHash =
301
+ T.type_alias do
302
+ T.any(
303
+ WhopSDK::CourseUpdateParams::Thumbnail::AttachmentInputWithID,
304
+ WhopSDK::Internal::AnyHash
305
+ )
306
+ end
307
+
272
308
  # The ID of an existing attachment object. Use this when updating a resource and
273
309
  # keeping a subset of the attachments. Don't use this unless you know what you're
274
310
  # doing.
275
- id: nil,
276
- # This ID should be used the first time you upload an attachment. It is the ID of
277
- # the direct upload that was created when uploading the file to S3 via the
278
- # mediaDirectUpload mutation.
279
- direct_upload_id: nil
280
- )
311
+ sig { returns(String) }
312
+ attr_accessor :id
313
+
314
+ # Input for an attachment
315
+ sig { params(id: String).returns(T.attached_class) }
316
+ def self.new(
317
+ # The ID of an existing attachment object. Use this when updating a resource and
318
+ # keeping a subset of the attachments. Don't use this unless you know what you're
319
+ # doing.
320
+ id:
321
+ )
322
+ end
323
+
324
+ sig { override.returns({ id: String }) }
325
+ def to_hash
326
+ end
281
327
  end
282
328
 
283
329
  sig do
284
330
  override.returns(
285
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
331
+ T::Array[WhopSDK::CourseUpdateParams::Thumbnail::Variants]
286
332
  )
287
333
  end
288
- def to_hash
334
+ def self.variants
289
335
  end
290
336
  end
291
337
  end