whop_sdk 0.0.5 → 0.0.7

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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +4 -7
  4. data/lib/whop_sdk/client.rb +17 -6
  5. data/lib/whop_sdk/models/access_token_create_params.rb +26 -36
  6. data/lib/whop_sdk/models/card_brands.rb +1 -0
  7. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +9 -9
  8. data/lib/whop_sdk/models/company.rb +1 -0
  9. data/lib/whop_sdk/models/currency.rb +1 -0
  10. data/lib/whop_sdk/models/dispute.rb +672 -0
  11. data/lib/whop_sdk/models/dispute_created_webhook_event.rb +48 -0
  12. data/lib/whop_sdk/models/dispute_list_params.rb +62 -0
  13. data/lib/whop_sdk/models/dispute_list_response.rb +187 -0
  14. data/lib/whop_sdk/models/dispute_retrieve_params.rb +14 -0
  15. data/lib/whop_sdk/models/dispute_statuses.rb +23 -0
  16. data/lib/whop_sdk/models/dispute_submit_evidence_params.rb +14 -0
  17. data/lib/whop_sdk/models/dispute_update_evidence_params.rb +342 -0
  18. data/lib/whop_sdk/models/dispute_updated_webhook_event.rb +48 -0
  19. data/lib/whop_sdk/models/forum_post_create_params.rb +20 -1
  20. data/lib/whop_sdk/models/forum_post_update_params.rb +20 -1
  21. data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +1 -0
  22. data/lib/whop_sdk/models/notification_create_params.rb +88 -0
  23. data/lib/whop_sdk/models/notification_create_response.rb +19 -0
  24. data/lib/whop_sdk/models/shipment.rb +3 -3
  25. data/lib/whop_sdk/models/shipment_list_response.rb +3 -3
  26. data/lib/whop_sdk/models/unwrap_webhook_event.rb +5 -1
  27. data/lib/whop_sdk/models.rb +18 -0
  28. data/lib/whop_sdk/resources/access_tokens.rb +9 -7
  29. data/lib/whop_sdk/resources/disputes.rb +182 -0
  30. data/lib/whop_sdk/resources/forum_posts.rb +6 -2
  31. data/lib/whop_sdk/resources/notifications.rb +53 -0
  32. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  33. data/lib/whop_sdk/version.rb +1 -1
  34. data/lib/whop_sdk.rb +13 -0
  35. data/rbi/whop_sdk/client.rbi +11 -2
  36. data/rbi/whop_sdk/models/access_token_create_params.rbi +34 -77
  37. data/rbi/whop_sdk/models/card_brands.rbi +1 -0
  38. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +8 -8
  39. data/rbi/whop_sdk/models/company.rbi +2 -0
  40. data/rbi/whop_sdk/models/currency.rbi +1 -0
  41. data/rbi/whop_sdk/models/dispute.rbi +938 -0
  42. data/rbi/whop_sdk/models/dispute_created_webhook_event.rbi +72 -0
  43. data/rbi/whop_sdk/models/dispute_list_params.rbi +83 -0
  44. data/rbi/whop_sdk/models/dispute_list_response.rbi +287 -0
  45. data/rbi/whop_sdk/models/dispute_retrieve_params.rbi +27 -0
  46. data/rbi/whop_sdk/models/dispute_statuses.rbi +32 -0
  47. data/rbi/whop_sdk/models/dispute_submit_evidence_params.rbi +30 -0
  48. data/rbi/whop_sdk/models/dispute_update_evidence_params.rbi +566 -0
  49. data/rbi/whop_sdk/models/dispute_updated_webhook_event.rbi +72 -0
  50. data/rbi/whop_sdk/models/forum_post_create_params.rbi +42 -0
  51. data/rbi/whop_sdk/models/forum_post_update_params.rbi +42 -0
  52. data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +5 -0
  53. data/rbi/whop_sdk/models/notification_create_params.rbi +113 -0
  54. data/rbi/whop_sdk/models/notification_create_response.rbi +31 -0
  55. data/rbi/whop_sdk/models/shipment.rbi +6 -4
  56. data/rbi/whop_sdk/models/shipment_list_response.rbi +6 -4
  57. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -1
  58. data/rbi/whop_sdk/models.rbi +18 -0
  59. data/rbi/whop_sdk/resources/access_tokens.rbi +19 -14
  60. data/rbi/whop_sdk/resources/disputes.rbi +194 -0
  61. data/rbi/whop_sdk/resources/forum_posts.rbi +8 -0
  62. data/rbi/whop_sdk/resources/notifications.rbi +54 -0
  63. data/rbi/whop_sdk/resources/webhooks.rbi +3 -1
  64. data/sig/whop_sdk/client.rbs +5 -1
  65. data/sig/whop_sdk/models/access_token_create_params.rbs +14 -29
  66. data/sig/whop_sdk/models/card_brands.rbs +2 -0
  67. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +5 -5
  68. data/sig/whop_sdk/models/company.rbs +2 -0
  69. data/sig/whop_sdk/models/currency.rbs +2 -0
  70. data/sig/whop_sdk/models/dispute.rbs +437 -0
  71. data/sig/whop_sdk/models/dispute_created_webhook_event.rbs +40 -0
  72. data/sig/whop_sdk/models/dispute_list_params.rbs +51 -0
  73. data/sig/whop_sdk/models/dispute_list_response.rbs +124 -0
  74. data/sig/whop_sdk/models/dispute_retrieve_params.rbs +15 -0
  75. data/sig/whop_sdk/models/dispute_statuses.rbs +30 -0
  76. data/sig/whop_sdk/models/dispute_submit_evidence_params.rbs +15 -0
  77. data/sig/whop_sdk/models/dispute_update_evidence_params.rbs +215 -0
  78. data/sig/whop_sdk/models/dispute_updated_webhook_event.rbs +40 -0
  79. data/sig/whop_sdk/models/forum_post_create_params.rbs +17 -1
  80. data/sig/whop_sdk/models/forum_post_update_params.rbs +17 -1
  81. data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +2 -0
  82. data/sig/whop_sdk/models/notification_create_params.rbs +61 -0
  83. data/sig/whop_sdk/models/notification_create_response.rbs +13 -0
  84. data/sig/whop_sdk/models/shipment.rbs +4 -4
  85. data/sig/whop_sdk/models/shipment_list_response.rbs +4 -4
  86. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
  87. data/sig/whop_sdk/models.rbs +18 -0
  88. data/sig/whop_sdk/resources/access_tokens.rbs +3 -3
  89. data/sig/whop_sdk/resources/disputes.rbs +46 -0
  90. data/sig/whop_sdk/resources/forum_posts.rbs +2 -0
  91. data/sig/whop_sdk/resources/notifications.rbs +19 -0
  92. data/sig/whop_sdk/resources/webhooks.rbs +3 -1
  93. metadata +41 -2
@@ -39,6 +39,12 @@ module WhopSDK
39
39
  sig { returns(T.nilable(String)) }
40
40
  attr_accessor :title
41
41
 
42
+ # The visibility types for forum posts
43
+ sig do
44
+ returns(T.nilable(WhopSDK::ForumPostUpdateParams::Visibility::OrSymbol))
45
+ end
46
+ attr_accessor :visibility
47
+
42
48
  sig do
43
49
  params(
44
50
  attachments:
@@ -53,6 +59,8 @@ module WhopSDK
53
59
  content: T.nilable(String),
54
60
  is_pinned: T.nilable(T::Boolean),
55
61
  title: T.nilable(String),
62
+ visibility:
63
+ T.nilable(WhopSDK::ForumPostUpdateParams::Visibility::OrSymbol),
56
64
  request_options: WhopSDK::RequestOptions::OrHash
57
65
  ).returns(T.attached_class)
58
66
  end
@@ -66,6 +74,8 @@ module WhopSDK
66
74
  is_pinned: nil,
67
75
  # The title of the post. Only visible if paywalled.
68
76
  title: nil,
77
+ # The visibility types for forum posts
78
+ visibility: nil,
69
79
  request_options: {}
70
80
  )
71
81
  end
@@ -85,6 +95,8 @@ module WhopSDK
85
95
  content: T.nilable(String),
86
96
  is_pinned: T.nilable(T::Boolean),
87
97
  title: T.nilable(String),
98
+ visibility:
99
+ T.nilable(WhopSDK::ForumPostUpdateParams::Visibility::OrSymbol),
88
100
  request_options: WhopSDK::RequestOptions
89
101
  }
90
102
  )
@@ -172,6 +184,36 @@ module WhopSDK
172
184
  def self.variants
173
185
  end
174
186
  end
187
+
188
+ # The visibility types for forum posts
189
+ module Visibility
190
+ extend WhopSDK::Internal::Type::Enum
191
+
192
+ TaggedSymbol =
193
+ T.type_alias do
194
+ T.all(Symbol, WhopSDK::ForumPostUpdateParams::Visibility)
195
+ end
196
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
197
+
198
+ MEMBERS_ONLY =
199
+ T.let(
200
+ :members_only,
201
+ WhopSDK::ForumPostUpdateParams::Visibility::TaggedSymbol
202
+ )
203
+ GLOBALLY_VISIBLE =
204
+ T.let(
205
+ :globally_visible,
206
+ WhopSDK::ForumPostUpdateParams::Visibility::TaggedSymbol
207
+ )
208
+
209
+ sig do
210
+ override.returns(
211
+ T::Array[WhopSDK::ForumPostUpdateParams::Visibility::TaggedSymbol]
212
+ )
213
+ end
214
+ def self.values
215
+ end
216
+ end
175
217
  end
176
218
  end
177
219
  end
@@ -216,6 +216,11 @@ module WhopSDK
216
216
  :pending,
217
217
  WhopSDK::Models::LedgerAccountRetrieveResponse::LedgerAccountAuditStatus::TaggedSymbol
218
218
  )
219
+ PENDING_AI_REVIEW =
220
+ T.let(
221
+ :pending_ai_review,
222
+ WhopSDK::Models::LedgerAccountRetrieveResponse::LedgerAccountAuditStatus::TaggedSymbol
223
+ )
219
224
  APPROVED =
220
225
  T.let(
221
226
  :approved,
@@ -0,0 +1,113 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class NotificationCreateParams < 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(WhopSDK::NotificationCreateParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The id of the company to target. Only team members of this company will receive
15
+ # the notification. When clicked will take the user to your dashboard app view.
16
+ sig { returns(String) }
17
+ attr_accessor :company_id
18
+
19
+ # The content of the notification
20
+ sig { returns(String) }
21
+ attr_accessor :content
22
+
23
+ # The title of the notification
24
+ sig { returns(String) }
25
+ attr_accessor :title
26
+
27
+ # Optional: ID of a Whop user whose profile picture will be used as the
28
+ # notification icon. If not provided, defaults to the experience or company
29
+ # avatar.
30
+ sig { returns(T.nilable(String)) }
31
+ attr_accessor :icon_user_id
32
+
33
+ # The rest path to append to the generated deep link that opens your app. Use
34
+ # [restPath] in your app path in the dashboard to read this parameter.
35
+ sig { returns(T.nilable(String)) }
36
+ attr_accessor :rest_path
37
+
38
+ # The subtitle of the notification
39
+ sig { returns(T.nilable(String)) }
40
+ attr_accessor :subtitle
41
+
42
+ # If provided, this will only send to these users if they are also in the main
43
+ # scope (experience or company)
44
+ sig { returns(T.nilable(T::Array[String])) }
45
+ attr_accessor :user_ids
46
+
47
+ # The id of the experience to target. All users with access to this experience
48
+ # (customers and admins) will receive the notification. When clicked, open your
49
+ # experience view.
50
+ sig { returns(String) }
51
+ attr_accessor :experience_id
52
+
53
+ sig do
54
+ params(
55
+ company_id: String,
56
+ content: String,
57
+ title: String,
58
+ experience_id: String,
59
+ icon_user_id: T.nilable(String),
60
+ rest_path: T.nilable(String),
61
+ subtitle: T.nilable(String),
62
+ user_ids: T.nilable(T::Array[String]),
63
+ request_options: WhopSDK::RequestOptions::OrHash
64
+ ).returns(T.attached_class)
65
+ end
66
+ def self.new(
67
+ # The id of the company to target. Only team members of this company will receive
68
+ # the notification. When clicked will take the user to your dashboard app view.
69
+ company_id:,
70
+ # The content of the notification
71
+ content:,
72
+ # The title of the notification
73
+ title:,
74
+ # The id of the experience to target. All users with access to this experience
75
+ # (customers and admins) will receive the notification. When clicked, open your
76
+ # experience view.
77
+ experience_id:,
78
+ # Optional: ID of a Whop user whose profile picture will be used as the
79
+ # notification icon. If not provided, defaults to the experience or company
80
+ # avatar.
81
+ icon_user_id: nil,
82
+ # The rest path to append to the generated deep link that opens your app. Use
83
+ # [restPath] in your app path in the dashboard to read this parameter.
84
+ rest_path: nil,
85
+ # The subtitle of the notification
86
+ subtitle: nil,
87
+ # If provided, this will only send to these users if they are also in the main
88
+ # scope (experience or company)
89
+ user_ids: nil,
90
+ request_options: {}
91
+ )
92
+ end
93
+
94
+ sig do
95
+ override.returns(
96
+ {
97
+ company_id: String,
98
+ content: String,
99
+ title: String,
100
+ icon_user_id: T.nilable(String),
101
+ rest_path: T.nilable(String),
102
+ subtitle: T.nilable(String),
103
+ user_ids: T.nilable(T::Array[String]),
104
+ experience_id: String,
105
+ request_options: WhopSDK::RequestOptions
106
+ }
107
+ )
108
+ end
109
+ def to_hash
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,31 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class NotificationCreateResponse < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ WhopSDK::Models::NotificationCreateResponse,
10
+ WhopSDK::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Whether the notification was successfully queued for delivery
15
+ sig { returns(T::Boolean) }
16
+ attr_accessor :success
17
+
18
+ # Response from queuing a notification
19
+ sig { params(success: T::Boolean).returns(T.attached_class) }
20
+ def self.new(
21
+ # Whether the notification was successfully queued for delivery
22
+ success:
23
+ )
24
+ end
25
+
26
+ sig { override.returns({ success: T::Boolean }) }
27
+ def to_hash
28
+ end
29
+ end
30
+ end
31
+ end
@@ -23,10 +23,12 @@ module WhopSDK
23
23
  attr_accessor :delivery_estimate
24
24
 
25
25
  # The payment of the shipment
26
- sig { returns(WhopSDK::Shipment::Payment) }
26
+ sig { returns(T.nilable(WhopSDK::Shipment::Payment)) }
27
27
  attr_reader :payment
28
28
 
29
- sig { params(payment: WhopSDK::Shipment::Payment::OrHash).void }
29
+ sig do
30
+ params(payment: T.nilable(WhopSDK::Shipment::Payment::OrHash)).void
31
+ end
30
32
  attr_writer :payment
31
33
 
32
34
  # The service of the shipment
@@ -56,7 +58,7 @@ module WhopSDK
56
58
  carrier: WhopSDK::ShipmentCarrier::OrSymbol,
57
59
  created_at: Time,
58
60
  delivery_estimate: T.nilable(Time),
59
- payment: WhopSDK::Shipment::Payment::OrHash,
61
+ payment: T.nilable(WhopSDK::Shipment::Payment::OrHash),
60
62
  service: T.nilable(String),
61
63
  status: WhopSDK::ShipmentStatus::OrSymbol,
62
64
  substatus: T.nilable(WhopSDK::ShipmentSubstatus::OrSymbol),
@@ -95,7 +97,7 @@ module WhopSDK
95
97
  carrier: WhopSDK::ShipmentCarrier::TaggedSymbol,
96
98
  created_at: Time,
97
99
  delivery_estimate: T.nilable(Time),
98
- payment: WhopSDK::Shipment::Payment,
100
+ payment: T.nilable(WhopSDK::Shipment::Payment),
99
101
  service: T.nilable(String),
100
102
  status: WhopSDK::ShipmentStatus::TaggedSymbol,
101
103
  substatus: T.nilable(WhopSDK::ShipmentSubstatus::TaggedSymbol),
@@ -28,12 +28,13 @@ module WhopSDK
28
28
  attr_accessor :delivery_estimate
29
29
 
30
30
  # The payment of the shipment
31
- sig { returns(WhopSDK::Models::ShipmentListResponse::Payment) }
31
+ sig { returns(T.nilable(WhopSDK::Models::ShipmentListResponse::Payment)) }
32
32
  attr_reader :payment
33
33
 
34
34
  sig do
35
35
  params(
36
- payment: WhopSDK::Models::ShipmentListResponse::Payment::OrHash
36
+ payment:
37
+ T.nilable(WhopSDK::Models::ShipmentListResponse::Payment::OrHash)
37
38
  ).void
38
39
  end
39
40
  attr_writer :payment
@@ -65,7 +66,8 @@ module WhopSDK
65
66
  carrier: WhopSDK::ShipmentCarrier::OrSymbol,
66
67
  created_at: Time,
67
68
  delivery_estimate: T.nilable(Time),
68
- payment: WhopSDK::Models::ShipmentListResponse::Payment::OrHash,
69
+ payment:
70
+ T.nilable(WhopSDK::Models::ShipmentListResponse::Payment::OrHash),
69
71
  service: T.nilable(String),
70
72
  status: WhopSDK::ShipmentStatus::OrSymbol,
71
73
  substatus: T.nilable(WhopSDK::ShipmentSubstatus::OrSymbol),
@@ -104,7 +106,7 @@ module WhopSDK
104
106
  carrier: WhopSDK::ShipmentCarrier::TaggedSymbol,
105
107
  created_at: Time,
106
108
  delivery_estimate: T.nilable(Time),
107
- payment: WhopSDK::Models::ShipmentListResponse::Payment,
109
+ payment: T.nilable(WhopSDK::Models::ShipmentListResponse::Payment),
108
110
  service: T.nilable(String),
109
111
  status: WhopSDK::ShipmentStatus::TaggedSymbol,
110
112
  substatus: T.nilable(WhopSDK::ShipmentSubstatus::TaggedSymbol),
@@ -21,7 +21,9 @@ module WhopSDK
21
21
  WhopSDK::CourseLessonInteractionCompletedWebhookEvent,
22
22
  WhopSDK::PaymentSucceededWebhookEvent,
23
23
  WhopSDK::PaymentFailedWebhookEvent,
24
- WhopSDK::PaymentPendingWebhookEvent
24
+ WhopSDK::PaymentPendingWebhookEvent,
25
+ WhopSDK::DisputeCreatedWebhookEvent,
26
+ WhopSDK::DisputeUpdatedWebhookEvent
25
27
  )
26
28
  end
27
29
 
@@ -138,6 +138,22 @@ module WhopSDK
138
138
 
139
139
  Direction = WhopSDK::Models::Direction
140
140
 
141
+ Dispute = WhopSDK::Models::Dispute
142
+
143
+ DisputeCreatedWebhookEvent = WhopSDK::Models::DisputeCreatedWebhookEvent
144
+
145
+ DisputeListParams = WhopSDK::Models::DisputeListParams
146
+
147
+ DisputeRetrieveParams = WhopSDK::Models::DisputeRetrieveParams
148
+
149
+ DisputeStatuses = WhopSDK::Models::DisputeStatuses
150
+
151
+ DisputeSubmitEvidenceParams = WhopSDK::Models::DisputeSubmitEvidenceParams
152
+
153
+ DisputeUpdatedWebhookEvent = WhopSDK::Models::DisputeUpdatedWebhookEvent
154
+
155
+ DisputeUpdateEvidenceParams = WhopSDK::Models::DisputeUpdateEvidenceParams
156
+
141
157
  DmsPostTypes = WhopSDK::Models::DmsPostTypes
142
158
 
143
159
  EmailNotificationPreferences = WhopSDK::Models::EmailNotificationPreferences
@@ -278,6 +294,8 @@ module WhopSDK
278
294
 
279
295
  MessageUpdateParams = WhopSDK::Models::MessageUpdateParams
280
296
 
297
+ NotificationCreateParams = WhopSDK::Models::NotificationCreateParams
298
+
281
299
  PageInfo = WhopSDK::Models::PageInfo
282
300
 
283
301
  Payment = WhopSDK::Models::Payment
@@ -3,31 +3,36 @@
3
3
  module WhopSDK
4
4
  module Resources
5
5
  class AccessTokens
6
- # Creates an access token for a user to access a specific resource. These access
7
- # tokens are designed to be used with Whop's embedded components.
6
+ # Create a short-lived access token to authenticate API requests on behalf of a
7
+ # Company or User. This token should be used with Whop's web and mobile embedded
8
+ # components. You must provide either a company_id or a user_id argument, but not
9
+ # both.
8
10
  sig do
9
11
  params(
10
- scoped_actions: T::Array[String],
11
- target_resource_id: String,
12
- target_resource_type:
13
- WhopSDK::AccessTokenCreateParams::TargetResourceType::OrSymbol,
12
+ company_id: String,
13
+ user_id: String,
14
14
  expires_at: T.nilable(Time),
15
+ scoped_actions: T.nilable(T::Array[String]),
15
16
  request_options: WhopSDK::RequestOptions::OrHash
16
17
  ).returns(WhopSDK::Models::AccessTokenCreateResponse)
17
18
  end
18
19
  def create(
19
- # Array of desired scoped actions for the access token. This list must be a subset
20
- # of the API keys's existing permissions. Otherwise, an error will be raised.
21
- scoped_actions:,
22
- # The ID of the target resource (Company, User, etc.) for which the access token
23
- # is being created.
24
- target_resource_id:,
25
- # The type of the target resource (company, user, product, experience, etc.).
26
- target_resource_type:,
20
+ # The ID of the Company to generate the token for. The API key must have
21
+ # permission to access this Company, such as the being the company the API key
22
+ # belongs to or a sub-merchant of it
23
+ company_id:,
24
+ # The ID of the User to generate the token for. The API key must have permission
25
+ # to access this User.
26
+ user_id:,
27
27
  # The expiration timestamp for the access token. If not provided, a default
28
28
  # expiration time of 1 hour will be used. The expiration can be set to a maximum
29
29
  # of 3 hours from the current time.
30
30
  expires_at: nil,
31
+ # Array of desired scoped actions for the access token. If sent as an empty array
32
+ # or not provided, all permissions from the API key making the request will be
33
+ # available on the token. If sending an explicit list, they must be a subset of
34
+ # the API keys's existing permissions. Otherwise, an error will be raised.
35
+ scoped_actions: nil,
31
36
  request_options: {}
32
37
  )
33
38
  end
@@ -0,0 +1,194 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Resources
5
+ class Disputes
6
+ # Retrieves a Dispute by ID
7
+ #
8
+ # Required permissions:
9
+ #
10
+ # - `payment:dispute:read`
11
+ # - `plan:basic:read`
12
+ # - `access_pass:basic:read`
13
+ # - `company:basic:read`
14
+ # - `payment:basic:read`
15
+ # - `member:email:read`
16
+ # - `member:basic:read`
17
+ # - `member:phone:read`
18
+ sig do
19
+ params(
20
+ id: String,
21
+ request_options: WhopSDK::RequestOptions::OrHash
22
+ ).returns(WhopSDK::Dispute)
23
+ end
24
+ def retrieve(
25
+ # The ID of the dispute
26
+ id,
27
+ request_options: {}
28
+ )
29
+ end
30
+
31
+ # Lists disputes the current actor has access to
32
+ #
33
+ # Required permissions:
34
+ #
35
+ # - `payment:dispute:read`
36
+ # - `plan:basic:read`
37
+ # - `access_pass:basic:read`
38
+ # - `company:basic:read`
39
+ # - `payment:basic:read`
40
+ sig do
41
+ params(
42
+ company_id: String,
43
+ after: T.nilable(String),
44
+ before: T.nilable(String),
45
+ direction: T.nilable(WhopSDK::Direction::OrSymbol),
46
+ first: T.nilable(Integer),
47
+ last: T.nilable(Integer),
48
+ request_options: WhopSDK::RequestOptions::OrHash
49
+ ).returns(
50
+ WhopSDK::Internal::CursorPage[WhopSDK::Models::DisputeListResponse]
51
+ )
52
+ end
53
+ def list(
54
+ # The ID of the company to list disputes for
55
+ company_id:,
56
+ # Returns the elements in the list that come after the specified cursor.
57
+ after: nil,
58
+ # Returns the elements in the list that come before the specified cursor.
59
+ before: nil,
60
+ # The direction of the sort.
61
+ direction: nil,
62
+ # Returns the first _n_ elements from the list.
63
+ first: nil,
64
+ # Returns the last _n_ elements from the list.
65
+ last: nil,
66
+ request_options: {}
67
+ )
68
+ end
69
+
70
+ # Submit a payment dispute to the payment processor for review. Once submitted, no
71
+ # further edits can be made.
72
+ #
73
+ # Required permissions:
74
+ #
75
+ # - `payment:dispute`
76
+ # - `plan:basic:read`
77
+ # - `access_pass:basic:read`
78
+ # - `company:basic:read`
79
+ # - `payment:basic:read`
80
+ # - `member:email:read`
81
+ # - `member:basic:read`
82
+ # - `member:phone:read`
83
+ sig do
84
+ params(
85
+ id: String,
86
+ request_options: WhopSDK::RequestOptions::OrHash
87
+ ).returns(WhopSDK::Dispute)
88
+ end
89
+ def submit_evidence(
90
+ # The ID of the dispute (Ex. dspt_xxxx) you want to finalize evidence submission
91
+ # for and send to the processor.
92
+ id,
93
+ request_options: {}
94
+ )
95
+ end
96
+
97
+ # Update a dispute with evidence data to attempt to win the dispute.
98
+ #
99
+ # Required permissions:
100
+ #
101
+ # - `payment:dispute`
102
+ # - `plan:basic:read`
103
+ # - `access_pass:basic:read`
104
+ # - `company:basic:read`
105
+ # - `payment:basic:read`
106
+ # - `member:email:read`
107
+ # - `member:basic:read`
108
+ # - `member:phone:read`
109
+ sig do
110
+ params(
111
+ id: String,
112
+ access_activity_log: T.nilable(String),
113
+ billing_address: T.nilable(String),
114
+ cancellation_policy_attachment:
115
+ T.nilable(
116
+ T.any(
117
+ WhopSDK::DisputeUpdateEvidenceParams::CancellationPolicyAttachment::AttachmentInputWithDirectUploadID::OrHash,
118
+ WhopSDK::DisputeUpdateEvidenceParams::CancellationPolicyAttachment::AttachmentInputWithID::OrHash
119
+ )
120
+ ),
121
+ cancellation_policy_disclosure: T.nilable(String),
122
+ customer_communication_attachment:
123
+ T.nilable(
124
+ T.any(
125
+ WhopSDK::DisputeUpdateEvidenceParams::CustomerCommunicationAttachment::AttachmentInputWithDirectUploadID::OrHash,
126
+ WhopSDK::DisputeUpdateEvidenceParams::CustomerCommunicationAttachment::AttachmentInputWithID::OrHash
127
+ )
128
+ ),
129
+ customer_email_address: T.nilable(String),
130
+ customer_name: T.nilable(String),
131
+ notes: T.nilable(String),
132
+ product_description: T.nilable(String),
133
+ refund_policy_attachment:
134
+ T.nilable(
135
+ T.any(
136
+ WhopSDK::DisputeUpdateEvidenceParams::RefundPolicyAttachment::AttachmentInputWithDirectUploadID::OrHash,
137
+ WhopSDK::DisputeUpdateEvidenceParams::RefundPolicyAttachment::AttachmentInputWithID::OrHash
138
+ )
139
+ ),
140
+ refund_policy_disclosure: T.nilable(String),
141
+ refund_refusal_explanation: T.nilable(String),
142
+ service_date: T.nilable(String),
143
+ uncategorized_attachment:
144
+ T.nilable(
145
+ T.any(
146
+ WhopSDK::DisputeUpdateEvidenceParams::UncategorizedAttachment::AttachmentInputWithDirectUploadID::OrHash,
147
+ WhopSDK::DisputeUpdateEvidenceParams::UncategorizedAttachment::AttachmentInputWithID::OrHash
148
+ )
149
+ ),
150
+ request_options: WhopSDK::RequestOptions::OrHash
151
+ ).returns(WhopSDK::Dispute)
152
+ end
153
+ def update_evidence(
154
+ # The ID of the dispute you want to update.
155
+ id,
156
+ # An IP access log for the user from Whop.
157
+ access_activity_log: nil,
158
+ # The billing address of the user from their payment details.
159
+ billing_address: nil,
160
+ # A file containing the cancellation policy from the company.
161
+ cancellation_policy_attachment: nil,
162
+ # A cancellation policy disclosure from the company.
163
+ cancellation_policy_disclosure: nil,
164
+ # A file containing the customer communication from the company (An image).
165
+ customer_communication_attachment: nil,
166
+ # The email of the customer from their payment details.
167
+ customer_email_address: nil,
168
+ # The name of the customer from their payment details.
169
+ customer_name: nil,
170
+ # Additional notes the company chooses to submit regarding the dispute.
171
+ notes: nil,
172
+ # The description of the product from the company.
173
+ product_description: nil,
174
+ # A file containing the refund policy from the company.
175
+ refund_policy_attachment: nil,
176
+ # A refund policy disclosure from the company.
177
+ refund_policy_disclosure: nil,
178
+ # A description on why the refund is being refused by the company.
179
+ refund_refusal_explanation: nil,
180
+ # When the product was delivered by the company.
181
+ service_date: nil,
182
+ # A file that does not fit in the other categories.
183
+ uncategorized_attachment: nil,
184
+ request_options: {}
185
+ )
186
+ end
187
+
188
+ # @api private
189
+ sig { params(client: WhopSDK::Client).returns(T.attached_class) }
190
+ def self.new(client:)
191
+ end
192
+ end
193
+ end
194
+ end
@@ -28,6 +28,8 @@ module WhopSDK
28
28
  pinned: T.nilable(T::Boolean),
29
29
  poll: T.nilable(WhopSDK::ForumPostCreateParams::Poll::OrHash),
30
30
  title: T.nilable(String),
31
+ visibility:
32
+ T.nilable(WhopSDK::ForumPostCreateParams::Visibility::OrSymbol),
31
33
  request_options: WhopSDK::RequestOptions::OrHash
32
34
  ).returns(WhopSDK::ForumPost)
33
35
  end
@@ -57,6 +59,8 @@ module WhopSDK
57
59
  poll: nil,
58
60
  # The title of the post. Only visible if paywalled.
59
61
  title: nil,
62
+ # The visibility types for forum posts
63
+ visibility: nil,
60
64
  request_options: {}
61
65
  )
62
66
  end
@@ -95,6 +99,8 @@ module WhopSDK
95
99
  content: T.nilable(String),
96
100
  is_pinned: T.nilable(T::Boolean),
97
101
  title: T.nilable(String),
102
+ visibility:
103
+ T.nilable(WhopSDK::ForumPostUpdateParams::Visibility::OrSymbol),
98
104
  request_options: WhopSDK::RequestOptions::OrHash
99
105
  ).returns(WhopSDK::ForumPost)
100
106
  end
@@ -110,6 +116,8 @@ module WhopSDK
110
116
  is_pinned: nil,
111
117
  # The title of the post. Only visible if paywalled.
112
118
  title: nil,
119
+ # The visibility types for forum posts
120
+ visibility: nil,
113
121
  request_options: {}
114
122
  )
115
123
  end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Resources
5
+ class Notifications
6
+ # Queues a notification to be sent to users in an experience or company team
7
+ sig do
8
+ params(
9
+ company_id: String,
10
+ content: String,
11
+ title: String,
12
+ experience_id: String,
13
+ icon_user_id: T.nilable(String),
14
+ rest_path: T.nilable(String),
15
+ subtitle: T.nilable(String),
16
+ user_ids: T.nilable(T::Array[String]),
17
+ request_options: WhopSDK::RequestOptions::OrHash
18
+ ).returns(WhopSDK::Models::NotificationCreateResponse)
19
+ end
20
+ def create(
21
+ # The id of the company to target. Only team members of this company will receive
22
+ # the notification. When clicked will take the user to your dashboard app view.
23
+ company_id:,
24
+ # The content of the notification
25
+ content:,
26
+ # The title of the notification
27
+ title:,
28
+ # The id of the experience to target. All users with access to this experience
29
+ # (customers and admins) will receive the notification. When clicked, open your
30
+ # experience view.
31
+ experience_id:,
32
+ # Optional: ID of a Whop user whose profile picture will be used as the
33
+ # notification icon. If not provided, defaults to the experience or company
34
+ # avatar.
35
+ icon_user_id: nil,
36
+ # The rest path to append to the generated deep link that opens your app. Use
37
+ # [restPath] in your app path in the dashboard to read this parameter.
38
+ rest_path: nil,
39
+ # The subtitle of the notification
40
+ subtitle: nil,
41
+ # If provided, this will only send to these users if they are also in the main
42
+ # scope (experience or company)
43
+ user_ids: nil,
44
+ request_options: {}
45
+ )
46
+ end
47
+
48
+ # @api private
49
+ sig { params(client: WhopSDK::Client).returns(T.attached_class) }
50
+ def self.new(client:)
51
+ end
52
+ end
53
+ end
54
+ end