whop_sdk 0.0.6 → 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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/models/access_token_create_params.rb +26 -36
  5. data/lib/whop_sdk/models/card_brands.rb +1 -0
  6. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +9 -9
  7. data/lib/whop_sdk/models/currency.rb +1 -0
  8. data/lib/whop_sdk/models/forum_post_create_params.rb +20 -1
  9. data/lib/whop_sdk/models/forum_post_update_params.rb +20 -1
  10. data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +1 -0
  11. data/lib/whop_sdk/models/shipment.rb +3 -3
  12. data/lib/whop_sdk/models/shipment_list_response.rb +3 -3
  13. data/lib/whop_sdk/resources/access_tokens.rb +9 -7
  14. data/lib/whop_sdk/resources/forum_posts.rb +6 -2
  15. data/lib/whop_sdk/version.rb +1 -1
  16. data/rbi/whop_sdk/models/access_token_create_params.rbi +34 -77
  17. data/rbi/whop_sdk/models/card_brands.rbi +1 -0
  18. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +8 -8
  19. data/rbi/whop_sdk/models/currency.rbi +1 -0
  20. data/rbi/whop_sdk/models/forum_post_create_params.rbi +42 -0
  21. data/rbi/whop_sdk/models/forum_post_update_params.rbi +42 -0
  22. data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +5 -0
  23. data/rbi/whop_sdk/models/shipment.rbi +6 -4
  24. data/rbi/whop_sdk/models/shipment_list_response.rbi +6 -4
  25. data/rbi/whop_sdk/resources/access_tokens.rbi +19 -14
  26. data/rbi/whop_sdk/resources/forum_posts.rbi +8 -0
  27. data/sig/whop_sdk/models/access_token_create_params.rbs +14 -29
  28. data/sig/whop_sdk/models/card_brands.rbs +2 -0
  29. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +5 -5
  30. data/sig/whop_sdk/models/currency.rbs +2 -0
  31. data/sig/whop_sdk/models/forum_post_create_params.rbs +17 -1
  32. data/sig/whop_sdk/models/forum_post_update_params.rbs +17 -1
  33. data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +2 -0
  34. data/sig/whop_sdk/models/shipment.rbs +4 -4
  35. data/sig/whop_sdk/models/shipment_list_response.rbs +4 -4
  36. data/sig/whop_sdk/resources/access_tokens.rbs +3 -3
  37. data/sig/whop_sdk/resources/forum_posts.rbs +2 -0
  38. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 732d86cb6f20a898b79b19dc92e2404632edcf05d822e0e1b7b922647b61e932
4
- data.tar.gz: c056debc5fdb1000cd5262befd3fced0a578b45ad0ac8010e11b6ea9cd9cad14
3
+ metadata.gz: 3eecc254b8ba9c6ee8fd458763a9749b1478efc921f4f3c696823cae79f31a1c
4
+ data.tar.gz: 0b085d7a2c1551bc99016a562266d326312f8da3b3a6104a08426677f9b89c1e
5
5
  SHA512:
6
- metadata.gz: b2763f3095b8e970464194a4eb59e86b69e8459a0efca643db385d1cc0ae01fd0c78cf0f6587be07a27320e4bd4040a4c0249fc11a7661c58396a9e273f10ddc
7
- data.tar.gz: d79ef16946f2a1e1fe950af483e8c4beceb50eb026ebf872ef1662bfcdb72b03d6051cb3a89e84ec17de393ea352ee77e799447945a3759fd2429aef6389ed89
6
+ metadata.gz: 4ed891547df3d339cbec397a7d78e55e7c00610187dc5cb80acf05e6fc2e93e0952020f55723e98b2f5230a220424d3bdf8498f70ac472f8f5e2aed37dfa0e6e
7
+ data.tar.gz: 9d9ca43b7fc87ff4df8a9e050d15503631e25070369381116c362b6cae95cf0740de7a3488325538928974349c1687e7147f729d8794bbbe44ca2ef79b125259
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.7 (2025-11-13)
4
+
5
+ Full Changelog: [v0.0.6...v0.0.7](https://github.com/whopio/whopsdk-ruby/compare/v0.0.6...v0.0.7)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([ebffee5](https://github.com/whopio/whopsdk-ruby/commit/ebffee5d68b29d6a7219b6f5446229c1734a9c58))
10
+ * **api:** api update ([9984831](https://github.com/whopio/whopsdk-ruby/commit/9984831a51353e776c0e3dd6c4e58bc7ecf94cb3))
11
+ * **api:** api update ([89cb635](https://github.com/whopio/whopsdk-ruby/commit/89cb635fcb034579638e5946bf7d773639848f80))
12
+ * **api:** api update ([71c9708](https://github.com/whopio/whopsdk-ruby/commit/71c9708ff5359af68c59e22eafe8c9b2af8be588))
13
+ * **api:** api update ([f0ed1e2](https://github.com/whopio/whopsdk-ruby/commit/f0ed1e29b2293b5bb408b7d3c12722df36add5b7))
14
+ * **api:** api update ([117f8ff](https://github.com/whopio/whopsdk-ruby/commit/117f8ff26be6ccd0e004d74e65c3ad866ae31d64))
15
+
3
16
  ## 0.0.6 (2025-11-10)
4
17
 
5
18
  Full Changelog: [v0.0.5...v0.0.6](https://github.com/whopio/whopsdk-ruby/compare/v0.0.5...v0.0.6)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "whop_sdk", "~> 0.0.6"
20
+ gem "whop_sdk", "~> 0.0.7"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -7,25 +7,13 @@ module WhopSDK
7
7
  extend WhopSDK::Internal::Type::RequestParameters::Converter
8
8
  include WhopSDK::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute scoped_actions
11
- # Array of desired scoped actions for the access token. This list must be a subset
12
- # of the API keys's existing permissions. Otherwise, an error will be raised.
13
- #
14
- # @return [Array<String>]
15
- required :scoped_actions, WhopSDK::Internal::Type::ArrayOf[String]
16
-
17
- # @!attribute target_resource_id
18
- # The ID of the target resource (Company, User, etc.) for which the access token
19
- # is being created.
10
+ # @!attribute company_id
11
+ # The ID of the Company to generate the token for. The API key must have
12
+ # permission to access this Company, such as the being the company the API key
13
+ # belongs to or a sub-merchant of it
20
14
  #
21
15
  # @return [String]
22
- required :target_resource_id, String
23
-
24
- # @!attribute target_resource_type
25
- # The type of the target resource (company, user, product, experience, etc.).
26
- #
27
- # @return [Symbol, WhopSDK::Models::AccessTokenCreateParams::TargetResourceType]
28
- required :target_resource_type, enum: -> { WhopSDK::AccessTokenCreateParams::TargetResourceType }
16
+ required :company_id, String
29
17
 
30
18
  # @!attribute expires_at
31
19
  # The expiration timestamp for the access token. If not provided, a default
@@ -35,33 +23,35 @@ module WhopSDK
35
23
  # @return [Time, nil]
36
24
  optional :expires_at, Time, nil?: true
37
25
 
38
- # @!method initialize(scoped_actions:, target_resource_id:, target_resource_type:, expires_at: nil, request_options: {})
26
+ # @!attribute scoped_actions
27
+ # Array of desired scoped actions for the access token. If sent as an empty array
28
+ # or not provided, all permissions from the API key making the request will be
29
+ # available on the token. If sending an explicit list, they must be a subset of
30
+ # the API keys's existing permissions. Otherwise, an error will be raised.
31
+ #
32
+ # @return [Array<String>, nil]
33
+ optional :scoped_actions, WhopSDK::Internal::Type::ArrayOf[String], nil?: true
34
+
35
+ # @!attribute user_id
36
+ # The ID of the User to generate the token for. The API key must have permission
37
+ # to access this User.
38
+ #
39
+ # @return [String]
40
+ required :user_id, String
41
+
42
+ # @!method initialize(company_id:, user_id:, expires_at: nil, scoped_actions: nil, request_options: {})
39
43
  # Some parameter documentations has been truncated, see
40
44
  # {WhopSDK::Models::AccessTokenCreateParams} for more details.
41
45
  #
42
- # @param scoped_actions [Array<String>] Array of desired scoped actions for the access token. This list must be a subset
43
- #
44
- # @param target_resource_id [String] The ID of the target resource (Company, User, etc.) for which the access token i
46
+ # @param company_id [String] The ID of the Company to generate the token for. The API key must have permissio
45
47
  #
46
- # @param target_resource_type [Symbol, WhopSDK::Models::AccessTokenCreateParams::TargetResourceType] The type of the target resource (company, user, product, experience, etc.).
48
+ # @param user_id [String] The ID of the User to generate the token for. The API key must have permission t
47
49
  #
48
50
  # @param expires_at [Time, nil] The expiration timestamp for the access token. If not provided, a default expira
49
51
  #
52
+ # @param scoped_actions [Array<String>, nil] Array of desired scoped actions for the access token. If sent as an empty array
53
+ #
50
54
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
51
-
52
- # The type of the target resource (company, user, product, experience, etc.).
53
- module TargetResourceType
54
- extend WhopSDK::Internal::Type::Enum
55
-
56
- COMPANY = :company
57
- PRODUCT = :product
58
- EXPERIENCE = :experience
59
- APP = :app
60
- USER = :user
61
-
62
- # @!method self.values
63
- # @return [Array<Symbol>]
64
- end
65
55
  end
66
56
  end
67
57
  end
@@ -21,6 +21,7 @@ module WhopSDK
21
21
  RUPAY = :rupay
22
22
  JCBRUPAY = :jcbrupay
23
23
  ELO = :elo
24
+ MAESTRO = :maestro
24
25
  UNKNOWN = :unknown
25
26
 
26
27
  # @!method self.values
@@ -57,18 +57,18 @@ module WhopSDK
57
57
  # @return [String]
58
58
  required :company_id, String
59
59
 
60
+ # @!attribute currency
61
+ # The respective currency identifier for the plan.
62
+ #
63
+ # @return [Symbol, WhopSDK::Models::Currency]
64
+ required :currency, enum: -> { WhopSDK::Currency }
65
+
60
66
  # @!attribute billing_period
61
67
  # The interval at which the plan charges (renewal plans).
62
68
  #
63
69
  # @return [Integer, nil]
64
70
  optional :billing_period, Integer, nil?: true
65
71
 
66
- # @!attribute currency
67
- # The available currencies on the platform
68
- #
69
- # @return [Symbol, WhopSDK::Models::Currency, nil]
70
- optional :currency, enum: -> { WhopSDK::Currency }, nil?: true
71
-
72
72
  # @!attribute custom_fields
73
73
  # An array of custom field objects.
74
74
  #
@@ -181,7 +181,7 @@ module WhopSDK
181
181
  # @return [Symbol, WhopSDK::Models::Visibility, nil]
182
182
  optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true
183
183
 
184
- # @!method initialize(company_id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, force_create_new_plan: nil, image: nil, initial_price: nil, internal_notes: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, product: nil, product_id: nil, release_method: nil, renewal_price: nil, title: nil, trial_period_days: nil, visibility: nil)
184
+ # @!method initialize(company_id:, currency:, billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, force_create_new_plan: nil, image: nil, initial_price: nil, internal_notes: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, product: nil, product_id: nil, release_method: nil, renewal_price: nil, title: nil, trial_period_days: nil, visibility: nil)
185
185
  # Some parameter documentations has been truncated, see
186
186
  # {WhopSDK::Models::CheckoutConfigurationCreateParams::Plan} for more details.
187
187
  #
@@ -189,9 +189,9 @@ module WhopSDK
189
189
  #
190
190
  # @param company_id [String] The company the plan should be created for.
191
191
  #
192
- # @param billing_period [Integer, nil] The interval at which the plan charges (renewal plans).
192
+ # @param currency [Symbol, WhopSDK::Models::Currency] The respective currency identifier for the plan.
193
193
  #
194
- # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform
194
+ # @param billing_period [Integer, nil] The interval at which the plan charges (renewal plans).
195
195
  #
196
196
  # @param custom_fields [Array<WhopSDK::Models::CheckoutConfigurationCreateParams::Plan::CustomField>, nil] An array of custom field objects.
197
197
  #
@@ -90,6 +90,7 @@ module WhopSDK
90
90
  UZS = :uzs
91
91
  RUB = :rub
92
92
  BTC = :btc
93
+ CNY = :cny
93
94
 
94
95
  # @!method self.values
95
96
  # @return [Array<Symbol>]
@@ -74,7 +74,13 @@ module WhopSDK
74
74
  # @return [String, nil]
75
75
  optional :title, String, nil?: true
76
76
 
77
- # @!method initialize(experience_id:, attachments: nil, content: nil, is_mention: nil, parent_id: nil, paywall_amount: nil, paywall_currency: nil, pinned: nil, poll: nil, title: nil, request_options: {})
77
+ # @!attribute visibility
78
+ # The visibility types for forum posts
79
+ #
80
+ # @return [Symbol, WhopSDK::Models::ForumPostCreateParams::Visibility, nil]
81
+ optional :visibility, enum: -> { WhopSDK::ForumPostCreateParams::Visibility }, nil?: true
82
+
83
+ # @!method initialize(experience_id:, attachments: nil, content: nil, is_mention: nil, parent_id: nil, paywall_amount: nil, paywall_currency: nil, pinned: nil, poll: nil, title: nil, visibility: nil, request_options: {})
78
84
  # Some parameter documentations has been truncated, see
79
85
  # {WhopSDK::Models::ForumPostCreateParams} for more details.
80
86
  #
@@ -98,6 +104,8 @@ module WhopSDK
98
104
  #
99
105
  # @param title [String, nil] The title of the post. Only visible if paywalled.
100
106
  #
107
+ # @param visibility [Symbol, WhopSDK::Models::ForumPostCreateParams::Visibility, nil] The visibility types for forum posts
108
+ #
101
109
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
102
110
 
103
111
  # Input for an attachment
@@ -185,6 +193,17 @@ module WhopSDK
185
193
  # @param text [String] The text of the poll option
186
194
  end
187
195
  end
196
+
197
+ # The visibility types for forum posts
198
+ module Visibility
199
+ extend WhopSDK::Internal::Type::Enum
200
+
201
+ MEMBERS_ONLY = :members_only
202
+ GLOBALLY_VISIBLE = :globally_visible
203
+
204
+ # @!method self.values
205
+ # @return [Array<Symbol>]
206
+ end
188
207
  end
189
208
  end
190
209
  end
@@ -34,7 +34,13 @@ module WhopSDK
34
34
  # @return [String, nil]
35
35
  optional :title, String, nil?: true
36
36
 
37
- # @!method initialize(attachments: nil, content: nil, is_pinned: nil, title: nil, request_options: {})
37
+ # @!attribute visibility
38
+ # The visibility types for forum posts
39
+ #
40
+ # @return [Symbol, WhopSDK::Models::ForumPostUpdateParams::Visibility, nil]
41
+ optional :visibility, enum: -> { WhopSDK::ForumPostUpdateParams::Visibility }, nil?: true
42
+
43
+ # @!method initialize(attachments: nil, content: nil, is_pinned: nil, title: nil, visibility: nil, request_options: {})
38
44
  # Some parameter documentations has been truncated, see
39
45
  # {WhopSDK::Models::ForumPostUpdateParams} for more details.
40
46
  #
@@ -46,6 +52,8 @@ module WhopSDK
46
52
  #
47
53
  # @param title [String, nil] The title of the post. Only visible if paywalled.
48
54
  #
55
+ # @param visibility [Symbol, WhopSDK::Models::ForumPostUpdateParams::Visibility, nil] The visibility types for forum posts
56
+ #
49
57
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
50
58
 
51
59
  # Input for an attachment
@@ -99,6 +107,17 @@ module WhopSDK
99
107
  # @!method self.variants
100
108
  # @return [Array(WhopSDK::Models::ForumPostUpdateParams::Attachment::AttachmentInputWithDirectUploadID, WhopSDK::Models::ForumPostUpdateParams::Attachment::AttachmentInputWithID)]
101
109
  end
110
+
111
+ # The visibility types for forum posts
112
+ module Visibility
113
+ extend WhopSDK::Internal::Type::Enum
114
+
115
+ MEMBERS_ONLY = :members_only
116
+ GLOBALLY_VISIBLE = :globally_visible
117
+
118
+ # @!method self.values
119
+ # @return [Array<Symbol>]
120
+ end
102
121
  end
103
122
  end
104
123
  end
@@ -112,6 +112,7 @@ module WhopSDK
112
112
  extend WhopSDK::Internal::Type::Enum
113
113
 
114
114
  PENDING = :pending
115
+ PENDING_AI_REVIEW = :pending_ai_review
115
116
  APPROVED = :approved
116
117
  RESERVES_IMPOSED = :reserves_imposed
117
118
  SUSPENDED = :suspended
@@ -30,8 +30,8 @@ module WhopSDK
30
30
  # @!attribute payment
31
31
  # The payment of the shipment
32
32
  #
33
- # @return [WhopSDK::Models::Shipment::Payment]
34
- required :payment, -> { WhopSDK::Shipment::Payment }
33
+ # @return [WhopSDK::Models::Shipment::Payment, nil]
34
+ required :payment, -> { WhopSDK::Shipment::Payment }, nil?: true
35
35
 
36
36
  # @!attribute service
37
37
  # The service of the shipment
@@ -74,7 +74,7 @@ module WhopSDK
74
74
  #
75
75
  # @param delivery_estimate [Time, nil] The delivery estimate of the shipment
76
76
  #
77
- # @param payment [WhopSDK::Models::Shipment::Payment] The payment of the shipment
77
+ # @param payment [WhopSDK::Models::Shipment::Payment, nil] The payment of the shipment
78
78
  #
79
79
  # @param service [String, nil] The service of the shipment
80
80
  #
@@ -31,8 +31,8 @@ module WhopSDK
31
31
  # @!attribute payment
32
32
  # The payment of the shipment
33
33
  #
34
- # @return [WhopSDK::Models::ShipmentListResponse::Payment]
35
- required :payment, -> { WhopSDK::Models::ShipmentListResponse::Payment }
34
+ # @return [WhopSDK::Models::ShipmentListResponse::Payment, nil]
35
+ required :payment, -> { WhopSDK::Models::ShipmentListResponse::Payment }, nil?: true
36
36
 
37
37
  # @!attribute service
38
38
  # The service of the shipment
@@ -75,7 +75,7 @@ module WhopSDK
75
75
  #
76
76
  # @param delivery_estimate [Time, nil] The delivery estimate of the shipment
77
77
  #
78
- # @param payment [WhopSDK::Models::ShipmentListResponse::Payment] The payment of the shipment
78
+ # @param payment [WhopSDK::Models::ShipmentListResponse::Payment, nil] The payment of the shipment
79
79
  #
80
80
  # @param service [String, nil] The service of the shipment
81
81
  #
@@ -6,19 +6,21 @@ module WhopSDK
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {WhopSDK::Models::AccessTokenCreateParams} for more details.
8
8
  #
9
- # Creates an access token for a user to access a specific resource. These access
10
- # tokens are designed to be used with Whop's embedded components.
9
+ # Create a short-lived access token to authenticate API requests on behalf of a
10
+ # Company or User. This token should be used with Whop's web and mobile embedded
11
+ # components. You must provide either a company_id or a user_id argument, but not
12
+ # both.
11
13
  #
12
- # @overload create(scoped_actions:, target_resource_id:, target_resource_type:, expires_at: nil, request_options: {})
14
+ # @overload create(company_id:, user_id:, expires_at: nil, scoped_actions: nil, request_options: {})
13
15
  #
14
- # @param scoped_actions [Array<String>] Array of desired scoped actions for the access token. This list must be a subset
16
+ # @param company_id [String] The ID of the Company to generate the token for. The API key must have permissio
15
17
  #
16
- # @param target_resource_id [String] The ID of the target resource (Company, User, etc.) for which the access token i
17
- #
18
- # @param target_resource_type [Symbol, WhopSDK::Models::AccessTokenCreateParams::TargetResourceType] The type of the target resource (company, user, product, experience, etc.).
18
+ # @param user_id [String] The ID of the User to generate the token for. The API key must have permission t
19
19
  #
20
20
  # @param expires_at [Time, nil] The expiration timestamp for the access token. If not provided, a default expira
21
21
  #
22
+ # @param scoped_actions [Array<String>, nil] Array of desired scoped actions for the access token. If sent as an empty array
23
+ #
22
24
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
23
25
  #
24
26
  # @return [WhopSDK::Models::AccessTokenCreateResponse]
@@ -12,7 +12,7 @@ module WhopSDK
12
12
  #
13
13
  # - `forum:post:create`
14
14
  #
15
- # @overload create(experience_id:, attachments: nil, content: nil, is_mention: nil, parent_id: nil, paywall_amount: nil, paywall_currency: nil, pinned: nil, poll: nil, title: nil, request_options: {})
15
+ # @overload create(experience_id:, attachments: nil, content: nil, is_mention: nil, parent_id: nil, paywall_amount: nil, paywall_currency: nil, pinned: nil, poll: nil, title: nil, visibility: nil, request_options: {})
16
16
  #
17
17
  # @param experience_id [String] The experience to create this post in
18
18
  #
@@ -34,6 +34,8 @@ module WhopSDK
34
34
  #
35
35
  # @param title [String, nil] The title of the post. Only visible if paywalled.
36
36
  #
37
+ # @param visibility [Symbol, WhopSDK::Models::ForumPostCreateParams::Visibility, nil] The visibility types for forum posts
38
+ #
37
39
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
38
40
  #
39
41
  # @return [WhopSDK::Models::ForumPost]
@@ -79,7 +81,7 @@ module WhopSDK
79
81
  #
80
82
  # Update an existing forum post
81
83
  #
82
- # @overload update(id, attachments: nil, content: nil, is_pinned: nil, title: nil, request_options: {})
84
+ # @overload update(id, attachments: nil, content: nil, is_pinned: nil, title: nil, visibility: nil, request_options: {})
83
85
  #
84
86
  # @param id [String] The ID of the forum post to update
85
87
  #
@@ -91,6 +93,8 @@ module WhopSDK
91
93
  #
92
94
  # @param title [String, nil] The title of the post. Only visible if paywalled.
93
95
  #
96
+ # @param visibility [Symbol, WhopSDK::Models::ForumPostUpdateParams::Visibility, nil] The visibility types for forum posts
97
+ #
94
98
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
95
99
  #
96
100
  # @return [WhopSDK::Models::ForumPost]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhopSDK
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
  end
@@ -11,21 +11,11 @@ module WhopSDK
11
11
  T.any(WhopSDK::AccessTokenCreateParams, WhopSDK::Internal::AnyHash)
12
12
  end
13
13
 
14
- # Array of desired scoped actions for the access token. This list must be a subset
15
- # of the API keys's existing permissions. Otherwise, an error will be raised.
16
- sig { returns(T::Array[String]) }
17
- attr_accessor :scoped_actions
18
-
19
- # The ID of the target resource (Company, User, etc.) for which the access token
20
- # is being created.
14
+ # The ID of the Company to generate the token for. The API key must have
15
+ # permission to access this Company, such as the being the company the API key
16
+ # belongs to or a sub-merchant of it
21
17
  sig { returns(String) }
22
- attr_accessor :target_resource_id
23
-
24
- # The type of the target resource (company, user, product, experience, etc.).
25
- sig do
26
- returns(WhopSDK::AccessTokenCreateParams::TargetResourceType::OrSymbol)
27
- end
28
- attr_accessor :target_resource_type
18
+ attr_accessor :company_id
29
19
 
30
20
  # The expiration timestamp for the access token. If not provided, a default
31
21
  # expiration time of 1 hour will be used. The expiration can be set to a maximum
@@ -33,29 +23,44 @@ module WhopSDK
33
23
  sig { returns(T.nilable(Time)) }
34
24
  attr_accessor :expires_at
35
25
 
26
+ # Array of desired scoped actions for the access token. If sent as an empty array
27
+ # or not provided, all permissions from the API key making the request will be
28
+ # available on the token. If sending an explicit list, they must be a subset of
29
+ # the API keys's existing permissions. Otherwise, an error will be raised.
30
+ sig { returns(T.nilable(T::Array[String])) }
31
+ attr_accessor :scoped_actions
32
+
33
+ # The ID of the User to generate the token for. The API key must have permission
34
+ # to access this User.
35
+ sig { returns(String) }
36
+ attr_accessor :user_id
37
+
36
38
  sig do
37
39
  params(
38
- scoped_actions: T::Array[String],
39
- target_resource_id: String,
40
- target_resource_type:
41
- WhopSDK::AccessTokenCreateParams::TargetResourceType::OrSymbol,
40
+ company_id: String,
41
+ user_id: String,
42
42
  expires_at: T.nilable(Time),
43
+ scoped_actions: T.nilable(T::Array[String]),
43
44
  request_options: WhopSDK::RequestOptions::OrHash
44
45
  ).returns(T.attached_class)
45
46
  end
46
47
  def self.new(
47
- # Array of desired scoped actions for the access token. This list must be a subset
48
- # of the API keys's existing permissions. Otherwise, an error will be raised.
49
- scoped_actions:,
50
- # The ID of the target resource (Company, User, etc.) for which the access token
51
- # is being created.
52
- target_resource_id:,
53
- # The type of the target resource (company, user, product, experience, etc.).
54
- target_resource_type:,
48
+ # The ID of the Company to generate the token for. The API key must have
49
+ # permission to access this Company, such as the being the company the API key
50
+ # belongs to or a sub-merchant of it
51
+ company_id:,
52
+ # The ID of the User to generate the token for. The API key must have permission
53
+ # to access this User.
54
+ user_id:,
55
55
  # The expiration timestamp for the access token. If not provided, a default
56
56
  # expiration time of 1 hour will be used. The expiration can be set to a maximum
57
57
  # of 3 hours from the current time.
58
58
  expires_at: nil,
59
+ # Array of desired scoped actions for the access token. If sent as an empty array
60
+ # or not provided, all permissions from the API key making the request will be
61
+ # available on the token. If sending an explicit list, they must be a subset of
62
+ # the API keys's existing permissions. Otherwise, an error will be raised.
63
+ scoped_actions: nil,
59
64
  request_options: {}
60
65
  )
61
66
  end
@@ -63,64 +68,16 @@ module WhopSDK
63
68
  sig do
64
69
  override.returns(
65
70
  {
66
- scoped_actions: T::Array[String],
67
- target_resource_id: String,
68
- target_resource_type:
69
- WhopSDK::AccessTokenCreateParams::TargetResourceType::OrSymbol,
71
+ company_id: String,
70
72
  expires_at: T.nilable(Time),
73
+ scoped_actions: T.nilable(T::Array[String]),
74
+ user_id: String,
71
75
  request_options: WhopSDK::RequestOptions
72
76
  }
73
77
  )
74
78
  end
75
79
  def to_hash
76
80
  end
77
-
78
- # The type of the target resource (company, user, product, experience, etc.).
79
- module TargetResourceType
80
- extend WhopSDK::Internal::Type::Enum
81
-
82
- TaggedSymbol =
83
- T.type_alias do
84
- T.all(Symbol, WhopSDK::AccessTokenCreateParams::TargetResourceType)
85
- end
86
- OrSymbol = T.type_alias { T.any(Symbol, String) }
87
-
88
- COMPANY =
89
- T.let(
90
- :company,
91
- WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
92
- )
93
- PRODUCT =
94
- T.let(
95
- :product,
96
- WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
97
- )
98
- EXPERIENCE =
99
- T.let(
100
- :experience,
101
- WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
102
- )
103
- APP =
104
- T.let(
105
- :app,
106
- WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
107
- )
108
- USER =
109
- T.let(
110
- :user,
111
- WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
112
- )
113
-
114
- sig do
115
- override.returns(
116
- T::Array[
117
- WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
118
- ]
119
- )
120
- end
121
- def self.values
122
- end
123
- end
124
81
  end
125
82
  end
126
83
  end
@@ -25,6 +25,7 @@ module WhopSDK
25
25
  RUPAY = T.let(:rupay, WhopSDK::CardBrands::TaggedSymbol)
26
26
  JCBRUPAY = T.let(:jcbrupay, WhopSDK::CardBrands::TaggedSymbol)
27
27
  ELO = T.let(:elo, WhopSDK::CardBrands::TaggedSymbol)
28
+ MAESTRO = T.let(:maestro, WhopSDK::CardBrands::TaggedSymbol)
28
29
  UNKNOWN = T.let(:unknown, WhopSDK::CardBrands::TaggedSymbol)
29
30
 
30
31
  sig { override.returns(T::Array[WhopSDK::CardBrands::TaggedSymbol]) }
@@ -94,14 +94,14 @@ module WhopSDK
94
94
  sig { returns(String) }
95
95
  attr_accessor :company_id
96
96
 
97
+ # The respective currency identifier for the plan.
98
+ sig { returns(WhopSDK::Currency::OrSymbol) }
99
+ attr_accessor :currency
100
+
97
101
  # The interval at which the plan charges (renewal plans).
98
102
  sig { returns(T.nilable(Integer)) }
99
103
  attr_accessor :billing_period
100
104
 
101
- # The available currencies on the platform
102
- sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) }
103
- attr_accessor :currency
104
-
105
105
  # An array of custom field objects.
106
106
  sig do
107
107
  returns(
@@ -225,8 +225,8 @@ module WhopSDK
225
225
  sig do
226
226
  params(
227
227
  company_id: String,
228
+ currency: WhopSDK::Currency::OrSymbol,
228
229
  billing_period: T.nilable(Integer),
229
- currency: T.nilable(WhopSDK::Currency::OrSymbol),
230
230
  custom_fields:
231
231
  T.nilable(
232
232
  T::Array[
@@ -266,10 +266,10 @@ module WhopSDK
266
266
  def self.new(
267
267
  # The company the plan should be created for.
268
268
  company_id:,
269
+ # The respective currency identifier for the plan.
270
+ currency:,
269
271
  # The interval at which the plan charges (renewal plans).
270
272
  billing_period: nil,
271
- # The available currencies on the platform
272
- currency: nil,
273
273
  # An array of custom field objects.
274
274
  custom_fields: nil,
275
275
  # The description of the plan.
@@ -315,8 +315,8 @@ module WhopSDK
315
315
  override.returns(
316
316
  {
317
317
  company_id: String,
318
+ currency: WhopSDK::Currency::OrSymbol,
318
319
  billing_period: T.nilable(Integer),
319
- currency: T.nilable(WhopSDK::Currency::OrSymbol),
320
320
  custom_fields:
321
321
  T.nilable(
322
322
  T::Array[
@@ -93,6 +93,7 @@ module WhopSDK
93
93
  UZS = T.let(:uzs, WhopSDK::Currency::TaggedSymbol)
94
94
  RUB = T.let(:rub, WhopSDK::Currency::TaggedSymbol)
95
95
  BTC = T.let(:btc, WhopSDK::Currency::TaggedSymbol)
96
+ CNY = T.let(:cny, WhopSDK::Currency::TaggedSymbol)
96
97
 
97
98
  sig { override.returns(T::Array[WhopSDK::Currency::TaggedSymbol]) }
98
99
  def self.values