diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 22b1a1e3..7972df48 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.20" + ".": "0.0.22" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 4c348f61..dd6b2e67 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 135 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-c28f76de0001bfa87ee1b13b38528823b96c236b51d3706bc7fbe2ef22ed1c96.yml -openapi_spec_hash: 8476411081a6a94534139b21c3cf74b7 -config_hash: c4e43bac321badafc3ba52b6c6c4e646 +configured_endpoints: 142 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-02f632061a0e7f6c587344bfa1aa46b552b6e1d6220b214ad3aeab192a6daba2.yml +openapi_spec_hash: c3fd12d172c45e6d09756677d83de4e0 +config_hash: 557f6692f697df2872da82b8dedf538b diff --git a/CHANGELOG.md b/CHANGELOG.md index 3614c66b..128423a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## 0.0.22 (2026-01-07) + +Full Changelog: [v0.0.20...v0.0.22](https://github.com/whopio/whopsdk-ruby/compare/v0.0.20...v0.0.22) + +### Features + +* **api:** api update ([3632c09](https://github.com/whopio/whopsdk-ruby/commit/3632c093586872857f605313dc80935152ceb2b4)) +* **api:** api update ([1369d6a](https://github.com/whopio/whopsdk-ruby/commit/1369d6a6a970fda437f47d398f14fdbd240326ba)) +* **api:** api update ([185c3ca](https://github.com/whopio/whopsdk-ruby/commit/185c3cad5d43af42c98004dfb6320bba79a4eb37)) +* **api:** api update ([7b79b5e](https://github.com/whopio/whopsdk-ruby/commit/7b79b5ecb10e297b2b40c6e9bcd8710486738370)) +* **api:** api update ([6b01cd6](https://github.com/whopio/whopsdk-ruby/commit/6b01cd6184c20f7b58f6b290afce78daf4fcb4ef)) +* **api:** api update ([f6a40eb](https://github.com/whopio/whopsdk-ruby/commit/f6a40eb1748db6b849c3857c8dd80ea2c2ce2402)) +* **api:** api update ([131ef7d](https://github.com/whopio/whopsdk-ruby/commit/131ef7d9396af31afbbc4cedb3f62835453cd4ca)) +* **api:** api update ([789ca6d](https://github.com/whopio/whopsdk-ruby/commit/789ca6d43533a22f94370de9c05c4ecf9714a044)) +* **api:** api update ([d165256](https://github.com/whopio/whopsdk-ruby/commit/d16525653fc3bb992650b120b2b63f3bac07dd77)) +* **api:** api update ([fe37424](https://github.com/whopio/whopsdk-ruby/commit/fe37424c5fd9a258bea07a1c003148ab6fbd02bd)) +* **api:** api update ([43788a0](https://github.com/whopio/whopsdk-ruby/commit/43788a0bdefecbcd1bea6393fb6959cf082a1b44)) +* **api:** api update ([72d8b00](https://github.com/whopio/whopsdk-ruby/commit/72d8b0022e186f3e9e3235fb95cbbe353e3a73a9)) +* **api:** manual updates ([6e8e692](https://github.com/whopio/whopsdk-ruby/commit/6e8e692bef8870ba11108e1febdefdeb70e9edbd)) + + +### Bug Fixes + +* calling `break` out of streams should be instantaneous ([7503ef5](https://github.com/whopio/whopsdk-ruby/commit/7503ef5800775d0c158500da07554f6f4e3e8d95)) +* issue where json.parse errors when receiving HTTP 204 with nobody ([919e4e1](https://github.com/whopio/whopsdk-ruby/commit/919e4e1a8a9dcada6957cbf07884c5cba26663fa)) + + +### Documentation + +* prominently feature MCP server setup in root SDK readmes ([8a808ef](https://github.com/whopio/whopsdk-ruby/commit/8a808ef1e408cc29afcdfce17d03dd828c09d7cb)) + ## 0.0.20 (2025-12-16) Full Changelog: [v0.0.19...v0.0.20](https://github.com/whopio/whopsdk-ruby/compare/v0.0.19...v0.0.20) diff --git a/Gemfile.lock b/Gemfile.lock index 31ecc130..6b9ce9f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - whop_sdk (0.0.20) + whop_sdk (0.0.22) connection_pool jwt openssl diff --git a/LICENSE b/LICENSE index 719201a6..68343782 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Whop + Copyright 2026 Whop Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 70294feb..8ae85110 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,15 @@ The Whop Ruby library provides convenient access to the Whop REST API from any R It is generated with [Stainless](https://www.stainless.com/). +## MCP Server + +Use the Whop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. + +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40whop%2Fmcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3aG9wL21jcCJdfQ) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40whop%2Fmcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40whop%2Fmcp%22%5D%7D) + +> Note: You may need to set environment variables in your MCP client. + ## Documentation Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/whop_sdk). @@ -17,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "whop_sdk", "~> 0.0.20" +gem "whop_sdk", "~> 0.0.22" ``` diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index 75b359f7..556acb0f 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -215,6 +215,14 @@ require_relative "whop_sdk/models/invoice_void_params" require_relative "whop_sdk/models/invoice_void_response" require_relative "whop_sdk/models/languages" +require_relative "whop_sdk/models/lead_create_params" +require_relative "whop_sdk/models/lead_create_response" +require_relative "whop_sdk/models/lead_list_params" +require_relative "whop_sdk/models/lead_list_response" +require_relative "whop_sdk/models/lead_retrieve_params" +require_relative "whop_sdk/models/lead_retrieve_response" +require_relative "whop_sdk/models/lead_update_params" +require_relative "whop_sdk/models/lead_update_response" require_relative "whop_sdk/models/ledger_account_retrieve_params" require_relative "whop_sdk/models/ledger_account_retrieve_response" require_relative "whop_sdk/models/lesson" @@ -227,6 +235,7 @@ require_relative "whop_sdk/models/member_retrieve_response" require_relative "whop_sdk/models/membership" require_relative "whop_sdk/models/membership_activated_webhook_event" +require_relative "whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event" require_relative "whop_sdk/models/membership_cancel_params" require_relative "whop_sdk/models/membership_deactivated_webhook_event" require_relative "whop_sdk/models/membership_list_params" @@ -266,8 +275,11 @@ require_relative "whop_sdk/models/payment_retry_params" require_relative "whop_sdk/models/payment_succeeded_webhook_event" require_relative "whop_sdk/models/payment_void_params" +require_relative "whop_sdk/models/payout_method_created_webhook_event" require_relative "whop_sdk/models/payout_method_list_params" require_relative "whop_sdk/models/payout_method_list_response" +require_relative "whop_sdk/models/payout_method_retrieve_params" +require_relative "whop_sdk/models/payout_method_retrieve_response" require_relative "whop_sdk/models/plan" require_relative "whop_sdk/models/plan_create_params" require_relative "whop_sdk/models/plan_delete_params" @@ -338,6 +350,8 @@ require_relative "whop_sdk/models/support_channel_list_response" require_relative "whop_sdk/models/support_channel_retrieve_params" require_relative "whop_sdk/models/tax_type" +require_relative "whop_sdk/models/topup_create_params" +require_relative "whop_sdk/models/topup_create_response" require_relative "whop_sdk/models/transfer" require_relative "whop_sdk/models/transfer_create_params" require_relative "whop_sdk/models/transfer_list_params" @@ -348,6 +362,9 @@ require_relative "whop_sdk/models/user_check_access_response" require_relative "whop_sdk/models/user_retrieve_params" require_relative "whop_sdk/models/user_retrieve_response" +require_relative "whop_sdk/models/verification_retrieve_params" +require_relative "whop_sdk/models/verification_retrieve_response" +require_relative "whop_sdk/models/verification_succeeded_webhook_event" require_relative "whop_sdk/models/visibility" require_relative "whop_sdk/models/visibility_filter" require_relative "whop_sdk/models/webhook_unwrap_params" @@ -388,6 +405,7 @@ require_relative "whop_sdk/resources/forum_posts" require_relative "whop_sdk/resources/forums" require_relative "whop_sdk/resources/invoices" +require_relative "whop_sdk/resources/leads" require_relative "whop_sdk/resources/ledger_accounts" require_relative "whop_sdk/resources/members" require_relative "whop_sdk/resources/memberships" @@ -405,8 +423,10 @@ require_relative "whop_sdk/resources/setup_intents" require_relative "whop_sdk/resources/shipments" require_relative "whop_sdk/resources/support_channels" +require_relative "whop_sdk/resources/topups" require_relative "whop_sdk/resources/transfers" require_relative "whop_sdk/resources/users" +require_relative "whop_sdk/resources/verifications" require_relative "whop_sdk/resources/webhooks" require_relative "whop_sdk/resources/withdrawals" require_relative "whop_sdk/helpers/verify_user_token" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index 132dc328..bfe846a1 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -147,6 +147,15 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::PayoutMethods] attr_reader :payout_methods + # @return [WhopSDK::Resources::Verifications] + attr_reader :verifications + + # @return [WhopSDK::Resources::Leads] + attr_reader :leads + + # @return [WhopSDK::Resources::Topups] + attr_reader :topups + # @api private # # @return [Hash{String=>String}] @@ -245,6 +254,9 @@ def initialize( @payment_methods = WhopSDK::Resources::PaymentMethods.new(client: self) @fee_markups = WhopSDK::Resources::FeeMarkups.new(client: self) @payout_methods = WhopSDK::Resources::PayoutMethods.new(client: self) + @verifications = WhopSDK::Resources::Verifications.new(client: self) + @leads = WhopSDK::Resources::Leads.new(client: self) + @topups = WhopSDK::Resources::Topups.new(client: self) end # Verifies a Whop user token diff --git a/lib/whop_sdk/internal/transport/pooled_net_requester.rb b/lib/whop_sdk/internal/transport/pooled_net_requester.rb index 7cbc3404..ea062b39 100644 --- a/lib/whop_sdk/internal/transport/pooled_net_requester.rb +++ b/lib/whop_sdk/internal/transport/pooled_net_requester.rb @@ -153,17 +153,19 @@ def execute(request) end self.class.calibrate_socket_timeout(conn, deadline) - conn.request(req) do |rsp| - y << [req, rsp] - break if finished - - rsp.read_body do |bytes| - y << bytes.force_encoding(Encoding::BINARY) - break if finished - - self.class.calibrate_socket_timeout(conn, deadline) + ::Kernel.catch(:jump) do + conn.request(req) do |rsp| + y << [req, rsp] + ::Kernel.throw(:jump) if finished + + rsp.read_body do |bytes| + y << bytes.force_encoding(Encoding::BINARY) + ::Kernel.throw(:jump) if finished + + self.class.calibrate_socket_timeout(conn, deadline) + end + eof = true end - eof = true end end ensure diff --git a/lib/whop_sdk/internal/util.rb b/lib/whop_sdk/internal/util.rb index 19909c35..371eaf65 100644 --- a/lib/whop_sdk/internal/util.rb +++ b/lib/whop_sdk/internal/util.rb @@ -657,7 +657,8 @@ def force_charset!(content_type, text:) def decode_content(headers, stream:, suppress_error: false) case (content_type = headers["content-type"]) in WhopSDK::Internal::Util::JSON_CONTENT - json = stream.to_a.join + return nil if (json = stream.to_a.join).empty? + begin JSON.parse(json, symbolize_names: true) rescue JSON::ParserError => e @@ -667,7 +668,11 @@ def decode_content(headers, stream:, suppress_error: false) in WhopSDK::Internal::Util::JSONL_CONTENT lines = decode_lines(stream) chain_fused(lines) do |y| - lines.each { y << JSON.parse(_1, symbolize_names: true) } + lines.each do + next if _1.empty? + + y << JSON.parse(_1, symbolize_names: true) + end end in %r{^text/event-stream} lines = decode_lines(stream) diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 4200147d..4f2e65a0 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -302,6 +302,14 @@ module WhopSDK Languages = WhopSDK::Models::Languages + LeadCreateParams = WhopSDK::Models::LeadCreateParams + + LeadListParams = WhopSDK::Models::LeadListParams + + LeadRetrieveParams = WhopSDK::Models::LeadRetrieveParams + + LeadUpdateParams = WhopSDK::Models::LeadUpdateParams + LedgerAccountRetrieveParams = WhopSDK::Models::LedgerAccountRetrieveParams Lesson = WhopSDK::Models::Lesson @@ -320,6 +328,9 @@ module WhopSDK MembershipActivatedWebhookEvent = WhopSDK::Models::MembershipActivatedWebhookEvent + MembershipCancelAtPeriodEndChangedWebhookEvent = + WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent + MembershipCancelParams = WhopSDK::Models::MembershipCancelParams MembershipDeactivatedWebhookEvent = WhopSDK::Models::MembershipDeactivatedWebhookEvent @@ -384,8 +395,12 @@ module WhopSDK PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + PayoutMethodCreatedWebhookEvent = WhopSDK::Models::PayoutMethodCreatedWebhookEvent + PayoutMethodListParams = WhopSDK::Models::PayoutMethodListParams + PayoutMethodRetrieveParams = WhopSDK::Models::PayoutMethodRetrieveParams + Plan = WhopSDK::Models::Plan PlanCreateParams = WhopSDK::Models::PlanCreateParams @@ -500,6 +515,8 @@ module WhopSDK TaxType = WhopSDK::Models::TaxType + TopupCreateParams = WhopSDK::Models::TopupCreateParams + Transfer = WhopSDK::Models::Transfer TransferCreateParams = WhopSDK::Models::TransferCreateParams @@ -514,6 +531,10 @@ module WhopSDK UserRetrieveParams = WhopSDK::Models::UserRetrieveParams + VerificationRetrieveParams = WhopSDK::Models::VerificationRetrieveParams + + VerificationSucceededWebhookEvent = WhopSDK::Models::VerificationSucceededWebhookEvent + Visibility = WhopSDK::Models::Visibility VisibilityFilter = WhopSDK::Models::VisibilityFilter diff --git a/lib/whop_sdk/models/lead_create_params.rb b/lib/whop_sdk/models/lead_create_params.rb new file mode 100644 index 00000000..c83d1a1d --- /dev/null +++ b/lib/whop_sdk/models/lead_create_params.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#create + class LeadCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute company_id + # The ID of the company to create a lead for. + # + # @return [String] + required :company_id, String + + # @!attribute metadata + # Custom metadata for the lead. + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute product_id + # The ID of the product the lead is interested in. + # + # @return [String, nil] + optional :product_id, String, nil?: true + + # @!attribute referrer + # The url referrer of the lead, if any. + # + # @return [String, nil] + optional :referrer, String, nil?: true + + # @!attribute user_id + # The ID of the user to create a lead for. If the request is made by a user, that + # user will be used. + # + # @return [String, nil] + optional :user_id, String, nil?: true + + # @!method initialize(company_id:, metadata: nil, product_id: nil, referrer: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::LeadCreateParams} for more details. + # + # @param company_id [String] The ID of the company to create a lead for. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param product_id [String, nil] The ID of the product the lead is interested in. + # + # @param referrer [String, nil] The url referrer of the lead, if any. + # + # @param user_id [String, nil] The ID of the user to create a lead for. If the request is made by a user, that + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/lead_create_response.rb b/lib/whop_sdk/models/lead_create_response.rb new file mode 100644 index 00000000..5500c433 --- /dev/null +++ b/lib/whop_sdk/models/lead_create_response.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#create + class LeadCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the lead. + # + # @return [String] + required :id, String + + # @!attribute created_at + # The timestamp of when the lead was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute member + # The converted member, if any. + # + # @return [WhopSDK::Models::LeadCreateResponse::Member, nil] + required :member, -> { WhopSDK::Models::LeadCreateResponse::Member }, nil?: true + + # @!attribute metadata + # Custom metadata for the lead. + # + # @return [Hash{Symbol=>Object}, nil] + required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute product + # The access pass the lead is interested in, if available. + # + # @return [WhopSDK::Models::LeadCreateResponse::Product, nil] + required :product, -> { WhopSDK::Models::LeadCreateResponse::Product }, nil?: true + + # @!attribute referrer + # The referrer URL that brought this lead. + # + # @return [String, nil] + required :referrer, String, nil?: true + + # @!attribute updated_at + # The timestamp of when the lead was last updated. + # + # @return [Time] + required :updated_at, Time + + # @!attribute user + # The user who is the lead. + # + # @return [WhopSDK::Models::LeadCreateResponse::User] + required :user, -> { WhopSDK::Models::LeadCreateResponse::User } + + # @!method initialize(id:, created_at:, member:, metadata:, product:, referrer:, updated_at:, user:) + # An object representing a lead (someone who is interested in a whop). + # + # @param id [String] The ID of the lead. + # + # @param created_at [Time] The timestamp of when the lead was created. + # + # @param member [WhopSDK::Models::LeadCreateResponse::Member, nil] The converted member, if any. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param product [WhopSDK::Models::LeadCreateResponse::Product, nil] The access pass the lead is interested in, if available. + # + # @param referrer [String, nil] The referrer URL that brought this lead. + # + # @param updated_at [Time] The timestamp of when the lead was last updated. + # + # @param user [WhopSDK::Models::LeadCreateResponse::User] The user who is the lead. + + # @see WhopSDK::Models::LeadCreateResponse#member + class Member < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the member + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The converted member, if any. + # + # @param id [String] The ID of the member + end + + # @see WhopSDK::Models::LeadCreateResponse#product + class Product < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the public product. + # + # @return [String] + required :id, String + + # @!attribute title + # The title of the product. Use for Whop 4.0. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The access pass the lead is interested in, if available. + # + # @param id [String] The internal ID of the public product. + # + # @param title [String] The title of the product. Use for Whop 4.0. + end + + # @see WhopSDK::Models::LeadCreateResponse#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the user. + # + # @return [String] + required :id, String + + # @!attribute email + # The email of the user + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute name + # The name of the user from their Whop account. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute username + # The username of the user from their Whop account. + # + # @return [String] + required :username, String + + # @!method initialize(id:, email:, name:, username:) + # The user who is the lead. + # + # @param id [String] The internal ID of the user. + # + # @param email [String, nil] The email of the user + # + # @param name [String, nil] The name of the user from their Whop account. + # + # @param username [String] The username of the user from their Whop account. + end + end + end +end diff --git a/lib/whop_sdk/models/lead_list_params.rb b/lib/whop_sdk/models/lead_list_params.rb new file mode 100644 index 00000000..c88e3626 --- /dev/null +++ b/lib/whop_sdk/models/lead_list_params.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#list + class LeadListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute company_id + # The ID of the company to list leads for + # + # @return [String] + required :company_id, String + + # @!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 created_after + # The minimum creation date to filter by + # + # @return [Time, nil] + optional :created_after, Time, nil?: true + + # @!attribute created_before + # The maximum creation date to filter by + # + # @return [Time, nil] + optional :created_before, Time, 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 product_ids + # The product IDs to filter the leads by + # + # @return [Array, nil] + optional :product_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, first: nil, last: nil, product_ids: nil, request_options: {}) + # @param company_id [String] The ID of the company to list leads for + # + # @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 created_after [Time, nil] The minimum creation date to filter by + # + # @param created_before [Time, nil] The maximum creation date to filter by + # + # @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 product_ids [Array, nil] The product IDs to filter the leads by + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/lead_list_response.rb b/lib/whop_sdk/models/lead_list_response.rb new file mode 100644 index 00000000..25a03e87 --- /dev/null +++ b/lib/whop_sdk/models/lead_list_response.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#list + class LeadListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the lead. + # + # @return [String] + required :id, String + + # @!attribute created_at + # The timestamp of when the lead was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute member + # The converted member, if any. + # + # @return [WhopSDK::Models::LeadListResponse::Member, nil] + required :member, -> { WhopSDK::Models::LeadListResponse::Member }, nil?: true + + # @!attribute metadata + # Custom metadata for the lead. + # + # @return [Hash{Symbol=>Object}, nil] + required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute product + # The access pass the lead is interested in, if available. + # + # @return [WhopSDK::Models::LeadListResponse::Product, nil] + required :product, -> { WhopSDK::Models::LeadListResponse::Product }, nil?: true + + # @!attribute referrer + # The referrer URL that brought this lead. + # + # @return [String, nil] + required :referrer, String, nil?: true + + # @!attribute updated_at + # The timestamp of when the lead was last updated. + # + # @return [Time] + required :updated_at, Time + + # @!attribute user + # The user who is the lead. + # + # @return [WhopSDK::Models::LeadListResponse::User] + required :user, -> { WhopSDK::Models::LeadListResponse::User } + + # @!method initialize(id:, created_at:, member:, metadata:, product:, referrer:, updated_at:, user:) + # An object representing a lead (someone who is interested in a whop). + # + # @param id [String] The ID of the lead. + # + # @param created_at [Time] The timestamp of when the lead was created. + # + # @param member [WhopSDK::Models::LeadListResponse::Member, nil] The converted member, if any. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param product [WhopSDK::Models::LeadListResponse::Product, nil] The access pass the lead is interested in, if available. + # + # @param referrer [String, nil] The referrer URL that brought this lead. + # + # @param updated_at [Time] The timestamp of when the lead was last updated. + # + # @param user [WhopSDK::Models::LeadListResponse::User] The user who is the lead. + + # @see WhopSDK::Models::LeadListResponse#member + class Member < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the member + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The converted member, if any. + # + # @param id [String] The ID of the member + end + + # @see WhopSDK::Models::LeadListResponse#product + class Product < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the public product. + # + # @return [String] + required :id, String + + # @!attribute title + # The title of the product. Use for Whop 4.0. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The access pass the lead is interested in, if available. + # + # @param id [String] The internal ID of the public product. + # + # @param title [String] The title of the product. Use for Whop 4.0. + end + + # @see WhopSDK::Models::LeadListResponse#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the user. + # + # @return [String] + required :id, String + + # @!attribute email + # The email of the user + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute name + # The name of the user from their Whop account. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute username + # The username of the user from their Whop account. + # + # @return [String] + required :username, String + + # @!method initialize(id:, email:, name:, username:) + # The user who is the lead. + # + # @param id [String] The internal ID of the user. + # + # @param email [String, nil] The email of the user + # + # @param name [String, nil] The name of the user from their Whop account. + # + # @param username [String] The username of the user from their Whop account. + end + end + end +end diff --git a/lib/whop_sdk/models/lead_retrieve_params.rb b/lib/whop_sdk/models/lead_retrieve_params.rb new file mode 100644 index 00000000..cc0f8b03 --- /dev/null +++ b/lib/whop_sdk/models/lead_retrieve_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#retrieve + class LeadRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/lead_retrieve_response.rb b/lib/whop_sdk/models/lead_retrieve_response.rb new file mode 100644 index 00000000..605070a7 --- /dev/null +++ b/lib/whop_sdk/models/lead_retrieve_response.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#retrieve + class LeadRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the lead. + # + # @return [String] + required :id, String + + # @!attribute created_at + # The timestamp of when the lead was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute member + # The converted member, if any. + # + # @return [WhopSDK::Models::LeadRetrieveResponse::Member, nil] + required :member, -> { WhopSDK::Models::LeadRetrieveResponse::Member }, nil?: true + + # @!attribute metadata + # Custom metadata for the lead. + # + # @return [Hash{Symbol=>Object}, nil] + required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute product + # The access pass the lead is interested in, if available. + # + # @return [WhopSDK::Models::LeadRetrieveResponse::Product, nil] + required :product, -> { WhopSDK::Models::LeadRetrieveResponse::Product }, nil?: true + + # @!attribute referrer + # The referrer URL that brought this lead. + # + # @return [String, nil] + required :referrer, String, nil?: true + + # @!attribute updated_at + # The timestamp of when the lead was last updated. + # + # @return [Time] + required :updated_at, Time + + # @!attribute user + # The user who is the lead. + # + # @return [WhopSDK::Models::LeadRetrieveResponse::User] + required :user, -> { WhopSDK::Models::LeadRetrieveResponse::User } + + # @!method initialize(id:, created_at:, member:, metadata:, product:, referrer:, updated_at:, user:) + # An object representing a lead (someone who is interested in a whop). + # + # @param id [String] The ID of the lead. + # + # @param created_at [Time] The timestamp of when the lead was created. + # + # @param member [WhopSDK::Models::LeadRetrieveResponse::Member, nil] The converted member, if any. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param product [WhopSDK::Models::LeadRetrieveResponse::Product, nil] The access pass the lead is interested in, if available. + # + # @param referrer [String, nil] The referrer URL that brought this lead. + # + # @param updated_at [Time] The timestamp of when the lead was last updated. + # + # @param user [WhopSDK::Models::LeadRetrieveResponse::User] The user who is the lead. + + # @see WhopSDK::Models::LeadRetrieveResponse#member + class Member < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the member + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The converted member, if any. + # + # @param id [String] The ID of the member + end + + # @see WhopSDK::Models::LeadRetrieveResponse#product + class Product < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the public product. + # + # @return [String] + required :id, String + + # @!attribute title + # The title of the product. Use for Whop 4.0. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The access pass the lead is interested in, if available. + # + # @param id [String] The internal ID of the public product. + # + # @param title [String] The title of the product. Use for Whop 4.0. + end + + # @see WhopSDK::Models::LeadRetrieveResponse#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the user. + # + # @return [String] + required :id, String + + # @!attribute email + # The email of the user + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute name + # The name of the user from their Whop account. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute username + # The username of the user from their Whop account. + # + # @return [String] + required :username, String + + # @!method initialize(id:, email:, name:, username:) + # The user who is the lead. + # + # @param id [String] The internal ID of the user. + # + # @param email [String, nil] The email of the user + # + # @param name [String, nil] The name of the user from their Whop account. + # + # @param username [String] The username of the user from their Whop account. + end + end + end +end diff --git a/lib/whop_sdk/models/lead_update_params.rb b/lib/whop_sdk/models/lead_update_params.rb new file mode 100644 index 00000000..9e8da9e8 --- /dev/null +++ b/lib/whop_sdk/models/lead_update_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#update + class LeadUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute metadata + # Custom metadata for the lead. + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute referrer + # The url referrer of the lead. + # + # @return [String, nil] + optional :referrer, String, nil?: true + + # @!method initialize(metadata: nil, referrer: nil, request_options: {}) + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param referrer [String, nil] The url referrer of the lead. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/lead_update_response.rb b/lib/whop_sdk/models/lead_update_response.rb new file mode 100644 index 00000000..40479789 --- /dev/null +++ b/lib/whop_sdk/models/lead_update_response.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Leads#update + class LeadUpdateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the lead. + # + # @return [String] + required :id, String + + # @!attribute created_at + # The timestamp of when the lead was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute member + # The converted member, if any. + # + # @return [WhopSDK::Models::LeadUpdateResponse::Member, nil] + required :member, -> { WhopSDK::Models::LeadUpdateResponse::Member }, nil?: true + + # @!attribute metadata + # Custom metadata for the lead. + # + # @return [Hash{Symbol=>Object}, nil] + required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute product + # The access pass the lead is interested in, if available. + # + # @return [WhopSDK::Models::LeadUpdateResponse::Product, nil] + required :product, -> { WhopSDK::Models::LeadUpdateResponse::Product }, nil?: true + + # @!attribute referrer + # The referrer URL that brought this lead. + # + # @return [String, nil] + required :referrer, String, nil?: true + + # @!attribute updated_at + # The timestamp of when the lead was last updated. + # + # @return [Time] + required :updated_at, Time + + # @!attribute user + # The user who is the lead. + # + # @return [WhopSDK::Models::LeadUpdateResponse::User] + required :user, -> { WhopSDK::Models::LeadUpdateResponse::User } + + # @!method initialize(id:, created_at:, member:, metadata:, product:, referrer:, updated_at:, user:) + # An object representing a lead (someone who is interested in a whop). + # + # @param id [String] The ID of the lead. + # + # @param created_at [Time] The timestamp of when the lead was created. + # + # @param member [WhopSDK::Models::LeadUpdateResponse::Member, nil] The converted member, if any. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param product [WhopSDK::Models::LeadUpdateResponse::Product, nil] The access pass the lead is interested in, if available. + # + # @param referrer [String, nil] The referrer URL that brought this lead. + # + # @param updated_at [Time] The timestamp of when the lead was last updated. + # + # @param user [WhopSDK::Models::LeadUpdateResponse::User] The user who is the lead. + + # @see WhopSDK::Models::LeadUpdateResponse#member + class Member < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the member + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The converted member, if any. + # + # @param id [String] The ID of the member + end + + # @see WhopSDK::Models::LeadUpdateResponse#product + class Product < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the public product. + # + # @return [String] + required :id, String + + # @!attribute title + # The title of the product. Use for Whop 4.0. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The access pass the lead is interested in, if available. + # + # @param id [String] The internal ID of the public product. + # + # @param title [String] The title of the product. Use for Whop 4.0. + end + + # @see WhopSDK::Models::LeadUpdateResponse#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The internal ID of the user. + # + # @return [String] + required :id, String + + # @!attribute email + # The email of the user + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute name + # The name of the user from their Whop account. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute username + # The username of the user from their Whop account. + # + # @return [String] + required :username, String + + # @!method initialize(id:, email:, name:, username:) + # The user who is the lead. + # + # @param id [String] The internal ID of the user. + # + # @param email [String, nil] The email of the user + # + # @param name [String, nil] The name of the user from their Whop account. + # + # @param username [String] The username of the user from their Whop account. + end + end + end +end diff --git a/lib/whop_sdk/models/ledger_account_retrieve_response.rb b/lib/whop_sdk/models/ledger_account_retrieve_response.rb index 8c317e3c..20985ddd 100644 --- a/lib/whop_sdk/models/ledger_account_retrieve_response.rb +++ b/lib/whop_sdk/models/ledger_account_retrieve_response.rb @@ -294,13 +294,21 @@ class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :email, String, nil?: true + # @!attribute latest_verification + # The latest verification for the connected account. + # + # @return [WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification, nil] + required :latest_verification, + -> { WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification }, + nil?: true + # @!attribute phone # The business representative's phone # # @return [String, nil] required :phone, String, nil?: true - # @!method initialize(id:, address:, business_name:, business_representative:, email:, phone:) + # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:) # The payout account associated with the LedgerAccount, if any. # # @param id [String] Unique identifier for the object @@ -313,6 +321,8 @@ class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel # # @param email [String, nil] The email address of the representative # + # @param latest_verification [WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification, nil] The latest verification for the connected account. + # # @param phone [String, nil] The business representative's phone # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails#address @@ -411,6 +421,101 @@ class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel # # @param middle_name [String, nil] The middle name of the business representative. end + + # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails#latest_verification + class LatestVerification < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique identifier for the verification. + # + # @return [String] + required :id, String + + # @!attribute last_error_code + # An error code for a verification attempt. + # + # @return [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode, nil] + required :last_error_code, + enum: -> { WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode }, + nil?: true + + # @!attribute last_error_reason + # The last error reason that occurred during the verification. + # + # @return [String, nil] + required :last_error_reason, String, nil?: true + + # @!attribute status + # The status of the verification. + # + # @return [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status] + required :status, + enum: -> { WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status } + + # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # The latest verification for the connected account. + # + # @param id [String] A unique identifier for the verification. + # + # @param last_error_code [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode, nil] An error code for a verification attempt. + # + # @param last_error_reason [String, nil] The last error reason that occurred during the verification. + # + # @param status [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status] The status of the verification. + + # An error code for a verification attempt. + # + # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification#last_error_code + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + ABANDONED = :abandoned + CONSENT_DECLINED = :consent_declined + COUNTRY_NOT_SUPPORTED = :country_not_supported + DEVICE_NOT_SUPPORTED = :device_not_supported + DOCUMENT_EXPIRED = :document_expired + DOCUMENT_TYPE_NOT_SUPPORTED = :document_type_not_supported + DOCUMENT_UNVERIFIED_OTHER = :document_unverified_other + EMAIL_UNVERIFIED_OTHER = :email_unverified_other + EMAIL_VERIFICATION_DECLINED = :email_verification_declined + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA = :id_number_insufficient_document_data + ID_NUMBER_MISMATCH = :id_number_mismatch + ID_NUMBER_UNVERIFIED_OTHER = :id_number_unverified_other + PHONE_UNVERIFIED_OTHER = :phone_unverified_other + PHONE_VERIFICATION_DECLINED = :phone_verification_declined + SELFIE_DOCUMENT_MISSING_PHOTO = :selfie_document_missing_photo + SELFIE_FACE_MISMATCH = :selfie_face_mismatch + SELFIE_MANIPULATED = :selfie_manipulated + SELFIE_UNVERIFIED_OTHER = :selfie_unverified_other + UNDER_SUPPORTED_AGE = :under_supported_age + + # @!method self.values + # @return [Array] + end + + # The status of the verification. + # + # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification#status + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRES_INPUT = :requires_input + PROCESSING = :processing + VERIFIED = :verified + CANCELED = :canceled + CREATED = :created + STARTED = :started + SUBMITTED = :submitted + APPROVED = :approved + DECLINED = :declined + RESUBMISSION_REQUESTED = :resubmission_requested + EXPIRED = :expired + ABANDONED = :abandoned + REVIEW = :review + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rb b/lib/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rb new file mode 100644 index 00000000..ce5d0bbb --- /dev/null +++ b/lib/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class MembershipCancelAtPeriodEndChangedWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # A membership represents a purchase between a User and a Company for a specific + # Product. + # + # @return [WhopSDK::Models::Membership] + required :data, -> { WhopSDK::Membership } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"membership.cancel_at_period_end_changed"] + required :type, const: :"membership.cancel_at_period_end_changed" + + # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"membership.cancel_at_period_end_changed") + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent} for more + # details. + # + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::Membership] A membership represents a purchase between a User and a Company for a specific P + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"membership.cancel_at_period_end_changed"] The webhook event type + end + end +end diff --git a/lib/whop_sdk/models/membership_status.rb b/lib/whop_sdk/models/membership_status.rb index 7392b34f..fa8bdc90 100644 --- a/lib/whop_sdk/models/membership_status.rb +++ b/lib/whop_sdk/models/membership_status.rb @@ -14,6 +14,7 @@ module MembershipStatus EXPIRED = :expired UNRESOLVED = :unresolved DRAFTED = :drafted + CANCELING = :canceling # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/payment.rb b/lib/whop_sdk/models/payment.rb index 19de8bc0..1e4b218e 100644 --- a/lib/whop_sdk/models/payment.rb +++ b/lib/whop_sdk/models/payment.rb @@ -94,8 +94,8 @@ class Payment < WhopSDK::Internal::Type::BaseModel required :membership, -> { WhopSDK::Payment::Membership }, nil?: true # @!attribute metadata - # The custom metadata stored on this payment. This will be copied the checkout - # configuration for which this payment was made + # The custom metadata stored on this payment. This will be copied over to the + # checkout configuration for which this payment was made # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -242,7 +242,7 @@ class Payment < WhopSDK::Internal::Type::BaseModel # # @param membership [WhopSDK::Models::Payment::Membership, nil] The membership attached to this payment. # - # @param metadata [Hash{Symbol=>Object}, nil] The custom metadata stored on this payment. This will be copied the checkout con + # @param metadata [Hash{Symbol=>Object}, nil] The custom metadata stored on this payment. This will be copied over to the chec # # @param paid_at [Time, nil] The datetime the payment was paid # diff --git a/lib/whop_sdk/models/payment_create_params.rb b/lib/whop_sdk/models/payment_create_params.rb index df4ea2b6..05436994 100644 --- a/lib/whop_sdk/models/payment_create_params.rb +++ b/lib/whop_sdk/models/payment_create_params.rb @@ -32,13 +32,19 @@ class PaymentCreateParams < WhopSDK::Internal::Type::BaseModel # @return [WhopSDK::Models::PaymentCreateParams::Plan] required :plan, -> { WhopSDK::PaymentCreateParams::Plan } + # @!attribute metadata + # Custom metadata to attach to the payment. + # + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @!attribute plan_id # An ID of an existing plan to use for the payment. # # @return [String] required :plan_id, String - # @!method initialize(company_id:, member_id:, payment_method_id:, plan:, plan_id:, request_options: {}) + # @!method initialize(company_id:, member_id:, payment_method_id:, plan:, plan_id:, metadata: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PaymentCreateParams} for more details. # @@ -52,6 +58,8 @@ class PaymentCreateParams < WhopSDK::Internal::Type::BaseModel # # @param plan_id [String] An ID of an existing plan to use for the payment. # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata to attach to the payment. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] class Plan < WhopSDK::Internal::Type::BaseModel diff --git a/lib/whop_sdk/models/payment_list_fees_response.rb b/lib/whop_sdk/models/payment_list_fees_response.rb index e4acdbe2..111f539f 100644 --- a/lib/whop_sdk/models/payment_list_fees_response.rb +++ b/lib/whop_sdk/models/payment_list_fees_response.rb @@ -75,6 +75,7 @@ module Type THREE_DS_FIXED_FEE = :three_ds_fixed_fee BILLING_PERCENTAGE_FEE = :billing_percentage_fee REVSHARE_PERCENTAGE_FEE = :revshare_percentage_fee + APPLICATION_FEE = :application_fee # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/payment_list_response.rb b/lib/whop_sdk/models/payment_list_response.rb index 1fdb0d93..3541ebf4 100644 --- a/lib/whop_sdk/models/payment_list_response.rb +++ b/lib/whop_sdk/models/payment_list_response.rb @@ -95,8 +95,8 @@ class PaymentListResponse < WhopSDK::Internal::Type::BaseModel required :membership, -> { WhopSDK::Models::PaymentListResponse::Membership }, nil?: true # @!attribute metadata - # The custom metadata stored on this payment. This will be copied the checkout - # configuration for which this payment was made + # The custom metadata stored on this payment. This will be copied over to the + # checkout configuration for which this payment was made # # @return [Hash{Symbol=>Object}, nil] required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true @@ -243,7 +243,7 @@ class PaymentListResponse < WhopSDK::Internal::Type::BaseModel # # @param membership [WhopSDK::Models::PaymentListResponse::Membership, nil] The membership attached to this payment. # - # @param metadata [Hash{Symbol=>Object}, nil] The custom metadata stored on this payment. This will be copied the checkout con + # @param metadata [Hash{Symbol=>Object}, nil] The custom metadata stored on this payment. This will be copied over to the chec # # @param paid_at [Time, nil] The datetime the payment was paid # diff --git a/lib/whop_sdk/models/payment_method_list_params.rb b/lib/whop_sdk/models/payment_method_list_params.rb index 95596b4a..04f93f63 100644 --- a/lib/whop_sdk/models/payment_method_list_params.rb +++ b/lib/whop_sdk/models/payment_method_list_params.rb @@ -7,12 +7,6 @@ class PaymentMethodListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute member_id - # The ID of the Member to list payment methods for - # - # @return [String] - required :member_id, String - # @!attribute after # Returns the elements in the list that come after the specified cursor. # @@ -25,6 +19,12 @@ class PaymentMethodListParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :before, String, nil?: true + # @!attribute company_id + # The ID of the Company. Provide either this or member_id (not both). + # + # @return [String, nil] + optional :company_id, String, nil?: true + # @!attribute created_after # The minimum creation date to filter by # @@ -55,13 +55,19 @@ class PaymentMethodListParams < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :last, Integer, nil?: true - # @!method initialize(member_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) - # @param member_id [String] The ID of the Member to list payment methods for + # @!attribute member_id + # The ID of the Member to list payment methods for # + # @return [String, nil] + optional :member_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, member_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] The ID of the Company. Provide either this or member_id (not both). + # # @param created_after [Time, nil] The minimum creation date to filter by # # @param created_before [Time, nil] The maximum creation date to filter by @@ -72,6 +78,8 @@ class PaymentMethodListParams < WhopSDK::Internal::Type::BaseModel # # @param last [Integer, nil] Returns the last _n_ elements from the list. # + # @param member_id [String, nil] The ID of the Member to list payment methods for + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/payment_method_retrieve_params.rb b/lib/whop_sdk/models/payment_method_retrieve_params.rb index b103a8c4..350c12f1 100644 --- a/lib/whop_sdk/models/payment_method_retrieve_params.rb +++ b/lib/whop_sdk/models/payment_method_retrieve_params.rb @@ -7,14 +7,22 @@ class PaymentMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + # @!attribute company_id + # The ID of the Company. Provide either this or member_id (not both). + # + # @return [String, nil] + optional :company_id, String, nil?: true + # @!attribute member_id - # The ID of the Member associated with the PaymentMethod + # The ID of the Member. Provide either this or company_id (not both). # - # @return [String] - required :member_id, String + # @return [String, nil] + optional :member_id, String, nil?: true - # @!method initialize(member_id:, request_options: {}) - # @param member_id [String] The ID of the Member associated with the PaymentMethod + # @!method initialize(company_id: nil, member_id: nil, request_options: {}) + # @param company_id [String, nil] The ID of the Company. Provide either this or member_id (not both). + # + # @param member_id [String, nil] The ID of the Member. Provide either this or company_id (not both). # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/payout_method_created_webhook_event.rb b/lib/whop_sdk/models/payout_method_created_webhook_event.rb new file mode 100644 index 00000000..f3b5cd6c --- /dev/null +++ b/lib/whop_sdk/models/payout_method_created_webhook_event.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class PayoutMethodCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # An object representing an user's setup payout destination. + # + # @return [WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data] + required :data, -> { WhopSDK::PayoutMethodCreatedWebhookEvent::Data } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"payout_method.created"] + required :type, const: :"payout_method.created" + + # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"payout_method.created") + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data] An object representing an user's setup payout destination. + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"payout_method.created"] The webhook event type + + # @see WhopSDK::Models::PayoutMethodCreatedWebhookEvent#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the payout token + # + # @return [String] + required :id, String + + # @!attribute company + # The company associated with the payout token + # + # @return [WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Company, nil] + required :company, -> { WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company }, nil?: true + + # @!attribute currency + # The currency code of the payout destination. This is the currency that payouts + # will be made in for this token. + # + # @return [String] + required :currency, String + + # @!attribute destination + # The payout destination associated with the payout token + # + # @return [WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination, nil] + required :destination, -> { WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination }, nil?: true + + # @!attribute is_default + # Whether this payout token is the default for the payout account + # + # @return [Boolean] + required :is_default, WhopSDK::Internal::Type::Boolean + + # @!attribute nickname + # An optional nickname for the payout token to help the user identify it. This is + # not used by the provider and is only for the user's reference. + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!method initialize(id:, company:, currency:, destination:, is_default:, nickname:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data} for more details. + # + # An object representing an user's setup payout destination. + # + # @param id [String] The ID of the payout token + # + # @param company [WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Company, nil] The company associated with the payout token + # + # @param currency [String] The currency code of the payout destination. This is the currency that payouts w + # + # @param destination [WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination, nil] The payout destination associated with the payout token + # + # @param is_default [Boolean] Whether this payout token is the default for the payout account + # + # @param nickname [String, nil] An optional nickname for the payout token to help the user identify it. This is + + # @see WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data#company + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID (tag) of the company. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The company associated with the payout token + # + # @param id [String] The ID (tag) of the company. + end + + # @see WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data#destination + class Destination < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # The category of the payout destination + # + # @return [Symbol, WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::Category] + required :category, enum: -> { WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category } + + # @!attribute country_code + # The country code of the payout destination + # + # @return [String] + required :country_code, String + + # @!attribute name + # The name of the payer associated with the payout destination + # + # @return [String] + required :name, String + + # @!method initialize(category:, country_code:, name:) + # The payout destination associated with the payout token + # + # @param category [Symbol, WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::Category] The category of the payout destination + # + # @param country_code [String] The country code of the payout destination + # + # @param name [String] The name of the payer associated with the payout destination + + # The category of the payout destination + # + # @see WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination#category + module Category + extend WhopSDK::Internal::Type::Enum + + CRYPTO = :crypto + RTP = :rtp + NEXT_DAY_BANK = :next_day_bank + BANK_WIRE = :bank_wire + DIGITAL_WALLET = :digital_wallet + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/whop_sdk/models/payout_method_list_response.rb b/lib/whop_sdk/models/payout_method_list_response.rb index 7772b76d..44e6ccb0 100644 --- a/lib/whop_sdk/models/payout_method_list_response.rb +++ b/lib/whop_sdk/models/payout_method_list_response.rb @@ -10,6 +10,12 @@ class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute company + # The company associated with the payout token + # + # @return [WhopSDK::Models::PayoutMethodListResponse::Company, nil] + required :company, -> { WhopSDK::Models::PayoutMethodListResponse::Company }, nil?: true + # @!attribute currency # The currency code of the payout destination. This is the currency that payouts # will be made in for this token. @@ -23,6 +29,12 @@ class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel # @return [WhopSDK::Models::PayoutMethodListResponse::Destination, nil] required :destination, -> { WhopSDK::Models::PayoutMethodListResponse::Destination }, nil?: true + # @!attribute is_default + # Whether this payout token is the default for the payout account + # + # @return [Boolean] + required :is_default, WhopSDK::Internal::Type::Boolean + # @!attribute nickname # An optional nickname for the payout token to help the user identify it. This is # not used by the provider and is only for the user's reference. @@ -30,7 +42,7 @@ class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :nickname, String, nil?: true - # @!method initialize(id:, currency:, destination:, nickname:) + # @!method initialize(id:, company:, currency:, destination:, is_default:, nickname:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PayoutMethodListResponse} for more details. # @@ -38,12 +50,30 @@ class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel # # @param id [String] The ID of the payout token # + # @param company [WhopSDK::Models::PayoutMethodListResponse::Company, nil] The company associated with the payout token + # # @param currency [String] The currency code of the payout destination. This is the currency that payouts w # # @param destination [WhopSDK::Models::PayoutMethodListResponse::Destination, nil] The payout destination associated with the payout token # + # @param is_default [Boolean] Whether this payout token is the default for the payout account + # # @param nickname [String, nil] An optional nickname for the payout token to help the user identify it. This is + # @see WhopSDK::Models::PayoutMethodListResponse#company + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID (tag) of the company. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The company associated with the payout token + # + # @param id [String] The ID (tag) of the company. + end + # @see WhopSDK::Models::PayoutMethodListResponse#destination class Destination < WhopSDK::Internal::Type::BaseModel # @!attribute category diff --git a/lib/whop_sdk/models/payout_method_retrieve_params.rb b/lib/whop_sdk/models/payout_method_retrieve_params.rb new file mode 100644 index 00000000..e70a6ad0 --- /dev/null +++ b/lib/whop_sdk/models/payout_method_retrieve_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::PayoutMethods#retrieve + class PayoutMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/payout_method_retrieve_response.rb b/lib/whop_sdk/models/payout_method_retrieve_response.rb new file mode 100644 index 00000000..054f2c58 --- /dev/null +++ b/lib/whop_sdk/models/payout_method_retrieve_response.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::PayoutMethods#retrieve + class PayoutMethodRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the payout token + # + # @return [String] + required :id, String + + # @!attribute company + # The company associated with the payout token + # + # @return [WhopSDK::Models::PayoutMethodRetrieveResponse::Company, nil] + required :company, -> { WhopSDK::Models::PayoutMethodRetrieveResponse::Company }, nil?: true + + # @!attribute currency + # The currency code of the payout destination. This is the currency that payouts + # will be made in for this token. + # + # @return [String] + required :currency, String + + # @!attribute destination + # The payout destination associated with the payout token + # + # @return [WhopSDK::Models::PayoutMethodRetrieveResponse::Destination, nil] + required :destination, -> { WhopSDK::Models::PayoutMethodRetrieveResponse::Destination }, nil?: true + + # @!attribute is_default + # Whether this payout token is the default for the payout account + # + # @return [Boolean] + required :is_default, WhopSDK::Internal::Type::Boolean + + # @!attribute nickname + # An optional nickname for the payout token to help the user identify it. This is + # not used by the provider and is only for the user's reference. + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!method initialize(id:, company:, currency:, destination:, is_default:, nickname:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutMethodRetrieveResponse} for more details. + # + # An object representing an user's setup payout destination. + # + # @param id [String] The ID of the payout token + # + # @param company [WhopSDK::Models::PayoutMethodRetrieveResponse::Company, nil] The company associated with the payout token + # + # @param currency [String] The currency code of the payout destination. This is the currency that payouts w + # + # @param destination [WhopSDK::Models::PayoutMethodRetrieveResponse::Destination, nil] The payout destination associated with the payout token + # + # @param is_default [Boolean] Whether this payout token is the default for the payout account + # + # @param nickname [String, nil] An optional nickname for the payout token to help the user identify it. This is + + # @see WhopSDK::Models::PayoutMethodRetrieveResponse#company + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID (tag) of the company. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The company associated with the payout token + # + # @param id [String] The ID (tag) of the company. + end + + # @see WhopSDK::Models::PayoutMethodRetrieveResponse#destination + class Destination < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # The category of the payout destination + # + # @return [Symbol, WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category] + required :category, enum: -> { WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category } + + # @!attribute country_code + # The country code of the payout destination + # + # @return [String] + required :country_code, String + + # @!attribute name + # The name of the payer associated with the payout destination + # + # @return [String] + required :name, String + + # @!method initialize(category:, country_code:, name:) + # The payout destination associated with the payout token + # + # @param category [Symbol, WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category] The category of the payout destination + # + # @param country_code [String] The country code of the payout destination + # + # @param name [String] The name of the payer associated with the payout destination + + # The category of the payout destination + # + # @see WhopSDK::Models::PayoutMethodRetrieveResponse::Destination#category + module Category + extend WhopSDK::Internal::Type::Enum + + CRYPTO = :crypto + RTP = :rtp + NEXT_DAY_BANK = :next_day_bank + BANK_WIRE = :bank_wire + DIGITAL_WALLET = :digital_wallet + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/support_channel_create_params.rb b/lib/whop_sdk/models/support_channel_create_params.rb index 5057d2c7..77e8d967 100644 --- a/lib/whop_sdk/models/support_channel_create_params.rb +++ b/lib/whop_sdk/models/support_channel_create_params.rb @@ -14,7 +14,7 @@ class SupportChannelCreateParams < WhopSDK::Internal::Type::BaseModel required :company_id, String # @!attribute user_id - # The ID of the user to create the support chat for + # The ID (user_xxx) or username of the user to create the support chat for # # @return [String] required :user_id, String @@ -22,7 +22,7 @@ class SupportChannelCreateParams < WhopSDK::Internal::Type::BaseModel # @!method initialize(company_id:, user_id:, request_options: {}) # @param company_id [String] The ID of the company to create the support chat in # - # @param user_id [String] The ID of the user to create the support chat for + # @param user_id [String] The ID (user_xxx) or username of the user to create the support chat for # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/topup_create_params.rb b/lib/whop_sdk/models/topup_create_params.rb new file mode 100644 index 00000000..4ca4c460 --- /dev/null +++ b/lib/whop_sdk/models/topup_create_params.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Topups#create + class TopupCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute amount + # The amount to add to the balance. + # + # @return [Float] + required :amount, Float + + # @!attribute company_id + # The ID of the company to add funds to. + # + # @return [String] + required :company_id, String + + # @!attribute currency + # The currency of the top-up. + # + # @return [Symbol, WhopSDK::Models::Currency] + required :currency, enum: -> { WhopSDK::Currency } + + # @!attribute payment_method_id + # The ID of the payment method to charge for the top-up. + # + # @return [String] + required :payment_method_id, String + + # @!method initialize(amount:, company_id:, currency:, payment_method_id:, request_options: {}) + # @param amount [Float] The amount to add to the balance. + # + # @param company_id [String] The ID of the company to add funds to. + # + # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the top-up. + # + # @param payment_method_id [String] The ID of the payment method to charge for the top-up. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/topup_create_response.rb b/lib/whop_sdk/models/topup_create_response.rb new file mode 100644 index 00000000..65010f9f --- /dev/null +++ b/lib/whop_sdk/models/topup_create_response.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Topups#create + class TopupCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The payment ID + # + # @return [String] + required :id, String + + # @!attribute created_at + # The datetime the payment was created + # + # @return [Time] + required :created_at, Time + + # @!attribute currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + required :currency, enum: -> { WhopSDK::Currency }, nil?: true + + # @!attribute failure_message + # If the payment failed, the reason for the failure. + # + # @return [String, nil] + required :failure_message, String, nil?: true + + # @!attribute paid_at + # The datetime the payment was paid + # + # @return [Time, nil] + required :paid_at, Time, nil?: true + + # @!attribute status + # The status of a receipt + # + # @return [Symbol, WhopSDK::Models::ReceiptStatus, nil] + required :status, enum: -> { WhopSDK::ReceiptStatus }, nil?: true + + # @!attribute total + # The total to show to the creator (excluding buyer fees). + # + # @return [Float, nil] + required :total, Float, nil?: true + + # @!method initialize(id:, created_at:, currency:, failure_message:, paid_at:, status:, total:) + # An object representing a receipt for a membership. + # + # @param id [String] The payment ID + # + # @param created_at [Time] The datetime the payment was created + # + # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # + # @param failure_message [String, nil] If the payment failed, the reason for the failure. + # + # @param paid_at [Time, nil] The datetime the payment was paid + # + # @param status [Symbol, WhopSDK::Models::ReceiptStatus, nil] The status of a receipt + # + # @param total [Float, nil] The total to show to the creator (excluding buyer fees). + end + end +end diff --git a/lib/whop_sdk/models/unwrap_webhook_event.rb b/lib/whop_sdk/models/unwrap_webhook_event.rb index 617487b8..8221537c 100644 --- a/lib/whop_sdk/models/unwrap_webhook_event.rb +++ b/lib/whop_sdk/models/unwrap_webhook_event.rb @@ -40,6 +40,10 @@ module UnwrapWebhookEvent variant :"course_lesson_interaction.completed", -> { WhopSDK::CourseLessonInteractionCompletedWebhookEvent } + variant :"payout_method.created", -> { WhopSDK::PayoutMethodCreatedWebhookEvent } + + variant :"verification.succeeded", -> { WhopSDK::VerificationSucceededWebhookEvent } + variant :"payment.created", -> { WhopSDK::PaymentCreatedWebhookEvent } variant :"payment.succeeded", -> { WhopSDK::PaymentSucceededWebhookEvent } @@ -56,8 +60,11 @@ module UnwrapWebhookEvent variant :"refund.updated", -> { WhopSDK::RefundUpdatedWebhookEvent } + variant :"membership.cancel_at_period_end_changed", + -> { WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent } + # @!method self.variants - # @return [Array(WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent)] + # @return [Array(WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent)] end end end diff --git a/lib/whop_sdk/models/verification_retrieve_params.rb b/lib/whop_sdk/models/verification_retrieve_params.rb new file mode 100644 index 00000000..871e6d86 --- /dev/null +++ b/lib/whop_sdk/models/verification_retrieve_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#retrieve + class VerificationRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/verification_retrieve_response.rb b/lib/whop_sdk/models/verification_retrieve_response.rb new file mode 100644 index 00000000..0e33f44d --- /dev/null +++ b/lib/whop_sdk/models/verification_retrieve_response.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#retrieve + class VerificationRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique identifier for the verification. + # + # @return [String] + required :id, String + + # @!attribute last_error_code + # An error code for a verification attempt. + # + # @return [Symbol, WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode, nil] + required :last_error_code, + enum: -> { WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode }, + nil?: true + + # @!attribute last_error_reason + # The last error reason that occurred during the verification. + # + # @return [String, nil] + required :last_error_reason, String, nil?: true + + # @!attribute status + # The status of the verification. + # + # @return [Symbol, WhopSDK::Models::VerificationRetrieveResponse::Status] + required :status, enum: -> { WhopSDK::Models::VerificationRetrieveResponse::Status } + + # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # An object representing an identity verification session + # + # @param id [String] A unique identifier for the verification. + # + # @param last_error_code [Symbol, WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode, nil] An error code for a verification attempt. + # + # @param last_error_reason [String, nil] The last error reason that occurred during the verification. + # + # @param status [Symbol, WhopSDK::Models::VerificationRetrieveResponse::Status] The status of the verification. + + # An error code for a verification attempt. + # + # @see WhopSDK::Models::VerificationRetrieveResponse#last_error_code + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + ABANDONED = :abandoned + CONSENT_DECLINED = :consent_declined + COUNTRY_NOT_SUPPORTED = :country_not_supported + DEVICE_NOT_SUPPORTED = :device_not_supported + DOCUMENT_EXPIRED = :document_expired + DOCUMENT_TYPE_NOT_SUPPORTED = :document_type_not_supported + DOCUMENT_UNVERIFIED_OTHER = :document_unverified_other + EMAIL_UNVERIFIED_OTHER = :email_unverified_other + EMAIL_VERIFICATION_DECLINED = :email_verification_declined + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA = :id_number_insufficient_document_data + ID_NUMBER_MISMATCH = :id_number_mismatch + ID_NUMBER_UNVERIFIED_OTHER = :id_number_unverified_other + PHONE_UNVERIFIED_OTHER = :phone_unverified_other + PHONE_VERIFICATION_DECLINED = :phone_verification_declined + SELFIE_DOCUMENT_MISSING_PHOTO = :selfie_document_missing_photo + SELFIE_FACE_MISMATCH = :selfie_face_mismatch + SELFIE_MANIPULATED = :selfie_manipulated + SELFIE_UNVERIFIED_OTHER = :selfie_unverified_other + UNDER_SUPPORTED_AGE = :under_supported_age + + # @!method self.values + # @return [Array] + end + + # The status of the verification. + # + # @see WhopSDK::Models::VerificationRetrieveResponse#status + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRES_INPUT = :requires_input + PROCESSING = :processing + VERIFIED = :verified + CANCELED = :canceled + CREATED = :created + STARTED = :started + SUBMITTED = :submitted + APPROVED = :approved + DECLINED = :declined + RESUBMISSION_REQUESTED = :resubmission_requested + EXPIRED = :expired + ABANDONED = :abandoned + REVIEW = :review + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/verification_succeeded_webhook_event.rb b/lib/whop_sdk/models/verification_succeeded_webhook_event.rb new file mode 100644 index 00000000..bedd9236 --- /dev/null +++ b/lib/whop_sdk/models/verification_succeeded_webhook_event.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class VerificationSucceededWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # An object representing an identity verification session + # + # @return [WhopSDK::Models::VerificationSucceededWebhookEvent::Data] + required :data, -> { WhopSDK::VerificationSucceededWebhookEvent::Data } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"verification.succeeded"] + required :type, const: :"verification.succeeded" + + # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"verification.succeeded") + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::VerificationSucceededWebhookEvent::Data] An object representing an identity verification session + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"verification.succeeded"] The webhook event type + + # @see WhopSDK::Models::VerificationSucceededWebhookEvent#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique identifier for the verification. + # + # @return [String] + required :id, String + + # @!attribute last_error_code + # An error code for a verification attempt. + # + # @return [Symbol, WhopSDK::Models::VerificationSucceededWebhookEvent::Data::LastErrorCode, nil] + required :last_error_code, + enum: -> { WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode }, + nil?: true + + # @!attribute last_error_reason + # The last error reason that occurred during the verification. + # + # @return [String, nil] + required :last_error_reason, String, nil?: true + + # @!attribute status + # The status of the verification. + # + # @return [Symbol, WhopSDK::Models::VerificationSucceededWebhookEvent::Data::Status] + required :status, enum: -> { WhopSDK::VerificationSucceededWebhookEvent::Data::Status } + + # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # An object representing an identity verification session + # + # @param id [String] A unique identifier for the verification. + # + # @param last_error_code [Symbol, WhopSDK::Models::VerificationSucceededWebhookEvent::Data::LastErrorCode, nil] An error code for a verification attempt. + # + # @param last_error_reason [String, nil] The last error reason that occurred during the verification. + # + # @param status [Symbol, WhopSDK::Models::VerificationSucceededWebhookEvent::Data::Status] The status of the verification. + + # An error code for a verification attempt. + # + # @see WhopSDK::Models::VerificationSucceededWebhookEvent::Data#last_error_code + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + ABANDONED = :abandoned + CONSENT_DECLINED = :consent_declined + COUNTRY_NOT_SUPPORTED = :country_not_supported + DEVICE_NOT_SUPPORTED = :device_not_supported + DOCUMENT_EXPIRED = :document_expired + DOCUMENT_TYPE_NOT_SUPPORTED = :document_type_not_supported + DOCUMENT_UNVERIFIED_OTHER = :document_unverified_other + EMAIL_UNVERIFIED_OTHER = :email_unverified_other + EMAIL_VERIFICATION_DECLINED = :email_verification_declined + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA = :id_number_insufficient_document_data + ID_NUMBER_MISMATCH = :id_number_mismatch + ID_NUMBER_UNVERIFIED_OTHER = :id_number_unverified_other + PHONE_UNVERIFIED_OTHER = :phone_unverified_other + PHONE_VERIFICATION_DECLINED = :phone_verification_declined + SELFIE_DOCUMENT_MISSING_PHOTO = :selfie_document_missing_photo + SELFIE_FACE_MISMATCH = :selfie_face_mismatch + SELFIE_MANIPULATED = :selfie_manipulated + SELFIE_UNVERIFIED_OTHER = :selfie_unverified_other + UNDER_SUPPORTED_AGE = :under_supported_age + + # @!method self.values + # @return [Array] + end + + # The status of the verification. + # + # @see WhopSDK::Models::VerificationSucceededWebhookEvent::Data#status + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRES_INPUT = :requires_input + PROCESSING = :processing + VERIFIED = :verified + CANCELED = :canceled + CREATED = :created + STARTED = :started + SUBMITTED = :submitted + APPROVED = :approved + DECLINED = :declined + RESUBMISSION_REQUESTED = :resubmission_requested + EXPIRED = :expired + ABANDONED = :abandoned + REVIEW = :review + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/resources/leads.rb b/lib/whop_sdk/resources/leads.rb new file mode 100644 index 00000000..95200377 --- /dev/null +++ b/lib/whop_sdk/resources/leads.rb @@ -0,0 +1,158 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Leads + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::LeadCreateParams} for more details. + # + # Creates a new lead + # + # Required permissions: + # + # - `lead:manage` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + # + # @overload create(company_id:, metadata: nil, product_id: nil, referrer: nil, user_id: nil, request_options: {}) + # + # @param company_id [String] The ID of the company to create a lead for. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param product_id [String, nil] The ID of the product the lead is interested in. + # + # @param referrer [String, nil] The url referrer of the lead, if any. + # + # @param user_id [String, nil] The ID of the user to create a lead for. If the request is made by a user, that + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::LeadCreateResponse] + # + # @see WhopSDK::Models::LeadCreateParams + def create(params) + parsed, options = WhopSDK::LeadCreateParams.dump_request(params) + @client.request( + method: :post, + path: "leads", + body: parsed, + model: WhopSDK::Models::LeadCreateResponse, + options: options + ) + end + + # Retrieves a lead by ID + # + # Required permissions: + # + # - `lead:basic:read` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] The ID of the lead + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::LeadRetrieveResponse] + # + # @see WhopSDK::Models::LeadRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["leads/%1$s", id], + model: WhopSDK::Models::LeadRetrieveResponse, + options: params[:request_options] + ) + end + + # Updates a lead + # + # Required permissions: + # + # - `lead:manage` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + # + # @overload update(id, metadata: nil, referrer: nil, request_options: {}) + # + # @param id [String] The ID of the lead to update. + # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead. + # + # @param referrer [String, nil] The url referrer of the lead. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::LeadUpdateResponse] + # + # @see WhopSDK::Models::LeadUpdateParams + def update(id, params = {}) + parsed, options = WhopSDK::LeadUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["leads/%1$s", id], + body: parsed, + model: WhopSDK::Models::LeadUpdateResponse, + options: options + ) + end + + # Lists leads for a company + # + # Required permissions: + # + # - `lead:basic:read` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + # + # @overload list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, first: nil, last: nil, product_ids: nil, request_options: {}) + # + # @param company_id [String] The ID of the company to list leads for + # + # @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 created_after [Time, nil] The minimum creation date to filter by + # + # @param created_before [Time, nil] The maximum creation date to filter by + # + # @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 product_ids [Array, nil] The product IDs to filter the leads by + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::LeadListParams + def list(params) + parsed, options = WhopSDK::LeadListParams.dump_request(params) + @client.request( + method: :get, + path: "leads", + query: parsed, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::LeadListResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/whop_sdk/resources/payment_methods.rb b/lib/whop_sdk/resources/payment_methods.rb index 23c86f36..69918fd3 100644 --- a/lib/whop_sdk/resources/payment_methods.rb +++ b/lib/whop_sdk/resources/payment_methods.rb @@ -7,24 +7,26 @@ class PaymentMethods # such as a card, bank account, or digital wallet. It holds the necessary billing # details and can be attached to a member for future one-time or recurring # charges. This lets you reuse the same payment credentials across multiple - # payments. + # payments. You must provide exactly one of company_id or member_id. # # Required permissions: # # - `member:payment_methods:read` # - # @overload retrieve(id, member_id:, request_options: {}) + # @overload retrieve(id, company_id: nil, member_id: nil, request_options: {}) # # @param id [String] The ID of the PaymentMethod # - # @param member_id [String] The ID of the Member associated with the PaymentMethod + # @param company_id [String, nil] The ID of the Company. Provide either this or member_id (not both). + # + # @param member_id [String, nil] The ID of the Member. Provide either this or company_id (not both). # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::PaymentMethodRetrieveResponse::BasePaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::CardPaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::UsBankAccountPaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::CashappPaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::IdealPaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::SepaDebitPaymentMethod] # # @see WhopSDK::Models::PaymentMethodRetrieveParams - def retrieve(id, params) + def retrieve(id, params = {}) parsed, options = WhopSDK::PaymentMethodRetrieveParams.dump_request(params) @client.request( method: :get, @@ -45,14 +47,14 @@ def retrieve(id, params) # # - `member:payment_methods:read` # - # @overload list(member_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) - # - # @param member_id [String] The ID of the Member to list payment methods for + # @overload list(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, member_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] The ID of the Company. Provide either this or member_id (not both). + # # @param created_after [Time, nil] The minimum creation date to filter by # # @param created_before [Time, nil] The maximum creation date to filter by @@ -63,12 +65,14 @@ def retrieve(id, params) # # @param last [Integer, nil] Returns the last _n_ elements from the list. # + # @param member_id [String, nil] The ID of the Member to list payment methods for + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Internal::CursorPage] # # @see WhopSDK::Models::PaymentMethodListParams - def list(params) + def list(params = {}) parsed, options = WhopSDK::PaymentMethodListParams.dump_request(params) @client.request( method: :get, diff --git a/lib/whop_sdk/resources/payments.rb b/lib/whop_sdk/resources/payments.rb index cf4e8558..1f813334 100644 --- a/lib/whop_sdk/resources/payments.rb +++ b/lib/whop_sdk/resources/payments.rb @@ -25,7 +25,7 @@ class Payments # - `member:phone:read` # - `promo_code:basic:read` # - # @overload create(company_id:, member_id:, payment_method_id:, plan:, plan_id:, request_options: {}) + # @overload create(company_id:, member_id:, payment_method_id:, plan:, plan_id:, metadata: nil, request_options: {}) # # @param company_id [String] The ID of the company to create the payment for. # @@ -37,6 +37,8 @@ class Payments # # @param plan_id [String] An ID of an existing plan to use for the payment. # + # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata to attach to the payment. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::Payment] diff --git a/lib/whop_sdk/resources/payout_methods.rb b/lib/whop_sdk/resources/payout_methods.rb index 43a12ce5..b7134ddf 100644 --- a/lib/whop_sdk/resources/payout_methods.rb +++ b/lib/whop_sdk/resources/payout_methods.rb @@ -3,6 +3,30 @@ module WhopSDK module Resources class PayoutMethods + # Retrieves a payout method by ID + # + # Required permissions: + # + # - `payout:destination:read` + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] The ID of the payout method + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PayoutMethodRetrieveResponse] + # + # @see WhopSDK::Models::PayoutMethodRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["payout_methods/%1$s", id], + model: WhopSDK::Models::PayoutMethodRetrieveResponse, + options: params[:request_options] + ) + end + # Lists payout destinations for a company # # Required permissions: diff --git a/lib/whop_sdk/resources/support_channels.rb b/lib/whop_sdk/resources/support_channels.rb index 5af3d623..776b7f13 100644 --- a/lib/whop_sdk/resources/support_channels.rb +++ b/lib/whop_sdk/resources/support_channels.rb @@ -14,7 +14,7 @@ class SupportChannels # # @param company_id [String] The ID of the company to create the support chat in # - # @param user_id [String] The ID of the user to create the support chat for + # @param user_id [String] The ID (user_xxx) or username of the user to create the support chat for # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/whop_sdk/resources/topups.rb b/lib/whop_sdk/resources/topups.rb new file mode 100644 index 00000000..adf183ee --- /dev/null +++ b/lib/whop_sdk/resources/topups.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Topups + # Add funds to your platform balance by charging a stored payment method. + # + # Required permissions: + # + # - `payment:charge` + # + # @overload create(amount:, company_id:, currency:, payment_method_id:, request_options: {}) + # + # @param amount [Float] The amount to add to the balance. + # + # @param company_id [String] The ID of the company to add funds to. + # + # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the top-up. + # + # @param payment_method_id [String] The ID of the payment method to charge for the top-up. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::TopupCreateResponse] + # + # @see WhopSDK::Models::TopupCreateParams + def create(params) + parsed, options = WhopSDK::TopupCreateParams.dump_request(params) + @client.request( + method: :post, + path: "topups", + body: parsed, + model: WhopSDK::Models::TopupCreateResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/whop_sdk/resources/verifications.rb b/lib/whop_sdk/resources/verifications.rb new file mode 100644 index 00000000..54d30bdf --- /dev/null +++ b/lib/whop_sdk/resources/verifications.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class Verifications + # Retrieves a verification by ID + # + # Required permissions: + # + # - `payout:account:read` + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] The ID of the verification + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::VerificationRetrieveResponse] + # + # @see WhopSDK::Models::VerificationRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["verifications/%1$s", id], + model: WhopSDK::Models::VerificationRetrieveResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/whop_sdk/resources/webhooks.rb b/lib/whop_sdk/resources/webhooks.rb index cb23edbb..c78c0759 100644 --- a/lib/whop_sdk/resources/webhooks.rb +++ b/lib/whop_sdk/resources/webhooks.rb @@ -5,7 +5,7 @@ module Resources class Webhooks # @param payload [String] The raw webhook payload as a string # - # @return [WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent] + # @return [WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent] def unwrap(payload) parsed = JSON.parse(payload, symbolize_names: true) WhopSDK::Internal::Type::Converter.coerce(WhopSDK::Models::UnwrapWebhookEvent, parsed) diff --git a/lib/whop_sdk/version.rb b/lib/whop_sdk/version.rb index 191b4856..51d7658d 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.20" + VERSION = "0.0.22" end diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index da96cb52..efa494de 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -142,6 +142,15 @@ module WhopSDK sig { returns(WhopSDK::Resources::PayoutMethods) } attr_reader :payout_methods + sig { returns(WhopSDK::Resources::Verifications) } + attr_reader :verifications + + sig { returns(WhopSDK::Resources::Leads) } + attr_reader :leads + + sig { returns(WhopSDK::Resources::Topups) } + attr_reader :topups + # @api private sig { override.returns(T::Hash[String, String]) } private def auth_headers diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index 80f2b894..31093537 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -272,6 +272,14 @@ module WhopSDK Languages = WhopSDK::Models::Languages + LeadCreateParams = WhopSDK::Models::LeadCreateParams + + LeadListParams = WhopSDK::Models::LeadListParams + + LeadRetrieveParams = WhopSDK::Models::LeadRetrieveParams + + LeadUpdateParams = WhopSDK::Models::LeadUpdateParams + LedgerAccountRetrieveParams = WhopSDK::Models::LedgerAccountRetrieveParams Lesson = WhopSDK::Models::Lesson @@ -291,6 +299,9 @@ module WhopSDK MembershipActivatedWebhookEvent = WhopSDK::Models::MembershipActivatedWebhookEvent + MembershipCancelAtPeriodEndChangedWebhookEvent = + WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent + MembershipCancelParams = WhopSDK::Models::MembershipCancelParams MembershipDeactivatedWebhookEvent = @@ -356,8 +367,13 @@ module WhopSDK PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + PayoutMethodCreatedWebhookEvent = + WhopSDK::Models::PayoutMethodCreatedWebhookEvent + PayoutMethodListParams = WhopSDK::Models::PayoutMethodListParams + PayoutMethodRetrieveParams = WhopSDK::Models::PayoutMethodRetrieveParams + Plan = WhopSDK::Models::Plan PlanCreateParams = WhopSDK::Models::PlanCreateParams @@ -475,6 +491,8 @@ module WhopSDK TaxType = WhopSDK::Models::TaxType + TopupCreateParams = WhopSDK::Models::TopupCreateParams + Transfer = WhopSDK::Models::Transfer TransferCreateParams = WhopSDK::Models::TransferCreateParams @@ -489,6 +507,11 @@ module WhopSDK UserRetrieveParams = WhopSDK::Models::UserRetrieveParams + VerificationRetrieveParams = WhopSDK::Models::VerificationRetrieveParams + + VerificationSucceededWebhookEvent = + WhopSDK::Models::VerificationSucceededWebhookEvent + Visibility = WhopSDK::Models::Visibility VisibilityFilter = WhopSDK::Models::VisibilityFilter diff --git a/rbi/whop_sdk/models/lead_create_params.rbi b/rbi/whop_sdk/models/lead_create_params.rbi new file mode 100644 index 00000000..4e93bb3e --- /dev/null +++ b/rbi/whop_sdk/models/lead_create_params.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module WhopSDK + module Models + class LeadCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::LeadCreateParams, WhopSDK::Internal::AnyHash) + end + + # The ID of the company to create a lead for. + sig { returns(String) } + attr_accessor :company_id + + # Custom metadata for the lead. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # The ID of the product the lead is interested in. + sig { returns(T.nilable(String)) } + attr_accessor :product_id + + # The url referrer of the lead, if any. + sig { returns(T.nilable(String)) } + attr_accessor :referrer + + # The ID of the user to create a lead for. If the request is made by a user, that + # user will be used. + sig { returns(T.nilable(String)) } + attr_accessor :user_id + + sig do + params( + company_id: String, + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product_id: T.nilable(String), + referrer: T.nilable(String), + user_id: T.nilable(String), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the company to create a lead for. + company_id:, + # Custom metadata for the lead. + metadata: nil, + # The ID of the product the lead is interested in. + product_id: nil, + # The url referrer of the lead, if any. + referrer: nil, + # The ID of the user to create a lead for. If the request is made by a user, that + # user will be used. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + company_id: String, + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product_id: T.nilable(String), + referrer: T.nilable(String), + user_id: T.nilable(String), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/lead_create_response.rbi b/rbi/whop_sdk/models/lead_create_response.rbi new file mode 100644 index 00000000..d0297a89 --- /dev/null +++ b/rbi/whop_sdk/models/lead_create_response.rbi @@ -0,0 +1,234 @@ +# typed: strong + +module WhopSDK + module Models + class LeadCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::LeadCreateResponse, WhopSDK::Internal::AnyHash) + end + + # The ID of the lead. + sig { returns(String) } + attr_accessor :id + + # The timestamp of when the lead was created. + sig { returns(Time) } + attr_accessor :created_at + + # The converted member, if any. + sig { returns(T.nilable(WhopSDK::Models::LeadCreateResponse::Member)) } + attr_reader :member + + sig do + params( + member: T.nilable(WhopSDK::Models::LeadCreateResponse::Member::OrHash) + ).void + end + attr_writer :member + + # Custom metadata for the lead. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # The access pass the lead is interested in, if available. + sig { returns(T.nilable(WhopSDK::Models::LeadCreateResponse::Product)) } + attr_reader :product + + sig do + params( + product: + T.nilable(WhopSDK::Models::LeadCreateResponse::Product::OrHash) + ).void + end + attr_writer :product + + # The referrer URL that brought this lead. + sig { returns(T.nilable(String)) } + attr_accessor :referrer + + # The timestamp of when the lead was last updated. + sig { returns(Time) } + attr_accessor :updated_at + + # The user who is the lead. + sig { returns(WhopSDK::Models::LeadCreateResponse::User) } + attr_reader :user + + sig do + params(user: WhopSDK::Models::LeadCreateResponse::User::OrHash).void + end + attr_writer :user + + # An object representing a lead (someone who is interested in a whop). + sig do + params( + id: String, + created_at: Time, + member: + T.nilable(WhopSDK::Models::LeadCreateResponse::Member::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: + T.nilable(WhopSDK::Models::LeadCreateResponse::Product::OrHash), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadCreateResponse::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the lead. + id:, + # The timestamp of when the lead was created. + created_at:, + # The converted member, if any. + member:, + # Custom metadata for the lead. + metadata:, + # The access pass the lead is interested in, if available. + product:, + # The referrer URL that brought this lead. + referrer:, + # The timestamp of when the lead was last updated. + updated_at:, + # The user who is the lead. + user: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + member: T.nilable(WhopSDK::Models::LeadCreateResponse::Member), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: T.nilable(WhopSDK::Models::LeadCreateResponse::Product), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadCreateResponse::User + } + ) + end + def to_hash + end + + class Member < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadCreateResponse::Member, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of the member + sig { returns(String) } + attr_accessor :id + + # The converted member, if any. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID of the member + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class Product < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadCreateResponse::Product, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the public product. + sig { returns(String) } + attr_accessor :id + + # The title of the product. Use for Whop 4.0. + sig { returns(String) } + attr_accessor :title + + # The access pass the lead is interested in, if available. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # The internal ID of the public product. + id:, + # The title of the product. Use for Whop 4.0. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadCreateResponse::User, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the user. + sig { returns(String) } + attr_accessor :id + + # The email of the user + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The name of the user from their Whop account. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The username of the user from their Whop account. + sig { returns(String) } + attr_accessor :username + + # The user who is the lead. + sig do + params( + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + ).returns(T.attached_class) + end + def self.new( + # The internal ID of the user. + id:, + # The email of the user + email:, + # The name of the user from their Whop account. + name:, + # The username of the user from their Whop account. + username: + ) + end + + sig do + override.returns( + { + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/lead_list_params.rbi b/rbi/whop_sdk/models/lead_list_params.rbi new file mode 100644 index 00000000..35a1b31b --- /dev/null +++ b/rbi/whop_sdk/models/lead_list_params.rbi @@ -0,0 +1,99 @@ +# typed: strong + +module WhopSDK + module Models + class LeadListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::LeadListParams, WhopSDK::Internal::AnyHash) + end + + # The ID of the company to list leads for + sig { returns(String) } + attr_accessor :company_id + + # 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 + + # The minimum creation date to filter by + sig { returns(T.nilable(Time)) } + attr_accessor :created_after + + # The maximum creation date to filter by + sig { returns(T.nilable(Time)) } + attr_accessor :created_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 + + # The product IDs to filter the leads by + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :product_ids + + sig do + params( + company_id: String, + after: T.nilable(String), + before: T.nilable(String), + created_after: T.nilable(Time), + created_before: T.nilable(Time), + first: T.nilable(Integer), + last: T.nilable(Integer), + product_ids: T.nilable(T::Array[String]), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the company to list leads for + company_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, + # The minimum creation date to filter by + created_after: nil, + # The maximum creation date to filter by + created_before: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + # The product IDs to filter the leads by + product_ids: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + company_id: String, + after: T.nilable(String), + before: T.nilable(String), + created_after: T.nilable(Time), + created_before: T.nilable(Time), + first: T.nilable(Integer), + last: T.nilable(Integer), + product_ids: T.nilable(T::Array[String]), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/lead_list_response.rbi b/rbi/whop_sdk/models/lead_list_response.rbi new file mode 100644 index 00000000..7cc8b322 --- /dev/null +++ b/rbi/whop_sdk/models/lead_list_response.rbi @@ -0,0 +1,230 @@ +# typed: strong + +module WhopSDK + module Models + class LeadListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::LeadListResponse, WhopSDK::Internal::AnyHash) + end + + # The ID of the lead. + sig { returns(String) } + attr_accessor :id + + # The timestamp of when the lead was created. + sig { returns(Time) } + attr_accessor :created_at + + # The converted member, if any. + sig { returns(T.nilable(WhopSDK::Models::LeadListResponse::Member)) } + attr_reader :member + + sig do + params( + member: T.nilable(WhopSDK::Models::LeadListResponse::Member::OrHash) + ).void + end + attr_writer :member + + # Custom metadata for the lead. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # The access pass the lead is interested in, if available. + sig { returns(T.nilable(WhopSDK::Models::LeadListResponse::Product)) } + attr_reader :product + + sig do + params( + product: T.nilable(WhopSDK::Models::LeadListResponse::Product::OrHash) + ).void + end + attr_writer :product + + # The referrer URL that brought this lead. + sig { returns(T.nilable(String)) } + attr_accessor :referrer + + # The timestamp of when the lead was last updated. + sig { returns(Time) } + attr_accessor :updated_at + + # The user who is the lead. + sig { returns(WhopSDK::Models::LeadListResponse::User) } + attr_reader :user + + sig { params(user: WhopSDK::Models::LeadListResponse::User::OrHash).void } + attr_writer :user + + # An object representing a lead (someone who is interested in a whop). + sig do + params( + id: String, + created_at: Time, + member: T.nilable(WhopSDK::Models::LeadListResponse::Member::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: + T.nilable(WhopSDK::Models::LeadListResponse::Product::OrHash), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadListResponse::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the lead. + id:, + # The timestamp of when the lead was created. + created_at:, + # The converted member, if any. + member:, + # Custom metadata for the lead. + metadata:, + # The access pass the lead is interested in, if available. + product:, + # The referrer URL that brought this lead. + referrer:, + # The timestamp of when the lead was last updated. + updated_at:, + # The user who is the lead. + user: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + member: T.nilable(WhopSDK::Models::LeadListResponse::Member), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: T.nilable(WhopSDK::Models::LeadListResponse::Product), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadListResponse::User + } + ) + end + def to_hash + end + + class Member < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadListResponse::Member, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of the member + sig { returns(String) } + attr_accessor :id + + # The converted member, if any. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID of the member + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class Product < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadListResponse::Product, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the public product. + sig { returns(String) } + attr_accessor :id + + # The title of the product. Use for Whop 4.0. + sig { returns(String) } + attr_accessor :title + + # The access pass the lead is interested in, if available. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # The internal ID of the public product. + id:, + # The title of the product. Use for Whop 4.0. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadListResponse::User, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the user. + sig { returns(String) } + attr_accessor :id + + # The email of the user + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The name of the user from their Whop account. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The username of the user from their Whop account. + sig { returns(String) } + attr_accessor :username + + # The user who is the lead. + sig do + params( + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + ).returns(T.attached_class) + end + def self.new( + # The internal ID of the user. + id:, + # The email of the user + email:, + # The name of the user from their Whop account. + name:, + # The username of the user from their Whop account. + username: + ) + end + + sig do + override.returns( + { + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/lead_retrieve_params.rbi b/rbi/whop_sdk/models/lead_retrieve_params.rbi new file mode 100644 index 00000000..1b851352 --- /dev/null +++ b/rbi/whop_sdk/models/lead_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module WhopSDK + module Models + class LeadRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::LeadRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: WhopSDK::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/lead_retrieve_response.rbi b/rbi/whop_sdk/models/lead_retrieve_response.rbi new file mode 100644 index 00000000..a91394d2 --- /dev/null +++ b/rbi/whop_sdk/models/lead_retrieve_response.rbi @@ -0,0 +1,238 @@ +# typed: strong + +module WhopSDK + module Models + class LeadRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of the lead. + sig { returns(String) } + attr_accessor :id + + # The timestamp of when the lead was created. + sig { returns(Time) } + attr_accessor :created_at + + # The converted member, if any. + sig { returns(T.nilable(WhopSDK::Models::LeadRetrieveResponse::Member)) } + attr_reader :member + + sig do + params( + member: + T.nilable(WhopSDK::Models::LeadRetrieveResponse::Member::OrHash) + ).void + end + attr_writer :member + + # Custom metadata for the lead. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # The access pass the lead is interested in, if available. + sig { returns(T.nilable(WhopSDK::Models::LeadRetrieveResponse::Product)) } + attr_reader :product + + sig do + params( + product: + T.nilable(WhopSDK::Models::LeadRetrieveResponse::Product::OrHash) + ).void + end + attr_writer :product + + # The referrer URL that brought this lead. + sig { returns(T.nilable(String)) } + attr_accessor :referrer + + # The timestamp of when the lead was last updated. + sig { returns(Time) } + attr_accessor :updated_at + + # The user who is the lead. + sig { returns(WhopSDK::Models::LeadRetrieveResponse::User) } + attr_reader :user + + sig do + params(user: WhopSDK::Models::LeadRetrieveResponse::User::OrHash).void + end + attr_writer :user + + # An object representing a lead (someone who is interested in a whop). + sig do + params( + id: String, + created_at: Time, + member: + T.nilable(WhopSDK::Models::LeadRetrieveResponse::Member::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: + T.nilable(WhopSDK::Models::LeadRetrieveResponse::Product::OrHash), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadRetrieveResponse::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the lead. + id:, + # The timestamp of when the lead was created. + created_at:, + # The converted member, if any. + member:, + # Custom metadata for the lead. + metadata:, + # The access pass the lead is interested in, if available. + product:, + # The referrer URL that brought this lead. + referrer:, + # The timestamp of when the lead was last updated. + updated_at:, + # The user who is the lead. + user: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + member: T.nilable(WhopSDK::Models::LeadRetrieveResponse::Member), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: T.nilable(WhopSDK::Models::LeadRetrieveResponse::Product), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadRetrieveResponse::User + } + ) + end + def to_hash + end + + class Member < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadRetrieveResponse::Member, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of the member + sig { returns(String) } + attr_accessor :id + + # The converted member, if any. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID of the member + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class Product < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadRetrieveResponse::Product, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the public product. + sig { returns(String) } + attr_accessor :id + + # The title of the product. Use for Whop 4.0. + sig { returns(String) } + attr_accessor :title + + # The access pass the lead is interested in, if available. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # The internal ID of the public product. + id:, + # The title of the product. Use for Whop 4.0. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadRetrieveResponse::User, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the user. + sig { returns(String) } + attr_accessor :id + + # The email of the user + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The name of the user from their Whop account. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The username of the user from their Whop account. + sig { returns(String) } + attr_accessor :username + + # The user who is the lead. + sig do + params( + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + ).returns(T.attached_class) + end + def self.new( + # The internal ID of the user. + id:, + # The email of the user + email:, + # The name of the user from their Whop account. + name:, + # The username of the user from their Whop account. + username: + ) + end + + sig do + override.returns( + { + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/lead_update_params.rbi b/rbi/whop_sdk/models/lead_update_params.rbi new file mode 100644 index 00000000..7016e5ce --- /dev/null +++ b/rbi/whop_sdk/models/lead_update_params.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module WhopSDK + module Models + class LeadUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::LeadUpdateParams, WhopSDK::Internal::AnyHash) + end + + # Custom metadata for the lead. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # The url referrer of the lead. + sig { returns(T.nilable(String)) } + attr_accessor :referrer + + sig do + params( + metadata: T.nilable(T::Hash[Symbol, T.anything]), + referrer: T.nilable(String), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Custom metadata for the lead. + metadata: nil, + # The url referrer of the lead. + referrer: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + metadata: T.nilable(T::Hash[Symbol, T.anything]), + referrer: T.nilable(String), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/lead_update_response.rbi b/rbi/whop_sdk/models/lead_update_response.rbi new file mode 100644 index 00000000..babcc12f --- /dev/null +++ b/rbi/whop_sdk/models/lead_update_response.rbi @@ -0,0 +1,234 @@ +# typed: strong + +module WhopSDK + module Models + class LeadUpdateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::LeadUpdateResponse, WhopSDK::Internal::AnyHash) + end + + # The ID of the lead. + sig { returns(String) } + attr_accessor :id + + # The timestamp of when the lead was created. + sig { returns(Time) } + attr_accessor :created_at + + # The converted member, if any. + sig { returns(T.nilable(WhopSDK::Models::LeadUpdateResponse::Member)) } + attr_reader :member + + sig do + params( + member: T.nilable(WhopSDK::Models::LeadUpdateResponse::Member::OrHash) + ).void + end + attr_writer :member + + # Custom metadata for the lead. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + + # The access pass the lead is interested in, if available. + sig { returns(T.nilable(WhopSDK::Models::LeadUpdateResponse::Product)) } + attr_reader :product + + sig do + params( + product: + T.nilable(WhopSDK::Models::LeadUpdateResponse::Product::OrHash) + ).void + end + attr_writer :product + + # The referrer URL that brought this lead. + sig { returns(T.nilable(String)) } + attr_accessor :referrer + + # The timestamp of when the lead was last updated. + sig { returns(Time) } + attr_accessor :updated_at + + # The user who is the lead. + sig { returns(WhopSDK::Models::LeadUpdateResponse::User) } + attr_reader :user + + sig do + params(user: WhopSDK::Models::LeadUpdateResponse::User::OrHash).void + end + attr_writer :user + + # An object representing a lead (someone who is interested in a whop). + sig do + params( + id: String, + created_at: Time, + member: + T.nilable(WhopSDK::Models::LeadUpdateResponse::Member::OrHash), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: + T.nilable(WhopSDK::Models::LeadUpdateResponse::Product::OrHash), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadUpdateResponse::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the lead. + id:, + # The timestamp of when the lead was created. + created_at:, + # The converted member, if any. + member:, + # Custom metadata for the lead. + metadata:, + # The access pass the lead is interested in, if available. + product:, + # The referrer URL that brought this lead. + referrer:, + # The timestamp of when the lead was last updated. + updated_at:, + # The user who is the lead. + user: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + member: T.nilable(WhopSDK::Models::LeadUpdateResponse::Member), + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product: T.nilable(WhopSDK::Models::LeadUpdateResponse::Product), + referrer: T.nilable(String), + updated_at: Time, + user: WhopSDK::Models::LeadUpdateResponse::User + } + ) + end + def to_hash + end + + class Member < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadUpdateResponse::Member, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of the member + sig { returns(String) } + attr_accessor :id + + # The converted member, if any. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID of the member + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class Product < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadUpdateResponse::Product, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the public product. + sig { returns(String) } + attr_accessor :id + + # The title of the product. Use for Whop 4.0. + sig { returns(String) } + attr_accessor :title + + # The access pass the lead is interested in, if available. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # The internal ID of the public product. + id:, + # The title of the product. Use for Whop 4.0. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LeadUpdateResponse::User, + WhopSDK::Internal::AnyHash + ) + end + + # The internal ID of the user. + sig { returns(String) } + attr_accessor :id + + # The email of the user + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The name of the user from their Whop account. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The username of the user from their Whop account. + sig { returns(String) } + attr_accessor :username + + # The user who is the lead. + sig do + params( + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + ).returns(T.attached_class) + end + def self.new( + # The internal ID of the user. + id:, + # The email of the user + email:, + # The name of the user from their Whop account. + name:, + # The username of the user from their Whop account. + username: + ) + end + + sig do + override.returns( + { + id: String, + email: T.nilable(String), + name: T.nilable(String), + username: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi index 444c44cc..60a6d02f 100644 --- a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +++ b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi @@ -594,6 +594,26 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :email + # The latest verification for the connected account. + sig do + returns( + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification + ) + ) + end + attr_reader :latest_verification + + sig do + params( + latest_verification: + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::OrHash + ) + ).void + end + attr_writer :latest_verification + # The business representative's phone sig { returns(T.nilable(String)) } attr_accessor :phone @@ -612,6 +632,10 @@ module WhopSDK WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative::OrHash ), email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::OrHash + ), phone: T.nilable(String) ).returns(T.attached_class) end @@ -626,6 +650,8 @@ module WhopSDK business_representative:, # The email address of the representative email:, + # The latest verification for the connected account. + latest_verification:, # The business representative's phone phone: ) @@ -645,6 +671,10 @@ module WhopSDK WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative ), email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification + ), phone: T.nilable(String) } ) @@ -789,6 +819,294 @@ module WhopSDK def to_hash end end + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification, + WhopSDK::Internal::AnyHash + ) + end + + # A unique identifier for the verification. + sig { returns(String) } + attr_accessor :id + + # An error code for a verification attempt. + sig do + returns( + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + ) + end + attr_accessor :last_error_code + + # The last error reason that occurred during the verification. + sig { returns(T.nilable(String)) } + attr_accessor :last_error_reason + + # The status of the verification. + sig do + returns( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The latest verification for the connected account. + sig do + params( + id: String, + last_error_code: + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::OrSymbol + ), + last_error_reason: T.nilable(String), + status: + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for the verification. + id:, + # An error code for a verification attempt. + last_error_code:, + # The last error reason that occurred during the verification. + last_error_reason:, + # The status of the verification. + status: + ) + end + + sig do + override.returns( + { + id: String, + last_error_code: + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ), + last_error_reason: T.nilable(String), + status: + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # An error code for a verification attempt. + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ABANDONED = + T.let( + :abandoned, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + CONSENT_DECLINED = + T.let( + :consent_declined, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + COUNTRY_NOT_SUPPORTED = + T.let( + :country_not_supported, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + DEVICE_NOT_SUPPORTED = + T.let( + :device_not_supported, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + DOCUMENT_EXPIRED = + T.let( + :document_expired, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + DOCUMENT_TYPE_NOT_SUPPORTED = + T.let( + :document_type_not_supported, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + DOCUMENT_UNVERIFIED_OTHER = + T.let( + :document_unverified_other, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + EMAIL_UNVERIFIED_OTHER = + T.let( + :email_unverified_other, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + EMAIL_VERIFICATION_DECLINED = + T.let( + :email_verification_declined, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA = + T.let( + :id_number_insufficient_document_data, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_MISMATCH = + T.let( + :id_number_mismatch, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_UNVERIFIED_OTHER = + T.let( + :id_number_unverified_other, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + PHONE_UNVERIFIED_OTHER = + T.let( + :phone_unverified_other, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + PHONE_VERIFICATION_DECLINED = + T.let( + :phone_verification_declined, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + SELFIE_DOCUMENT_MISSING_PHOTO = + T.let( + :selfie_document_missing_photo, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + SELFIE_FACE_MISMATCH = + T.let( + :selfie_face_mismatch, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + SELFIE_MANIPULATED = + T.let( + :selfie_manipulated, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + SELFIE_UNVERIFIED_OTHER = + T.let( + :selfie_unverified_other, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + UNDER_SUPPORTED_AGE = + T.let( + :under_supported_age, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::LastErrorCode::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the verification. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRES_INPUT = + T.let( + :requires_input, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + PROCESSING = + T.let( + :processing, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + VERIFIED = + T.let( + :verified, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + CREATED = + T.let( + :created, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + STARTED = + T.let( + :started, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + SUBMITTED = + T.let( + :submitted, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + DECLINED = + T.let( + :declined, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + RESUBMISSION_REQUESTED = + T.let( + :resubmission_requested, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + ABANDONED = + T.let( + :abandoned, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + REVIEW = + T.let( + :review, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbi b/rbi/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbi new file mode 100644 index 00000000..f1071c69 --- /dev/null +++ b/rbi/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module WhopSDK + module Models + class MembershipCancelAtPeriodEndChangedWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + # A membership represents a purchase between a User and a Company for a specific + # Product. + sig { returns(WhopSDK::Membership) } + attr_reader :data + + sig { params(data: WhopSDK::Membership::OrHash).void } + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + data: WhopSDK::Membership::OrHash, + timestamp: Time, + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + # A membership represents a purchase between a User and a Company for a specific + # Product. + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"membership.cancel_at_period_end_changed" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::Membership, + timestamp: Time, + type: Symbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/membership_status.rbi b/rbi/whop_sdk/models/membership_status.rbi index 5e8f3fa0..53153ee9 100644 --- a/rbi/whop_sdk/models/membership_status.rbi +++ b/rbi/whop_sdk/models/membership_status.rbi @@ -17,6 +17,7 @@ module WhopSDK EXPIRED = T.let(:expired, WhopSDK::MembershipStatus::TaggedSymbol) UNRESOLVED = T.let(:unresolved, WhopSDK::MembershipStatus::TaggedSymbol) DRAFTED = T.let(:drafted, WhopSDK::MembershipStatus::TaggedSymbol) + CANCELING = T.let(:canceling, WhopSDK::MembershipStatus::TaggedSymbol) sig do override.returns(T::Array[WhopSDK::MembershipStatus::TaggedSymbol]) diff --git a/rbi/whop_sdk/models/payment.rbi b/rbi/whop_sdk/models/payment.rbi index 8f43a05d..1f570255 100644 --- a/rbi/whop_sdk/models/payment.rbi +++ b/rbi/whop_sdk/models/payment.rbi @@ -84,8 +84,8 @@ module WhopSDK end attr_writer :membership - # The custom metadata stored on this payment. This will be copied the checkout - # configuration for which this payment was made + # The custom metadata stored on this payment. This will be copied over to the + # checkout configuration for which this payment was made sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -251,8 +251,8 @@ module WhopSDK member:, # The membership attached to this payment. membership:, - # The custom metadata stored on this payment. This will be copied the checkout - # configuration for which this payment was made + # The custom metadata stored on this payment. This will be copied over to the + # checkout configuration for which this payment was made metadata:, # The datetime the payment was paid paid_at:, diff --git a/rbi/whop_sdk/models/payment_create_params.rbi b/rbi/whop_sdk/models/payment_create_params.rbi index 14a5d4cc..0f5a0699 100644 --- a/rbi/whop_sdk/models/payment_create_params.rbi +++ b/rbi/whop_sdk/models/payment_create_params.rbi @@ -31,6 +31,10 @@ module WhopSDK sig { params(plan: WhopSDK::PaymentCreateParams::Plan::OrHash).void } attr_writer :plan + # Custom metadata to attach to the payment. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :metadata + # An ID of an existing plan to use for the payment. sig { returns(String) } attr_accessor :plan_id @@ -42,6 +46,7 @@ module WhopSDK payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Plan::OrHash, plan_id: String, + metadata: T.nilable(T::Hash[Symbol, T.anything]), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -57,6 +62,8 @@ module WhopSDK plan:, # An ID of an existing plan to use for the payment. plan_id:, + # Custom metadata to attach to the payment. + metadata: nil, request_options: {} ) end @@ -68,6 +75,7 @@ module WhopSDK member_id: String, payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Plan, + metadata: T.nilable(T::Hash[Symbol, T.anything]), plan_id: String, request_options: WhopSDK::RequestOptions } diff --git a/rbi/whop_sdk/models/payment_list_fees_response.rbi b/rbi/whop_sdk/models/payment_list_fees_response.rbi index abfbd198..d8781320 100644 --- a/rbi/whop_sdk/models/payment_list_fees_response.rbi +++ b/rbi/whop_sdk/models/payment_list_fees_response.rbi @@ -223,6 +223,11 @@ module WhopSDK :revshare_percentage_fee, WhopSDK::Models::PaymentListFeesResponse::Type::TaggedSymbol ) + APPLICATION_FEE = + T.let( + :application_fee, + WhopSDK::Models::PaymentListFeesResponse::Type::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/whop_sdk/models/payment_list_response.rbi b/rbi/whop_sdk/models/payment_list_response.rbi index a39f035c..4ef154c4 100644 --- a/rbi/whop_sdk/models/payment_list_response.rbi +++ b/rbi/whop_sdk/models/payment_list_response.rbi @@ -109,8 +109,8 @@ module WhopSDK end attr_writer :membership - # The custom metadata stored on this payment. This will be copied the checkout - # configuration for which this payment was made + # The custom metadata stored on this payment. This will be copied over to the + # checkout configuration for which this payment was made sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata @@ -310,8 +310,8 @@ module WhopSDK member:, # The membership attached to this payment. membership:, - # The custom metadata stored on this payment. This will be copied the checkout - # configuration for which this payment was made + # The custom metadata stored on this payment. This will be copied over to the + # checkout configuration for which this payment was made metadata:, # The datetime the payment was paid paid_at:, diff --git a/rbi/whop_sdk/models/payment_method_list_params.rbi b/rbi/whop_sdk/models/payment_method_list_params.rbi index a5f81307..008ac21c 100644 --- a/rbi/whop_sdk/models/payment_method_list_params.rbi +++ b/rbi/whop_sdk/models/payment_method_list_params.rbi @@ -11,10 +11,6 @@ module WhopSDK T.any(WhopSDK::PaymentMethodListParams, WhopSDK::Internal::AnyHash) end - # The ID of the Member to list payment methods for - sig { returns(String) } - attr_accessor :member_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 + # The ID of the Company. Provide either this or member_id (not both). + sig { returns(T.nilable(String)) } + attr_accessor :company_id + # The minimum creation date to filter by sig { returns(T.nilable(Time)) } attr_accessor :created_after @@ -43,26 +43,31 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :last + # The ID of the Member to list payment methods for + sig { returns(T.nilable(String)) } + attr_accessor :member_id + sig do params( - member_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), + member_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The ID of the Member to list payment methods for - member_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, + # The ID of the Company. Provide either this or member_id (not both). + company_id: nil, # The minimum creation date to filter by created_after: nil, # The maximum creation date to filter by @@ -73,6 +78,8 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, + # The ID of the Member to list payment methods for + member_id: nil, request_options: {} ) end @@ -80,14 +87,15 @@ module WhopSDK sig do override.returns( { - member_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), + member_id: T.nilable(String), request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/payment_method_retrieve_params.rbi b/rbi/whop_sdk/models/payment_method_retrieve_params.rbi index 02523169..2a21b2d8 100644 --- a/rbi/whop_sdk/models/payment_method_retrieve_params.rbi +++ b/rbi/whop_sdk/models/payment_method_retrieve_params.rbi @@ -14,26 +14,37 @@ module WhopSDK ) end - # The ID of the Member associated with the PaymentMethod - sig { returns(String) } + # The ID of the Company. Provide either this or member_id (not both). + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # The ID of the Member. Provide either this or company_id (not both). + sig { returns(T.nilable(String)) } attr_accessor :member_id sig do params( - member_id: String, + company_id: T.nilable(String), + member_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The ID of the Member associated with the PaymentMethod - member_id:, + # The ID of the Company. Provide either this or member_id (not both). + company_id: nil, + # The ID of the Member. Provide either this or company_id (not both). + member_id: nil, request_options: {} ) end sig do override.returns( - { member_id: String, request_options: WhopSDK::RequestOptions } + { + company_id: T.nilable(String), + member_id: T.nilable(String), + request_options: WhopSDK::RequestOptions + } ) end def to_hash diff --git a/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi b/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi new file mode 100644 index 00000000..a754228d --- /dev/null +++ b/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi @@ -0,0 +1,340 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutMethodCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutMethodCreatedWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + # An object representing an user's setup payout destination. + sig { returns(WhopSDK::PayoutMethodCreatedWebhookEvent::Data) } + attr_reader :data + + sig do + params( + data: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::OrHash + ).void + end + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + data: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::OrHash, + timestamp: Time, + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + # An object representing an user's setup payout destination. + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"payout_method.created" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::PayoutMethodCreatedWebhookEvent::Data, + timestamp: Time, + type: Symbol + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of the payout token + sig { returns(String) } + attr_accessor :id + + # The company associated with the payout token + sig do + returns( + T.nilable(WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company) + ) + end + attr_reader :company + + sig do + params( + company: + T.nilable( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company::OrHash + ) + ).void + end + attr_writer :company + + # The currency code of the payout destination. This is the currency that payouts + # will be made in for this token. + sig { returns(String) } + attr_accessor :currency + + # The payout destination associated with the payout token + sig do + returns( + T.nilable( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination + ) + ) + end + attr_reader :destination + + sig do + params( + destination: + T.nilable( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::OrHash + ) + ).void + end + attr_writer :destination + + # Whether this payout token is the default for the payout account + sig { returns(T::Boolean) } + attr_accessor :is_default + + # An optional nickname for the payout token to help the user identify it. This is + # not used by the provider and is only for the user's reference. + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + # An object representing an user's setup payout destination. + sig do + params( + id: String, + company: + T.nilable( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company::OrHash + ), + currency: String, + destination: + T.nilable( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::OrHash + ), + is_default: T::Boolean, + nickname: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The ID of the payout token + id:, + # The company associated with the payout token + company:, + # The currency code of the payout destination. This is the currency that payouts + # will be made in for this token. + currency:, + # The payout destination associated with the payout token + destination:, + # Whether this payout token is the default for the payout account + is_default:, + # An optional nickname for the payout token to help the user identify it. This is + # not used by the provider and is only for the user's reference. + nickname: + ) + end + + sig do + override.returns( + { + id: String, + company: + T.nilable( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company + ), + currency: String, + destination: + T.nilable( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination + ), + is_default: T::Boolean, + nickname: T.nilable(String) + } + ) + end + def to_hash + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company, + WhopSDK::Internal::AnyHash + ) + end + + # The ID (tag) of the company. + sig { returns(String) } + attr_accessor :id + + # The company associated with the payout token + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID (tag) of the company. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class Destination < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination, + WhopSDK::Internal::AnyHash + ) + end + + # The category of the payout destination + sig do + returns( + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + end + attr_accessor :category + + # The country code of the payout destination + sig { returns(String) } + attr_accessor :country_code + + # The name of the payer associated with the payout destination + sig { returns(String) } + attr_accessor :name + + # The payout destination associated with the payout token + sig do + params( + category: + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::OrSymbol, + country_code: String, + name: String + ).returns(T.attached_class) + end + def self.new( + # The category of the payout destination + category:, + # The country code of the payout destination + country_code:, + # The name of the payer associated with the payout destination + name: + ) + end + + sig do + override.returns( + { + category: + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol, + country_code: String, + name: String + } + ) + end + def to_hash + end + + # The category of the payout destination + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CRYPTO = + T.let( + :crypto, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + RTP = + T.let( + :rtp, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + NEXT_DAY_BANK = + T.let( + :next_day_bank, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + BANK_WIRE = + T.let( + :bank_wire, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + DIGITAL_WALLET = + T.let( + :digital_wallet, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_method_list_response.rbi b/rbi/whop_sdk/models/payout_method_list_response.rbi index c02ce24d..9d4448f3 100644 --- a/rbi/whop_sdk/models/payout_method_list_response.rbi +++ b/rbi/whop_sdk/models/payout_method_list_response.rbi @@ -15,6 +15,22 @@ module WhopSDK sig { returns(String) } attr_accessor :id + # The company associated with the payout token + sig do + returns(T.nilable(WhopSDK::Models::PayoutMethodListResponse::Company)) + end + attr_reader :company + + sig do + params( + company: + T.nilable( + WhopSDK::Models::PayoutMethodListResponse::Company::OrHash + ) + ).void + end + attr_writer :company + # The currency code of the payout destination. This is the currency that payouts # will be made in for this token. sig { returns(String) } @@ -38,6 +54,10 @@ module WhopSDK end attr_writer :destination + # Whether this payout token is the default for the payout account + sig { returns(T::Boolean) } + attr_accessor :is_default + # An optional nickname for the payout token to help the user identify it. This is # not used by the provider and is only for the user's reference. sig { returns(T.nilable(String)) } @@ -47,22 +67,31 @@ module WhopSDK sig do params( id: String, + company: + T.nilable( + WhopSDK::Models::PayoutMethodListResponse::Company::OrHash + ), currency: String, destination: T.nilable( WhopSDK::Models::PayoutMethodListResponse::Destination::OrHash ), + is_default: T::Boolean, nickname: T.nilable(String) ).returns(T.attached_class) end def self.new( # The ID of the payout token id:, + # The company associated with the payout token + company:, # The currency code of the payout destination. This is the currency that payouts # will be made in for this token. currency:, # The payout destination associated with the payout token destination:, + # Whether this payout token is the default for the payout account + is_default:, # An optional nickname for the payout token to help the user identify it. This is # not used by the provider and is only for the user's reference. nickname: @@ -73,9 +102,12 @@ module WhopSDK override.returns( { id: String, + company: + T.nilable(WhopSDK::Models::PayoutMethodListResponse::Company), currency: String, destination: T.nilable(WhopSDK::Models::PayoutMethodListResponse::Destination), + is_default: T::Boolean, nickname: T.nilable(String) } ) @@ -83,6 +115,32 @@ module WhopSDK def to_hash end + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutMethodListResponse::Company, + WhopSDK::Internal::AnyHash + ) + end + + # The ID (tag) of the company. + sig { returns(String) } + attr_accessor :id + + # The company associated with the payout token + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID (tag) of the company. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + class Destination < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/payout_method_retrieve_params.rbi b/rbi/whop_sdk/models/payout_method_retrieve_params.rbi new file mode 100644 index 00000000..9ce071c1 --- /dev/null +++ b/rbi/whop_sdk/models/payout_method_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::PayoutMethodRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: WhopSDK::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_method_retrieve_response.rbi b/rbi/whop_sdk/models/payout_method_retrieve_response.rbi new file mode 100644 index 00000000..9966e67d --- /dev/null +++ b/rbi/whop_sdk/models/payout_method_retrieve_response.rbi @@ -0,0 +1,262 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutMethodRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutMethodRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The ID of the payout token + sig { returns(String) } + attr_accessor :id + + # The company associated with the payout token + sig do + returns( + T.nilable(WhopSDK::Models::PayoutMethodRetrieveResponse::Company) + ) + end + attr_reader :company + + sig do + params( + company: + T.nilable( + WhopSDK::Models::PayoutMethodRetrieveResponse::Company::OrHash + ) + ).void + end + attr_writer :company + + # The currency code of the payout destination. This is the currency that payouts + # will be made in for this token. + sig { returns(String) } + attr_accessor :currency + + # The payout destination associated with the payout token + sig do + returns( + T.nilable(WhopSDK::Models::PayoutMethodRetrieveResponse::Destination) + ) + end + attr_reader :destination + + sig do + params( + destination: + T.nilable( + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::OrHash + ) + ).void + end + attr_writer :destination + + # Whether this payout token is the default for the payout account + sig { returns(T::Boolean) } + attr_accessor :is_default + + # An optional nickname for the payout token to help the user identify it. This is + # not used by the provider and is only for the user's reference. + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + # An object representing an user's setup payout destination. + sig do + params( + id: String, + company: + T.nilable( + WhopSDK::Models::PayoutMethodRetrieveResponse::Company::OrHash + ), + currency: String, + destination: + T.nilable( + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::OrHash + ), + is_default: T::Boolean, + nickname: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The ID of the payout token + id:, + # The company associated with the payout token + company:, + # The currency code of the payout destination. This is the currency that payouts + # will be made in for this token. + currency:, + # The payout destination associated with the payout token + destination:, + # Whether this payout token is the default for the payout account + is_default:, + # An optional nickname for the payout token to help the user identify it. This is + # not used by the provider and is only for the user's reference. + nickname: + ) + end + + sig do + override.returns( + { + id: String, + company: + T.nilable(WhopSDK::Models::PayoutMethodRetrieveResponse::Company), + currency: String, + destination: + T.nilable( + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination + ), + is_default: T::Boolean, + nickname: T.nilable(String) + } + ) + end + def to_hash + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutMethodRetrieveResponse::Company, + WhopSDK::Internal::AnyHash + ) + end + + # The ID (tag) of the company. + sig { returns(String) } + attr_accessor :id + + # The company associated with the payout token + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The ID (tag) of the company. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class Destination < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination, + WhopSDK::Internal::AnyHash + ) + end + + # The category of the payout destination + sig do + returns( + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ) + end + attr_accessor :category + + # The country code of the payout destination + sig { returns(String) } + attr_accessor :country_code + + # The name of the payer associated with the payout destination + sig { returns(String) } + attr_accessor :name + + # The payout destination associated with the payout token + sig do + params( + category: + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::OrSymbol, + country_code: String, + name: String + ).returns(T.attached_class) + end + def self.new( + # The category of the payout destination + category:, + # The country code of the payout destination + country_code:, + # The name of the payer associated with the payout destination + name: + ) + end + + sig do + override.returns( + { + category: + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol, + country_code: String, + name: String + } + ) + end + def to_hash + end + + # The category of the payout destination + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CRYPTO = + T.let( + :crypto, + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ) + RTP = + T.let( + :rtp, + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ) + NEXT_DAY_BANK = + T.let( + :next_day_bank, + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ) + BANK_WIRE = + T.let( + :bank_wire, + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ) + DIGITAL_WALLET = + T.let( + :digital_wallet, + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ) + UNKNOWN = + T.let( + :unknown, + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/support_channel_create_params.rbi b/rbi/whop_sdk/models/support_channel_create_params.rbi index 7b72e1e9..57b4948f 100644 --- a/rbi/whop_sdk/models/support_channel_create_params.rbi +++ b/rbi/whop_sdk/models/support_channel_create_params.rbi @@ -15,7 +15,7 @@ module WhopSDK sig { returns(String) } attr_accessor :company_id - # The ID of the user to create the support chat for + # The ID (user_xxx) or username of the user to create the support chat for sig { returns(String) } attr_accessor :user_id @@ -29,7 +29,7 @@ module WhopSDK def self.new( # The ID of the company to create the support chat in company_id:, - # The ID of the user to create the support chat for + # The ID (user_xxx) or username of the user to create the support chat for user_id:, request_options: {} ) diff --git a/rbi/whop_sdk/models/topup_create_params.rbi b/rbi/whop_sdk/models/topup_create_params.rbi new file mode 100644 index 00000000..96ebe992 --- /dev/null +++ b/rbi/whop_sdk/models/topup_create_params.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module WhopSDK + module Models + class TopupCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::TopupCreateParams, WhopSDK::Internal::AnyHash) + end + + # The amount to add to the balance. + sig { returns(Float) } + attr_accessor :amount + + # The ID of the company to add funds to. + sig { returns(String) } + attr_accessor :company_id + + # The currency of the top-up. + sig { returns(WhopSDK::Currency::OrSymbol) } + attr_accessor :currency + + # The ID of the payment method to charge for the top-up. + sig { returns(String) } + attr_accessor :payment_method_id + + sig do + params( + amount: Float, + company_id: String, + currency: WhopSDK::Currency::OrSymbol, + payment_method_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The amount to add to the balance. + amount:, + # The ID of the company to add funds to. + company_id:, + # The currency of the top-up. + currency:, + # The ID of the payment method to charge for the top-up. + payment_method_id:, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Float, + company_id: String, + currency: WhopSDK::Currency::OrSymbol, + payment_method_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/topup_create_response.rbi b/rbi/whop_sdk/models/topup_create_response.rbi new file mode 100644 index 00000000..755504d8 --- /dev/null +++ b/rbi/whop_sdk/models/topup_create_response.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module WhopSDK + module Models + class TopupCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::TopupCreateResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The payment ID + sig { returns(String) } + attr_accessor :id + + # The datetime the payment was created + sig { returns(Time) } + attr_accessor :created_at + + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + attr_accessor :currency + + # If the payment failed, the reason for the failure. + sig { returns(T.nilable(String)) } + attr_accessor :failure_message + + # The datetime the payment was paid + sig { returns(T.nilable(Time)) } + attr_accessor :paid_at + + # The status of a receipt + sig { returns(T.nilable(WhopSDK::ReceiptStatus::TaggedSymbol)) } + attr_accessor :status + + # The total to show to the creator (excluding buyer fees). + sig { returns(T.nilable(Float)) } + attr_accessor :total + + # An object representing a receipt for a membership. + sig do + params( + id: String, + created_at: Time, + currency: T.nilable(WhopSDK::Currency::OrSymbol), + failure_message: T.nilable(String), + paid_at: T.nilable(Time), + status: T.nilable(WhopSDK::ReceiptStatus::OrSymbol), + total: T.nilable(Float) + ).returns(T.attached_class) + end + def self.new( + # The payment ID + id:, + # The datetime the payment was created + created_at:, + # The available currencies on the platform + currency:, + # If the payment failed, the reason for the failure. + failure_message:, + # The datetime the payment was paid + paid_at:, + # The status of a receipt + status:, + # The total to show to the creator (excluding buyer fees). + total: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + currency: T.nilable(WhopSDK::Currency::TaggedSymbol), + failure_message: T.nilable(String), + paid_at: T.nilable(Time), + status: T.nilable(WhopSDK::ReceiptStatus::TaggedSymbol), + total: T.nilable(Float) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/unwrap_webhook_event.rbi b/rbi/whop_sdk/models/unwrap_webhook_event.rbi index 98d95793..2ab236e7 100644 --- a/rbi/whop_sdk/models/unwrap_webhook_event.rbi +++ b/rbi/whop_sdk/models/unwrap_webhook_event.rbi @@ -24,6 +24,8 @@ module WhopSDK WhopSDK::WithdrawalCreatedWebhookEvent, WhopSDK::WithdrawalUpdatedWebhookEvent, WhopSDK::CourseLessonInteractionCompletedWebhookEvent, + WhopSDK::PayoutMethodCreatedWebhookEvent, + WhopSDK::VerificationSucceededWebhookEvent, WhopSDK::PaymentCreatedWebhookEvent, WhopSDK::PaymentSucceededWebhookEvent, WhopSDK::PaymentFailedWebhookEvent, @@ -31,7 +33,8 @@ module WhopSDK WhopSDK::DisputeCreatedWebhookEvent, WhopSDK::DisputeUpdatedWebhookEvent, WhopSDK::RefundCreatedWebhookEvent, - WhopSDK::RefundUpdatedWebhookEvent + WhopSDK::RefundUpdatedWebhookEvent, + WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent ) end diff --git a/rbi/whop_sdk/models/verification_retrieve_params.rbi b/rbi/whop_sdk/models/verification_retrieve_params.rbi new file mode 100644 index 00000000..49ebad0f --- /dev/null +++ b/rbi/whop_sdk/models/verification_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::VerificationRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig do + params(request_options: WhopSDK::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: WhopSDK::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/verification_retrieve_response.rbi b/rbi/whop_sdk/models/verification_retrieve_response.rbi new file mode 100644 index 00000000..15ea82c4 --- /dev/null +++ b/rbi/whop_sdk/models/verification_retrieve_response.rbi @@ -0,0 +1,290 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # A unique identifier for the verification. + sig { returns(String) } + attr_accessor :id + + # An error code for a verification attempt. + sig do + returns( + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + ) + end + attr_accessor :last_error_code + + # The last error reason that occurred during the verification. + sig { returns(T.nilable(String)) } + attr_accessor :last_error_reason + + # The status of the verification. + sig do + returns( + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + # An object representing an identity verification session + sig do + params( + id: String, + last_error_code: + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::OrSymbol + ), + last_error_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationRetrieveResponse::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for the verification. + id:, + # An error code for a verification attempt. + last_error_code:, + # The last error reason that occurred during the verification. + last_error_reason:, + # The status of the verification. + status: + ) + end + + sig do + override.returns( + { + id: String, + last_error_code: + T.nilable( + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ), + last_error_reason: T.nilable(String), + status: + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # An error code for a verification attempt. + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ABANDONED = + T.let( + :abandoned, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + CONSENT_DECLINED = + T.let( + :consent_declined, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + COUNTRY_NOT_SUPPORTED = + T.let( + :country_not_supported, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + DEVICE_NOT_SUPPORTED = + T.let( + :device_not_supported, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + DOCUMENT_EXPIRED = + T.let( + :document_expired, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + DOCUMENT_TYPE_NOT_SUPPORTED = + T.let( + :document_type_not_supported, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + DOCUMENT_UNVERIFIED_OTHER = + T.let( + :document_unverified_other, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + EMAIL_UNVERIFIED_OTHER = + T.let( + :email_unverified_other, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + EMAIL_VERIFICATION_DECLINED = + T.let( + :email_verification_declined, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA = + T.let( + :id_number_insufficient_document_data, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_MISMATCH = + T.let( + :id_number_mismatch, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_UNVERIFIED_OTHER = + T.let( + :id_number_unverified_other, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + PHONE_UNVERIFIED_OTHER = + T.let( + :phone_unverified_other, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + PHONE_VERIFICATION_DECLINED = + T.let( + :phone_verification_declined, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + SELFIE_DOCUMENT_MISSING_PHOTO = + T.let( + :selfie_document_missing_photo, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + SELFIE_FACE_MISMATCH = + T.let( + :selfie_face_mismatch, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + SELFIE_MANIPULATED = + T.let( + :selfie_manipulated, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + SELFIE_UNVERIFIED_OTHER = + T.let( + :selfie_unverified_other, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + UNDER_SUPPORTED_AGE = + T.let( + :under_supported_age, + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the verification. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::VerificationRetrieveResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRES_INPUT = + T.let( + :requires_input, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + PROCESSING = + T.let( + :processing, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + VERIFIED = + T.let( + :verified, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + CREATED = + T.let( + :created, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + STARTED = + T.let( + :started, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + SUBMITTED = + T.let( + :submitted, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + DECLINED = + T.let( + :declined, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + RESUBMISSION_REQUESTED = + T.let( + :resubmission_requested, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + ABANDONED = + T.let( + :abandoned, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + REVIEW = + T.let( + :review, + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::VerificationRetrieveResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/verification_succeeded_webhook_event.rbi b/rbi/whop_sdk/models/verification_succeeded_webhook_event.rbi new file mode 100644 index 00000000..b5d55259 --- /dev/null +++ b/rbi/whop_sdk/models/verification_succeeded_webhook_event.rbi @@ -0,0 +1,367 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationSucceededWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationSucceededWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + # An object representing an identity verification session + sig { returns(WhopSDK::VerificationSucceededWebhookEvent::Data) } + attr_reader :data + + sig do + params( + data: WhopSDK::VerificationSucceededWebhookEvent::Data::OrHash + ).void + end + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + id: String, + data: WhopSDK::VerificationSucceededWebhookEvent::Data::OrHash, + timestamp: Time, + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + # An object representing an identity verification session + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"verification.succeeded" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::VerificationSucceededWebhookEvent::Data, + timestamp: Time, + type: Symbol + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::VerificationSucceededWebhookEvent::Data, + WhopSDK::Internal::AnyHash + ) + end + + # A unique identifier for the verification. + sig { returns(String) } + attr_accessor :id + + # An error code for a verification attempt. + sig do + returns( + T.nilable( + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + ) + end + attr_accessor :last_error_code + + # The last error reason that occurred during the verification. + sig { returns(T.nilable(String)) } + attr_accessor :last_error_reason + + # The status of the verification. + sig do + returns( + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + end + attr_accessor :status + + # An object representing an identity verification session + sig do + params( + id: String, + last_error_code: + T.nilable( + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::OrSymbol + ), + last_error_reason: T.nilable(String), + status: + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for the verification. + id:, + # An error code for a verification attempt. + last_error_code:, + # The last error reason that occurred during the verification. + last_error_reason:, + # The status of the verification. + status: + ) + end + + sig do + override.returns( + { + id: String, + last_error_code: + T.nilable( + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ), + last_error_reason: T.nilable(String), + status: + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # An error code for a verification attempt. + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ABANDONED = + T.let( + :abandoned, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + CONSENT_DECLINED = + T.let( + :consent_declined, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + COUNTRY_NOT_SUPPORTED = + T.let( + :country_not_supported, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + DEVICE_NOT_SUPPORTED = + T.let( + :device_not_supported, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + DOCUMENT_EXPIRED = + T.let( + :document_expired, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + DOCUMENT_TYPE_NOT_SUPPORTED = + T.let( + :document_type_not_supported, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + DOCUMENT_UNVERIFIED_OTHER = + T.let( + :document_unverified_other, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + EMAIL_UNVERIFIED_OTHER = + T.let( + :email_unverified_other, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + EMAIL_VERIFICATION_DECLINED = + T.let( + :email_verification_declined, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA = + T.let( + :id_number_insufficient_document_data, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_MISMATCH = + T.let( + :id_number_mismatch, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + ID_NUMBER_UNVERIFIED_OTHER = + T.let( + :id_number_unverified_other, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + PHONE_UNVERIFIED_OTHER = + T.let( + :phone_unverified_other, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + PHONE_VERIFICATION_DECLINED = + T.let( + :phone_verification_declined, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + SELFIE_DOCUMENT_MISSING_PHOTO = + T.let( + :selfie_document_missing_photo, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + SELFIE_FACE_MISMATCH = + T.let( + :selfie_face_mismatch, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + SELFIE_MANIPULATED = + T.let( + :selfie_manipulated, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + SELFIE_UNVERIFIED_OTHER = + T.let( + :selfie_unverified_other, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + UNDER_SUPPORTED_AGE = + T.let( + :under_supported_age, + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::VerificationSucceededWebhookEvent::Data::LastErrorCode::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the verification. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRES_INPUT = + T.let( + :requires_input, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + PROCESSING = + T.let( + :processing, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + VERIFIED = + T.let( + :verified, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + CANCELED = + T.let( + :canceled, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + CREATED = + T.let( + :created, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + STARTED = + T.let( + :started, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + SUBMITTED = + T.let( + :submitted, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + APPROVED = + T.let( + :approved, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + DECLINED = + T.let( + :declined, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + RESUBMISSION_REQUESTED = + T.let( + :resubmission_requested, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + ABANDONED = + T.let( + :abandoned, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + REVIEW = + T.let( + :review, + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::VerificationSucceededWebhookEvent::Data::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/leads.rbi b/rbi/whop_sdk/resources/leads.rbi new file mode 100644 index 00000000..caeede26 --- /dev/null +++ b/rbi/whop_sdk/resources/leads.rbi @@ -0,0 +1,138 @@ +# typed: strong + +module WhopSDK + module Resources + class Leads + # Creates a new lead + # + # Required permissions: + # + # - `lead:manage` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + sig do + params( + company_id: String, + metadata: T.nilable(T::Hash[Symbol, T.anything]), + product_id: T.nilable(String), + referrer: T.nilable(String), + user_id: T.nilable(String), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::LeadCreateResponse) + end + def create( + # The ID of the company to create a lead for. + company_id:, + # Custom metadata for the lead. + metadata: nil, + # The ID of the product the lead is interested in. + product_id: nil, + # The url referrer of the lead, if any. + referrer: nil, + # The ID of the user to create a lead for. If the request is made by a user, that + # user will be used. + user_id: nil, + request_options: {} + ) + end + + # Retrieves a lead by ID + # + # Required permissions: + # + # - `lead:basic:read` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::LeadRetrieveResponse) + end + def retrieve( + # The ID of the lead + id, + request_options: {} + ) + end + + # Updates a lead + # + # Required permissions: + # + # - `lead:manage` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + sig do + params( + id: String, + metadata: T.nilable(T::Hash[Symbol, T.anything]), + referrer: T.nilable(String), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::LeadUpdateResponse) + end + def update( + # The ID of the lead to update. + id, + # Custom metadata for the lead. + metadata: nil, + # The url referrer of the lead. + referrer: nil, + request_options: {} + ) + end + + # Lists leads for a company + # + # Required permissions: + # + # - `lead:basic:read` + # - `member:email:read` + # - `access_pass:basic:read` + # - `member:basic:read` + sig do + params( + company_id: String, + after: T.nilable(String), + before: T.nilable(String), + created_after: T.nilable(Time), + created_before: T.nilable(Time), + first: T.nilable(Integer), + last: T.nilable(Integer), + product_ids: T.nilable(T::Array[String]), + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[WhopSDK::Models::LeadListResponse] + ) + end + def list( + # The ID of the company to list leads for + company_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, + # The minimum creation date to filter by + created_after: nil, + # The maximum creation date to filter by + created_before: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + # The product IDs to filter the leads by + product_ids: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/whop_sdk/resources/payment_methods.rbi b/rbi/whop_sdk/resources/payment_methods.rbi index 1d4c6b55..589ade98 100644 --- a/rbi/whop_sdk/resources/payment_methods.rbi +++ b/rbi/whop_sdk/resources/payment_methods.rbi @@ -7,7 +7,7 @@ module WhopSDK # such as a card, bank account, or digital wallet. It holds the necessary billing # details and can be attached to a member for future one-time or recurring # charges. This lets you reuse the same payment credentials across multiple - # payments. + # payments. You must provide exactly one of company_id or member_id. # # Required permissions: # @@ -15,15 +15,18 @@ module WhopSDK sig do params( id: String, - member_id: String, + company_id: T.nilable(String), + member_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Models::PaymentMethodRetrieveResponse::Variants) end def retrieve( # The ID of the PaymentMethod id, - # The ID of the Member associated with the PaymentMethod - member_id:, + # The ID of the Company. Provide either this or member_id (not both). + company_id: nil, + # The ID of the Member. Provide either this or company_id (not both). + member_id: nil, request_options: {} ) end @@ -39,14 +42,15 @@ module WhopSDK # - `member:payment_methods:read` sig do params( - member_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), + member_id: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[ @@ -55,12 +59,12 @@ module WhopSDK ) end def list( - # The ID of the Member to list payment methods for - member_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, + # The ID of the Company. Provide either this or member_id (not both). + company_id: nil, # The minimum creation date to filter by created_after: nil, # The maximum creation date to filter by @@ -71,6 +75,8 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, + # The ID of the Member to list payment methods for + member_id: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/payments.rbi b/rbi/whop_sdk/resources/payments.rbi index 9ce14be7..c700cdbf 100644 --- a/rbi/whop_sdk/resources/payments.rbi +++ b/rbi/whop_sdk/resources/payments.rbi @@ -28,6 +28,7 @@ module WhopSDK payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Plan::OrHash, plan_id: String, + metadata: T.nilable(T::Hash[Symbol, T.anything]), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Payment) end @@ -43,6 +44,8 @@ module WhopSDK plan:, # An ID of an existing plan to use for the payment. plan_id:, + # Custom metadata to attach to the payment. + metadata: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/payout_methods.rbi b/rbi/whop_sdk/resources/payout_methods.rbi index ea15e668..a574a42d 100644 --- a/rbi/whop_sdk/resources/payout_methods.rbi +++ b/rbi/whop_sdk/resources/payout_methods.rbi @@ -3,6 +3,24 @@ module WhopSDK module Resources class PayoutMethods + # Retrieves a payout method by ID + # + # Required permissions: + # + # - `payout:destination:read` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::PayoutMethodRetrieveResponse) + end + def retrieve( + # The ID of the payout method + id, + request_options: {} + ) + end + # Lists payout destinations for a company # # Required permissions: diff --git a/rbi/whop_sdk/resources/support_channels.rbi b/rbi/whop_sdk/resources/support_channels.rbi index e2abff18..d52a84ff 100644 --- a/rbi/whop_sdk/resources/support_channels.rbi +++ b/rbi/whop_sdk/resources/support_channels.rbi @@ -19,7 +19,7 @@ module WhopSDK def create( # The ID of the company to create the support chat in company_id:, - # The ID of the user to create the support chat for + # The ID (user_xxx) or username of the user to create the support chat for user_id:, request_options: {} ) diff --git a/rbi/whop_sdk/resources/topups.rbi b/rbi/whop_sdk/resources/topups.rbi new file mode 100644 index 00000000..bc28fb0f --- /dev/null +++ b/rbi/whop_sdk/resources/topups.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module WhopSDK + module Resources + class Topups + # Add funds to your platform balance by charging a stored payment method. + # + # Required permissions: + # + # - `payment:charge` + sig do + params( + amount: Float, + company_id: String, + currency: WhopSDK::Currency::OrSymbol, + payment_method_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::TopupCreateResponse) + end + def create( + # The amount to add to the balance. + amount:, + # The ID of the company to add funds to. + company_id:, + # The currency of the top-up. + currency:, + # The ID of the payment method to charge for the top-up. + payment_method_id:, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/whop_sdk/resources/verifications.rbi b/rbi/whop_sdk/resources/verifications.rbi new file mode 100644 index 00000000..21df1d80 --- /dev/null +++ b/rbi/whop_sdk/resources/verifications.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module WhopSDK + module Resources + class Verifications + # Retrieves a verification by ID + # + # Required permissions: + # + # - `payout:account:read` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::VerificationRetrieveResponse) + end + def retrieve( + # The ID of the verification + id, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/whop_sdk/resources/webhooks.rbi b/rbi/whop_sdk/resources/webhooks.rbi index 51359194..6d0ec8b6 100644 --- a/rbi/whop_sdk/resources/webhooks.rbi +++ b/rbi/whop_sdk/resources/webhooks.rbi @@ -22,6 +22,8 @@ module WhopSDK WhopSDK::WithdrawalCreatedWebhookEvent, WhopSDK::WithdrawalUpdatedWebhookEvent, WhopSDK::CourseLessonInteractionCompletedWebhookEvent, + WhopSDK::PayoutMethodCreatedWebhookEvent, + WhopSDK::VerificationSucceededWebhookEvent, WhopSDK::PaymentCreatedWebhookEvent, WhopSDK::PaymentSucceededWebhookEvent, WhopSDK::PaymentFailedWebhookEvent, @@ -29,7 +31,8 @@ module WhopSDK WhopSDK::DisputeCreatedWebhookEvent, WhopSDK::DisputeUpdatedWebhookEvent, WhopSDK::RefundCreatedWebhookEvent, - WhopSDK::RefundUpdatedWebhookEvent + WhopSDK::RefundUpdatedWebhookEvent, + WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent ) ) end diff --git a/sig/whop_sdk/client.rbs b/sig/whop_sdk/client.rbs index 6c28220c..d2a3aeca 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -94,6 +94,12 @@ module WhopSDK attr_reader payout_methods: WhopSDK::Resources::PayoutMethods + attr_reader verifications: WhopSDK::Resources::Verifications + + attr_reader leads: WhopSDK::Resources::Leads + + attr_reader topups: WhopSDK::Resources::Topups + private def auth_headers: -> ::Hash[String, String] def initialize: ( diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 35b748a8..6e376457 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -261,6 +261,14 @@ module WhopSDK module Languages = WhopSDK::Models::Languages + class LeadCreateParams = WhopSDK::Models::LeadCreateParams + + class LeadListParams = WhopSDK::Models::LeadListParams + + class LeadRetrieveParams = WhopSDK::Models::LeadRetrieveParams + + class LeadUpdateParams = WhopSDK::Models::LeadUpdateParams + class LedgerAccountRetrieveParams = WhopSDK::Models::LedgerAccountRetrieveParams class Lesson = WhopSDK::Models::Lesson @@ -279,6 +287,8 @@ module WhopSDK class MembershipActivatedWebhookEvent = WhopSDK::Models::MembershipActivatedWebhookEvent + class MembershipCancelAtPeriodEndChangedWebhookEvent = WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent + class MembershipCancelParams = WhopSDK::Models::MembershipCancelParams class MembershipDeactivatedWebhookEvent = WhopSDK::Models::MembershipDeactivatedWebhookEvent @@ -343,8 +353,12 @@ module WhopSDK class PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + class PayoutMethodCreatedWebhookEvent = WhopSDK::Models::PayoutMethodCreatedWebhookEvent + class PayoutMethodListParams = WhopSDK::Models::PayoutMethodListParams + class PayoutMethodRetrieveParams = WhopSDK::Models::PayoutMethodRetrieveParams + class Plan = WhopSDK::Models::Plan class PlanCreateParams = WhopSDK::Models::PlanCreateParams @@ -459,6 +473,8 @@ module WhopSDK module TaxType = WhopSDK::Models::TaxType + class TopupCreateParams = WhopSDK::Models::TopupCreateParams + class Transfer = WhopSDK::Models::Transfer class TransferCreateParams = WhopSDK::Models::TransferCreateParams @@ -473,6 +489,10 @@ module WhopSDK class UserRetrieveParams = WhopSDK::Models::UserRetrieveParams + class VerificationRetrieveParams = WhopSDK::Models::VerificationRetrieveParams + + class VerificationSucceededWebhookEvent = WhopSDK::Models::VerificationSucceededWebhookEvent + module Visibility = WhopSDK::Models::Visibility module VisibilityFilter = WhopSDK::Models::VisibilityFilter diff --git a/sig/whop_sdk/models/lead_create_params.rbs b/sig/whop_sdk/models/lead_create_params.rbs new file mode 100644 index 00000000..f6bf58aa --- /dev/null +++ b/sig/whop_sdk/models/lead_create_params.rbs @@ -0,0 +1,46 @@ +module WhopSDK + module Models + type lead_create_params = + { + company_id: String, + metadata: ::Hash[Symbol, top]?, + product_id: String?, + referrer: String?, + user_id: String? + } + & WhopSDK::Internal::Type::request_parameters + + class LeadCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor company_id: String + + attr_accessor metadata: ::Hash[Symbol, top]? + + attr_accessor product_id: String? + + attr_accessor referrer: String? + + attr_accessor user_id: String? + + def initialize: ( + company_id: String, + ?metadata: ::Hash[Symbol, top]?, + ?product_id: String?, + ?referrer: String?, + ?user_id: String?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + company_id: String, + metadata: ::Hash[Symbol, top]?, + product_id: String?, + referrer: String?, + user_id: String?, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/lead_create_response.rbs b/sig/whop_sdk/models/lead_create_response.rbs new file mode 100644 index 00000000..ddc3d90e --- /dev/null +++ b/sig/whop_sdk/models/lead_create_response.rbs @@ -0,0 +1,104 @@ +module WhopSDK + module Models + type lead_create_response = + { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadCreateResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadCreateResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadCreateResponse::User + } + + class LeadCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor member: WhopSDK::Models::LeadCreateResponse::Member? + + attr_accessor metadata: ::Hash[Symbol, top]? + + attr_accessor product: WhopSDK::Models::LeadCreateResponse::Product? + + attr_accessor referrer: String? + + attr_accessor updated_at: Time + + attr_accessor user: WhopSDK::Models::LeadCreateResponse::User + + def initialize: ( + id: String, + created_at: Time, + member: WhopSDK::Models::LeadCreateResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadCreateResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadCreateResponse::User + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadCreateResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadCreateResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadCreateResponse::User + } + + type member = { id: String } + + class Member < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type product = { id: String, title: String } + + class Product < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor title: String + + def initialize: (id: String, title: String) -> void + + def to_hash: -> { id: String, title: String } + end + + type user = + { id: String, email: String?, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor email: String? + + attr_accessor name: String? + + attr_accessor username: String + + def initialize: ( + id: String, + email: String?, + name: String?, + username: String + ) -> void + + def to_hash: -> { + id: String, + email: String?, + name: String?, + username: String + } + end + end + end +end diff --git a/sig/whop_sdk/models/lead_list_params.rbs b/sig/whop_sdk/models/lead_list_params.rbs new file mode 100644 index 00000000..2f82178b --- /dev/null +++ b/sig/whop_sdk/models/lead_list_params.rbs @@ -0,0 +1,61 @@ +module WhopSDK + module Models + type lead_list_params = + { + company_id: String, + after: String?, + before: String?, + created_after: Time?, + created_before: Time?, + first: Integer?, + last: Integer?, + product_ids: ::Array[String]? + } + & WhopSDK::Internal::Type::request_parameters + + class LeadListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor company_id: String + + attr_accessor after: String? + + attr_accessor before: String? + + attr_accessor created_after: Time? + + attr_accessor created_before: Time? + + attr_accessor first: Integer? + + attr_accessor last: Integer? + + attr_accessor product_ids: ::Array[String]? + + def initialize: ( + company_id: String, + ?after: String?, + ?before: String?, + ?created_after: Time?, + ?created_before: Time?, + ?first: Integer?, + ?last: Integer?, + ?product_ids: ::Array[String]?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + company_id: String, + after: String?, + before: String?, + created_after: Time?, + created_before: Time?, + first: Integer?, + last: Integer?, + product_ids: ::Array[String]?, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/lead_list_response.rbs b/sig/whop_sdk/models/lead_list_response.rbs new file mode 100644 index 00000000..e4185e93 --- /dev/null +++ b/sig/whop_sdk/models/lead_list_response.rbs @@ -0,0 +1,104 @@ +module WhopSDK + module Models + type lead_list_response = + { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadListResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadListResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadListResponse::User + } + + class LeadListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor member: WhopSDK::Models::LeadListResponse::Member? + + attr_accessor metadata: ::Hash[Symbol, top]? + + attr_accessor product: WhopSDK::Models::LeadListResponse::Product? + + attr_accessor referrer: String? + + attr_accessor updated_at: Time + + attr_accessor user: WhopSDK::Models::LeadListResponse::User + + def initialize: ( + id: String, + created_at: Time, + member: WhopSDK::Models::LeadListResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadListResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadListResponse::User + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadListResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadListResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadListResponse::User + } + + type member = { id: String } + + class Member < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type product = { id: String, title: String } + + class Product < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor title: String + + def initialize: (id: String, title: String) -> void + + def to_hash: -> { id: String, title: String } + end + + type user = + { id: String, email: String?, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor email: String? + + attr_accessor name: String? + + attr_accessor username: String + + def initialize: ( + id: String, + email: String?, + name: String?, + username: String + ) -> void + + def to_hash: -> { + id: String, + email: String?, + name: String?, + username: String + } + end + end + end +end diff --git a/sig/whop_sdk/models/lead_retrieve_params.rbs b/sig/whop_sdk/models/lead_retrieve_params.rbs new file mode 100644 index 00000000..ec05e2fa --- /dev/null +++ b/sig/whop_sdk/models/lead_retrieve_params.rbs @@ -0,0 +1,15 @@ +module WhopSDK + module Models + type lead_retrieve_params = + { } & WhopSDK::Internal::Type::request_parameters + + class LeadRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + def initialize: (?request_options: WhopSDK::request_opts) -> void + + def to_hash: -> { request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/lead_retrieve_response.rbs b/sig/whop_sdk/models/lead_retrieve_response.rbs new file mode 100644 index 00000000..27152dbf --- /dev/null +++ b/sig/whop_sdk/models/lead_retrieve_response.rbs @@ -0,0 +1,104 @@ +module WhopSDK + module Models + type lead_retrieve_response = + { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadRetrieveResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadRetrieveResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadRetrieveResponse::User + } + + class LeadRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor member: WhopSDK::Models::LeadRetrieveResponse::Member? + + attr_accessor metadata: ::Hash[Symbol, top]? + + attr_accessor product: WhopSDK::Models::LeadRetrieveResponse::Product? + + attr_accessor referrer: String? + + attr_accessor updated_at: Time + + attr_accessor user: WhopSDK::Models::LeadRetrieveResponse::User + + def initialize: ( + id: String, + created_at: Time, + member: WhopSDK::Models::LeadRetrieveResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadRetrieveResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadRetrieveResponse::User + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadRetrieveResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadRetrieveResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadRetrieveResponse::User + } + + type member = { id: String } + + class Member < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type product = { id: String, title: String } + + class Product < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor title: String + + def initialize: (id: String, title: String) -> void + + def to_hash: -> { id: String, title: String } + end + + type user = + { id: String, email: String?, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor email: String? + + attr_accessor name: String? + + attr_accessor username: String + + def initialize: ( + id: String, + email: String?, + name: String?, + username: String + ) -> void + + def to_hash: -> { + id: String, + email: String?, + name: String?, + username: String + } + end + end + end +end diff --git a/sig/whop_sdk/models/lead_update_params.rbs b/sig/whop_sdk/models/lead_update_params.rbs new file mode 100644 index 00000000..5a6a1c0f --- /dev/null +++ b/sig/whop_sdk/models/lead_update_params.rbs @@ -0,0 +1,28 @@ +module WhopSDK + module Models + type lead_update_params = + { metadata: ::Hash[Symbol, top]?, referrer: String? } + & WhopSDK::Internal::Type::request_parameters + + class LeadUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor metadata: ::Hash[Symbol, top]? + + attr_accessor referrer: String? + + def initialize: ( + ?metadata: ::Hash[Symbol, top]?, + ?referrer: String?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + metadata: ::Hash[Symbol, top]?, + referrer: String?, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/lead_update_response.rbs b/sig/whop_sdk/models/lead_update_response.rbs new file mode 100644 index 00000000..9baecd62 --- /dev/null +++ b/sig/whop_sdk/models/lead_update_response.rbs @@ -0,0 +1,104 @@ +module WhopSDK + module Models + type lead_update_response = + { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadUpdateResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadUpdateResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadUpdateResponse::User + } + + class LeadUpdateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor member: WhopSDK::Models::LeadUpdateResponse::Member? + + attr_accessor metadata: ::Hash[Symbol, top]? + + attr_accessor product: WhopSDK::Models::LeadUpdateResponse::Product? + + attr_accessor referrer: String? + + attr_accessor updated_at: Time + + attr_accessor user: WhopSDK::Models::LeadUpdateResponse::User + + def initialize: ( + id: String, + created_at: Time, + member: WhopSDK::Models::LeadUpdateResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadUpdateResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadUpdateResponse::User + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadUpdateResponse::Member?, + metadata: ::Hash[Symbol, top]?, + product: WhopSDK::Models::LeadUpdateResponse::Product?, + referrer: String?, + updated_at: Time, + user: WhopSDK::Models::LeadUpdateResponse::User + } + + type member = { id: String } + + class Member < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type product = { id: String, title: String } + + class Product < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor title: String + + def initialize: (id: String, title: String) -> void + + def to_hash: -> { id: String, title: String } + end + + type user = + { id: String, email: String?, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor email: String? + + attr_accessor name: String? + + attr_accessor username: String + + def initialize: ( + id: String, + email: String?, + name: String?, + username: String + ) -> void + + def to_hash: -> { + id: String, + email: String?, + name: String?, + username: String + } + end + end + end +end diff --git a/sig/whop_sdk/models/ledger_account_retrieve_response.rbs b/sig/whop_sdk/models/ledger_account_retrieve_response.rbs index 206f6bf3..7518325e 100644 --- a/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +++ b/sig/whop_sdk/models/ledger_account_retrieve_response.rbs @@ -212,6 +212,7 @@ module WhopSDK business_name: String?, business_representative: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative?, email: String?, + latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, phone: String? } @@ -226,6 +227,8 @@ module WhopSDK attr_accessor email: String? + attr_accessor latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification? + attr_accessor phone: String? def initialize: ( @@ -234,6 +237,7 @@ module WhopSDK business_name: String?, business_representative: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative?, email: String?, + latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, phone: String? ) -> void @@ -243,6 +247,7 @@ module WhopSDK business_name: String?, business_representative: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative?, email: String?, + latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, phone: String? } @@ -319,6 +324,120 @@ module WhopSDK middle_name: String? } end + + type latest_verification = + { + id: String, + last_error_code: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::status + } + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor last_error_code: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::last_error_code? + + attr_accessor last_error_reason: String? + + attr_accessor status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::status + + def initialize: ( + id: String, + last_error_code: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::status + ) -> void + + def to_hash: -> { + id: String, + last_error_code: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::status + } + + type last_error_code = + :abandoned + | :consent_declined + | :country_not_supported + | :device_not_supported + | :document_expired + | :document_type_not_supported + | :document_unverified_other + | :email_unverified_other + | :email_verification_declined + | :id_number_insufficient_document_data + | :id_number_mismatch + | :id_number_unverified_other + | :phone_unverified_other + | :phone_verification_declined + | :selfie_document_missing_photo + | :selfie_face_mismatch + | :selfie_manipulated + | :selfie_unverified_other + | :under_supported_age + + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + ABANDONED: :abandoned + CONSENT_DECLINED: :consent_declined + COUNTRY_NOT_SUPPORTED: :country_not_supported + DEVICE_NOT_SUPPORTED: :device_not_supported + DOCUMENT_EXPIRED: :document_expired + DOCUMENT_TYPE_NOT_SUPPORTED: :document_type_not_supported + DOCUMENT_UNVERIFIED_OTHER: :document_unverified_other + EMAIL_UNVERIFIED_OTHER: :email_unverified_other + EMAIL_VERIFICATION_DECLINED: :email_verification_declined + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA: :id_number_insufficient_document_data + ID_NUMBER_MISMATCH: :id_number_mismatch + ID_NUMBER_UNVERIFIED_OTHER: :id_number_unverified_other + PHONE_UNVERIFIED_OTHER: :phone_unverified_other + PHONE_VERIFICATION_DECLINED: :phone_verification_declined + SELFIE_DOCUMENT_MISSING_PHOTO: :selfie_document_missing_photo + SELFIE_FACE_MISMATCH: :selfie_face_mismatch + SELFIE_MANIPULATED: :selfie_manipulated + SELFIE_UNVERIFIED_OTHER: :selfie_unverified_other + UNDER_SUPPORTED_AGE: :under_supported_age + + def self?.values: -> ::Array[WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::last_error_code] + end + + type status = + :requires_input + | :processing + | :verified + | :canceled + | :created + | :started + | :submitted + | :approved + | :declined + | :resubmission_requested + | :expired + | :abandoned + | :review + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRES_INPUT: :requires_input + PROCESSING: :processing + VERIFIED: :verified + CANCELED: :canceled + CREATED: :created + STARTED: :started + SUBMITTED: :submitted + APPROVED: :approved + DECLINED: :declined + RESUBMISSION_REQUESTED: :resubmission_requested + EXPIRED: :expired + ABANDONED: :abandoned + REVIEW: :review + + def self?.values: -> ::Array[WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::status] + end + end end end end diff --git a/sig/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbs b/sig/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbs new file mode 100644 index 00000000..f01835ec --- /dev/null +++ b/sig/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbs @@ -0,0 +1,40 @@ +module WhopSDK + module Models + type membership_cancel_at_period_end_changed_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::Membership, + timestamp: Time, + type: :"membership.cancel_at_period_end_changed" + } + + class MembershipCancelAtPeriodEndChangedWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::Membership + + attr_accessor timestamp: Time + + attr_accessor type: :"membership.cancel_at_period_end_changed" + + def initialize: ( + id: String, + data: WhopSDK::Membership, + timestamp: Time, + ?api_version: :v1, + ?type: :"membership.cancel_at_period_end_changed" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::Membership, + timestamp: Time, + type: :"membership.cancel_at_period_end_changed" + } + end + end +end diff --git a/sig/whop_sdk/models/membership_status.rbs b/sig/whop_sdk/models/membership_status.rbs index f8ad93a8..8657e853 100644 --- a/sig/whop_sdk/models/membership_status.rbs +++ b/sig/whop_sdk/models/membership_status.rbs @@ -9,6 +9,7 @@ module WhopSDK | :expired | :unresolved | :drafted + | :canceling module MembershipStatus extend WhopSDK::Internal::Type::Enum @@ -21,6 +22,7 @@ module WhopSDK EXPIRED: :expired UNRESOLVED: :unresolved DRAFTED: :drafted + CANCELING: :canceling def self?.values: -> ::Array[WhopSDK::Models::membership_status] end diff --git a/sig/whop_sdk/models/payment_create_params.rbs b/sig/whop_sdk/models/payment_create_params.rbs index 9da3ecd4..54ff98d4 100644 --- a/sig/whop_sdk/models/payment_create_params.rbs +++ b/sig/whop_sdk/models/payment_create_params.rbs @@ -6,6 +6,7 @@ module WhopSDK member_id: String, payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Plan, + metadata: ::Hash[Symbol, top]?, plan_id: String } & WhopSDK::Internal::Type::request_parameters @@ -22,6 +23,8 @@ module WhopSDK attr_accessor plan: WhopSDK::PaymentCreateParams::Plan + attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor plan_id: String def initialize: ( @@ -30,6 +33,7 @@ module WhopSDK payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Plan, plan_id: String, + ?metadata: ::Hash[Symbol, top]?, ?request_options: WhopSDK::request_opts ) -> void @@ -38,6 +42,7 @@ module WhopSDK member_id: String, payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Plan, + metadata: ::Hash[Symbol, top]?, plan_id: String, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/models/payment_list_fees_response.rbs b/sig/whop_sdk/models/payment_list_fees_response.rbs index c0e7b1d5..4337ab47 100644 --- a/sig/whop_sdk/models/payment_list_fees_response.rbs +++ b/sig/whop_sdk/models/payment_list_fees_response.rbs @@ -62,6 +62,7 @@ module WhopSDK | :three_ds_fixed_fee | :billing_percentage_fee | :revshare_percentage_fee + | :application_fee module Type extend WhopSDK::Internal::Type::Enum @@ -96,6 +97,7 @@ module WhopSDK THREE_DS_FIXED_FEE: :three_ds_fixed_fee BILLING_PERCENTAGE_FEE: :billing_percentage_fee REVSHARE_PERCENTAGE_FEE: :revshare_percentage_fee + APPLICATION_FEE: :application_fee def self?.values: -> ::Array[WhopSDK::Models::PaymentListFeesResponse::type_] end diff --git a/sig/whop_sdk/models/payment_method_list_params.rbs b/sig/whop_sdk/models/payment_method_list_params.rbs index fb49bafa..548cd362 100644 --- a/sig/whop_sdk/models/payment_method_list_params.rbs +++ b/sig/whop_sdk/models/payment_method_list_params.rbs @@ -2,14 +2,15 @@ module WhopSDK module Models type payment_method_list_params = { - member_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?, + member_id: String? } & WhopSDK::Internal::Type::request_parameters @@ -17,12 +18,12 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor member_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 +34,31 @@ module WhopSDK attr_accessor last: Integer? + attr_accessor member_id: String? + def initialize: ( - member_id: String, ?after: String?, ?before: String?, + ?company_id: String?, ?created_after: Time?, ?created_before: Time?, ?direction: WhopSDK::Models::direction?, ?first: Integer?, ?last: Integer?, + ?member_id: String?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - member_id: String, after: String?, before: String?, + company_id: String?, created_after: Time?, created_before: Time?, direction: WhopSDK::Models::direction?, first: Integer?, last: Integer?, + member_id: String?, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/payment_method_retrieve_params.rbs b/sig/whop_sdk/models/payment_method_retrieve_params.rbs index 75402fb6..8b9fb9bd 100644 --- a/sig/whop_sdk/models/payment_method_retrieve_params.rbs +++ b/sig/whop_sdk/models/payment_method_retrieve_params.rbs @@ -1,21 +1,26 @@ module WhopSDK module Models type payment_method_retrieve_params = - { member_id: String } & WhopSDK::Internal::Type::request_parameters + { company_id: String?, member_id: String? } + & WhopSDK::Internal::Type::request_parameters class PaymentMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor member_id: String + attr_accessor company_id: String? + + attr_accessor member_id: String? def initialize: ( - member_id: String, + ?company_id: String?, + ?member_id: String?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - member_id: String, + company_id: String?, + member_id: String?, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/payout_method_created_webhook_event.rbs b/sig/whop_sdk/models/payout_method_created_webhook_event.rbs new file mode 100644 index 00000000..f51a9c2f --- /dev/null +++ b/sig/whop_sdk/models/payout_method_created_webhook_event.rbs @@ -0,0 +1,140 @@ +module WhopSDK + module Models + type payout_method_created_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::PayoutMethodCreatedWebhookEvent::Data, + timestamp: Time, + type: :"payout_method.created" + } + + class PayoutMethodCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::PayoutMethodCreatedWebhookEvent::Data + + attr_accessor timestamp: Time + + attr_accessor type: :"payout_method.created" + + def initialize: ( + id: String, + data: WhopSDK::PayoutMethodCreatedWebhookEvent::Data, + timestamp: Time, + ?api_version: :v1, + ?type: :"payout_method.created" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::PayoutMethodCreatedWebhookEvent::Data, + timestamp: Time, + type: :"payout_method.created" + } + + type data = + { + id: String, + company: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company?, + currency: String, + destination: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination?, + is_default: bool, + nickname: String? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor company: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company? + + attr_accessor currency: String + + attr_accessor destination: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination? + + attr_accessor is_default: bool + + attr_accessor nickname: String? + + def initialize: ( + id: String, + company: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company?, + currency: String, + destination: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination?, + is_default: bool, + nickname: String? + ) -> void + + def to_hash: -> { + id: String, + company: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Company?, + currency: String, + destination: WhopSDK::PayoutMethodCreatedWebhookEvent::Data::Destination?, + is_default: bool, + nickname: String? + } + + type company = { id: String } + + class Company < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type destination = + { + category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category, + country_code: String, + name: String + } + + class Destination < WhopSDK::Internal::Type::BaseModel + attr_accessor category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category + + attr_accessor country_code: String + + attr_accessor name: String + + def initialize: ( + category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category, + country_code: String, + name: String + ) -> void + + def to_hash: -> { + category: WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category, + country_code: String, + name: String + } + + type category = + :crypto + | :rtp + | :next_day_bank + | :bank_wire + | :digital_wallet + | :unknown + + module Category + extend WhopSDK::Internal::Type::Enum + + CRYPTO: :crypto + RTP: :rtp + NEXT_DAY_BANK: :next_day_bank + BANK_WIRE: :bank_wire + DIGITAL_WALLET: :digital_wallet + UNKNOWN: :unknown + + def self?.values: -> ::Array[WhopSDK::Models::PayoutMethodCreatedWebhookEvent::Data::Destination::category] + end + end + end + end + end +end diff --git a/sig/whop_sdk/models/payout_method_list_response.rbs b/sig/whop_sdk/models/payout_method_list_response.rbs index 6ed3df14..f78b6263 100644 --- a/sig/whop_sdk/models/payout_method_list_response.rbs +++ b/sig/whop_sdk/models/payout_method_list_response.rbs @@ -3,34 +3,54 @@ module WhopSDK type payout_method_list_response = { id: String, + company: WhopSDK::Models::PayoutMethodListResponse::Company?, currency: String, destination: WhopSDK::Models::PayoutMethodListResponse::Destination?, + is_default: bool, nickname: String? } class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel attr_accessor id: String + attr_accessor company: WhopSDK::Models::PayoutMethodListResponse::Company? + attr_accessor currency: String attr_accessor destination: WhopSDK::Models::PayoutMethodListResponse::Destination? + attr_accessor is_default: bool + attr_accessor nickname: String? def initialize: ( id: String, + company: WhopSDK::Models::PayoutMethodListResponse::Company?, currency: String, destination: WhopSDK::Models::PayoutMethodListResponse::Destination?, + is_default: bool, nickname: String? ) -> void def to_hash: -> { id: String, + company: WhopSDK::Models::PayoutMethodListResponse::Company?, currency: String, destination: WhopSDK::Models::PayoutMethodListResponse::Destination?, + is_default: bool, nickname: String? } + type company = { id: String } + + class Company < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + type destination = { category: WhopSDK::Models::PayoutMethodListResponse::Destination::category, diff --git a/sig/whop_sdk/models/payout_method_retrieve_params.rbs b/sig/whop_sdk/models/payout_method_retrieve_params.rbs new file mode 100644 index 00000000..3c378b34 --- /dev/null +++ b/sig/whop_sdk/models/payout_method_retrieve_params.rbs @@ -0,0 +1,15 @@ +module WhopSDK + module Models + type payout_method_retrieve_params = + { } & WhopSDK::Internal::Type::request_parameters + + class PayoutMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + def initialize: (?request_options: WhopSDK::request_opts) -> void + + def to_hash: -> { request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/payout_method_retrieve_response.rbs b/sig/whop_sdk/models/payout_method_retrieve_response.rbs new file mode 100644 index 00000000..71b3a8b5 --- /dev/null +++ b/sig/whop_sdk/models/payout_method_retrieve_response.rbs @@ -0,0 +1,103 @@ +module WhopSDK + module Models + type payout_method_retrieve_response = + { + id: String, + company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company?, + currency: String, + destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination?, + is_default: bool, + nickname: String? + } + + class PayoutMethodRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company? + + attr_accessor currency: String + + attr_accessor destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination? + + attr_accessor is_default: bool + + attr_accessor nickname: String? + + def initialize: ( + id: String, + company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company?, + currency: String, + destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination?, + is_default: bool, + nickname: String? + ) -> void + + def to_hash: -> { + id: String, + company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company?, + currency: String, + destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination?, + is_default: bool, + nickname: String? + } + + type company = { id: String } + + class Company < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type destination = + { + category: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::category, + country_code: String, + name: String + } + + class Destination < WhopSDK::Internal::Type::BaseModel + attr_accessor category: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::category + + attr_accessor country_code: String + + attr_accessor name: String + + def initialize: ( + category: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::category, + country_code: String, + name: String + ) -> void + + def to_hash: -> { + category: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::category, + country_code: String, + name: String + } + + type category = + :crypto + | :rtp + | :next_day_bank + | :bank_wire + | :digital_wallet + | :unknown + + module Category + extend WhopSDK::Internal::Type::Enum + + CRYPTO: :crypto + RTP: :rtp + NEXT_DAY_BANK: :next_day_bank + BANK_WIRE: :bank_wire + DIGITAL_WALLET: :digital_wallet + UNKNOWN: :unknown + + def self?.values: -> ::Array[WhopSDK::Models::PayoutMethodRetrieveResponse::Destination::category] + end + end + end + end +end diff --git a/sig/whop_sdk/models/topup_create_params.rbs b/sig/whop_sdk/models/topup_create_params.rbs new file mode 100644 index 00000000..b26255d0 --- /dev/null +++ b/sig/whop_sdk/models/topup_create_params.rbs @@ -0,0 +1,41 @@ +module WhopSDK + module Models + type topup_create_params = + { + amount: Float, + company_id: String, + currency: WhopSDK::Models::currency, + payment_method_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class TopupCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor amount: Float + + attr_accessor company_id: String + + attr_accessor currency: WhopSDK::Models::currency + + attr_accessor payment_method_id: String + + def initialize: ( + amount: Float, + company_id: String, + currency: WhopSDK::Models::currency, + payment_method_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + amount: Float, + company_id: String, + currency: WhopSDK::Models::currency, + payment_method_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/topup_create_response.rbs b/sig/whop_sdk/models/topup_create_response.rbs new file mode 100644 index 00000000..bced972a --- /dev/null +++ b/sig/whop_sdk/models/topup_create_response.rbs @@ -0,0 +1,50 @@ +module WhopSDK + module Models + type topup_create_response = + { + id: String, + created_at: Time, + currency: WhopSDK::Models::currency?, + failure_message: String?, + paid_at: Time?, + status: WhopSDK::Models::receipt_status?, + total: Float? + } + + class TopupCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor currency: WhopSDK::Models::currency? + + attr_accessor failure_message: String? + + attr_accessor paid_at: Time? + + attr_accessor status: WhopSDK::Models::receipt_status? + + attr_accessor total: Float? + + def initialize: ( + id: String, + created_at: Time, + currency: WhopSDK::Models::currency?, + failure_message: String?, + paid_at: Time?, + status: WhopSDK::Models::receipt_status?, + total: Float? + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + currency: WhopSDK::Models::currency?, + failure_message: String?, + paid_at: Time?, + status: WhopSDK::Models::receipt_status?, + total: Float? + } + end + end +end diff --git a/sig/whop_sdk/models/unwrap_webhook_event.rbs b/sig/whop_sdk/models/unwrap_webhook_event.rbs index 9bc75e2b..101e3294 100644 --- a/sig/whop_sdk/models/unwrap_webhook_event.rbs +++ b/sig/whop_sdk/models/unwrap_webhook_event.rbs @@ -17,6 +17,8 @@ module WhopSDK | WhopSDK::WithdrawalCreatedWebhookEvent | WhopSDK::WithdrawalUpdatedWebhookEvent | WhopSDK::CourseLessonInteractionCompletedWebhookEvent + | WhopSDK::PayoutMethodCreatedWebhookEvent + | WhopSDK::VerificationSucceededWebhookEvent | WhopSDK::PaymentCreatedWebhookEvent | WhopSDK::PaymentSucceededWebhookEvent | WhopSDK::PaymentFailedWebhookEvent @@ -25,6 +27,7 @@ module WhopSDK | WhopSDK::DisputeUpdatedWebhookEvent | WhopSDK::RefundCreatedWebhookEvent | WhopSDK::RefundUpdatedWebhookEvent + | WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent module UnwrapWebhookEvent extend WhopSDK::Internal::Type::Union diff --git a/sig/whop_sdk/models/verification_retrieve_params.rbs b/sig/whop_sdk/models/verification_retrieve_params.rbs new file mode 100644 index 00000000..5856598a --- /dev/null +++ b/sig/whop_sdk/models/verification_retrieve_params.rbs @@ -0,0 +1,15 @@ +module WhopSDK + module Models + type verification_retrieve_params = + { } & WhopSDK::Internal::Type::request_parameters + + class VerificationRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + def initialize: (?request_options: WhopSDK::request_opts) -> void + + def to_hash: -> { request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/verification_retrieve_response.rbs b/sig/whop_sdk/models/verification_retrieve_response.rbs new file mode 100644 index 00000000..83a150ed --- /dev/null +++ b/sig/whop_sdk/models/verification_retrieve_response.rbs @@ -0,0 +1,117 @@ +module WhopSDK + module Models + type verification_retrieve_response = + { + id: String, + last_error_code: WhopSDK::Models::VerificationRetrieveResponse::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::VerificationRetrieveResponse::status + } + + class VerificationRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor last_error_code: WhopSDK::Models::VerificationRetrieveResponse::last_error_code? + + attr_accessor last_error_reason: String? + + attr_accessor status: WhopSDK::Models::VerificationRetrieveResponse::status + + def initialize: ( + id: String, + last_error_code: WhopSDK::Models::VerificationRetrieveResponse::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::VerificationRetrieveResponse::status + ) -> void + + def to_hash: -> { + id: String, + last_error_code: WhopSDK::Models::VerificationRetrieveResponse::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::VerificationRetrieveResponse::status + } + + type last_error_code = + :abandoned + | :consent_declined + | :country_not_supported + | :device_not_supported + | :document_expired + | :document_type_not_supported + | :document_unverified_other + | :email_unverified_other + | :email_verification_declined + | :id_number_insufficient_document_data + | :id_number_mismatch + | :id_number_unverified_other + | :phone_unverified_other + | :phone_verification_declined + | :selfie_document_missing_photo + | :selfie_face_mismatch + | :selfie_manipulated + | :selfie_unverified_other + | :under_supported_age + + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + ABANDONED: :abandoned + CONSENT_DECLINED: :consent_declined + COUNTRY_NOT_SUPPORTED: :country_not_supported + DEVICE_NOT_SUPPORTED: :device_not_supported + DOCUMENT_EXPIRED: :document_expired + DOCUMENT_TYPE_NOT_SUPPORTED: :document_type_not_supported + DOCUMENT_UNVERIFIED_OTHER: :document_unverified_other + EMAIL_UNVERIFIED_OTHER: :email_unverified_other + EMAIL_VERIFICATION_DECLINED: :email_verification_declined + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA: :id_number_insufficient_document_data + ID_NUMBER_MISMATCH: :id_number_mismatch + ID_NUMBER_UNVERIFIED_OTHER: :id_number_unverified_other + PHONE_UNVERIFIED_OTHER: :phone_unverified_other + PHONE_VERIFICATION_DECLINED: :phone_verification_declined + SELFIE_DOCUMENT_MISSING_PHOTO: :selfie_document_missing_photo + SELFIE_FACE_MISMATCH: :selfie_face_mismatch + SELFIE_MANIPULATED: :selfie_manipulated + SELFIE_UNVERIFIED_OTHER: :selfie_unverified_other + UNDER_SUPPORTED_AGE: :under_supported_age + + def self?.values: -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::last_error_code] + end + + type status = + :requires_input + | :processing + | :verified + | :canceled + | :created + | :started + | :submitted + | :approved + | :declined + | :resubmission_requested + | :expired + | :abandoned + | :review + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRES_INPUT: :requires_input + PROCESSING: :processing + VERIFIED: :verified + CANCELED: :canceled + CREATED: :created + STARTED: :started + SUBMITTED: :submitted + APPROVED: :approved + DECLINED: :declined + RESUBMISSION_REQUESTED: :resubmission_requested + EXPIRED: :expired + ABANDONED: :abandoned + REVIEW: :review + + def self?.values: -> ::Array[WhopSDK::Models::VerificationRetrieveResponse::status] + end + end + end +end diff --git a/sig/whop_sdk/models/verification_succeeded_webhook_event.rbs b/sig/whop_sdk/models/verification_succeeded_webhook_event.rbs new file mode 100644 index 00000000..4653e45f --- /dev/null +++ b/sig/whop_sdk/models/verification_succeeded_webhook_event.rbs @@ -0,0 +1,154 @@ +module WhopSDK + module Models + type verification_succeeded_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::VerificationSucceededWebhookEvent::Data, + timestamp: Time, + type: :"verification.succeeded" + } + + class VerificationSucceededWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::VerificationSucceededWebhookEvent::Data + + attr_accessor timestamp: Time + + attr_accessor type: :"verification.succeeded" + + def initialize: ( + id: String, + data: WhopSDK::VerificationSucceededWebhookEvent::Data, + timestamp: Time, + ?api_version: :v1, + ?type: :"verification.succeeded" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::VerificationSucceededWebhookEvent::Data, + timestamp: Time, + type: :"verification.succeeded" + } + + type data = + { + id: String, + last_error_code: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::status + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor last_error_code: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::last_error_code? + + attr_accessor last_error_reason: String? + + attr_accessor status: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::status + + def initialize: ( + id: String, + last_error_code: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::status + ) -> void + + def to_hash: -> { + id: String, + last_error_code: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::last_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::VerificationSucceededWebhookEvent::Data::status + } + + type last_error_code = + :abandoned + | :consent_declined + | :country_not_supported + | :device_not_supported + | :document_expired + | :document_type_not_supported + | :document_unverified_other + | :email_unverified_other + | :email_verification_declined + | :id_number_insufficient_document_data + | :id_number_mismatch + | :id_number_unverified_other + | :phone_unverified_other + | :phone_verification_declined + | :selfie_document_missing_photo + | :selfie_face_mismatch + | :selfie_manipulated + | :selfie_unverified_other + | :under_supported_age + + module LastErrorCode + extend WhopSDK::Internal::Type::Enum + + ABANDONED: :abandoned + CONSENT_DECLINED: :consent_declined + COUNTRY_NOT_SUPPORTED: :country_not_supported + DEVICE_NOT_SUPPORTED: :device_not_supported + DOCUMENT_EXPIRED: :document_expired + DOCUMENT_TYPE_NOT_SUPPORTED: :document_type_not_supported + DOCUMENT_UNVERIFIED_OTHER: :document_unverified_other + EMAIL_UNVERIFIED_OTHER: :email_unverified_other + EMAIL_VERIFICATION_DECLINED: :email_verification_declined + ID_NUMBER_INSUFFICIENT_DOCUMENT_DATA: :id_number_insufficient_document_data + ID_NUMBER_MISMATCH: :id_number_mismatch + ID_NUMBER_UNVERIFIED_OTHER: :id_number_unverified_other + PHONE_UNVERIFIED_OTHER: :phone_unverified_other + PHONE_VERIFICATION_DECLINED: :phone_verification_declined + SELFIE_DOCUMENT_MISSING_PHOTO: :selfie_document_missing_photo + SELFIE_FACE_MISMATCH: :selfie_face_mismatch + SELFIE_MANIPULATED: :selfie_manipulated + SELFIE_UNVERIFIED_OTHER: :selfie_unverified_other + UNDER_SUPPORTED_AGE: :under_supported_age + + def self?.values: -> ::Array[WhopSDK::Models::VerificationSucceededWebhookEvent::Data::last_error_code] + end + + type status = + :requires_input + | :processing + | :verified + | :canceled + | :created + | :started + | :submitted + | :approved + | :declined + | :resubmission_requested + | :expired + | :abandoned + | :review + + module Status + extend WhopSDK::Internal::Type::Enum + + REQUIRES_INPUT: :requires_input + PROCESSING: :processing + VERIFIED: :verified + CANCELED: :canceled + CREATED: :created + STARTED: :started + SUBMITTED: :submitted + APPROVED: :approved + DECLINED: :declined + RESUBMISSION_REQUESTED: :resubmission_requested + EXPIRED: :expired + ABANDONED: :abandoned + REVIEW: :review + + def self?.values: -> ::Array[WhopSDK::Models::VerificationSucceededWebhookEvent::Data::status] + end + end + end + end +end diff --git a/sig/whop_sdk/resources/leads.rbs b/sig/whop_sdk/resources/leads.rbs new file mode 100644 index 00000000..88bc73b3 --- /dev/null +++ b/sig/whop_sdk/resources/leads.rbs @@ -0,0 +1,40 @@ +module WhopSDK + module Resources + class Leads + def create: ( + company_id: String, + ?metadata: ::Hash[Symbol, top]?, + ?product_id: String?, + ?referrer: String?, + ?user_id: String?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::LeadCreateResponse + + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::LeadRetrieveResponse + + def update: ( + String id, + ?metadata: ::Hash[Symbol, top]?, + ?referrer: String?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::LeadUpdateResponse + + def list: ( + company_id: String, + ?after: String?, + ?before: String?, + ?created_after: Time?, + ?created_before: Time?, + ?first: Integer?, + ?last: Integer?, + ?product_ids: ::Array[String]?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::LeadListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/payment_methods.rbs b/sig/whop_sdk/resources/payment_methods.rbs index c0b47f86..d1e95ef4 100644 --- a/sig/whop_sdk/resources/payment_methods.rbs +++ b/sig/whop_sdk/resources/payment_methods.rbs @@ -3,19 +3,21 @@ module WhopSDK class PaymentMethods def retrieve: ( String id, - member_id: String, + ?company_id: String?, + ?member_id: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::payment_method_retrieve_response def list: ( - member_id: String, ?after: String?, ?before: String?, + ?company_id: String?, ?created_after: Time?, ?created_before: Time?, ?direction: WhopSDK::Models::direction?, ?first: Integer?, ?last: Integer?, + ?member_id: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::payment_method_list_response] diff --git a/sig/whop_sdk/resources/payments.rbs b/sig/whop_sdk/resources/payments.rbs index 2645af30..dc9ecaf4 100644 --- a/sig/whop_sdk/resources/payments.rbs +++ b/sig/whop_sdk/resources/payments.rbs @@ -7,6 +7,7 @@ module WhopSDK payment_method_id: String, plan: WhopSDK::PaymentCreateParams::Plan, plan_id: String, + ?metadata: ::Hash[Symbol, top]?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Payment diff --git a/sig/whop_sdk/resources/payout_methods.rbs b/sig/whop_sdk/resources/payout_methods.rbs index eddd5e74..c3743973 100644 --- a/sig/whop_sdk/resources/payout_methods.rbs +++ b/sig/whop_sdk/resources/payout_methods.rbs @@ -1,6 +1,11 @@ module WhopSDK module Resources class PayoutMethods + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PayoutMethodRetrieveResponse + def list: ( company_id: String, ?after: String?, diff --git a/sig/whop_sdk/resources/topups.rbs b/sig/whop_sdk/resources/topups.rbs new file mode 100644 index 00000000..84510ec0 --- /dev/null +++ b/sig/whop_sdk/resources/topups.rbs @@ -0,0 +1,15 @@ +module WhopSDK + module Resources + class Topups + def create: ( + amount: Float, + company_id: String, + currency: WhopSDK::Models::currency, + payment_method_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::TopupCreateResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/verifications.rbs b/sig/whop_sdk/resources/verifications.rbs new file mode 100644 index 00000000..bc8bf196 --- /dev/null +++ b/sig/whop_sdk/resources/verifications.rbs @@ -0,0 +1,12 @@ +module WhopSDK + module Resources + class Verifications + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::VerificationRetrieveResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/webhooks.rbs b/sig/whop_sdk/resources/webhooks.rbs index 09304f86..aa431878 100644 --- a/sig/whop_sdk/resources/webhooks.rbs +++ b/sig/whop_sdk/resources/webhooks.rbs @@ -19,6 +19,8 @@ module WhopSDK | WhopSDK::WithdrawalCreatedWebhookEvent | WhopSDK::WithdrawalUpdatedWebhookEvent | WhopSDK::CourseLessonInteractionCompletedWebhookEvent + | WhopSDK::PayoutMethodCreatedWebhookEvent + | WhopSDK::VerificationSucceededWebhookEvent | WhopSDK::PaymentCreatedWebhookEvent | WhopSDK::PaymentSucceededWebhookEvent | WhopSDK::PaymentFailedWebhookEvent @@ -26,7 +28,8 @@ module WhopSDK | WhopSDK::DisputeCreatedWebhookEvent | WhopSDK::DisputeUpdatedWebhookEvent | WhopSDK::RefundCreatedWebhookEvent - | WhopSDK::RefundUpdatedWebhookEvent) + | WhopSDK::RefundUpdatedWebhookEvent + | WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent) def initialize: (client: WhopSDK::Client) -> void end diff --git a/test/whop_sdk/resources/leads_test.rb b/test/whop_sdk/resources/leads_test.rb new file mode 100644 index 00000000..fd20a97c --- /dev/null +++ b/test/whop_sdk/resources/leads_test.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::LeadsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Prism tests are disabled") + + response = @whop.leads.create(company_id: "biz_xxxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Models::LeadCreateResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadCreateResponse::Member | nil, + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, + product: WhopSDK::Models::LeadCreateResponse::Product | nil, + referrer: String | nil, + updated_at: Time, + user: WhopSDK::Models::LeadCreateResponse::User + } + end + end + + def test_retrieve + skip("Prism tests are disabled") + + response = @whop.leads.retrieve("lead_xxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Models::LeadRetrieveResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadRetrieveResponse::Member | nil, + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, + product: WhopSDK::Models::LeadRetrieveResponse::Product | nil, + referrer: String | nil, + updated_at: Time, + user: WhopSDK::Models::LeadRetrieveResponse::User + } + end + end + + def test_update + skip("Prism tests are disabled") + + response = @whop.leads.update("lead_xxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Models::LeadUpdateResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadUpdateResponse::Member | nil, + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, + product: WhopSDK::Models::LeadUpdateResponse::Product | nil, + referrer: String | nil, + updated_at: Time, + user: WhopSDK::Models::LeadUpdateResponse::User + } + end + end + + def test_list_required_params + skip("Prism tests are disabled") + + response = @whop.leads.list(company_id: "biz_xxxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::LeadListResponse + end + + assert_pattern do + row => { + id: String, + created_at: Time, + member: WhopSDK::Models::LeadListResponse::Member | nil, + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, + product: WhopSDK::Models::LeadListResponse::Product | nil, + referrer: String | nil, + updated_at: Time, + user: WhopSDK::Models::LeadListResponse::User + } + end + end +end diff --git a/test/whop_sdk/resources/payment_methods_test.rb b/test/whop_sdk/resources/payment_methods_test.rb index 6232cfe1..597843aa 100644 --- a/test/whop_sdk/resources/payment_methods_test.rb +++ b/test/whop_sdk/resources/payment_methods_test.rb @@ -3,10 +3,10 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::PaymentMethodsTest < WhopSDK::Test::ResourceTest - def test_retrieve_required_params + def test_retrieve skip("Prism tests are disabled") - response = @whop.payment_methods.retrieve("payt_xxxxxxxxxxxxx", member_id: "mber_xxxxxxxxxxxxx") + response = @whop.payment_methods.retrieve("payt_xxxxxxxxxxxxx") assert_pattern do response => WhopSDK::Models::PaymentMethodRetrieveResponse @@ -65,10 +65,10 @@ def test_retrieve_required_params end end - def test_list_required_params + def test_list skip("Prism tests are disabled") - response = @whop.payment_methods.list(member_id: "mber_xxxxxxxxxxxxx") + response = @whop.payment_methods.list assert_pattern do response => WhopSDK::Internal::CursorPage diff --git a/test/whop_sdk/resources/payout_methods_test.rb b/test/whop_sdk/resources/payout_methods_test.rb index 68738585..2e5794c7 100644 --- a/test/whop_sdk/resources/payout_methods_test.rb +++ b/test/whop_sdk/resources/payout_methods_test.rb @@ -3,6 +3,27 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::PayoutMethodsTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Prism tests are disabled") + + response = @whop.payout_methods.retrieve("potk_xxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Models::PayoutMethodRetrieveResponse + end + + assert_pattern do + response => { + id: String, + company: WhopSDK::Models::PayoutMethodRetrieveResponse::Company | nil, + currency: String, + destination: WhopSDK::Models::PayoutMethodRetrieveResponse::Destination | nil, + is_default: WhopSDK::Internal::Type::Boolean, + nickname: String | nil + } + end + end + def test_list_required_params skip("Prism tests are disabled") @@ -22,8 +43,10 @@ def test_list_required_params assert_pattern do row => { id: String, + company: WhopSDK::Models::PayoutMethodListResponse::Company | nil, currency: String, destination: WhopSDK::Models::PayoutMethodListResponse::Destination | nil, + is_default: WhopSDK::Internal::Type::Boolean, nickname: String | nil } end diff --git a/test/whop_sdk/resources/topups_test.rb b/test/whop_sdk/resources/topups_test.rb new file mode 100644 index 00000000..5af7004e --- /dev/null +++ b/test/whop_sdk/resources/topups_test.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::TopupsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Prism tests are disabled") + + response = + @whop.topups.create( + amount: 6.9, + company_id: "biz_xxxxxxxxxxxxxx", + currency: :usd, + payment_method_id: "pmt_xxxxxxxxxxxxxx" + ) + + assert_pattern do + response => WhopSDK::Models::TopupCreateResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + currency: WhopSDK::Currency | nil, + failure_message: String | nil, + paid_at: Time | nil, + status: WhopSDK::ReceiptStatus | nil, + total: Float | nil + } + end + end +end diff --git a/test/whop_sdk/resources/verifications_test.rb b/test/whop_sdk/resources/verifications_test.rb new file mode 100644 index 00000000..02c18bcc --- /dev/null +++ b/test/whop_sdk/resources/verifications_test.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::VerificationsTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Prism tests are disabled") + + response = @whop.verifications.retrieve("verf_xxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Models::VerificationRetrieveResponse + end + + assert_pattern do + response => { + id: String, + last_error_code: WhopSDK::Models::VerificationRetrieveResponse::LastErrorCode | nil, + last_error_reason: String | nil, + status: WhopSDK::Models::VerificationRetrieveResponse::Status + } + end + end +end