diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 18a5b4e2..09a565df 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.33" + ".": "0.0.34" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index c14a3691..d46615ab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 180 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-51fb88de05d428f3ea78a4b7ba2d5c6e04ae039816961e810f99d9d5d29bc015.yml -openapi_spec_hash: d59179d7d9a835795741673012f20d79 -config_hash: a9229678a4146beeb5be82ed0ae3d4f1 +configured_endpoints: 181 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-b6e1387ac58f903f887eae989de30273824663a9a752e7834b82b1036950c3d2.yml +openapi_spec_hash: 0bea29a304f3d57c44cc186478bef054 +config_hash: 7e9d4f2abf58b7918a0e103387d2a2e9 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a9b3153..56931185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.0.34 (2026-03-13) + +Full Changelog: [v0.0.33...v0.0.34](https://github.com/whopio/whopsdk-ruby/compare/v0.0.33...v0.0.34) + +### Features + +* **api:** api update ([955ac05](https://github.com/whopio/whopsdk-ruby/commit/955ac05985d441c367414c55f55bb6e6a5a1d128)) +* **api:** manual updates ([dae94e8](https://github.com/whopio/whopsdk-ruby/commit/dae94e887a9c370ae4e67335eec818e22bb60a0a)) + ## 0.0.33 (2026-03-12) Full Changelog: [v0.0.32...v0.0.33](https://github.com/whopio/whopsdk-ruby/compare/v0.0.32...v0.0.33) diff --git a/Gemfile.lock b/Gemfile.lock index 0094da64..db17d07e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - whop_sdk (0.0.33) + whop_sdk (0.0.34) cgi connection_pool standardwebhooks diff --git a/README.md b/README.md index ab7fedf8..1bb645f9 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "whop_sdk", "~> 0.0.33" +gem "whop_sdk", "~> 0.0.34" ``` diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index dae673e8..7855786b 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -428,6 +428,8 @@ require_relative "whop_sdk/models/user" require_relative "whop_sdk/models/user_check_access_params" require_relative "whop_sdk/models/user_check_access_response" +require_relative "whop_sdk/models/user_list_params" +require_relative "whop_sdk/models/user_list_response" require_relative "whop_sdk/models/user_retrieve_params" require_relative "whop_sdk/models/user_update_profile_params" require_relative "whop_sdk/models/verification_error_code" diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index b4a99496..c3bb9137 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -637,6 +637,8 @@ module WhopSDK UserCheckAccessParams = WhopSDK::Models::UserCheckAccessParams + UserListParams = WhopSDK::Models::UserListParams + UserRetrieveParams = WhopSDK::Models::UserRetrieveParams UserUpdateProfileParams = WhopSDK::Models::UserUpdateProfileParams diff --git a/lib/whop_sdk/models/refund_list_params.rb b/lib/whop_sdk/models/refund_list_params.rb index e11e3740..6959c400 100644 --- a/lib/whop_sdk/models/refund_list_params.rb +++ b/lib/whop_sdk/models/refund_list_params.rb @@ -7,12 +7,6 @@ class RefundListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute payment_id - # The unique identifier of the payment to list refunds for. - # - # @return [String] - required :payment_id, String - # @!attribute after # Returns the elements in the list that come after the specified cursor. # @@ -25,6 +19,12 @@ class RefundListParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :before, String, nil?: true + # @!attribute company_id + # Filter refunds to only those belonging to this company. + # + # @return [String, nil] + optional :company_id, String, nil?: true + # @!attribute created_after # Only return refunds created after this timestamp. # @@ -55,13 +55,25 @@ class RefundListParams < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :last, Integer, nil?: true - # @!method initialize(payment_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) - # @param payment_id [String] The unique identifier of the payment to list refunds for. + # @!attribute payment_id + # Filter refunds to only those associated with this specific payment. # + # @return [String, nil] + optional :payment_id, String, nil?: true + + # @!attribute user_id + # Filter refunds to only those associated with this specific user. + # + # @return [String, nil] + optional :user_id, String, nil?: true + + # @!method initialize(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, payment_id: nil, user_id: nil, request_options: {}) # @param after [String, nil] Returns the elements in the list that come after the specified cursor. # # @param before [String, nil] Returns the elements in the list that come before the specified cursor. # + # @param company_id [String, nil] Filter refunds to only those belonging to this company. + # # @param created_after [Time, nil] Only return refunds created after this timestamp. # # @param created_before [Time, nil] Only return refunds created before this timestamp. @@ -72,6 +84,10 @@ class RefundListParams < WhopSDK::Internal::Type::BaseModel # # @param last [Integer, nil] Returns the last _n_ elements from the list. # + # @param payment_id [String, nil] Filter refunds to only those associated with this specific payment. + # + # @param user_id [String, nil] Filter refunds to only those associated with this specific user. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/user_list_params.rb b/lib/whop_sdk/models/user_list_params.rb new file mode 100644 index 00000000..626420a0 --- /dev/null +++ b/lib/whop_sdk/models/user_list_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Users#list + class UserListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute after + # Returns the elements in the list that come after the specified cursor. + # + # @return [String, nil] + optional :after, String, nil?: true + + # @!attribute before + # Returns the elements in the list that come before the specified cursor. + # + # @return [String, nil] + optional :before, String, nil?: true + + # @!attribute first + # Returns the first _n_ elements from the list. + # + # @return [Integer, nil] + optional :first, Integer, nil?: true + + # @!attribute last + # Returns the last _n_ elements from the list. + # + # @return [Integer, nil] + optional :last, Integer, nil?: true + + # @!attribute query + # Search term to filter by name or username. + # + # @return [String, nil] + optional :query, String, nil?: true + + # @!method initialize(after: nil, before: nil, first: nil, last: nil, query: nil, request_options: {}) + # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # + # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # + # @param first [Integer, nil] Returns the first _n_ elements from the list. + # + # @param last [Integer, nil] Returns the last _n_ elements from the list. + # + # @param query [String, nil] Search term to filter by name or username. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/user_list_response.rb b/lib/whop_sdk/models/user_list_response.rb new file mode 100644 index 00000000..61a3ea65 --- /dev/null +++ b/lib/whop_sdk/models/user_list_response.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Users#list + class UserListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the user. + # + # @return [String] + required :id, String + + # @!attribute bio + # A short biography written by the user, displayed on their public profile. + # + # @return [String, nil] + required :bio, String, nil?: true + + # @!attribute created_at + # The datetime the user was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute name + # The user's display name shown on their public profile. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture + # The user's profile picture attachment with URL, content type, and file metadata. + # Null if using a legacy profile picture. + # + # @return [WhopSDK::Models::UserListResponse::ProfilePicture, nil] + required :profile_picture, -> { WhopSDK::Models::UserListResponse::ProfilePicture }, nil?: true + + # @!attribute username + # The user's unique username shown on their public profile. + # + # @return [String] + required :username, String + + # @!method initialize(id:, bio:, created_at:, name:, profile_picture:, username:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::UserListResponse} for more details. + # + # A user account on Whop. Contains profile information, identity details, and + # social connections. + # + # @param id [String] The unique identifier for the user. + # + # @param bio [String, nil] A short biography written by the user, displayed on their public profile. + # + # @param created_at [Time] The datetime the user was created. + # + # @param name [String, nil] The user's display name shown on their public profile. + # + # @param profile_picture [WhopSDK::Models::UserListResponse::ProfilePicture, nil] The user's profile picture attachment with URL, content type, and file metadata. + # + # @param username [String] The user's unique username shown on their public profile. + + # @see WhopSDK::Models::UserListResponse#profile_picture + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute url + # A pre-optimized URL for rendering this attachment on the client. This should be + # used for displaying attachments in apps. + # + # @return [String, nil] + required :url, String, nil?: true + + # @!method initialize(url:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::UserListResponse::ProfilePicture} for more details. + # + # The user's profile picture attachment with URL, content type, and file metadata. + # Null if using a legacy profile picture. + # + # @param url [String, nil] A pre-optimized URL for rendering this attachment on the client. This should be + end + end + end +end diff --git a/lib/whop_sdk/resources/refunds.rb b/lib/whop_sdk/resources/refunds.rb index a2041fa5..dc9aba10 100644 --- a/lib/whop_sdk/resources/refunds.rb +++ b/lib/whop_sdk/resources/refunds.rb @@ -31,21 +31,21 @@ def retrieve(id, params = {}) ) end - # Returns a paginated list of refunds for a specific payment, with optional - # filtering by creation date. + # Returns a paginated list of refunds, with optional filtering by payment, + # company, user, and creation date. # # Required permissions: # # - `payment:basic:read` # - # @overload list(payment_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) - # - # @param payment_id [String] The unique identifier of the payment to list refunds for. + # @overload list(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, payment_id: nil, user_id: nil, request_options: {}) # # @param after [String, nil] Returns the elements in the list that come after the specified cursor. # # @param before [String, nil] Returns the elements in the list that come before the specified cursor. # + # @param company_id [String, nil] Filter refunds to only those belonging to this company. + # # @param created_after [Time, nil] Only return refunds created after this timestamp. # # @param created_before [Time, nil] Only return refunds created before this timestamp. @@ -56,12 +56,16 @@ def retrieve(id, params = {}) # # @param last [Integer, nil] Returns the last _n_ elements from the list. # + # @param payment_id [String, nil] Filter refunds to only those associated with this specific payment. + # + # @param user_id [String, nil] Filter refunds to only those associated with this specific user. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Internal::CursorPage] # # @see WhopSDK::Models::RefundListParams - def list(params) + def list(params = {}) parsed, options = WhopSDK::RefundListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( diff --git a/lib/whop_sdk/resources/users.rb b/lib/whop_sdk/resources/users.rb index 22bb0ab2..fa142e62 100644 --- a/lib/whop_sdk/resources/users.rb +++ b/lib/whop_sdk/resources/users.rb @@ -24,6 +24,39 @@ def retrieve(id, params = {}) ) end + # Search for users by name or username, ranked by social proximity to the + # authenticated user. + # + # @overload list(after: nil, before: nil, first: nil, last: nil, query: nil, request_options: {}) + # + # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # + # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # + # @param first [Integer, nil] Returns the first _n_ elements from the list. + # + # @param last [Integer, nil] Returns the last _n_ elements from the list. + # + # @param query [String, nil] Search term to filter by name or username. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::UserListParams + def list(params = {}) + parsed, options = WhopSDK::UserListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "users", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::UserListResponse, + options: options + ) + end + # Some parameter documentations has been truncated, see # {WhopSDK::Models::UserCheckAccessParams} for more details. # diff --git a/lib/whop_sdk/version.rb b/lib/whop_sdk/version.rb index 06665b99..30d9b812 100644 --- a/lib/whop_sdk/version.rb +++ b/lib/whop_sdk/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WhopSDK - VERSION = "0.0.33" + VERSION = "0.0.34" end diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index 96e74f4c..3d53bd46 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -625,6 +625,8 @@ module WhopSDK UserCheckAccessParams = WhopSDK::Models::UserCheckAccessParams + UserListParams = WhopSDK::Models::UserListParams + UserRetrieveParams = WhopSDK::Models::UserRetrieveParams UserUpdateProfileParams = WhopSDK::Models::UserUpdateProfileParams diff --git a/rbi/whop_sdk/models/refund_list_params.rbi b/rbi/whop_sdk/models/refund_list_params.rbi index d23a5964..89691607 100644 --- a/rbi/whop_sdk/models/refund_list_params.rbi +++ b/rbi/whop_sdk/models/refund_list_params.rbi @@ -11,10 +11,6 @@ module WhopSDK T.any(WhopSDK::RefundListParams, WhopSDK::Internal::AnyHash) end - # The unique identifier of the payment to list refunds for. - sig { returns(String) } - attr_accessor :payment_id - # Returns the elements in the list that come after the specified cursor. sig { returns(T.nilable(String)) } attr_accessor :after @@ -23,6 +19,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :before + # Filter refunds to only those belonging to this company. + sig { returns(T.nilable(String)) } + attr_accessor :company_id + # Only return refunds created after this timestamp. sig { returns(T.nilable(Time)) } attr_accessor :created_after @@ -43,26 +43,36 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :last + # Filter refunds to only those associated with this specific payment. + sig { returns(T.nilable(String)) } + attr_accessor :payment_id + + # Filter refunds to only those associated with this specific user. + sig { returns(T.nilable(String)) } + attr_accessor :user_id + sig do params( - payment_id: String, after: T.nilable(String), before: T.nilable(String), + company_id: T.nilable(String), created_after: T.nilable(Time), created_before: T.nilable(Time), direction: T.nilable(WhopSDK::Direction::OrSymbol), first: T.nilable(Integer), last: T.nilable(Integer), + payment_id: T.nilable(String), + user_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The unique identifier of the payment to list refunds for. - payment_id:, # Returns the elements in the list that come after the specified cursor. after: nil, # Returns the elements in the list that come before the specified cursor. before: nil, + # Filter refunds to only those belonging to this company. + company_id: nil, # Only return refunds created after this timestamp. created_after: nil, # Only return refunds created before this timestamp. @@ -73,6 +83,10 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, + # Filter refunds to only those associated with this specific payment. + payment_id: nil, + # Filter refunds to only those associated with this specific user. + user_id: nil, request_options: {} ) end @@ -80,14 +94,16 @@ module WhopSDK sig do override.returns( { - payment_id: String, after: T.nilable(String), before: T.nilable(String), + company_id: T.nilable(String), created_after: T.nilable(Time), created_before: T.nilable(Time), direction: T.nilable(WhopSDK::Direction::OrSymbol), first: T.nilable(Integer), last: T.nilable(Integer), + payment_id: T.nilable(String), + user_id: T.nilable(String), request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/user_list_params.rbi b/rbi/whop_sdk/models/user_list_params.rbi new file mode 100644 index 00000000..e6ea9833 --- /dev/null +++ b/rbi/whop_sdk/models/user_list_params.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module WhopSDK + module Models + class UserListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::UserListParams, WhopSDK::Internal::AnyHash) + end + + # Returns the elements in the list that come after the specified cursor. + sig { returns(T.nilable(String)) } + attr_accessor :after + + # Returns the elements in the list that come before the specified cursor. + sig { returns(T.nilable(String)) } + attr_accessor :before + + # Returns the first _n_ elements from the list. + sig { returns(T.nilable(Integer)) } + attr_accessor :first + + # Returns the last _n_ elements from the list. + sig { returns(T.nilable(Integer)) } + attr_accessor :last + + # Search term to filter by name or username. + sig { returns(T.nilable(String)) } + attr_accessor :query + + sig do + params( + after: T.nilable(String), + before: T.nilable(String), + first: T.nilable(Integer), + last: T.nilable(Integer), + query: T.nilable(String), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Returns the elements in the list that come after the specified cursor. + after: nil, + # Returns the elements in the list that come before the specified cursor. + before: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + # Search term to filter by name or username. + query: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + after: T.nilable(String), + before: T.nilable(String), + first: T.nilable(Integer), + last: T.nilable(Integer), + query: T.nilable(String), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/user_list_response.rbi b/rbi/whop_sdk/models/user_list_response.rbi new file mode 100644 index 00000000..5b130ab2 --- /dev/null +++ b/rbi/whop_sdk/models/user_list_response.rbi @@ -0,0 +1,124 @@ +# typed: strong + +module WhopSDK + module Models + class UserListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::UserListResponse, WhopSDK::Internal::AnyHash) + end + + # The unique identifier for the user. + sig { returns(String) } + attr_accessor :id + + # A short biography written by the user, displayed on their public profile. + sig { returns(T.nilable(String)) } + attr_accessor :bio + + # The datetime the user was created. + sig { returns(Time) } + attr_accessor :created_at + + # The user's display name shown on their public profile. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's profile picture attachment with URL, content type, and file metadata. + # Null if using a legacy profile picture. + sig do + returns(T.nilable(WhopSDK::Models::UserListResponse::ProfilePicture)) + end + attr_reader :profile_picture + + sig do + params( + profile_picture: + T.nilable(WhopSDK::Models::UserListResponse::ProfilePicture::OrHash) + ).void + end + attr_writer :profile_picture + + # The user's unique username shown on their public profile. + sig { returns(String) } + attr_accessor :username + + # A user account on Whop. Contains profile information, identity details, and + # social connections. + sig do + params( + id: String, + bio: T.nilable(String), + created_at: Time, + name: T.nilable(String), + profile_picture: + T.nilable( + WhopSDK::Models::UserListResponse::ProfilePicture::OrHash + ), + username: String + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the user. + id:, + # A short biography written by the user, displayed on their public profile. + bio:, + # The datetime the user was created. + created_at:, + # The user's display name shown on their public profile. + name:, + # The user's profile picture attachment with URL, content type, and file metadata. + # Null if using a legacy profile picture. + profile_picture:, + # The user's unique username shown on their public profile. + username: + ) + end + + sig do + override.returns( + { + id: String, + bio: T.nilable(String), + created_at: Time, + name: T.nilable(String), + profile_picture: + T.nilable(WhopSDK::Models::UserListResponse::ProfilePicture), + username: String + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::UserListResponse::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + # A pre-optimized URL for rendering this attachment on the client. This should be + # used for displaying attachments in apps. + sig { returns(T.nilable(String)) } + attr_accessor :url + + # The user's profile picture attachment with URL, content type, and file metadata. + # Null if using a legacy profile picture. + sig { params(url: T.nilable(String)).returns(T.attached_class) } + def self.new( + # A pre-optimized URL for rendering this attachment on the client. This should be + # used for displaying attachments in apps. + url: + ) + end + + sig { override.returns({ url: T.nilable(String) }) } + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/refunds.rbi b/rbi/whop_sdk/resources/refunds.rbi index 1924361a..08c0b348 100644 --- a/rbi/whop_sdk/resources/refunds.rbi +++ b/rbi/whop_sdk/resources/refunds.rbi @@ -25,34 +25,36 @@ module WhopSDK ) end - # Returns a paginated list of refunds for a specific payment, with optional - # filtering by creation date. + # Returns a paginated list of refunds, with optional filtering by payment, + # company, user, and creation date. # # Required permissions: # # - `payment:basic:read` sig do params( - payment_id: String, after: T.nilable(String), before: T.nilable(String), + company_id: T.nilable(String), created_after: T.nilable(Time), created_before: T.nilable(Time), direction: T.nilable(WhopSDK::Direction::OrSymbol), first: T.nilable(Integer), last: T.nilable(Integer), + payment_id: T.nilable(String), + user_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[WhopSDK::Models::RefundListResponse] ) end def list( - # The unique identifier of the payment to list refunds for. - payment_id:, # Returns the elements in the list that come after the specified cursor. after: nil, # Returns the elements in the list that come before the specified cursor. before: nil, + # Filter refunds to only those belonging to this company. + company_id: nil, # Only return refunds created after this timestamp. created_after: nil, # Only return refunds created before this timestamp. @@ -63,6 +65,10 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, + # Filter refunds to only those associated with this specific payment. + payment_id: nil, + # Filter refunds to only those associated with this specific user. + user_id: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/users.rbi b/rbi/whop_sdk/resources/users.rbi index 328f039c..cdd04994 100644 --- a/rbi/whop_sdk/resources/users.rbi +++ b/rbi/whop_sdk/resources/users.rbi @@ -18,6 +18,35 @@ module WhopSDK ) end + # Search for users by name or username, ranked by social proximity to the + # authenticated user. + sig do + params( + after: T.nilable(String), + before: T.nilable(String), + first: T.nilable(Integer), + last: T.nilable(Integer), + query: T.nilable(String), + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[WhopSDK::Models::UserListResponse] + ) + end + def list( + # Returns the elements in the list that come after the specified cursor. + after: nil, + # Returns the elements in the list that come before the specified cursor. + before: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + # Search term to filter by name or username. + query: nil, + request_options: {} + ) + end + # Check whether a user has access to a specific resource, and return their access # level. sig do diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 74a54487..28f37a14 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -595,6 +595,8 @@ module WhopSDK class UserCheckAccessParams = WhopSDK::Models::UserCheckAccessParams + class UserListParams = WhopSDK::Models::UserListParams + class UserRetrieveParams = WhopSDK::Models::UserRetrieveParams class UserUpdateProfileParams = WhopSDK::Models::UserUpdateProfileParams diff --git a/sig/whop_sdk/models/refund_list_params.rbs b/sig/whop_sdk/models/refund_list_params.rbs index cc09bfe0..cc3455b2 100644 --- a/sig/whop_sdk/models/refund_list_params.rbs +++ b/sig/whop_sdk/models/refund_list_params.rbs @@ -2,14 +2,16 @@ module WhopSDK module Models type refund_list_params = { - payment_id: String, after: String?, before: String?, + company_id: String?, created_after: Time?, created_before: Time?, direction: WhopSDK::Models::direction?, first: Integer?, - last: Integer? + last: Integer?, + payment_id: String?, + user_id: String? } & WhopSDK::Internal::Type::request_parameters @@ -17,12 +19,12 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor payment_id: String - attr_accessor after: String? attr_accessor before: String? + attr_accessor company_id: String? + attr_accessor created_after: Time? attr_accessor created_before: Time? @@ -33,27 +35,35 @@ module WhopSDK attr_accessor last: Integer? + attr_accessor payment_id: String? + + attr_accessor user_id: String? + def initialize: ( - payment_id: String, ?after: String?, ?before: String?, + ?company_id: String?, ?created_after: Time?, ?created_before: Time?, ?direction: WhopSDK::Models::direction?, ?first: Integer?, ?last: Integer?, + ?payment_id: String?, + ?user_id: String?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - payment_id: String, after: String?, before: String?, + company_id: String?, created_after: Time?, created_before: Time?, direction: WhopSDK::Models::direction?, first: Integer?, last: Integer?, + payment_id: String?, + user_id: String?, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/user_list_params.rbs b/sig/whop_sdk/models/user_list_params.rbs new file mode 100644 index 00000000..b5f7f5b3 --- /dev/null +++ b/sig/whop_sdk/models/user_list_params.rbs @@ -0,0 +1,46 @@ +module WhopSDK + module Models + type user_list_params = + { + after: String?, + before: String?, + first: Integer?, + last: Integer?, + query: String? + } + & WhopSDK::Internal::Type::request_parameters + + class UserListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor after: String? + + attr_accessor before: String? + + attr_accessor first: Integer? + + attr_accessor last: Integer? + + attr_accessor query: String? + + def initialize: ( + ?after: String?, + ?before: String?, + ?first: Integer?, + ?last: Integer?, + ?query: String?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + after: String?, + before: String?, + first: Integer?, + last: Integer?, + query: String?, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/user_list_response.rbs b/sig/whop_sdk/models/user_list_response.rbs new file mode 100644 index 00000000..5f1fe47e --- /dev/null +++ b/sig/whop_sdk/models/user_list_response.rbs @@ -0,0 +1,55 @@ +module WhopSDK + module Models + type user_list_response = + { + id: String, + bio: String?, + created_at: Time, + name: String?, + profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture?, + username: String + } + + class UserListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor bio: String? + + attr_accessor created_at: Time + + attr_accessor name: String? + + attr_accessor profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture? + + attr_accessor username: String + + def initialize: ( + id: String, + bio: String?, + created_at: Time, + name: String?, + profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture?, + username: String + ) -> void + + def to_hash: -> { + id: String, + bio: String?, + created_at: Time, + name: String?, + profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture?, + username: String + } + + type profile_picture = { url: String? } + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + attr_accessor url: String? + + def initialize: (url: String?) -> void + + def to_hash: -> { url: String? } + end + end + end +end diff --git a/sig/whop_sdk/resources/refunds.rbs b/sig/whop_sdk/resources/refunds.rbs index 7b8776ed..e715dee6 100644 --- a/sig/whop_sdk/resources/refunds.rbs +++ b/sig/whop_sdk/resources/refunds.rbs @@ -7,14 +7,16 @@ module WhopSDK ) -> WhopSDK::Models::RefundRetrieveResponse def list: ( - payment_id: String, ?after: String?, ?before: String?, + ?company_id: String?, ?created_after: Time?, ?created_before: Time?, ?direction: WhopSDK::Models::direction?, ?first: Integer?, ?last: Integer?, + ?payment_id: String?, + ?user_id: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::RefundListResponse] diff --git a/sig/whop_sdk/resources/users.rbs b/sig/whop_sdk/resources/users.rbs index f85a8513..44fe25b1 100644 --- a/sig/whop_sdk/resources/users.rbs +++ b/sig/whop_sdk/resources/users.rbs @@ -6,6 +6,15 @@ module WhopSDK ?request_options: WhopSDK::request_opts ) -> WhopSDK::User + def list: ( + ?after: String?, + ?before: String?, + ?first: Integer?, + ?last: Integer?, + ?query: String?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::UserListResponse] + def check_access: ( String resource_id, id: String, diff --git a/test/whop_sdk/resources/refunds_test.rb b/test/whop_sdk/resources/refunds_test.rb index e0fdd749..093f3330 100644 --- a/test/whop_sdk/resources/refunds_test.rb +++ b/test/whop_sdk/resources/refunds_test.rb @@ -29,10 +29,10 @@ def test_retrieve end end - def test_list_required_params + def test_list skip("Mock server tests are disabled") - response = @whop.refunds.list(payment_id: "pay_xxxxxxxxxxxxxx") + response = @whop.refunds.list assert_pattern do response => WhopSDK::Internal::CursorPage diff --git a/test/whop_sdk/resources/users_test.rb b/test/whop_sdk/resources/users_test.rb index a727f47e..98848af9 100644 --- a/test/whop_sdk/resources/users_test.rb +++ b/test/whop_sdk/resources/users_test.rb @@ -24,6 +24,34 @@ def test_retrieve end end + def test_list + skip("Mock server tests are disabled") + + response = @whop.users.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::UserListResponse + end + + assert_pattern do + row => { + id: String, + bio: String | nil, + created_at: Time, + name: String | nil, + profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture | nil, + username: String + } + end + end + def test_check_access_required_params skip("Mock server tests are disabled")