From e764995aa75bd2b92fdc29592c81f75afd0abd49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 01:13:43 +0000 Subject: [PATCH 1/6] feat(api): api update --- .stats.yml | 4 ++-- lib/whop_sdk/models/product_create_params.rb | 11 ++++++++++- lib/whop_sdk/models/product_update_params.rb | 11 ++++++++++- lib/whop_sdk/resources/products.rb | 8 ++++++-- rbi/whop_sdk/models/product_create_params.rbi | 10 ++++++++++ rbi/whop_sdk/models/product_update_params.rbi | 10 ++++++++++ rbi/whop_sdk/resources/products.rbi | 8 ++++++++ sig/whop_sdk/models/product_create_params.rbs | 5 +++++ sig/whop_sdk/models/product_update_params.rbs | 5 +++++ sig/whop_sdk/resources/products.rbs | 2 ++ 10 files changed, 68 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index cbc67135..f926b8cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-f49331e3fb23d1041f941c72c6ee9924dfa47634889ed5209244207c8ea0586e.yml -openapi_spec_hash: 93d6cef1312ed0cbe6b2b6616c535ebf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-b477216108f1b9e4bea7aac4f4da49b14bdba7d4e2660f2b2d643463390fa6e1.yml +openapi_spec_hash: b2415f4dd2e2397ed4b2558773a1005a config_hash: 71004ac2f2a6283ca55db1065c47e5f6 diff --git a/lib/whop_sdk/models/product_create_params.rb b/lib/whop_sdk/models/product_create_params.rb index e4b18d07..133a013b 100644 --- a/lib/whop_sdk/models/product_create_params.rb +++ b/lib/whop_sdk/models/product_create_params.rb @@ -114,13 +114,20 @@ class ProductCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :route, String, nil?: true + # @!attribute send_welcome_message + # Whether to send an automated welcome message via support chat when a user joins + # this product. Defaults to true. + # + # @return [Boolean, nil] + optional :send_welcome_message, WhopSDK::Internal::Type::Boolean, nil?: true + # @!attribute visibility # Visibility of a resource # # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!method initialize(company_id:, title:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, experience_ids: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, plan_options: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, visibility: nil, request_options: {}) + # @!method initialize(company_id:, title:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, experience_ids: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, plan_options: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::ProductCreateParams} for more details. # @@ -158,6 +165,8 @@ class ProductCreateParams < WhopSDK::Internal::Type::BaseModel # # @param route [String, nil] The URL slug for the product's public link. # + # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins + # # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/whop_sdk/models/product_update_params.rb b/lib/whop_sdk/models/product_update_params.rb index 1e59366c..d723f7e4 100644 --- a/lib/whop_sdk/models/product_update_params.rb +++ b/lib/whop_sdk/models/product_update_params.rb @@ -103,6 +103,13 @@ class ProductUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :route, String, nil?: true + # @!attribute send_welcome_message + # Whether to send an automated welcome message via support chat when a user joins + # this product. + # + # @return [Boolean, nil] + optional :send_welcome_message, WhopSDK::Internal::Type::Boolean, nil?: true + # @!attribute store_page_config # Layout and display configuration for this product on the company's store page. # @@ -121,7 +128,7 @@ class ProductUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!method initialize(id:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, gallery_images: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, store_page_config: nil, title: nil, visibility: nil, request_options: {}) + # @!method initialize(id:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, gallery_images: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, store_page_config: nil, title: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::ProductUpdateParams} for more details. # @@ -155,6 +162,8 @@ class ProductUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param route [String, nil] The URL slug for the product's public link. # + # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins + # # @param store_page_config [WhopSDK::Models::ProductUpdateParams::StorePageConfig, nil] Layout and display configuration for this product on the company's store page. # # @param title [String, nil] The display name of the product. Maximum 40 characters. diff --git a/lib/whop_sdk/resources/products.rb b/lib/whop_sdk/resources/products.rb index 0cc06524..26dc1e5e 100644 --- a/lib/whop_sdk/resources/products.rb +++ b/lib/whop_sdk/resources/products.rb @@ -15,7 +15,7 @@ class Products # - `access_pass:create` # - `access_pass:basic:read` # - # @overload create(company_id:, title:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, experience_ids: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, plan_options: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, visibility: nil, request_options: {}) + # @overload create(company_id:, title:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, experience_ids: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, plan_options: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, visibility: nil, request_options: {}) # # @param company_id [String] The unique identifier of the company to create this product for. # @@ -51,6 +51,8 @@ class Products # # @param route [String, nil] The URL slug for the product's public link. # + # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins + # # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] @@ -103,7 +105,7 @@ def retrieve(id, params = {}) # - `access_pass:update` # - `access_pass:basic:read` # - # @overload update(id, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, gallery_images: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, store_page_config: nil, title: nil, visibility: nil, request_options: {}) + # @overload update(id, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, gallery_images: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, store_page_config: nil, title: nil, visibility: nil, request_options: {}) # # @param id [String] The unique identifier of the product to update. # @@ -135,6 +137,8 @@ def retrieve(id, params = {}) # # @param route [String, nil] The URL slug for the product's public link. # + # @param send_welcome_message [Boolean, nil] Whether to send an automated welcome message via support chat when a user joins + # # @param store_page_config [WhopSDK::Models::ProductUpdateParams::StorePageConfig, nil] Layout and display configuration for this product on the company's store page. # # @param title [String, nil] The display name of the product. Maximum 40 characters. diff --git a/rbi/whop_sdk/models/product_create_params.rbi b/rbi/whop_sdk/models/product_create_params.rbi index b6effa32..315ab7de 100644 --- a/rbi/whop_sdk/models/product_create_params.rbi +++ b/rbi/whop_sdk/models/product_create_params.rbi @@ -92,6 +92,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :route + # Whether to send an automated welcome message via support chat when a user joins + # this product. Defaults to true. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :send_welcome_message + # Visibility of a resource sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } attr_accessor :visibility @@ -118,6 +123,7 @@ module WhopSDK product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), + send_welcome_message: T.nilable(T::Boolean), visibility: T.nilable(WhopSDK::Visibility::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) @@ -162,6 +168,9 @@ module WhopSDK redirect_purchase_url: nil, # The URL slug for the product's public link. route: nil, + # Whether to send an automated welcome message via support chat when a user joins + # this product. Defaults to true. + send_welcome_message: nil, # Visibility of a resource visibility: nil, request_options: {} @@ -190,6 +199,7 @@ module WhopSDK product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), + send_welcome_message: T.nilable(T::Boolean), visibility: T.nilable(WhopSDK::Visibility::OrSymbol), request_options: WhopSDK::RequestOptions } diff --git a/rbi/whop_sdk/models/product_update_params.rbi b/rbi/whop_sdk/models/product_update_params.rbi index 981b5214..3b3d1df6 100644 --- a/rbi/whop_sdk/models/product_update_params.rbi +++ b/rbi/whop_sdk/models/product_update_params.rbi @@ -77,6 +77,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :route + # Whether to send an automated welcome message via support chat when a user joins + # this product. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :send_welcome_message + # Layout and display configuration for this product on the company's store page. sig { returns(T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig)) } attr_reader :store_page_config @@ -119,6 +124,7 @@ module WhopSDK product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), + send_welcome_message: T.nilable(T::Boolean), store_page_config: T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash), title: T.nilable(String), @@ -161,6 +167,9 @@ module WhopSDK redirect_purchase_url: nil, # The URL slug for the product's public link. route: nil, + # Whether to send an automated welcome message via support chat when a user joins + # this product. + send_welcome_message: nil, # Layout and display configuration for this product on the company's store page. store_page_config: nil, # The display name of the product. Maximum 40 characters. @@ -192,6 +201,7 @@ module WhopSDK product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), + send_welcome_message: T.nilable(T::Boolean), store_page_config: T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig), title: T.nilable(String), diff --git a/rbi/whop_sdk/resources/products.rbi b/rbi/whop_sdk/resources/products.rbi index b5f8622e..179b224e 100644 --- a/rbi/whop_sdk/resources/products.rbi +++ b/rbi/whop_sdk/resources/products.rbi @@ -33,6 +33,7 @@ module WhopSDK product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), + send_welcome_message: T.nilable(T::Boolean), visibility: T.nilable(WhopSDK::Visibility::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Product) @@ -77,6 +78,9 @@ module WhopSDK redirect_purchase_url: nil, # The URL slug for the product's public link. route: nil, + # Whether to send an automated welcome message via support chat when a user joins + # this product. Defaults to true. + send_welcome_message: nil, # Visibility of a resource visibility: nil, request_options: {} @@ -129,6 +133,7 @@ module WhopSDK product_tax_code_id: T.nilable(String), redirect_purchase_url: T.nilable(String), route: T.nilable(String), + send_welcome_message: T.nilable(T::Boolean), store_page_config: T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash), title: T.nilable(String), @@ -172,6 +177,9 @@ module WhopSDK redirect_purchase_url: nil, # The URL slug for the product's public link. route: nil, + # Whether to send an automated welcome message via support chat when a user joins + # this product. + send_welcome_message: nil, # Layout and display configuration for this product on the company's store page. store_page_config: nil, # The display name of the product. Maximum 40 characters. diff --git a/sig/whop_sdk/models/product_create_params.rbs b/sig/whop_sdk/models/product_create_params.rbs index 835d95cf..0cedb54c 100644 --- a/sig/whop_sdk/models/product_create_params.rbs +++ b/sig/whop_sdk/models/product_create_params.rbs @@ -19,6 +19,7 @@ module WhopSDK product_tax_code_id: String?, redirect_purchase_url: String?, route: String?, + send_welcome_message: bool?, visibility: WhopSDK::Models::visibility? } & WhopSDK::Internal::Type::request_parameters @@ -61,6 +62,8 @@ module WhopSDK attr_accessor route: String? + attr_accessor send_welcome_message: bool? + attr_accessor visibility: WhopSDK::Models::visibility? def initialize: ( @@ -81,6 +84,7 @@ module WhopSDK ?product_tax_code_id: String?, ?redirect_purchase_url: String?, ?route: String?, + ?send_welcome_message: bool?, ?visibility: WhopSDK::Models::visibility?, ?request_options: WhopSDK::request_opts ) -> void @@ -103,6 +107,7 @@ module WhopSDK product_tax_code_id: String?, redirect_purchase_url: String?, route: String?, + send_welcome_message: bool?, visibility: WhopSDK::Models::visibility?, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/models/product_update_params.rbs b/sig/whop_sdk/models/product_update_params.rbs index 903a6c38..beb94e1b 100644 --- a/sig/whop_sdk/models/product_update_params.rbs +++ b/sig/whop_sdk/models/product_update_params.rbs @@ -17,6 +17,7 @@ module WhopSDK product_tax_code_id: String?, redirect_purchase_url: String?, route: String?, + send_welcome_message: bool?, store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, title: String?, visibility: WhopSDK::Models::visibility? @@ -57,6 +58,8 @@ module WhopSDK attr_accessor route: String? + attr_accessor send_welcome_message: bool? + attr_accessor store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig? attr_accessor title: String? @@ -79,6 +82,7 @@ module WhopSDK ?product_tax_code_id: String?, ?redirect_purchase_url: String?, ?route: String?, + ?send_welcome_message: bool?, ?store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, ?title: String?, ?visibility: WhopSDK::Models::visibility?, @@ -101,6 +105,7 @@ module WhopSDK product_tax_code_id: String?, redirect_purchase_url: String?, route: String?, + send_welcome_message: bool?, store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, title: String?, visibility: WhopSDK::Models::visibility?, diff --git a/sig/whop_sdk/resources/products.rbs b/sig/whop_sdk/resources/products.rbs index 0ef102f2..dc045969 100644 --- a/sig/whop_sdk/resources/products.rbs +++ b/sig/whop_sdk/resources/products.rbs @@ -19,6 +19,7 @@ module WhopSDK ?product_tax_code_id: String?, ?redirect_purchase_url: String?, ?route: String?, + ?send_welcome_message: bool?, ?visibility: WhopSDK::Models::visibility?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Product @@ -44,6 +45,7 @@ module WhopSDK ?product_tax_code_id: String?, ?redirect_purchase_url: String?, ?route: String?, + ?send_welcome_message: bool?, ?store_page_config: WhopSDK::ProductUpdateParams::StorePageConfig?, ?title: String?, ?visibility: WhopSDK::Models::visibility?, From f1b05ca076a06579625ec9c3a78dc96b59d867fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 18:57:23 +0000 Subject: [PATCH 2/6] feat(client): add webhook support --- Gemfile.lock | 2 ++ lib/whop_sdk.rb | 1 + lib/whop_sdk/client.rb | 7 ++++++ lib/whop_sdk/resources/webhooks.rb | 12 ++++++++++- rbi/whop_sdk/client.rbi | 6 ++++++ rbi/whop_sdk/resources/webhooks.rbi | 12 +++++++++-- sig/whop_sdk/client.rbs | 3 +++ sig/whop_sdk/resources/webhooks.rbs | 4 +++- test/whop_sdk/resources/webhooks_test.rb | 27 ++++++++++++++++++++++++ whop_sdk.gemspec | 1 + 10 files changed, 71 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7c1e59bb..19438b7a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,6 +14,7 @@ PATH whop_sdk (0.0.31) cgi connection_pool + standardwebhooks jwt openssl @@ -148,6 +149,7 @@ GEM rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) + standardwebhooks (1.0.1) steep (1.10.0) activesupport (>= 5.1) concurrent-ruby (>= 1.1.10) diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index 023a09cf..7d27e66f 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -30,6 +30,7 @@ # Gems. require "connection_pool" +require "standardwebhooks" # Package files. require_relative "whop_sdk/version" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index ff45a35f..a136b059 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -21,6 +21,9 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [String] attr_reader :api_key + # @return [String, nil] + attr_reader :webhook_key + # When using the SDK in app mode pass this parameter to allow verifying user # tokens # @return [String, nil] @@ -241,6 +244,8 @@ class Client < WhopSDK::Internal::Transport::BaseClient # must prepend your key/token with the word 'Bearer', which will look like # `Bearer ***************************` Defaults to `ENV["WHOP_API_KEY"]` # + # @param webhook_key [String, nil] Defaults to `ENV["WHOP_WEBHOOK_SECRET"]` + # # @param app_id [String, nil] When using the SDK in app mode pass this parameter to allow verifying user # tokens Defaults to `ENV["WHOP_APP_ID"]` # @@ -256,6 +261,7 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @param max_retry_delay [Float] def initialize( api_key: ENV["WHOP_API_KEY"], + webhook_key: ENV["WHOP_WEBHOOK_SECRET"], app_id: ENV["WHOP_APP_ID"], base_url: ENV["WHOP_BASE_URL"], max_retries: self.class::DEFAULT_MAX_RETRIES, @@ -274,6 +280,7 @@ def initialize( } @api_key = api_key.to_s + @webhook_key = webhook_key&.to_s super( base_url: base_url, diff --git a/lib/whop_sdk/resources/webhooks.rb b/lib/whop_sdk/resources/webhooks.rb index 1d22ab6d..3616b7e9 100644 --- a/lib/whop_sdk/resources/webhooks.rb +++ b/lib/whop_sdk/resources/webhooks.rb @@ -166,8 +166,18 @@ def delete(id, params = {}) # @param payload [String] The raw webhook payload as a string # + # @param headers [Hash{String=>String}] The raw HTTP headers that came with the payload + # + # @param key [String, nil] The webhook signing key + # # @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::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent] - def unwrap(payload) + def unwrap(payload, headers:, key: @client.webhook_key) + if key.nil? + raise ArgumentError.new("Cannot verify a webhook without a key on either the client's webhook_key or passed in as an argument") + end + + ::StandardWebhooks::Webhook.new(key).verify(payload, headers) + parsed = JSON.parse(payload, symbolize_names: true) WhopSDK::Internal::Type::Converter.coerce(WhopSDK::Models::UnwrapWebhookEvent, parsed) end diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index 6211afc1..362c7a57 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -16,6 +16,9 @@ module WhopSDK sig { returns(String) } attr_reader :api_key + sig { returns(T.nilable(String)) } + attr_reader :webhook_key + # When using the SDK in app mode pass this parameter to allow verifying user # tokens sig { returns(T.nilable(String)) } @@ -230,6 +233,7 @@ module WhopSDK sig do params( api_key: T.nilable(String), + webhook_key: T.nilable(String), app_id: T.nilable(String), base_url: T.nilable(String), max_retries: Integer, @@ -243,6 +247,8 @@ module WhopSDK # must prepend your key/token with the word 'Bearer', which will look like # `Bearer ***************************` Defaults to `ENV["WHOP_API_KEY"]` api_key: ENV["WHOP_API_KEY"], + # Defaults to `ENV["WHOP_WEBHOOK_SECRET"]` + webhook_key: ENV["WHOP_WEBHOOK_SECRET"], # When using the SDK in app mode pass this parameter to allow verifying user # tokens Defaults to `ENV["WHOP_APP_ID"]` app_id: ENV["WHOP_APP_ID"], diff --git a/rbi/whop_sdk/resources/webhooks.rbi b/rbi/whop_sdk/resources/webhooks.rbi index 80320bcb..d2a8d043 100644 --- a/rbi/whop_sdk/resources/webhooks.rbi +++ b/rbi/whop_sdk/resources/webhooks.rbi @@ -142,7 +142,11 @@ module WhopSDK end sig do - params(payload: String).returns( + params( + payload: String, + headers: T::Hash[String, String], + key: T.nilable(String) + ).returns( T.any( WhopSDK::InvoiceCreatedWebhookEvent, WhopSDK::InvoicePaidWebhookEvent, @@ -177,7 +181,11 @@ module WhopSDK end def unwrap( # The raw webhook payload as a string - payload + payload, + # The raw HTTP headers that came with the payload + headers:, + # The webhook signing key + key: @client.webhook_key ) end diff --git a/sig/whop_sdk/client.rbs b/sig/whop_sdk/client.rbs index bd193ac8..eeac2604 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -10,6 +10,8 @@ module WhopSDK attr_reader api_key: String + attr_reader webhook_key: String? + attr_reader app_id: String? attr_reader apps: WhopSDK::Resources::Apps @@ -116,6 +118,7 @@ module WhopSDK def initialize: ( ?api_key: String?, + ?webhook_key: String?, ?app_id: String?, ?base_url: String?, ?max_retries: Integer, diff --git a/sig/whop_sdk/resources/webhooks.rbs b/sig/whop_sdk/resources/webhooks.rbs index 9cbb4d21..47ea4c96 100644 --- a/sig/whop_sdk/resources/webhooks.rbs +++ b/sig/whop_sdk/resources/webhooks.rbs @@ -38,7 +38,9 @@ module WhopSDK def delete: (String id, ?request_options: WhopSDK::request_opts) -> bool def unwrap: ( - String payload + String payload, + headers: ::Hash[String, String], + ?key: String? ) -> (WhopSDK::InvoiceCreatedWebhookEvent | WhopSDK::InvoicePaidWebhookEvent | WhopSDK::InvoicePastDueWebhookEvent diff --git a/test/whop_sdk/resources/webhooks_test.rb b/test/whop_sdk/resources/webhooks_test.rb index f22bf5b6..4f436c5f 100644 --- a/test/whop_sdk/resources/webhooks_test.rb +++ b/test/whop_sdk/resources/webhooks_test.rb @@ -114,4 +114,31 @@ def test_delete response => WhopSDK::Internal::Type::Boolean end end + + def test_unwrap + key = "whsec_c2VjcmV0Cg==" + + webhook = StandardWebhooks::Webhook.new(key) + + data = + "{\"id\":\"msg_xxxxxxxxxxxxxxxxxxxxxxxx\",\"api_version\":\"v1\",\"data\":{\"id\":\"inv_xxxxxxxxxxxxxx\",\"created_at\":\"2023-12-01T05:00:00.401Z\",\"current_plan\":{\"id\":\"plan_xxxxxxxxxxxxx\",\"currency\":\"usd\",\"formatted_price\":\"$10.00\"},\"due_date\":\"2023-12-01T05:00:00.401Z\",\"email_address\":\"customer@example.com\",\"fetch_invoice_token\":\"eyJhbGciOiJIUzI1NiJ9...\",\"number\":\"#0001\",\"status\":\"draft\",\"user\":{\"id\":\"user_xxxxxxxxxxxxx\",\"name\":\"John Doe\",\"username\":\"johndoe42\"}},\"timestamp\":\"2025-01-01T00:00:00.000Z\",\"type\":\"invoice.created\",\"company_id\":\"biz_xxxxxxxxxxxxxx\"}" + message_id = "1" + timestamp = Time.now.to_i.to_s + signature = webhook.sign(message_id, timestamp, data) + headers = + {"webhook-id" => message_id, "webhook-timestamp" => timestamp, "webhook-signature" => signature} + + @whop.webhooks.unwrap(data, headers: headers, key: key) + + bad_headers = [ + headers.merge("webhook-id" => "bad"), + headers.merge("webhook-timestamp" => "0"), + headers.merge("webhook-signature" => webhook.sign(message_id, timestamp, "xxx")) + ] + bad_headers.each do |bad_header| + assert_raises(StandardWebhooks::WebhookVerificationError) do + @whop.webhooks.unwrap(data, headers: bad_header, key: key) + end + end + end end diff --git a/whop_sdk.gemspec b/whop_sdk.gemspec index b4007437..1588e27f 100644 --- a/whop_sdk.gemspec +++ b/whop_sdk.gemspec @@ -26,6 +26,7 @@ Gem::Specification.new do |s| s.extra_rdoc_files = ["README.md"] s.add_dependency "cgi" s.add_dependency "connection_pool" + s.add_dependency "standardwebhooks" s.add_dependency "jwt" s.add_dependency "openssl" end From d6af2cc7ea14659053aff192953d4062ce31a293 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:14:00 +0000 Subject: [PATCH 3/6] feat(api): api update --- .stats.yml | 4 ++-- lib/whop_sdk/models/payment.rb | 4 ++-- rbi/whop_sdk/models/payment.rbi | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index f926b8cf..39fd4693 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-b477216108f1b9e4bea7aac4f4da49b14bdba7d4e2660f2b2d643463390fa6e1.yml -openapi_spec_hash: b2415f4dd2e2397ed4b2558773a1005a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-c4baa40d76eb5b4842beff69f7baff7522fc3d64b40fa2d4d172b0c2c4ee2f12.yml +openapi_spec_hash: d70e313314720c22a3b35c67f4068f18 config_hash: 71004ac2f2a6283ca55db1065c47e5f6 diff --git a/lib/whop_sdk/models/payment.rb b/lib/whop_sdk/models/payment.rb index 19f0241a..728cd310 100644 --- a/lib/whop_sdk/models/payment.rb +++ b/lib/whop_sdk/models/payment.rb @@ -981,8 +981,8 @@ class Resolution < WhopSDK::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {WhopSDK::Models::Payment::Resolution} for more details. # - # A resolution is a dispute or support case between a buyer and seller, tracking - # the issue, status, and outcome. + # A resolution center case is a dispute or support case between a user and a + # company, tracking the issue, status, and outcome. # # @param id [String] The unique identifier for the resolution. # diff --git a/rbi/whop_sdk/models/payment.rbi b/rbi/whop_sdk/models/payment.rbi index 252646d7..306d76d1 100644 --- a/rbi/whop_sdk/models/payment.rbi +++ b/rbi/whop_sdk/models/payment.rbi @@ -1369,8 +1369,8 @@ module WhopSDK sig { returns(WhopSDK::Payment::Resolution::Status::TaggedSymbol) } attr_accessor :status - # A resolution is a dispute or support case between a buyer and seller, tracking - # the issue, status, and outcome. + # A resolution center case is a dispute or support case between a user and a + # company, tracking the issue, status, and outcome. sig do params( id: String, From 67365979c3472172bef736fc73574bb5719614e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 18:14:00 +0000 Subject: [PATCH 4/6] feat(api): api update --- .stats.yml | 4 ++-- lib/whop_sdk/models/ai_chat_list_params.rb | 10 +++++++++- lib/whop_sdk/resources/ai_chats.rb | 4 +++- rbi/whop_sdk/models/ai_chat_list_params.rbi | 8 ++++++++ rbi/whop_sdk/resources/ai_chats.rbi | 3 +++ sig/whop_sdk/models/ai_chat_list_params.rbs | 12 +++++++++++- sig/whop_sdk/resources/ai_chats.rbs | 1 + 7 files changed, 37 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 39fd4693..65711ede 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-c4baa40d76eb5b4842beff69f7baff7522fc3d64b40fa2d4d172b0c2c4ee2f12.yml -openapi_spec_hash: d70e313314720c22a3b35c67f4068f18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-187882c4d823394e3577f9843c288f4187e4f9b38646105c40b88e4e83b27979.yml +openapi_spec_hash: 16eb1c84681dc3ad39c987b7abf1e191 config_hash: 71004ac2f2a6283ca55db1065c47e5f6 diff --git a/lib/whop_sdk/models/ai_chat_list_params.rb b/lib/whop_sdk/models/ai_chat_list_params.rb index 38459dbe..cf504685 100644 --- a/lib/whop_sdk/models/ai_chat_list_params.rb +++ b/lib/whop_sdk/models/ai_chat_list_params.rb @@ -31,7 +31,13 @@ class AIChatListParams < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :last, Integer, nil?: true - # @!method initialize(after: nil, before: nil, first: nil, last: nil, request_options: {}) + # @!attribute only_active_crons + # When true, returns only chats with an active cron schedule + # + # @return [Boolean, nil] + optional :only_active_crons, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!method initialize(after: nil, before: nil, first: nil, last: nil, only_active_crons: 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. @@ -40,6 +46,8 @@ class AIChatListParams < WhopSDK::Internal::Type::BaseModel # # @param last [Integer, nil] Returns the last _n_ elements from the list. # + # @param only_active_crons [Boolean, nil] When true, returns only chats with an active cron schedule + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/resources/ai_chats.rb b/lib/whop_sdk/resources/ai_chats.rb index 093407dc..d22cb22a 100644 --- a/lib/whop_sdk/resources/ai_chats.rb +++ b/lib/whop_sdk/resources/ai_chats.rb @@ -98,7 +98,7 @@ def update(id, params = {}) # Returns a paginated list of AI chat threads for the current authenticated user. # - # @overload list(after: nil, before: nil, first: nil, last: nil, request_options: {}) + # @overload list(after: nil, before: nil, first: nil, last: nil, only_active_crons: nil, request_options: {}) # # @param after [String, nil] Returns the elements in the list that come after the specified cursor. # @@ -108,6 +108,8 @@ def update(id, params = {}) # # @param last [Integer, nil] Returns the last _n_ elements from the list. # + # @param only_active_crons [Boolean, nil] When true, returns only chats with an active cron schedule + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Internal::CursorPage] diff --git a/rbi/whop_sdk/models/ai_chat_list_params.rbi b/rbi/whop_sdk/models/ai_chat_list_params.rbi index d56b26f8..c38c8489 100644 --- a/rbi/whop_sdk/models/ai_chat_list_params.rbi +++ b/rbi/whop_sdk/models/ai_chat_list_params.rbi @@ -27,12 +27,17 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :last + # When true, returns only chats with an active cron schedule + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :only_active_crons + sig do params( after: T.nilable(String), before: T.nilable(String), first: T.nilable(Integer), last: T.nilable(Integer), + only_active_crons: T.nilable(T::Boolean), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -45,6 +50,8 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, + # When true, returns only chats with an active cron schedule + only_active_crons: nil, request_options: {} ) end @@ -56,6 +63,7 @@ module WhopSDK before: T.nilable(String), first: T.nilable(Integer), last: T.nilable(Integer), + only_active_crons: T.nilable(T::Boolean), request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/resources/ai_chats.rbi b/rbi/whop_sdk/resources/ai_chats.rbi index 11f21599..fa0b15a7 100644 --- a/rbi/whop_sdk/resources/ai_chats.rbi +++ b/rbi/whop_sdk/resources/ai_chats.rbi @@ -90,6 +90,7 @@ module WhopSDK before: T.nilable(String), first: T.nilable(Integer), last: T.nilable(Integer), + only_active_crons: T.nilable(T::Boolean), request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[WhopSDK::Models::AIChatListResponse] @@ -104,6 +105,8 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, + # When true, returns only chats with an active cron schedule + only_active_crons: nil, request_options: {} ) end diff --git a/sig/whop_sdk/models/ai_chat_list_params.rbs b/sig/whop_sdk/models/ai_chat_list_params.rbs index b9e8f18f..4889a097 100644 --- a/sig/whop_sdk/models/ai_chat_list_params.rbs +++ b/sig/whop_sdk/models/ai_chat_list_params.rbs @@ -1,7 +1,13 @@ module WhopSDK module Models type ai_chat_list_params = - { after: String?, before: String?, first: Integer?, last: Integer? } + { + after: String?, + before: String?, + first: Integer?, + last: Integer?, + only_active_crons: bool? + } & WhopSDK::Internal::Type::request_parameters class AIChatListParams < WhopSDK::Internal::Type::BaseModel @@ -16,11 +22,14 @@ module WhopSDK attr_accessor last: Integer? + attr_accessor only_active_crons: bool? + def initialize: ( ?after: String?, ?before: String?, ?first: Integer?, ?last: Integer?, + ?only_active_crons: bool?, ?request_options: WhopSDK::request_opts ) -> void @@ -29,6 +38,7 @@ module WhopSDK before: String?, first: Integer?, last: Integer?, + only_active_crons: bool?, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/resources/ai_chats.rbs b/sig/whop_sdk/resources/ai_chats.rbs index d25b65b3..81ccb028 100644 --- a/sig/whop_sdk/resources/ai_chats.rbs +++ b/sig/whop_sdk/resources/ai_chats.rbs @@ -28,6 +28,7 @@ module WhopSDK ?before: String?, ?first: Integer?, ?last: Integer?, + ?only_active_crons: bool?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::AIChatListResponse] From 3539993a158657780bdc730aecb8c3cad3c16d12 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 18:25:33 +0000 Subject: [PATCH 5/6] feat(api): manual updates --- .stats.yml | 4 +- lib/whop_sdk.rb | 13 +- lib/whop_sdk/client.rb | 5 + lib/whop_sdk/models.rb | 16 + ..._create_response.rb => authorized_user.rb} | 20 +- .../authorized_user_retrieve_response.rb | 108 --- lib/whop_sdk/models/payment.rb | 106 +-- ...esolution_center_case_customer_response.rb | 17 + .../resolution_center_case_issue_type.rb | 19 + .../resolution_center_case_list_params.rb | 88 +++ .../resolution_center_case_list_response.rb | 191 +++++ ...esolution_center_case_merchant_response.rb | 19 + ...esolution_center_case_platform_response.rb | 19 + .../resolution_center_case_retrieve_params.rb | 20 + ...esolution_center_case_retrieve_response.rb | 372 ++++++++++ .../models/resolution_center_case_status.rb | 22 + lib/whop_sdk/resources/authorized_users.rb | 8 +- .../resources/resolution_center_cases.rb | 84 +++ rbi/whop_sdk/client.rbi | 4 + rbi/whop_sdk/models.rbi | 21 + ...reate_response.rbi => authorized_user.rbi} | 43 +- .../authorized_user_retrieve_response.rbi | 176 ----- rbi/whop_sdk/models/payment.rbi | 278 +------- ...solution_center_case_customer_response.rbi | 40 ++ .../resolution_center_case_issue_type.rbi | 48 ++ .../resolution_center_case_list_params.rbi | 118 +++ .../resolution_center_case_list_response.rbi | 303 ++++++++ ...solution_center_case_merchant_response.rbi | 50 ++ ...solution_center_case_platform_response.rbi | 50 ++ ...resolution_center_case_retrieve_params.rbi | 38 + ...solution_center_case_retrieve_response.rbi | 673 ++++++++++++++++++ .../models/resolution_center_case_status.rbi | 57 ++ rbi/whop_sdk/resources/authorized_users.rbi | 4 +- .../resources/resolution_center_cases.rbi | 79 ++ sig/whop_sdk/client.rbs | 2 + sig/whop_sdk/models.rbs | 16 + ...reate_response.rbs => authorized_user.rbs} | 20 +- .../authorized_user_retrieve_response.rbs | 74 -- sig/whop_sdk/models/payment.rbs | 130 +--- ...solution_center_case_customer_response.rbs | 16 + .../resolution_center_case_issue_type.rbs | 22 + .../resolution_center_case_list_params.rbs | 66 ++ .../resolution_center_case_list_response.rbs | 116 +++ ...solution_center_case_merchant_response.rbs | 18 + ...solution_center_case_platform_response.rbs | 22 + ...resolution_center_case_retrieve_params.rbs | 20 + ...solution_center_case_retrieve_response.rbs | 254 +++++++ .../models/resolution_center_case_status.rbs | 28 + sig/whop_sdk/resources/authorized_users.rbs | 4 +- .../resources/resolution_center_cases.rbs | 25 + .../resources/authorized_users_test.rb | 12 +- .../resources/resolution_center_cases_test.rb | 71 ++ 52 files changed, 3138 insertions(+), 891 deletions(-) rename lib/whop_sdk/models/{authorized_user_create_response.rb => authorized_user.rb} (78%) delete mode 100644 lib/whop_sdk/models/authorized_user_retrieve_response.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_customer_response.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_issue_type.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_list_params.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_list_response.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_merchant_response.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_platform_response.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_retrieve_params.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_retrieve_response.rb create mode 100644 lib/whop_sdk/models/resolution_center_case_status.rb create mode 100644 lib/whop_sdk/resources/resolution_center_cases.rb rename rbi/whop_sdk/models/{authorized_user_create_response.rbi => authorized_user.rbi} (75%) delete mode 100644 rbi/whop_sdk/models/authorized_user_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_customer_response.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_issue_type.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_list_params.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_list_response.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_merchant_response.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_platform_response.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/resolution_center_case_status.rbi create mode 100644 rbi/whop_sdk/resources/resolution_center_cases.rbi rename sig/whop_sdk/models/{authorized_user_create_response.rbs => authorized_user.rbs} (65%) delete mode 100644 sig/whop_sdk/models/authorized_user_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_customer_response.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_issue_type.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_list_params.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_list_response.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_merchant_response.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_platform_response.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/resolution_center_case_status.rbs create mode 100644 sig/whop_sdk/resources/resolution_center_cases.rbs create mode 100644 test/whop_sdk/resources/resolution_center_cases_test.rb diff --git a/.stats.yml b/.stats.yml index 65711ede..00310ca6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 176 +configured_endpoints: 178 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-187882c4d823394e3577f9843c288f4187e4f9b38646105c40b88e4e83b27979.yml openapi_spec_hash: 16eb1c84681dc3ad39c987b7abf1e191 -config_hash: 71004ac2f2a6283ca55db1065c47e5f6 +config_hash: e9bda7cddca13f2b41d8f7521ad36cf5 diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index 7d27e66f..471c0a9c 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -87,14 +87,13 @@ require_relative "whop_sdk/models/app_update_params" require_relative "whop_sdk/models/app_view_type" require_relative "whop_sdk/models/assessment_question_types" +require_relative "whop_sdk/models/authorized_user" require_relative "whop_sdk/models/authorized_user_create_params" -require_relative "whop_sdk/models/authorized_user_create_response" require_relative "whop_sdk/models/authorized_user_delete_params" require_relative "whop_sdk/models/authorized_user_delete_response" require_relative "whop_sdk/models/authorized_user_list_params" require_relative "whop_sdk/models/authorized_user_list_response" require_relative "whop_sdk/models/authorized_user_retrieve_params" -require_relative "whop_sdk/models/authorized_user_retrieve_response" require_relative "whop_sdk/models/authorized_user_roles" require_relative "whop_sdk/models/billing_reasons" require_relative "whop_sdk/models/cancel_options" @@ -376,6 +375,15 @@ require_relative "whop_sdk/models/refund_status" require_relative "whop_sdk/models/refund_updated_webhook_event" require_relative "whop_sdk/models/release_method" +require_relative "whop_sdk/models/resolution_center_case_customer_response" +require_relative "whop_sdk/models/resolution_center_case_issue_type" +require_relative "whop_sdk/models/resolution_center_case_list_params" +require_relative "whop_sdk/models/resolution_center_case_list_response" +require_relative "whop_sdk/models/resolution_center_case_merchant_response" +require_relative "whop_sdk/models/resolution_center_case_platform_response" +require_relative "whop_sdk/models/resolution_center_case_retrieve_params" +require_relative "whop_sdk/models/resolution_center_case_retrieve_response" +require_relative "whop_sdk/models/resolution_center_case_status" require_relative "whop_sdk/models/review_list_params" require_relative "whop_sdk/models/review_list_response" require_relative "whop_sdk/models/review_retrieve_params" @@ -491,6 +499,7 @@ require_relative "whop_sdk/resources/promo_codes" require_relative "whop_sdk/resources/reactions" require_relative "whop_sdk/resources/refunds" +require_relative "whop_sdk/resources/resolution_center_cases" require_relative "whop_sdk/resources/reviews" require_relative "whop_sdk/resources/setup_intents" require_relative "whop_sdk/resources/shipments" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index a136b059..de17181a 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -229,6 +229,10 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::DisputeAlerts] attr_reader :dispute_alerts + # Resolution center cases + # @return [WhopSDK::Resources::ResolutionCenterCases] + attr_reader :resolution_center_cases + # @api private # # @return [Hash{String=>String}] @@ -341,6 +345,7 @@ def initialize( @ai_chats = WhopSDK::Resources::AIChats.new(client: self) @dm_channels = WhopSDK::Resources::DmChannels.new(client: self) @dispute_alerts = WhopSDK::Resources::DisputeAlerts.new(client: self) + @resolution_center_cases = WhopSDK::Resources::ResolutionCenterCases.new(client: self) end # Verifies a Whop user token diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 08fa81ee..7854086f 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -93,6 +93,8 @@ module WhopSDK AssessmentQuestionTypes = WhopSDK::Models::AssessmentQuestionTypes + AuthorizedUser = WhopSDK::Models::AuthorizedUser + AuthorizedUserCreateParams = WhopSDK::Models::AuthorizedUserCreateParams AuthorizedUserDeleteParams = WhopSDK::Models::AuthorizedUserDeleteParams @@ -551,6 +553,20 @@ module WhopSDK ReleaseMethod = WhopSDK::Models::ReleaseMethod + ResolutionCenterCaseCustomerResponse = WhopSDK::Models::ResolutionCenterCaseCustomerResponse + + ResolutionCenterCaseIssueType = WhopSDK::Models::ResolutionCenterCaseIssueType + + ResolutionCenterCaseListParams = WhopSDK::Models::ResolutionCenterCaseListParams + + ResolutionCenterCaseMerchantResponse = WhopSDK::Models::ResolutionCenterCaseMerchantResponse + + ResolutionCenterCasePlatformResponse = WhopSDK::Models::ResolutionCenterCasePlatformResponse + + ResolutionCenterCaseRetrieveParams = WhopSDK::Models::ResolutionCenterCaseRetrieveParams + + ResolutionCenterCaseStatus = WhopSDK::Models::ResolutionCenterCaseStatus + ReviewListParams = WhopSDK::Models::ReviewListParams ReviewRetrieveParams = WhopSDK::Models::ReviewRetrieveParams diff --git a/lib/whop_sdk/models/authorized_user_create_response.rb b/lib/whop_sdk/models/authorized_user.rb similarity index 78% rename from lib/whop_sdk/models/authorized_user_create_response.rb rename to lib/whop_sdk/models/authorized_user.rb index 27ed6aed..fc004b12 100644 --- a/lib/whop_sdk/models/authorized_user_create_response.rb +++ b/lib/whop_sdk/models/authorized_user.rb @@ -3,7 +3,7 @@ module WhopSDK module Models # @see WhopSDK::Resources::AuthorizedUsers#create - class AuthorizedUserCreateResponse < WhopSDK::Internal::Type::BaseModel + class AuthorizedUser < WhopSDK::Internal::Type::BaseModel # @!attribute id # The unique identifier for the authorized user. # @@ -13,8 +13,8 @@ class AuthorizedUserCreateResponse < WhopSDK::Internal::Type::BaseModel # @!attribute company # The company this authorized user has access to. # - # @return [WhopSDK::Models::AuthorizedUserCreateResponse::Company] - required :company, -> { WhopSDK::Models::AuthorizedUserCreateResponse::Company } + # @return [WhopSDK::Models::AuthorizedUser::Company] + required :company, -> { WhopSDK::AuthorizedUser::Company } # @!attribute role # The permission role assigned to this authorized user within the company. @@ -25,8 +25,8 @@ class AuthorizedUserCreateResponse < WhopSDK::Internal::Type::BaseModel # @!attribute user # The user account linked to this authorized user record. # - # @return [WhopSDK::Models::AuthorizedUserCreateResponse::User] - required :user, -> { WhopSDK::Models::AuthorizedUserCreateResponse::User } + # @return [WhopSDK::Models::AuthorizedUser::User] + required :user, -> { WhopSDK::AuthorizedUser::User } # @!method initialize(id:, company:, role:, user:) # A user who has been granted administrative access to manage a company's @@ -34,13 +34,13 @@ class AuthorizedUserCreateResponse < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for the authorized user. # - # @param company [WhopSDK::Models::AuthorizedUserCreateResponse::Company] The company this authorized user has access to. + # @param company [WhopSDK::Models::AuthorizedUser::Company] The company this authorized user has access to. # # @param role [Symbol, WhopSDK::Models::AuthorizedUserRoles] The permission role assigned to this authorized user within the company. # - # @param user [WhopSDK::Models::AuthorizedUserCreateResponse::User] The user account linked to this authorized user record. + # @param user [WhopSDK::Models::AuthorizedUser::User] The user account linked to this authorized user record. - # @see WhopSDK::Models::AuthorizedUserCreateResponse#company + # @see WhopSDK::Models::AuthorizedUser#company class Company < WhopSDK::Internal::Type::BaseModel # @!attribute id # The unique identifier for the company. @@ -62,7 +62,7 @@ class Company < WhopSDK::Internal::Type::BaseModel # @param title [String] The display name of the company shown to customers. end - # @see WhopSDK::Models::AuthorizedUserCreateResponse#user + # @see WhopSDK::Models::AuthorizedUser#user class User < WhopSDK::Internal::Type::BaseModel # @!attribute id # The unique identifier for the user. @@ -91,7 +91,7 @@ class User < WhopSDK::Internal::Type::BaseModel # @!method initialize(id:, email:, name:, username:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AuthorizedUserCreateResponse::User} for more details. + # {WhopSDK::Models::AuthorizedUser::User} for more details. # # The user account linked to this authorized user record. # diff --git a/lib/whop_sdk/models/authorized_user_retrieve_response.rb b/lib/whop_sdk/models/authorized_user_retrieve_response.rb deleted file mode 100644 index c14d6486..00000000 --- a/lib/whop_sdk/models/authorized_user_retrieve_response.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::AuthorizedUsers#retrieve - class AuthorizedUserRetrieveResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the authorized user. - # - # @return [String] - required :id, String - - # @!attribute company - # The company this authorized user has access to. - # - # @return [WhopSDK::Models::AuthorizedUserRetrieveResponse::Company] - required :company, -> { WhopSDK::Models::AuthorizedUserRetrieveResponse::Company } - - # @!attribute role - # The permission role assigned to this authorized user within the company. - # - # @return [Symbol, WhopSDK::Models::AuthorizedUserRoles] - required :role, enum: -> { WhopSDK::AuthorizedUserRoles } - - # @!attribute user - # The user account linked to this authorized user record. - # - # @return [WhopSDK::Models::AuthorizedUserRetrieveResponse::User] - required :user, -> { WhopSDK::Models::AuthorizedUserRetrieveResponse::User } - - # @!method initialize(id:, company:, role:, user:) - # A user who has been granted administrative access to manage a company's - # dashboard and settings. - # - # @param id [String] The unique identifier for the authorized user. - # - # @param company [WhopSDK::Models::AuthorizedUserRetrieveResponse::Company] The company this authorized user has access to. - # - # @param role [Symbol, WhopSDK::Models::AuthorizedUserRoles] The permission role assigned to this authorized user within the company. - # - # @param user [WhopSDK::Models::AuthorizedUserRetrieveResponse::User] The user account linked to this authorized user record. - - # @see WhopSDK::Models::AuthorizedUserRetrieveResponse#company - class Company < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the company. - # - # @return [String] - required :id, String - - # @!attribute title - # The display name of the company shown to customers. - # - # @return [String] - required :title, String - - # @!method initialize(id:, title:) - # The company this authorized user has access to. - # - # @param id [String] The unique identifier for the company. - # - # @param title [String] The display name of the company shown to customers. - end - - # @see WhopSDK::Models::AuthorizedUserRetrieveResponse#user - class User < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the user. - # - # @return [String] - required :id, String - - # @!attribute email - # The user's email address. Requires the member:email:read permission to access. - # Null if not authorized. - # - # @return [String, nil] - required :email, String, nil?: true - - # @!attribute name - # The user's display name shown on their public profile. - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute username - # The user's unique username shown on their public profile. - # - # @return [String] - required :username, String - - # @!method initialize(id:, email:, name:, username:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AuthorizedUserRetrieveResponse::User} for more details. - # - # The user account linked to this authorized user record. - # - # @param id [String] The unique identifier for the user. - # - # @param email [String, nil] The user's email address. Requires the member:email:read permission to access. N - # - # @param name [String, nil] The user's display name shown on their public profile. - # - # @param username [String] The user's unique username shown on their public profile. - end - end - end -end diff --git a/lib/whop_sdk/models/payment.rb b/lib/whop_sdk/models/payment.rb index 728cd310..db660df1 100644 --- a/lib/whop_sdk/models/payment.rb +++ b/lib/whop_sdk/models/payment.rb @@ -932,9 +932,9 @@ class Resolution < WhopSDK::Internal::Type::BaseModel # @!attribute customer_response_actions # The list of actions currently available to the customer. # - # @return [Array] + # @return [Array] required :customer_response_actions, - -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::Payment::Resolution::CustomerResponseAction] } + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseCustomerResponse] } # @!attribute due_date # The deadline by which the next response is required. Null if no deadline is @@ -946,8 +946,8 @@ class Resolution < WhopSDK::Internal::Type::BaseModel # @!attribute issue # The category of the dispute. # - # @return [Symbol, WhopSDK::Models::Payment::Resolution::Issue] - required :issue, enum: -> { WhopSDK::Payment::Resolution::Issue } + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseIssueType] + required :issue, enum: -> { WhopSDK::ResolutionCenterCaseIssueType } # @!attribute merchant_appealed # Whether the merchant has filed an appeal after the initial resolution decision. @@ -958,24 +958,24 @@ class Resolution < WhopSDK::Internal::Type::BaseModel # @!attribute merchant_response_actions # The list of actions currently available to the merchant. # - # @return [Array] + # @return [Array] required :merchant_response_actions, - -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::Payment::Resolution::MerchantResponseAction] } + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseMerchantResponse] } # @!attribute platform_response_actions # The list of actions currently available to the Whop platform for moderating this # resolution. # - # @return [Array] + # @return [Array] required :platform_response_actions, - -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::Payment::Resolution::PlatformResponseAction] } + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCasePlatformResponse] } # @!attribute status # The current status of the resolution case, indicating which party needs to # respond or if the case is closed. # - # @return [Symbol, WhopSDK::Models::Payment::Resolution::Status] - required :status, enum: -> { WhopSDK::Payment::Resolution::Status } + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseStatus] + required :status, enum: -> { WhopSDK::ResolutionCenterCaseStatus } # @!method initialize(id:, customer_appealed:, customer_response_actions:, due_date:, issue:, merchant_appealed:, merchant_response_actions:, platform_response_actions:, status:) # Some parameter documentations has been truncated, see @@ -988,95 +988,19 @@ class Resolution < WhopSDK::Internal::Type::BaseModel # # @param customer_appealed [Boolean] Whether the customer has filed an appeal after the initial resolution decision. # - # @param customer_response_actions [Array] The list of actions currently available to the customer. + # @param customer_response_actions [Array] The list of actions currently available to the customer. # # @param due_date [Time, nil] The deadline by which the next response is required. Null if no deadline is curr # - # @param issue [Symbol, WhopSDK::Models::Payment::Resolution::Issue] The category of the dispute. + # @param issue [Symbol, WhopSDK::Models::ResolutionCenterCaseIssueType] The category of the dispute. # # @param merchant_appealed [Boolean] Whether the merchant has filed an appeal after the initial resolution decision. # - # @param merchant_response_actions [Array] The list of actions currently available to the merchant. + # @param merchant_response_actions [Array] The list of actions currently available to the merchant. # - # @param platform_response_actions [Array] The list of actions currently available to the Whop platform for moderating this + # @param platform_response_actions [Array] The list of actions currently available to the Whop platform for moderating this # - # @param status [Symbol, WhopSDK::Models::Payment::Resolution::Status] The current status of the resolution case, indicating which party needs to respo - - # The types of responses a customer can make to a resolution. - module CustomerResponseAction - extend WhopSDK::Internal::Type::Enum - - RESPOND = :respond - APPEAL = :appeal - WITHDRAW = :withdraw - - # @!method self.values - # @return [Array] - end - - # The category of the dispute. - # - # @see WhopSDK::Models::Payment::Resolution#issue - module Issue - extend WhopSDK::Internal::Type::Enum - - FORGOT_TO_CANCEL = :forgot_to_cancel - ITEM_NOT_RECEIVED = :item_not_received - SIGNIFICANTLY_NOT_AS_DESCRIBED = :significantly_not_as_described - UNAUTHORIZED_TRANSACTION = :unauthorized_transaction - PRODUCT_UNACCEPTABLE = :product_unacceptable - - # @!method self.values - # @return [Array] - end - - # The types of responses a merchant can make to a resolution. - module MerchantResponseAction - extend WhopSDK::Internal::Type::Enum - - ACCEPT = :accept - DENY = :deny - REQUEST_MORE_INFO = :request_more_info - APPEAL = :appeal - RESPOND = :respond - - # @!method self.values - # @return [Array] - end - - # The types of responses the platform can make to a resolution. - module PlatformResponseAction - extend WhopSDK::Internal::Type::Enum - - REQUEST_BUYER_INFO = :request_buyer_info - REQUEST_MERCHANT_INFO = :request_merchant_info - MERCHANT_WINS = :merchant_wins - PLATFORM_REFUND = :platform_refund - MERCHANT_REFUND = :merchant_refund - - # @!method self.values - # @return [Array] - end - - # The current status of the resolution case, indicating which party needs to - # respond or if the case is closed. - # - # @see WhopSDK::Models::Payment::Resolution#status - module Status - extend WhopSDK::Internal::Type::Enum - - MERCHANT_RESPONSE_NEEDED = :merchant_response_needed - CUSTOMER_RESPONSE_NEEDED = :customer_response_needed - MERCHANT_INFO_NEEDED = :merchant_info_needed - CUSTOMER_INFO_NEEDED = :customer_info_needed - UNDER_PLATFORM_REVIEW = :under_platform_review - CUSTOMER_WON = :customer_won - MERCHANT_WON = :merchant_won - CUSTOMER_WITHDREW = :customer_withdrew - - # @!method self.values - # @return [Array] - end + # @param status [Symbol, WhopSDK::Models::ResolutionCenterCaseStatus] The current status of the resolution case, indicating which party needs to respo end # @see WhopSDK::Models::Payment#user diff --git a/lib/whop_sdk/models/resolution_center_case_customer_response.rb b/lib/whop_sdk/models/resolution_center_case_customer_response.rb new file mode 100644 index 00000000..c3ece268 --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_customer_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The types of responses a customer can make to a resolution. + module ResolutionCenterCaseCustomerResponse + extend WhopSDK::Internal::Type::Enum + + RESPOND = :respond + APPEAL = :appeal + WITHDRAW = :withdraw + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_issue_type.rb b/lib/whop_sdk/models/resolution_center_case_issue_type.rb new file mode 100644 index 00000000..fcaaa03b --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_issue_type.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The different types of issues a resolution can be + module ResolutionCenterCaseIssueType + extend WhopSDK::Internal::Type::Enum + + FORGOT_TO_CANCEL = :forgot_to_cancel + ITEM_NOT_RECEIVED = :item_not_received + SIGNIFICANTLY_NOT_AS_DESCRIBED = :significantly_not_as_described + UNAUTHORIZED_TRANSACTION = :unauthorized_transaction + PRODUCT_UNACCEPTABLE = :product_unacceptable + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_list_params.rb b/lib/whop_sdk/models/resolution_center_case_list_params.rb new file mode 100644 index 00000000..eedfa21b --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_list_params.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::ResolutionCenterCases#list + class ResolutionCenterCaseListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute after + # Returns the elements in the list that come after the specified cursor. + # + # @return [String, nil] + optional :after, String, nil?: true + + # @!attribute before + # Returns the elements in the list that come before the specified cursor. + # + # @return [String, nil] + optional :before, String, nil?: true + + # @!attribute company_id + # The unique identifier of the company to list resolution center cases for. + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute created_after + # Only return cases created after this timestamp. + # + # @return [Time, nil] + optional :created_after, Time, nil?: true + + # @!attribute created_before + # Only return cases created before this timestamp. + # + # @return [Time, nil] + optional :created_before, Time, nil?: true + + # @!attribute direction + # The direction of the sort. + # + # @return [Symbol, WhopSDK::Models::Direction, nil] + optional :direction, enum: -> { WhopSDK::Direction }, 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 statuses + # Filter by resolution center case status. + # + # @return [Array, nil] + optional :statuses, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseStatus] }, + nil?: true + + # @!method initialize(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, statuses: 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 unique identifier of the company to list resolution center cases for. + # + # @param created_after [Time, nil] Only return cases created after this timestamp. + # + # @param created_before [Time, nil] Only return cases created before this timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # + # @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 statuses [Array, nil] Filter by resolution center case status. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_list_response.rb b/lib/whop_sdk/models/resolution_center_case_list_response.rb new file mode 100644 index 00000000..55992a47 --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_list_response.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::ResolutionCenterCases#list + class ResolutionCenterCaseListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the resolution. + # + # @return [String] + required :id, String + + # @!attribute company + # The company involved in this resolution case. Null if the company no longer + # exists. + # + # @return [WhopSDK::Models::ResolutionCenterCaseListResponse::Company, nil] + required :company, -> { WhopSDK::Models::ResolutionCenterCaseListResponse::Company }, nil?: true + + # @!attribute created_at + # The datetime the resolution was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute customer_appealed + # Whether the customer has filed an appeal after the initial resolution decision. + # + # @return [Boolean] + required :customer_appealed, WhopSDK::Internal::Type::Boolean + + # @!attribute customer_response_actions + # The list of actions currently available to the customer. + # + # @return [Array] + required :customer_response_actions, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseCustomerResponse] } + + # @!attribute due_date + # The deadline by which the next response is required. Null if no deadline is + # currently active. As a Unix timestamp. + # + # @return [Time, nil] + required :due_date, Time, nil?: true + + # @!attribute issue + # The category of the dispute. + # + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseIssueType] + required :issue, enum: -> { WhopSDK::ResolutionCenterCaseIssueType } + + # @!attribute merchant_appealed + # Whether the merchant has filed an appeal after the initial resolution decision. + # + # @return [Boolean] + required :merchant_appealed, WhopSDK::Internal::Type::Boolean + + # @!attribute merchant_response_actions + # The list of actions currently available to the merchant. + # + # @return [Array] + required :merchant_response_actions, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseMerchantResponse] } + + # @!attribute payment + # The payment record that is the subject of this resolution case. + # + # @return [WhopSDK::Models::ResolutionCenterCaseListResponse::Payment] + required :payment, -> { WhopSDK::Models::ResolutionCenterCaseListResponse::Payment } + + # @!attribute status + # The current status of the resolution case, indicating which party needs to + # respond or if the case is closed. + # + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseStatus] + required :status, enum: -> { WhopSDK::ResolutionCenterCaseStatus } + + # @!attribute updated_at + # The datetime the resolution was last updated. + # + # @return [Time] + required :updated_at, Time + + # @!attribute user + # The customer (buyer) who filed this resolution case. + # + # @return [WhopSDK::Models::ResolutionCenterCaseListResponse::User] + required :user, -> { WhopSDK::Models::ResolutionCenterCaseListResponse::User } + + # @!method initialize(id:, company:, created_at:, customer_appealed:, customer_response_actions:, due_date:, issue:, merchant_appealed:, merchant_response_actions:, payment:, status:, updated_at:, user:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ResolutionCenterCaseListResponse} for more details. + # + # A resolution center case is a dispute or support case between a user and a + # company, tracking the issue, status, and outcome. + # + # @param id [String] The unique identifier for the resolution. + # + # @param company [WhopSDK::Models::ResolutionCenterCaseListResponse::Company, nil] The company involved in this resolution case. Null if the company no longer exis + # + # @param created_at [Time] The datetime the resolution was created. + # + # @param customer_appealed [Boolean] Whether the customer has filed an appeal after the initial resolution decision. + # + # @param customer_response_actions [Array] The list of actions currently available to the customer. + # + # @param due_date [Time, nil] The deadline by which the next response is required. Null if no deadline is curr + # + # @param issue [Symbol, WhopSDK::Models::ResolutionCenterCaseIssueType] The category of the dispute. + # + # @param merchant_appealed [Boolean] Whether the merchant has filed an appeal after the initial resolution decision. + # + # @param merchant_response_actions [Array] The list of actions currently available to the merchant. + # + # @param payment [WhopSDK::Models::ResolutionCenterCaseListResponse::Payment] The payment record that is the subject of this resolution case. + # + # @param status [Symbol, WhopSDK::Models::ResolutionCenterCaseStatus] The current status of the resolution case, indicating which party needs to respo + # + # @param updated_at [Time] The datetime the resolution was last updated. + # + # @param user [WhopSDK::Models::ResolutionCenterCaseListResponse::User] The customer (buyer) who filed this resolution case. + + # @see WhopSDK::Models::ResolutionCenterCaseListResponse#company + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the company. + # + # @return [String] + required :id, String + + # @!attribute title + # The display name of the company shown to customers. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The company involved in this resolution case. Null if the company no longer + # exists. + # + # @param id [String] The unique identifier for the company. + # + # @param title [String] The display name of the company shown to customers. + end + + # @see WhopSDK::Models::ResolutionCenterCaseListResponse#payment + class Payment < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the payment. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The payment record that is the subject of this resolution case. + # + # @param id [String] The unique identifier for the payment. + end + + # @see WhopSDK::Models::ResolutionCenterCaseListResponse#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the user. + # + # @return [String] + required :id, String + + # @!attribute name + # The user's display name shown on their public profile. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute username + # The user's unique username shown on their public profile. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, username:) + # The customer (buyer) who filed this resolution case. + # + # @param id [String] The unique identifier for the user. + # + # @param name [String, nil] The user's display name shown on their public profile. + # + # @param username [String] The user's unique username shown on their public profile. + end + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_merchant_response.rb b/lib/whop_sdk/models/resolution_center_case_merchant_response.rb new file mode 100644 index 00000000..aa3ef3ff --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_merchant_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The types of responses a merchant can make to a resolution. + module ResolutionCenterCaseMerchantResponse + extend WhopSDK::Internal::Type::Enum + + ACCEPT = :accept + DENY = :deny + REQUEST_MORE_INFO = :request_more_info + APPEAL = :appeal + RESPOND = :respond + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_platform_response.rb b/lib/whop_sdk/models/resolution_center_case_platform_response.rb new file mode 100644 index 00000000..bb7062c3 --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_platform_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The types of responses the platform can make to a resolution. + module ResolutionCenterCasePlatformResponse + extend WhopSDK::Internal::Type::Enum + + REQUEST_BUYER_INFO = :request_buyer_info + REQUEST_MERCHANT_INFO = :request_merchant_info + MERCHANT_WINS = :merchant_wins + PLATFORM_REFUND = :platform_refund + MERCHANT_REFUND = :merchant_refund + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_retrieve_params.rb b/lib/whop_sdk/models/resolution_center_case_retrieve_params.rb new file mode 100644 index 00000000..846d8088 --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::ResolutionCenterCases#retrieve + class ResolutionCenterCaseRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_retrieve_response.rb b/lib/whop_sdk/models/resolution_center_case_retrieve_response.rb new file mode 100644 index 00000000..cc6a8645 --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_retrieve_response.rb @@ -0,0 +1,372 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::ResolutionCenterCases#retrieve + class ResolutionCenterCaseRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the resolution. + # + # @return [String] + required :id, String + + # @!attribute company + # The company involved in this resolution case. Null if the company no longer + # exists. + # + # @return [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company, nil] + required :company, -> { WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company }, nil?: true + + # @!attribute created_at + # The datetime the resolution was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute customer_appealed + # Whether the customer has filed an appeal after the initial resolution decision. + # + # @return [Boolean] + required :customer_appealed, WhopSDK::Internal::Type::Boolean + + # @!attribute customer_response_actions + # The list of actions currently available to the customer. + # + # @return [Array] + required :customer_response_actions, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseCustomerResponse] } + + # @!attribute due_date + # The deadline by which the next response is required. Null if no deadline is + # currently active. As a Unix timestamp. + # + # @return [Time, nil] + required :due_date, Time, nil?: true + + # @!attribute issue + # The category of the dispute. + # + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseIssueType] + required :issue, enum: -> { WhopSDK::ResolutionCenterCaseIssueType } + + # @!attribute member + # The membership record associated with the disputed payment. Null if the + # membership no longer exists. + # + # @return [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member, nil] + required :member, -> { WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member }, nil?: true + + # @!attribute merchant_appealed + # Whether the merchant has filed an appeal after the initial resolution decision. + # + # @return [Boolean] + required :merchant_appealed, WhopSDK::Internal::Type::Boolean + + # @!attribute merchant_response_actions + # The list of actions currently available to the merchant. + # + # @return [Array] + required :merchant_response_actions, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseMerchantResponse] } + + # @!attribute payment + # The payment record that is the subject of this resolution case. + # + # @return [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment] + required :payment, -> { WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment } + + # @!attribute platform_response_actions + # The list of actions currently available to the Whop platform for moderating this + # resolution. + # + # @return [Array] + required :platform_response_actions, + -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCasePlatformResponse] } + + # @!attribute resolution_events + # The most recent 50 messages, actions, and status changes that have occurred + # during this resolution case. + # + # @return [Array] + required :resolution_events, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent] } + + # @!attribute status + # The current status of the resolution case, indicating which party needs to + # respond or if the case is closed. + # + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseStatus] + required :status, enum: -> { WhopSDK::ResolutionCenterCaseStatus } + + # @!attribute updated_at + # The datetime the resolution was last updated. + # + # @return [Time] + required :updated_at, Time + + # @!attribute user + # The customer (buyer) who filed this resolution case. + # + # @return [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User] + required :user, -> { WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User } + + # @!method initialize(id:, company:, created_at:, customer_appealed:, customer_response_actions:, due_date:, issue:, member:, merchant_appealed:, merchant_response_actions:, payment:, platform_response_actions:, resolution_events:, status:, updated_at:, user:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ResolutionCenterCaseRetrieveResponse} for more details. + # + # A resolution center case is a dispute or support case between a user and a + # company, tracking the issue, status, and outcome. + # + # @param id [String] The unique identifier for the resolution. + # + # @param company [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company, nil] The company involved in this resolution case. Null if the company no longer exis + # + # @param created_at [Time] The datetime the resolution was created. + # + # @param customer_appealed [Boolean] Whether the customer has filed an appeal after the initial resolution decision. + # + # @param customer_response_actions [Array] The list of actions currently available to the customer. + # + # @param due_date [Time, nil] The deadline by which the next response is required. Null if no deadline is curr + # + # @param issue [Symbol, WhopSDK::Models::ResolutionCenterCaseIssueType] The category of the dispute. + # + # @param member [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member, nil] The membership record associated with the disputed payment. Null if the membersh + # + # @param merchant_appealed [Boolean] Whether the merchant has filed an appeal after the initial resolution decision. + # + # @param merchant_response_actions [Array] The list of actions currently available to the merchant. + # + # @param payment [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment] The payment record that is the subject of this resolution case. + # + # @param platform_response_actions [Array] The list of actions currently available to the Whop platform for moderating this + # + # @param resolution_events [Array] The most recent 50 messages, actions, and status changes that have occurred duri + # + # @param status [Symbol, WhopSDK::Models::ResolutionCenterCaseStatus] The current status of the resolution case, indicating which party needs to respo + # + # @param updated_at [Time] The datetime the resolution was last updated. + # + # @param user [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User] The customer (buyer) who filed this resolution case. + + # @see WhopSDK::Models::ResolutionCenterCaseRetrieveResponse#company + class Company < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the company. + # + # @return [String] + required :id, String + + # @!attribute title + # The display name of the company shown to customers. + # + # @return [String] + required :title, String + + # @!method initialize(id:, title:) + # The company involved in this resolution case. Null if the company no longer + # exists. + # + # @param id [String] The unique identifier for the company. + # + # @param title [String] The display name of the company shown to customers. + end + + # @see WhopSDK::Models::ResolutionCenterCaseRetrieveResponse#member + class Member < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the extra public member. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # The membership record associated with the disputed payment. Null if the + # membership no longer exists. + # + # @param id [String] The unique identifier for the extra public member. + end + + # @see WhopSDK::Models::ResolutionCenterCaseRetrieveResponse#payment + class Payment < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the payment. + # + # @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 paid_at + # The time at which this payment was successfully collected. Null if the payment + # has not yet succeeded. As a Unix timestamp. + # + # @return [Time, nil] + required :paid_at, Time, nil?: true + + # @!attribute subtotal + # The payment amount before taxes and discounts are applied. In the currency + # specified by the currency field. + # + # @return [Float, nil] + required :subtotal, Float, nil?: true + + # @!attribute total + # The total amount charged to the customer for this payment, including taxes and + # after any discounts. In the currency specified by the currency field. + # + # @return [Float] + required :total, Float + + # @!method initialize(id:, created_at:, currency:, paid_at:, subtotal:, total:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment} for more + # details. + # + # The payment record that is the subject of this resolution case. + # + # @param id [String] The unique identifier for the payment. + # + # @param created_at [Time] The datetime the payment was created. + # + # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # + # @param paid_at [Time, nil] The time at which this payment was successfully collected. Null if the payment h + # + # @param subtotal [Float, nil] The payment amount before taxes and discounts are applied. In the currency speci + # + # @param total [Float] The total amount charged to the customer for this payment, including taxes and a + end + + class ResolutionEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the resolution event. + # + # @return [String] + required :id, String + + # @!attribute action + # The type of action recorded in this event. + # + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action] + required :action, + enum: -> { WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action } + + # @!attribute created_at + # The datetime the resolution event was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute details + # The message body or additional context provided with this resolution event. Null + # if no details were included. + # + # @return [String, nil] + required :details, String, nil?: true + + # @!attribute reporter_type + # The party who performed this action. + # + # @return [Symbol, WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType] + required :reporter_type, + enum: -> { WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType } + + # @!method initialize(id:, action:, created_at:, details:, reporter_type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent} for + # more details. + # + # A resolution event is a message or action within a resolution case, such as a + # response, escalation, or status change. + # + # @param id [String] The unique identifier for the resolution event. + # + # @param action [Symbol, WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action] The type of action recorded in this event. + # + # @param created_at [Time] The datetime the resolution event was created. + # + # @param details [String, nil] The message body or additional context provided with this resolution event. Null + # + # @param reporter_type [Symbol, WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType] The party who performed this action. + + # The type of action recorded in this event. + # + # @see WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent#action + module Action + extend WhopSDK::Internal::Type::Enum + + CREATED = :created + RESPONDED = :responded + ACCEPTED = :accepted + DENIED = :denied + APPEALED = :appealed + WITHDREW = :withdrew + REQUESTED_MORE_INFO = :requested_more_info + ESCALATED = :escalated + DISPUTE_OPENED = :dispute_opened + DISPUTE_CUSTOMER_WON = :dispute_customer_won + DISPUTE_MERCHANT_WON = :dispute_merchant_won + + # @!method self.values + # @return [Array] + end + + # The party who performed this action. + # + # @see WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent#reporter_type + module ReporterType + extend WhopSDK::Internal::Type::Enum + + MERCHANT = :merchant + CUSTOMER = :customer + PLATFORM = :platform + SYSTEM = :system + + # @!method self.values + # @return [Array] + end + end + + # @see WhopSDK::Models::ResolutionCenterCaseRetrieveResponse#user + class User < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the user. + # + # @return [String] + required :id, String + + # @!attribute name + # The user's display name shown on their public profile. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute username + # The user's unique username shown on their public profile. + # + # @return [String] + required :username, String + + # @!method initialize(id:, name:, username:) + # The customer (buyer) who filed this resolution case. + # + # @param id [String] The unique identifier for the user. + # + # @param name [String, nil] The user's display name shown on their public profile. + # + # @param username [String] The user's unique username shown on their public profile. + end + end + end +end diff --git a/lib/whop_sdk/models/resolution_center_case_status.rb b/lib/whop_sdk/models/resolution_center_case_status.rb new file mode 100644 index 00000000..d6dcef78 --- /dev/null +++ b/lib/whop_sdk/models/resolution_center_case_status.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The statuses a resolution object can have + module ResolutionCenterCaseStatus + extend WhopSDK::Internal::Type::Enum + + MERCHANT_RESPONSE_NEEDED = :merchant_response_needed + CUSTOMER_RESPONSE_NEEDED = :customer_response_needed + MERCHANT_INFO_NEEDED = :merchant_info_needed + CUSTOMER_INFO_NEEDED = :customer_info_needed + UNDER_PLATFORM_REVIEW = :under_platform_review + CUSTOMER_WON = :customer_won + MERCHANT_WON = :merchant_won + CUSTOMER_WITHDREW = :customer_withdrew + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/resources/authorized_users.rb b/lib/whop_sdk/resources/authorized_users.rb index 3bf65d89..838e6ca6 100644 --- a/lib/whop_sdk/resources/authorized_users.rb +++ b/lib/whop_sdk/resources/authorized_users.rb @@ -26,7 +26,7 @@ class AuthorizedUsers # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Models::AuthorizedUserCreateResponse] + # @return [WhopSDK::Models::AuthorizedUser] # # @see WhopSDK::Models::AuthorizedUserCreateParams def create(params) @@ -35,7 +35,7 @@ def create(params) method: :post, path: "authorized_users", body: parsed, - model: WhopSDK::Models::AuthorizedUserCreateResponse, + model: WhopSDK::AuthorizedUser, options: options ) end @@ -53,14 +53,14 @@ def create(params) # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Models::AuthorizedUserRetrieveResponse] + # @return [WhopSDK::Models::AuthorizedUser] # # @see WhopSDK::Models::AuthorizedUserRetrieveParams def retrieve(id, params = {}) @client.request( method: :get, path: ["authorized_users/%1$s", id], - model: WhopSDK::Models::AuthorizedUserRetrieveResponse, + model: WhopSDK::AuthorizedUser, options: params[:request_options] ) end diff --git a/lib/whop_sdk/resources/resolution_center_cases.rb b/lib/whop_sdk/resources/resolution_center_cases.rb new file mode 100644 index 00000000..110f38fb --- /dev/null +++ b/lib/whop_sdk/resources/resolution_center_cases.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # Resolution center cases + class ResolutionCenterCases + # Retrieves the details of an existing resolution center case. + # + # Required permissions: + # + # - `payment:resolution_center_case:read` + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] The unique identifier of the resolution center case. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::ResolutionCenterCaseRetrieveResponse] + # + # @see WhopSDK::Models::ResolutionCenterCaseRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["resolution_center_cases/%1$s", id], + model: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse, + options: params[:request_options] + ) + end + + # Returns a paginated list of resolution center cases, with optional filtering by + # company, status, and creation date. + # + # Required permissions: + # + # - `payment:resolution_center_case:read` + # + # @overload list(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, statuses: 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 unique identifier of the company to list resolution center cases for. + # + # @param created_after [Time, nil] Only return cases created after this timestamp. + # + # @param created_before [Time, nil] Only return cases created before this timestamp. + # + # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # + # @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 statuses [Array, nil] Filter by resolution center case status. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::ResolutionCenterCaseListParams + def list(params = {}) + parsed, options = WhopSDK::ResolutionCenterCaseListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "resolution_center_cases", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::ResolutionCenterCaseListResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index 362c7a57..ee4fdfdc 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -224,6 +224,10 @@ module WhopSDK sig { returns(WhopSDK::Resources::DisputeAlerts) } attr_reader :dispute_alerts + # Resolution center cases + sig { returns(WhopSDK::Resources::ResolutionCenterCases) } + attr_reader :resolution_center_cases + # @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 2c5d5811..b7843b77 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -55,6 +55,8 @@ module WhopSDK AssessmentQuestionTypes = WhopSDK::Models::AssessmentQuestionTypes + AuthorizedUser = WhopSDK::Models::AuthorizedUser + AuthorizedUserCreateParams = WhopSDK::Models::AuthorizedUserCreateParams AuthorizedUserDeleteParams = WhopSDK::Models::AuthorizedUserDeleteParams @@ -529,6 +531,25 @@ module WhopSDK ReleaseMethod = WhopSDK::Models::ReleaseMethod + ResolutionCenterCaseCustomerResponse = + WhopSDK::Models::ResolutionCenterCaseCustomerResponse + + ResolutionCenterCaseIssueType = WhopSDK::Models::ResolutionCenterCaseIssueType + + ResolutionCenterCaseListParams = + WhopSDK::Models::ResolutionCenterCaseListParams + + ResolutionCenterCaseMerchantResponse = + WhopSDK::Models::ResolutionCenterCaseMerchantResponse + + ResolutionCenterCasePlatformResponse = + WhopSDK::Models::ResolutionCenterCasePlatformResponse + + ResolutionCenterCaseRetrieveParams = + WhopSDK::Models::ResolutionCenterCaseRetrieveParams + + ResolutionCenterCaseStatus = WhopSDK::Models::ResolutionCenterCaseStatus + ReviewListParams = WhopSDK::Models::ReviewListParams ReviewRetrieveParams = WhopSDK::Models::ReviewRetrieveParams diff --git a/rbi/whop_sdk/models/authorized_user_create_response.rbi b/rbi/whop_sdk/models/authorized_user.rbi similarity index 75% rename from rbi/whop_sdk/models/authorized_user_create_response.rbi rename to rbi/whop_sdk/models/authorized_user.rbi index 76638486..cea07ff7 100644 --- a/rbi/whop_sdk/models/authorized_user_create_response.rbi +++ b/rbi/whop_sdk/models/authorized_user.rbi @@ -2,13 +2,10 @@ module WhopSDK module Models - class AuthorizedUserCreateResponse < WhopSDK::Internal::Type::BaseModel + class AuthorizedUser < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - WhopSDK::Models::AuthorizedUserCreateResponse, - WhopSDK::Internal::AnyHash - ) + T.any(WhopSDK::AuthorizedUser, WhopSDK::Internal::AnyHash) end # The unique identifier for the authorized user. @@ -16,15 +13,10 @@ module WhopSDK attr_accessor :id # The company this authorized user has access to. - sig { returns(WhopSDK::Models::AuthorizedUserCreateResponse::Company) } + sig { returns(WhopSDK::AuthorizedUser::Company) } attr_reader :company - sig do - params( - company: - WhopSDK::Models::AuthorizedUserCreateResponse::Company::OrHash - ).void - end + sig { params(company: WhopSDK::AuthorizedUser::Company::OrHash).void } attr_writer :company # The permission role assigned to this authorized user within the company. @@ -32,14 +24,10 @@ module WhopSDK attr_accessor :role # The user account linked to this authorized user record. - sig { returns(WhopSDK::Models::AuthorizedUserCreateResponse::User) } + sig { returns(WhopSDK::AuthorizedUser::User) } attr_reader :user - sig do - params( - user: WhopSDK::Models::AuthorizedUserCreateResponse::User::OrHash - ).void - end + sig { params(user: WhopSDK::AuthorizedUser::User::OrHash).void } attr_writer :user # A user who has been granted administrative access to manage a company's @@ -47,10 +35,9 @@ module WhopSDK sig do params( id: String, - company: - WhopSDK::Models::AuthorizedUserCreateResponse::Company::OrHash, + company: WhopSDK::AuthorizedUser::Company::OrHash, role: WhopSDK::AuthorizedUserRoles::OrSymbol, - user: WhopSDK::Models::AuthorizedUserCreateResponse::User::OrHash + user: WhopSDK::AuthorizedUser::User::OrHash ).returns(T.attached_class) end def self.new( @@ -69,9 +56,9 @@ module WhopSDK override.returns( { id: String, - company: WhopSDK::Models::AuthorizedUserCreateResponse::Company, + company: WhopSDK::AuthorizedUser::Company, role: WhopSDK::AuthorizedUserRoles::TaggedSymbol, - user: WhopSDK::Models::AuthorizedUserCreateResponse::User + user: WhopSDK::AuthorizedUser::User } ) end @@ -81,10 +68,7 @@ module WhopSDK class Company < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - WhopSDK::Models::AuthorizedUserCreateResponse::Company, - WhopSDK::Internal::AnyHash - ) + T.any(WhopSDK::AuthorizedUser::Company, WhopSDK::Internal::AnyHash) end # The unique identifier for the company. @@ -113,10 +97,7 @@ module WhopSDK class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - WhopSDK::Models::AuthorizedUserCreateResponse::User, - WhopSDK::Internal::AnyHash - ) + T.any(WhopSDK::AuthorizedUser::User, WhopSDK::Internal::AnyHash) end # The unique identifier for the user. diff --git a/rbi/whop_sdk/models/authorized_user_retrieve_response.rbi b/rbi/whop_sdk/models/authorized_user_retrieve_response.rbi deleted file mode 100644 index aa0b011b..00000000 --- a/rbi/whop_sdk/models/authorized_user_retrieve_response.rbi +++ /dev/null @@ -1,176 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class AuthorizedUserRetrieveResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AuthorizedUserRetrieveResponse, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the authorized user. - sig { returns(String) } - attr_accessor :id - - # The company this authorized user has access to. - sig { returns(WhopSDK::Models::AuthorizedUserRetrieveResponse::Company) } - attr_reader :company - - sig do - params( - company: - WhopSDK::Models::AuthorizedUserRetrieveResponse::Company::OrHash - ).void - end - attr_writer :company - - # The permission role assigned to this authorized user within the company. - sig { returns(WhopSDK::AuthorizedUserRoles::TaggedSymbol) } - attr_accessor :role - - # The user account linked to this authorized user record. - sig { returns(WhopSDK::Models::AuthorizedUserRetrieveResponse::User) } - attr_reader :user - - sig do - params( - user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User::OrHash - ).void - end - attr_writer :user - - # A user who has been granted administrative access to manage a company's - # dashboard and settings. - sig do - params( - id: String, - company: - WhopSDK::Models::AuthorizedUserRetrieveResponse::Company::OrHash, - role: WhopSDK::AuthorizedUserRoles::OrSymbol, - user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User::OrHash - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the authorized user. - id:, - # The company this authorized user has access to. - company:, - # The permission role assigned to this authorized user within the company. - role:, - # The user account linked to this authorized user record. - user: - ) - end - - sig do - override.returns( - { - id: String, - company: WhopSDK::Models::AuthorizedUserRetrieveResponse::Company, - role: WhopSDK::AuthorizedUserRoles::TaggedSymbol, - user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User - } - ) - end - def to_hash - end - - class Company < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::AuthorizedUserRetrieveResponse::Company, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the company. - sig { returns(String) } - attr_accessor :id - - # The display name of the company shown to customers. - sig { returns(String) } - attr_accessor :title - - # The company this authorized user has access to. - sig { params(id: String, title: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the company. - id:, - # The display name of the company shown to customers. - 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::AuthorizedUserRetrieveResponse::User, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the user. - sig { returns(String) } - attr_accessor :id - - # The user's email address. Requires the member:email:read permission to access. - # Null if not authorized. - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The user's display name shown on their public profile. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The user's unique username shown on their public profile. - sig { returns(String) } - attr_accessor :username - - # The user account linked to this authorized user record. - sig do - params( - id: String, - email: T.nilable(String), - name: T.nilable(String), - username: String - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the user. - id:, - # The user's email address. Requires the member:email:read permission to access. - # Null if not authorized. - email:, - # The user's display name shown on their public profile. - name:, - # The user's unique username shown on their public profile. - 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/payment.rbi b/rbi/whop_sdk/models/payment.rbi index 306d76d1..558f9f7f 100644 --- a/rbi/whop_sdk/models/payment.rbi +++ b/rbi/whop_sdk/models/payment.rbi @@ -1324,7 +1324,7 @@ module WhopSDK sig do returns( T::Array[ - WhopSDK::Payment::Resolution::CustomerResponseAction::TaggedSymbol + WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol ] ) end @@ -1336,7 +1336,7 @@ module WhopSDK attr_accessor :due_date # The category of the dispute. - sig { returns(WhopSDK::Payment::Resolution::Issue::TaggedSymbol) } + sig { returns(WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol) } attr_accessor :issue # Whether the merchant has filed an appeal after the initial resolution decision. @@ -1347,7 +1347,7 @@ module WhopSDK sig do returns( T::Array[ - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol ] ) end @@ -1358,7 +1358,7 @@ module WhopSDK sig do returns( T::Array[ - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol ] ) end @@ -1366,7 +1366,7 @@ module WhopSDK # The current status of the resolution case, indicating which party needs to # respond or if the case is closed. - sig { returns(WhopSDK::Payment::Resolution::Status::TaggedSymbol) } + sig { returns(WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol) } attr_accessor :status # A resolution center case is a dispute or support case between a user and a @@ -1376,21 +1376,15 @@ module WhopSDK id: String, customer_appealed: T::Boolean, customer_response_actions: - T::Array[ - WhopSDK::Payment::Resolution::CustomerResponseAction::OrSymbol - ], + T::Array[WhopSDK::ResolutionCenterCaseCustomerResponse::OrSymbol], due_date: T.nilable(Time), - issue: WhopSDK::Payment::Resolution::Issue::OrSymbol, + issue: WhopSDK::ResolutionCenterCaseIssueType::OrSymbol, merchant_appealed: T::Boolean, merchant_response_actions: - T::Array[ - WhopSDK::Payment::Resolution::MerchantResponseAction::OrSymbol - ], + T::Array[WhopSDK::ResolutionCenterCaseMerchantResponse::OrSymbol], platform_response_actions: - T::Array[ - WhopSDK::Payment::Resolution::PlatformResponseAction::OrSymbol - ], - status: WhopSDK::Payment::Resolution::Status::OrSymbol + T::Array[WhopSDK::ResolutionCenterCasePlatformResponse::OrSymbol], + status: WhopSDK::ResolutionCenterCaseStatus::OrSymbol ).returns(T.attached_class) end def self.new( @@ -1425,267 +1419,25 @@ module WhopSDK customer_appealed: T::Boolean, customer_response_actions: T::Array[ - WhopSDK::Payment::Resolution::CustomerResponseAction::TaggedSymbol + WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol ], due_date: T.nilable(Time), - issue: WhopSDK::Payment::Resolution::Issue::TaggedSymbol, + issue: WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol, merchant_appealed: T::Boolean, merchant_response_actions: T::Array[ - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol ], platform_response_actions: T::Array[ - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol ], - status: WhopSDK::Payment::Resolution::Status::TaggedSymbol + status: WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol } ) end def to_hash end - - # The types of responses a customer can make to a resolution. - module CustomerResponseAction - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::Payment::Resolution::CustomerResponseAction - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - RESPOND = - T.let( - :respond, - WhopSDK::Payment::Resolution::CustomerResponseAction::TaggedSymbol - ) - APPEAL = - T.let( - :appeal, - WhopSDK::Payment::Resolution::CustomerResponseAction::TaggedSymbol - ) - WITHDRAW = - T.let( - :withdraw, - WhopSDK::Payment::Resolution::CustomerResponseAction::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Payment::Resolution::CustomerResponseAction::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The category of the dispute. - module Issue - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::Payment::Resolution::Issue) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - FORGOT_TO_CANCEL = - T.let( - :forgot_to_cancel, - WhopSDK::Payment::Resolution::Issue::TaggedSymbol - ) - ITEM_NOT_RECEIVED = - T.let( - :item_not_received, - WhopSDK::Payment::Resolution::Issue::TaggedSymbol - ) - SIGNIFICANTLY_NOT_AS_DESCRIBED = - T.let( - :significantly_not_as_described, - WhopSDK::Payment::Resolution::Issue::TaggedSymbol - ) - UNAUTHORIZED_TRANSACTION = - T.let( - :unauthorized_transaction, - WhopSDK::Payment::Resolution::Issue::TaggedSymbol - ) - PRODUCT_UNACCEPTABLE = - T.let( - :product_unacceptable, - WhopSDK::Payment::Resolution::Issue::TaggedSymbol - ) - - sig do - override.returns( - T::Array[WhopSDK::Payment::Resolution::Issue::TaggedSymbol] - ) - end - def self.values - end - end - - # The types of responses a merchant can make to a resolution. - module MerchantResponseAction - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::Payment::Resolution::MerchantResponseAction - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ACCEPT = - T.let( - :accept, - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol - ) - DENY = - T.let( - :deny, - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol - ) - REQUEST_MORE_INFO = - T.let( - :request_more_info, - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol - ) - APPEAL = - T.let( - :appeal, - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol - ) - RESPOND = - T.let( - :respond, - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Payment::Resolution::MerchantResponseAction::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The types of responses the platform can make to a resolution. - module PlatformResponseAction - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::Payment::Resolution::PlatformResponseAction - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REQUEST_BUYER_INFO = - T.let( - :request_buyer_info, - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol - ) - REQUEST_MERCHANT_INFO = - T.let( - :request_merchant_info, - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol - ) - MERCHANT_WINS = - T.let( - :merchant_wins, - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol - ) - PLATFORM_REFUND = - T.let( - :platform_refund, - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol - ) - MERCHANT_REFUND = - T.let( - :merchant_refund, - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Payment::Resolution::PlatformResponseAction::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The current status of the resolution case, indicating which party needs to - # respond or if the case is closed. - module Status - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, WhopSDK::Payment::Resolution::Status) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MERCHANT_RESPONSE_NEEDED = - T.let( - :merchant_response_needed, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - CUSTOMER_RESPONSE_NEEDED = - T.let( - :customer_response_needed, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - MERCHANT_INFO_NEEDED = - T.let( - :merchant_info_needed, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - CUSTOMER_INFO_NEEDED = - T.let( - :customer_info_needed, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - UNDER_PLATFORM_REVIEW = - T.let( - :under_platform_review, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - CUSTOMER_WON = - T.let( - :customer_won, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - MERCHANT_WON = - T.let( - :merchant_won, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - CUSTOMER_WITHDREW = - T.let( - :customer_withdrew, - WhopSDK::Payment::Resolution::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[WhopSDK::Payment::Resolution::Status::TaggedSymbol] - ) - end - def self.values - end - end end class User < WhopSDK::Internal::Type::BaseModel diff --git a/rbi/whop_sdk/models/resolution_center_case_customer_response.rbi b/rbi/whop_sdk/models/resolution_center_case_customer_response.rbi new file mode 100644 index 00000000..f9a339d8 --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_customer_response.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module WhopSDK + module Models + # The types of responses a customer can make to a resolution. + module ResolutionCenterCaseCustomerResponse + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::ResolutionCenterCaseCustomerResponse) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RESPOND = + T.let( + :respond, + WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol + ) + APPEAL = + T.let( + :appeal, + WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol + ) + WITHDRAW = + T.let( + :withdraw, + WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_issue_type.rbi b/rbi/whop_sdk/models/resolution_center_case_issue_type.rbi new file mode 100644 index 00000000..fb308aa1 --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_issue_type.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module WhopSDK + module Models + # The different types of issues a resolution can be + module ResolutionCenterCaseIssueType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::ResolutionCenterCaseIssueType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FORGOT_TO_CANCEL = + T.let( + :forgot_to_cancel, + WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol + ) + ITEM_NOT_RECEIVED = + T.let( + :item_not_received, + WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol + ) + SIGNIFICANTLY_NOT_AS_DESCRIBED = + T.let( + :significantly_not_as_described, + WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol + ) + UNAUTHORIZED_TRANSACTION = + T.let( + :unauthorized_transaction, + WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol + ) + PRODUCT_UNACCEPTABLE = + T.let( + :product_unacceptable, + WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_list_params.rbi b/rbi/whop_sdk/models/resolution_center_case_list_params.rbi new file mode 100644 index 00000000..74d79241 --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_list_params.rbi @@ -0,0 +1,118 @@ +# typed: strong + +module WhopSDK + module Models + class ResolutionCenterCaseListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::ResolutionCenterCaseListParams, + WhopSDK::Internal::AnyHash + ) + end + + # Returns the elements in the list that come after the specified cursor. + sig { returns(T.nilable(String)) } + attr_accessor :after + + # Returns the elements in the list that come before the specified cursor. + sig { returns(T.nilable(String)) } + attr_accessor :before + + # The unique identifier of the company to list resolution center cases for. + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Only return cases created after this timestamp. + sig { returns(T.nilable(Time)) } + attr_accessor :created_after + + # Only return cases created before this timestamp. + sig { returns(T.nilable(Time)) } + attr_accessor :created_before + + # The direction of the sort. + sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) } + attr_accessor :direction + + # 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 + + # Filter by resolution center case status. + sig do + returns( + T.nilable(T::Array[WhopSDK::ResolutionCenterCaseStatus::OrSymbol]) + ) + end + attr_accessor :statuses + + sig do + params( + 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), + statuses: + T.nilable(T::Array[WhopSDK::ResolutionCenterCaseStatus::OrSymbol]), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Returns the elements in the list that come after the specified cursor. + after: nil, + # Returns the elements in the list that come before the specified cursor. + before: nil, + # The unique identifier of the company to list resolution center cases for. + company_id: nil, + # Only return cases created after this timestamp. + created_after: nil, + # Only return cases created before this timestamp. + created_before: nil, + # The direction of the sort. + direction: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + # Filter by resolution center case status. + statuses: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + 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), + statuses: + T.nilable( + T::Array[WhopSDK::ResolutionCenterCaseStatus::OrSymbol] + ), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_list_response.rbi b/rbi/whop_sdk/models/resolution_center_case_list_response.rbi new file mode 100644 index 00000000..d6d0a754 --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_list_response.rbi @@ -0,0 +1,303 @@ +# typed: strong + +module WhopSDK + module Models + class ResolutionCenterCaseListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseListResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the resolution. + sig { returns(String) } + attr_accessor :id + + # The company involved in this resolution case. Null if the company no longer + # exists. + sig do + returns( + T.nilable(WhopSDK::Models::ResolutionCenterCaseListResponse::Company) + ) + end + attr_reader :company + + sig do + params( + company: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseListResponse::Company::OrHash + ) + ).void + end + attr_writer :company + + # The datetime the resolution was created. + sig { returns(Time) } + attr_accessor :created_at + + # Whether the customer has filed an appeal after the initial resolution decision. + sig { returns(T::Boolean) } + attr_accessor :customer_appealed + + # The list of actions currently available to the customer. + sig do + returns( + T::Array[WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol] + ) + end + attr_accessor :customer_response_actions + + # The deadline by which the next response is required. Null if no deadline is + # currently active. As a Unix timestamp. + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + # The category of the dispute. + sig { returns(WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol) } + attr_accessor :issue + + # Whether the merchant has filed an appeal after the initial resolution decision. + sig { returns(T::Boolean) } + attr_accessor :merchant_appealed + + # The list of actions currently available to the merchant. + sig do + returns( + T::Array[WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol] + ) + end + attr_accessor :merchant_response_actions + + # The payment record that is the subject of this resolution case. + sig do + returns(WhopSDK::Models::ResolutionCenterCaseListResponse::Payment) + end + attr_reader :payment + + sig do + params( + payment: + WhopSDK::Models::ResolutionCenterCaseListResponse::Payment::OrHash + ).void + end + attr_writer :payment + + # The current status of the resolution case, indicating which party needs to + # respond or if the case is closed. + sig { returns(WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol) } + attr_accessor :status + + # The datetime the resolution was last updated. + sig { returns(Time) } + attr_accessor :updated_at + + # The customer (buyer) who filed this resolution case. + sig { returns(WhopSDK::Models::ResolutionCenterCaseListResponse::User) } + attr_reader :user + + sig do + params( + user: WhopSDK::Models::ResolutionCenterCaseListResponse::User::OrHash + ).void + end + attr_writer :user + + # A resolution center case is a dispute or support case between a user and a + # company, tracking the issue, status, and outcome. + sig do + params( + id: String, + company: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseListResponse::Company::OrHash + ), + created_at: Time, + customer_appealed: T::Boolean, + customer_response_actions: + T::Array[WhopSDK::ResolutionCenterCaseCustomerResponse::OrSymbol], + due_date: T.nilable(Time), + issue: WhopSDK::ResolutionCenterCaseIssueType::OrSymbol, + merchant_appealed: T::Boolean, + merchant_response_actions: + T::Array[WhopSDK::ResolutionCenterCaseMerchantResponse::OrSymbol], + payment: + WhopSDK::Models::ResolutionCenterCaseListResponse::Payment::OrHash, + status: WhopSDK::ResolutionCenterCaseStatus::OrSymbol, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseListResponse::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the resolution. + id:, + # The company involved in this resolution case. Null if the company no longer + # exists. + company:, + # The datetime the resolution was created. + created_at:, + # Whether the customer has filed an appeal after the initial resolution decision. + customer_appealed:, + # The list of actions currently available to the customer. + customer_response_actions:, + # The deadline by which the next response is required. Null if no deadline is + # currently active. As a Unix timestamp. + due_date:, + # The category of the dispute. + issue:, + # Whether the merchant has filed an appeal after the initial resolution decision. + merchant_appealed:, + # The list of actions currently available to the merchant. + merchant_response_actions:, + # The payment record that is the subject of this resolution case. + payment:, + # The current status of the resolution case, indicating which party needs to + # respond or if the case is closed. + status:, + # The datetime the resolution was last updated. + updated_at:, + # The customer (buyer) who filed this resolution case. + user: + ) + end + + sig do + override.returns( + { + id: String, + company: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseListResponse::Company + ), + created_at: Time, + customer_appealed: T::Boolean, + customer_response_actions: + T::Array[ + WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol + ], + due_date: T.nilable(Time), + issue: WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol, + merchant_appealed: T::Boolean, + merchant_response_actions: + T::Array[ + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol + ], + payment: WhopSDK::Models::ResolutionCenterCaseListResponse::Payment, + status: WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseListResponse::User + } + ) + end + def to_hash + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseListResponse::Company, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the company. + sig { returns(String) } + attr_accessor :id + + # The display name of the company shown to customers. + sig { returns(String) } + attr_accessor :title + + # The company involved in this resolution case. Null if the company no longer + # exists. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # The unique identifier for the company. + id:, + # The display name of the company shown to customers. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class Payment < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseListResponse::Payment, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the payment. + sig { returns(String) } + attr_accessor :id + + # The payment record that is the subject of this resolution case. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The unique identifier for the payment. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseListResponse::User, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the user. + sig { returns(String) } + attr_accessor :id + + # The user's display name shown on their public profile. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's unique username shown on their public profile. + sig { returns(String) } + attr_accessor :username + + # The customer (buyer) who filed this resolution case. + sig do + params(id: String, name: T.nilable(String), username: String).returns( + T.attached_class + ) + end + def self.new( + # The unique identifier for the user. + id:, + # The user's display name shown on their public profile. + name:, + # The user's unique username shown on their public profile. + username: + ) + end + + sig do + override.returns( + { id: String, name: T.nilable(String), username: String } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_merchant_response.rbi b/rbi/whop_sdk/models/resolution_center_case_merchant_response.rbi new file mode 100644 index 00000000..294d4198 --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_merchant_response.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module WhopSDK + module Models + # The types of responses a merchant can make to a resolution. + module ResolutionCenterCaseMerchantResponse + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::ResolutionCenterCaseMerchantResponse) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPT = + T.let( + :accept, + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol + ) + DENY = + T.let( + :deny, + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol + ) + REQUEST_MORE_INFO = + T.let( + :request_more_info, + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol + ) + APPEAL = + T.let( + :appeal, + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol + ) + RESPOND = + T.let( + :respond, + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_platform_response.rbi b/rbi/whop_sdk/models/resolution_center_case_platform_response.rbi new file mode 100644 index 00000000..b71f7ef0 --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_platform_response.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module WhopSDK + module Models + # The types of responses the platform can make to a resolution. + module ResolutionCenterCasePlatformResponse + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::ResolutionCenterCasePlatformResponse) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUEST_BUYER_INFO = + T.let( + :request_buyer_info, + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol + ) + REQUEST_MERCHANT_INFO = + T.let( + :request_merchant_info, + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol + ) + MERCHANT_WINS = + T.let( + :merchant_wins, + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol + ) + PLATFORM_REFUND = + T.let( + :platform_refund, + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol + ) + MERCHANT_REFUND = + T.let( + :merchant_refund, + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_retrieve_params.rbi b/rbi/whop_sdk/models/resolution_center_case_retrieve_params.rbi new file mode 100644 index 00000000..7df1d0b7 --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module WhopSDK + module Models + class ResolutionCenterCaseRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::ResolutionCenterCaseRetrieveParams, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_retrieve_response.rbi b/rbi/whop_sdk/models/resolution_center_case_retrieve_response.rbi new file mode 100644 index 00000000..8d4c7ceb --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_retrieve_response.rbi @@ -0,0 +1,673 @@ +# typed: strong + +module WhopSDK + module Models + class ResolutionCenterCaseRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the resolution. + sig { returns(String) } + attr_accessor :id + + # The company involved in this resolution case. Null if the company no longer + # exists. + sig do + returns( + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company + ) + ) + end + attr_reader :company + + sig do + params( + company: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company::OrHash + ) + ).void + end + attr_writer :company + + # The datetime the resolution was created. + sig { returns(Time) } + attr_accessor :created_at + + # Whether the customer has filed an appeal after the initial resolution decision. + sig { returns(T::Boolean) } + attr_accessor :customer_appealed + + # The list of actions currently available to the customer. + sig do + returns( + T::Array[WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol] + ) + end + attr_accessor :customer_response_actions + + # The deadline by which the next response is required. Null if no deadline is + # currently active. As a Unix timestamp. + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + # The category of the dispute. + sig { returns(WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol) } + attr_accessor :issue + + # The membership record associated with the disputed payment. Null if the + # membership no longer exists. + sig do + returns( + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member + ) + ) + end + attr_reader :member + + sig do + params( + member: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member::OrHash + ) + ).void + end + attr_writer :member + + # Whether the merchant has filed an appeal after the initial resolution decision. + sig { returns(T::Boolean) } + attr_accessor :merchant_appealed + + # The list of actions currently available to the merchant. + sig do + returns( + T::Array[WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol] + ) + end + attr_accessor :merchant_response_actions + + # The payment record that is the subject of this resolution case. + sig do + returns(WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment) + end + attr_reader :payment + + sig do + params( + payment: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment::OrHash + ).void + end + attr_writer :payment + + # The list of actions currently available to the Whop platform for moderating this + # resolution. + sig do + returns( + T::Array[WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol] + ) + end + attr_accessor :platform_response_actions + + # The most recent 50 messages, actions, and status changes that have occurred + # during this resolution case. + sig do + returns( + T::Array[ + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent + ] + ) + end + attr_accessor :resolution_events + + # The current status of the resolution case, indicating which party needs to + # respond or if the case is closed. + sig { returns(WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol) } + attr_accessor :status + + # The datetime the resolution was last updated. + sig { returns(Time) } + attr_accessor :updated_at + + # The customer (buyer) who filed this resolution case. + sig do + returns(WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User) + end + attr_reader :user + + sig do + params( + user: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User::OrHash + ).void + end + attr_writer :user + + # A resolution center case is a dispute or support case between a user and a + # company, tracking the issue, status, and outcome. + sig do + params( + id: String, + company: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company::OrHash + ), + created_at: Time, + customer_appealed: T::Boolean, + customer_response_actions: + T::Array[WhopSDK::ResolutionCenterCaseCustomerResponse::OrSymbol], + due_date: T.nilable(Time), + issue: WhopSDK::ResolutionCenterCaseIssueType::OrSymbol, + member: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member::OrHash + ), + merchant_appealed: T::Boolean, + merchant_response_actions: + T::Array[WhopSDK::ResolutionCenterCaseMerchantResponse::OrSymbol], + payment: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment::OrHash, + platform_response_actions: + T::Array[WhopSDK::ResolutionCenterCasePlatformResponse::OrSymbol], + resolution_events: + T::Array[ + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::OrHash + ], + status: WhopSDK::ResolutionCenterCaseStatus::OrSymbol, + updated_at: Time, + user: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the resolution. + id:, + # The company involved in this resolution case. Null if the company no longer + # exists. + company:, + # The datetime the resolution was created. + created_at:, + # Whether the customer has filed an appeal after the initial resolution decision. + customer_appealed:, + # The list of actions currently available to the customer. + customer_response_actions:, + # The deadline by which the next response is required. Null if no deadline is + # currently active. As a Unix timestamp. + due_date:, + # The category of the dispute. + issue:, + # The membership record associated with the disputed payment. Null if the + # membership no longer exists. + member:, + # Whether the merchant has filed an appeal after the initial resolution decision. + merchant_appealed:, + # The list of actions currently available to the merchant. + merchant_response_actions:, + # The payment record that is the subject of this resolution case. + payment:, + # The list of actions currently available to the Whop platform for moderating this + # resolution. + platform_response_actions:, + # The most recent 50 messages, actions, and status changes that have occurred + # during this resolution case. + resolution_events:, + # The current status of the resolution case, indicating which party needs to + # respond or if the case is closed. + status:, + # The datetime the resolution was last updated. + updated_at:, + # The customer (buyer) who filed this resolution case. + user: + ) + end + + sig do + override.returns( + { + id: String, + company: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company + ), + created_at: Time, + customer_appealed: T::Boolean, + customer_response_actions: + T::Array[ + WhopSDK::ResolutionCenterCaseCustomerResponse::TaggedSymbol + ], + due_date: T.nilable(Time), + issue: WhopSDK::ResolutionCenterCaseIssueType::TaggedSymbol, + member: + T.nilable( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member + ), + merchant_appealed: T::Boolean, + merchant_response_actions: + T::Array[ + WhopSDK::ResolutionCenterCaseMerchantResponse::TaggedSymbol + ], + payment: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment, + platform_response_actions: + T::Array[ + WhopSDK::ResolutionCenterCasePlatformResponse::TaggedSymbol + ], + resolution_events: + T::Array[ + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent + ], + status: WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User + } + ) + end + def to_hash + end + + class Company < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the company. + sig { returns(String) } + attr_accessor :id + + # The display name of the company shown to customers. + sig { returns(String) } + attr_accessor :title + + # The company involved in this resolution case. Null if the company no longer + # exists. + sig { params(id: String, title: String).returns(T.attached_class) } + def self.new( + # The unique identifier for the company. + id:, + # The display name of the company shown to customers. + title: + ) + end + + sig { override.returns({ id: String, title: String }) } + def to_hash + end + end + + class Member < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the extra public member. + sig { returns(String) } + attr_accessor :id + + # The membership record associated with the disputed payment. Null if the + # membership no longer exists. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The unique identifier for the extra public member. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + class Payment < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the payment. + 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 + + # The time at which this payment was successfully collected. Null if the payment + # has not yet succeeded. As a Unix timestamp. + sig { returns(T.nilable(Time)) } + attr_accessor :paid_at + + # The payment amount before taxes and discounts are applied. In the currency + # specified by the currency field. + sig { returns(T.nilable(Float)) } + attr_accessor :subtotal + + # The total amount charged to the customer for this payment, including taxes and + # after any discounts. In the currency specified by the currency field. + sig { returns(Float) } + attr_accessor :total + + # The payment record that is the subject of this resolution case. + sig do + params( + id: String, + created_at: Time, + currency: T.nilable(WhopSDK::Currency::OrSymbol), + paid_at: T.nilable(Time), + subtotal: T.nilable(Float), + total: Float + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the payment. + id:, + # The datetime the payment was created. + created_at:, + # The available currencies on the platform + currency:, + # The time at which this payment was successfully collected. Null if the payment + # has not yet succeeded. As a Unix timestamp. + paid_at:, + # The payment amount before taxes and discounts are applied. In the currency + # specified by the currency field. + subtotal:, + # The total amount charged to the customer for this payment, including taxes and + # after any discounts. In the currency specified by the currency field. + total: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + currency: T.nilable(WhopSDK::Currency::TaggedSymbol), + paid_at: T.nilable(Time), + subtotal: T.nilable(Float), + total: Float + } + ) + end + def to_hash + end + end + + class ResolutionEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the resolution event. + sig { returns(String) } + attr_accessor :id + + # The type of action recorded in this event. + sig do + returns( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + end + attr_accessor :action + + # The datetime the resolution event was created. + sig { returns(Time) } + attr_accessor :created_at + + # The message body or additional context provided with this resolution event. Null + # if no details were included. + sig { returns(T.nilable(String)) } + attr_accessor :details + + # The party who performed this action. + sig do + returns( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::TaggedSymbol + ) + end + attr_accessor :reporter_type + + # A resolution event is a message or action within a resolution case, such as a + # response, escalation, or status change. + sig do + params( + id: String, + action: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::OrSymbol, + created_at: Time, + details: T.nilable(String), + reporter_type: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the resolution event. + id:, + # The type of action recorded in this event. + action:, + # The datetime the resolution event was created. + created_at:, + # The message body or additional context provided with this resolution event. Null + # if no details were included. + details:, + # The party who performed this action. + reporter_type: + ) + end + + sig do + override.returns( + { + id: String, + action: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol, + created_at: Time, + details: T.nilable(String), + reporter_type: + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::TaggedSymbol + } + ) + end + def to_hash + end + + # The type of action recorded in this event. + module Action + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED = + T.let( + :created, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + RESPONDED = + T.let( + :responded, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + ACCEPTED = + T.let( + :accepted, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + DENIED = + T.let( + :denied, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + APPEALED = + T.let( + :appealed, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + WITHDREW = + T.let( + :withdrew, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + REQUESTED_MORE_INFO = + T.let( + :requested_more_info, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + ESCALATED = + T.let( + :escalated, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + DISPUTE_OPENED = + T.let( + :dispute_opened, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + DISPUTE_CUSTOMER_WON = + T.let( + :dispute_customer_won, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + DISPUTE_MERCHANT_WON = + T.let( + :dispute_merchant_won, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The party who performed this action. + module ReporterType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MERCHANT = + T.let( + :merchant, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::TaggedSymbol + ) + CUSTOMER = + T.let( + :customer, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::TaggedSymbol + ) + PLATFORM = + T.let( + :platform, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::ReporterType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class User < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the user. + sig { returns(String) } + attr_accessor :id + + # The user's display name shown on their public profile. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The user's unique username shown on their public profile. + sig { returns(String) } + attr_accessor :username + + # The customer (buyer) who filed this resolution case. + sig do + params(id: String, name: T.nilable(String), username: String).returns( + T.attached_class + ) + end + def self.new( + # The unique identifier for the user. + id:, + # The user's display name shown on their public profile. + name:, + # The user's unique username shown on their public profile. + username: + ) + end + + sig do + override.returns( + { id: String, name: T.nilable(String), username: String } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/resolution_center_case_status.rbi b/rbi/whop_sdk/models/resolution_center_case_status.rbi new file mode 100644 index 00000000..4a6b926d --- /dev/null +++ b/rbi/whop_sdk/models/resolution_center_case_status.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module WhopSDK + module Models + # The statuses a resolution object can have + module ResolutionCenterCaseStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::ResolutionCenterCaseStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MERCHANT_RESPONSE_NEEDED = + T.let( + :merchant_response_needed, + WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol + ) + CUSTOMER_RESPONSE_NEEDED = + T.let( + :customer_response_needed, + WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol + ) + MERCHANT_INFO_NEEDED = + T.let( + :merchant_info_needed, + WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol + ) + CUSTOMER_INFO_NEEDED = + T.let( + :customer_info_needed, + WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol + ) + UNDER_PLATFORM_REVIEW = + T.let( + :under_platform_review, + WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol + ) + CUSTOMER_WON = + T.let(:customer_won, WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol) + MERCHANT_WON = + T.let(:merchant_won, WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol) + CUSTOMER_WITHDREW = + T.let( + :customer_withdrew, + WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::ResolutionCenterCaseStatus::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/resources/authorized_users.rbi b/rbi/whop_sdk/resources/authorized_users.rbi index d091bf4c..881b4bf2 100644 --- a/rbi/whop_sdk/resources/authorized_users.rbi +++ b/rbi/whop_sdk/resources/authorized_users.rbi @@ -17,7 +17,7 @@ module WhopSDK user_id: String, send_emails: T.nilable(T::Boolean), request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::AuthorizedUserCreateResponse) + ).returns(WhopSDK::AuthorizedUser) end def create( # The ID of the company to add the authorized user to. @@ -43,7 +43,7 @@ module WhopSDK params( id: String, request_options: WhopSDK::RequestOptions::OrHash - ).returns(WhopSDK::Models::AuthorizedUserRetrieveResponse) + ).returns(WhopSDK::AuthorizedUser) end def retrieve( # The unique identifier of the authorized user to retrieve. diff --git a/rbi/whop_sdk/resources/resolution_center_cases.rbi b/rbi/whop_sdk/resources/resolution_center_cases.rbi new file mode 100644 index 00000000..abd270fa --- /dev/null +++ b/rbi/whop_sdk/resources/resolution_center_cases.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module WhopSDK + module Resources + # Resolution center cases + class ResolutionCenterCases + # Retrieves the details of an existing resolution center case. + # + # Required permissions: + # + # - `payment:resolution_center_case:read` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::ResolutionCenterCaseRetrieveResponse) + end + def retrieve( + # The unique identifier of the resolution center case. + id, + request_options: {} + ) + end + + # Returns a paginated list of resolution center cases, with optional filtering by + # company, status, and creation date. + # + # Required permissions: + # + # - `payment:resolution_center_case:read` + sig do + params( + 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), + statuses: + T.nilable(T::Array[WhopSDK::ResolutionCenterCaseStatus::OrSymbol]), + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[ + WhopSDK::Models::ResolutionCenterCaseListResponse + ] + ) + end + def list( + # Returns the elements in the list that come after the specified cursor. + after: nil, + # Returns the elements in the list that come before the specified cursor. + before: nil, + # The unique identifier of the company to list resolution center cases for. + company_id: nil, + # Only return cases created after this timestamp. + created_after: nil, + # Only return cases created before this timestamp. + created_before: nil, + # The direction of the sort. + direction: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + # Filter by resolution center case status. + statuses: 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/sig/whop_sdk/client.rbs b/sig/whop_sdk/client.rbs index eeac2604..4611d31c 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -114,6 +114,8 @@ module WhopSDK attr_reader dispute_alerts: WhopSDK::Resources::DisputeAlerts + attr_reader resolution_center_cases: WhopSDK::Resources::ResolutionCenterCases + private def auth_headers: -> ::Hash[String, String] def initialize: ( diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 54bb4fbf..14daf3c6 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -53,6 +53,8 @@ module WhopSDK module AssessmentQuestionTypes = WhopSDK::Models::AssessmentQuestionTypes + class AuthorizedUser = WhopSDK::Models::AuthorizedUser + class AuthorizedUserCreateParams = WhopSDK::Models::AuthorizedUserCreateParams class AuthorizedUserDeleteParams = WhopSDK::Models::AuthorizedUserDeleteParams @@ -509,6 +511,20 @@ module WhopSDK module ReleaseMethod = WhopSDK::Models::ReleaseMethod + module ResolutionCenterCaseCustomerResponse = WhopSDK::Models::ResolutionCenterCaseCustomerResponse + + module ResolutionCenterCaseIssueType = WhopSDK::Models::ResolutionCenterCaseIssueType + + class ResolutionCenterCaseListParams = WhopSDK::Models::ResolutionCenterCaseListParams + + module ResolutionCenterCaseMerchantResponse = WhopSDK::Models::ResolutionCenterCaseMerchantResponse + + module ResolutionCenterCasePlatformResponse = WhopSDK::Models::ResolutionCenterCasePlatformResponse + + class ResolutionCenterCaseRetrieveParams = WhopSDK::Models::ResolutionCenterCaseRetrieveParams + + module ResolutionCenterCaseStatus = WhopSDK::Models::ResolutionCenterCaseStatus + class ReviewListParams = WhopSDK::Models::ReviewListParams class ReviewRetrieveParams = WhopSDK::Models::ReviewRetrieveParams diff --git a/sig/whop_sdk/models/authorized_user_create_response.rbs b/sig/whop_sdk/models/authorized_user.rbs similarity index 65% rename from sig/whop_sdk/models/authorized_user_create_response.rbs rename to sig/whop_sdk/models/authorized_user.rbs index 6791ee18..d3e4031b 100644 --- a/sig/whop_sdk/models/authorized_user_create_response.rbs +++ b/sig/whop_sdk/models/authorized_user.rbs @@ -1,34 +1,34 @@ module WhopSDK module Models - type authorized_user_create_response = + type authorized_user = { id: String, - company: WhopSDK::Models::AuthorizedUserCreateResponse::Company, + company: WhopSDK::AuthorizedUser::Company, role: WhopSDK::Models::authorized_user_roles, - user: WhopSDK::Models::AuthorizedUserCreateResponse::User + user: WhopSDK::AuthorizedUser::User } - class AuthorizedUserCreateResponse < WhopSDK::Internal::Type::BaseModel + class AuthorizedUser < WhopSDK::Internal::Type::BaseModel attr_accessor id: String - attr_accessor company: WhopSDK::Models::AuthorizedUserCreateResponse::Company + attr_accessor company: WhopSDK::AuthorizedUser::Company attr_accessor role: WhopSDK::Models::authorized_user_roles - attr_accessor user: WhopSDK::Models::AuthorizedUserCreateResponse::User + attr_accessor user: WhopSDK::AuthorizedUser::User def initialize: ( id: String, - company: WhopSDK::Models::AuthorizedUserCreateResponse::Company, + company: WhopSDK::AuthorizedUser::Company, role: WhopSDK::Models::authorized_user_roles, - user: WhopSDK::Models::AuthorizedUserCreateResponse::User + user: WhopSDK::AuthorizedUser::User ) -> void def to_hash: -> { id: String, - company: WhopSDK::Models::AuthorizedUserCreateResponse::Company, + company: WhopSDK::AuthorizedUser::Company, role: WhopSDK::Models::authorized_user_roles, - user: WhopSDK::Models::AuthorizedUserCreateResponse::User + user: WhopSDK::AuthorizedUser::User } type company = { id: String, title: String } diff --git a/sig/whop_sdk/models/authorized_user_retrieve_response.rbs b/sig/whop_sdk/models/authorized_user_retrieve_response.rbs deleted file mode 100644 index b944c226..00000000 --- a/sig/whop_sdk/models/authorized_user_retrieve_response.rbs +++ /dev/null @@ -1,74 +0,0 @@ -module WhopSDK - module Models - type authorized_user_retrieve_response = - { - id: String, - company: WhopSDK::Models::AuthorizedUserRetrieveResponse::Company, - role: WhopSDK::Models::authorized_user_roles, - user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User - } - - class AuthorizedUserRetrieveResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor company: WhopSDK::Models::AuthorizedUserRetrieveResponse::Company - - attr_accessor role: WhopSDK::Models::authorized_user_roles - - attr_accessor user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User - - def initialize: ( - id: String, - company: WhopSDK::Models::AuthorizedUserRetrieveResponse::Company, - role: WhopSDK::Models::authorized_user_roles, - user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User - ) -> void - - def to_hash: -> { - id: String, - company: WhopSDK::Models::AuthorizedUserRetrieveResponse::Company, - role: WhopSDK::Models::authorized_user_roles, - user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User - } - - type company = { id: String, title: String } - - class Company < 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/payment.rbs b/sig/whop_sdk/models/payment.rbs index 54b86215..5b06118f 100644 --- a/sig/whop_sdk/models/payment.rbs +++ b/sig/whop_sdk/models/payment.rbs @@ -643,13 +643,13 @@ module WhopSDK { id: String, customer_appealed: bool, - customer_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::customer_response_action], + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], due_date: Time?, - issue: WhopSDK::Models::Payment::Resolution::issue, + issue: WhopSDK::Models::resolution_center_case_issue_type, merchant_appealed: bool, - merchant_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::merchant_response_action], - platform_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::platform_response_action], - status: WhopSDK::Models::Payment::Resolution::status + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response], + status: WhopSDK::Models::resolution_center_case_status } class Resolution < WhopSDK::Internal::Type::BaseModel @@ -657,133 +657,43 @@ module WhopSDK attr_accessor customer_appealed: bool - attr_accessor customer_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::customer_response_action] + attr_accessor customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response] attr_accessor due_date: Time? - attr_accessor issue: WhopSDK::Models::Payment::Resolution::issue + attr_accessor issue: WhopSDK::Models::resolution_center_case_issue_type attr_accessor merchant_appealed: bool - attr_accessor merchant_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::merchant_response_action] + attr_accessor merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response] - attr_accessor platform_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::platform_response_action] + attr_accessor platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response] - attr_accessor status: WhopSDK::Models::Payment::Resolution::status + attr_accessor status: WhopSDK::Models::resolution_center_case_status def initialize: ( id: String, customer_appealed: bool, - customer_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::customer_response_action], + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], due_date: Time?, - issue: WhopSDK::Models::Payment::Resolution::issue, + issue: WhopSDK::Models::resolution_center_case_issue_type, merchant_appealed: bool, - merchant_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::merchant_response_action], - platform_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::platform_response_action], - status: WhopSDK::Models::Payment::Resolution::status + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response], + status: WhopSDK::Models::resolution_center_case_status ) -> void def to_hash: -> { id: String, customer_appealed: bool, - customer_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::customer_response_action], + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], due_date: Time?, - issue: WhopSDK::Models::Payment::Resolution::issue, + issue: WhopSDK::Models::resolution_center_case_issue_type, merchant_appealed: bool, - merchant_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::merchant_response_action], - platform_response_actions: ::Array[WhopSDK::Models::Payment::Resolution::platform_response_action], - status: WhopSDK::Models::Payment::Resolution::status + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response], + status: WhopSDK::Models::resolution_center_case_status } - - type customer_response_action = :respond | :appeal | :withdraw - - module CustomerResponseAction - extend WhopSDK::Internal::Type::Enum - - RESPOND: :respond - APPEAL: :appeal - WITHDRAW: :withdraw - - def self?.values: -> ::Array[WhopSDK::Models::Payment::Resolution::customer_response_action] - end - - type issue = - :forgot_to_cancel - | :item_not_received - | :significantly_not_as_described - | :unauthorized_transaction - | :product_unacceptable - - module Issue - extend WhopSDK::Internal::Type::Enum - - FORGOT_TO_CANCEL: :forgot_to_cancel - ITEM_NOT_RECEIVED: :item_not_received - SIGNIFICANTLY_NOT_AS_DESCRIBED: :significantly_not_as_described - UNAUTHORIZED_TRANSACTION: :unauthorized_transaction - PRODUCT_UNACCEPTABLE: :product_unacceptable - - def self?.values: -> ::Array[WhopSDK::Models::Payment::Resolution::issue] - end - - type merchant_response_action = - :accept | :deny | :request_more_info | :appeal | :respond - - module MerchantResponseAction - extend WhopSDK::Internal::Type::Enum - - ACCEPT: :accept - DENY: :deny - REQUEST_MORE_INFO: :request_more_info - APPEAL: :appeal - RESPOND: :respond - - def self?.values: -> ::Array[WhopSDK::Models::Payment::Resolution::merchant_response_action] - end - - type platform_response_action = - :request_buyer_info - | :request_merchant_info - | :merchant_wins - | :platform_refund - | :merchant_refund - - module PlatformResponseAction - extend WhopSDK::Internal::Type::Enum - - REQUEST_BUYER_INFO: :request_buyer_info - REQUEST_MERCHANT_INFO: :request_merchant_info - MERCHANT_WINS: :merchant_wins - PLATFORM_REFUND: :platform_refund - MERCHANT_REFUND: :merchant_refund - - def self?.values: -> ::Array[WhopSDK::Models::Payment::Resolution::platform_response_action] - end - - type status = - :merchant_response_needed - | :customer_response_needed - | :merchant_info_needed - | :customer_info_needed - | :under_platform_review - | :customer_won - | :merchant_won - | :customer_withdrew - - module Status - extend WhopSDK::Internal::Type::Enum - - MERCHANT_RESPONSE_NEEDED: :merchant_response_needed - CUSTOMER_RESPONSE_NEEDED: :customer_response_needed - MERCHANT_INFO_NEEDED: :merchant_info_needed - CUSTOMER_INFO_NEEDED: :customer_info_needed - UNDER_PLATFORM_REVIEW: :under_platform_review - CUSTOMER_WON: :customer_won - MERCHANT_WON: :merchant_won - CUSTOMER_WITHDREW: :customer_withdrew - - def self?.values: -> ::Array[WhopSDK::Models::Payment::Resolution::status] - end end type user = diff --git a/sig/whop_sdk/models/resolution_center_case_customer_response.rbs b/sig/whop_sdk/models/resolution_center_case_customer_response.rbs new file mode 100644 index 00000000..a5e37cf1 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_customer_response.rbs @@ -0,0 +1,16 @@ +module WhopSDK + module Models + type resolution_center_case_customer_response = + :respond | :appeal | :withdraw + + module ResolutionCenterCaseCustomerResponse + extend WhopSDK::Internal::Type::Enum + + RESPOND: :respond + APPEAL: :appeal + WITHDRAW: :withdraw + + def self?.values: -> ::Array[WhopSDK::Models::resolution_center_case_customer_response] + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_issue_type.rbs b/sig/whop_sdk/models/resolution_center_case_issue_type.rbs new file mode 100644 index 00000000..dfcfd833 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_issue_type.rbs @@ -0,0 +1,22 @@ +module WhopSDK + module Models + type resolution_center_case_issue_type = + :forgot_to_cancel + | :item_not_received + | :significantly_not_as_described + | :unauthorized_transaction + | :product_unacceptable + + module ResolutionCenterCaseIssueType + extend WhopSDK::Internal::Type::Enum + + FORGOT_TO_CANCEL: :forgot_to_cancel + ITEM_NOT_RECEIVED: :item_not_received + SIGNIFICANTLY_NOT_AS_DESCRIBED: :significantly_not_as_described + UNAUTHORIZED_TRANSACTION: :unauthorized_transaction + PRODUCT_UNACCEPTABLE: :product_unacceptable + + def self?.values: -> ::Array[WhopSDK::Models::resolution_center_case_issue_type] + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_list_params.rbs b/sig/whop_sdk/models/resolution_center_case_list_params.rbs new file mode 100644 index 00000000..3dcf9a32 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_list_params.rbs @@ -0,0 +1,66 @@ +module WhopSDK + module Models + type resolution_center_case_list_params = + { + after: String?, + before: String?, + company_id: String?, + created_after: Time?, + created_before: Time?, + direction: WhopSDK::Models::direction?, + first: Integer?, + last: Integer?, + statuses: ::Array[WhopSDK::Models::resolution_center_case_status]? + } + & WhopSDK::Internal::Type::request_parameters + + class ResolutionCenterCaseListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor after: String? + + attr_accessor before: String? + + attr_accessor company_id: String? + + attr_accessor created_after: Time? + + attr_accessor created_before: Time? + + attr_accessor direction: WhopSDK::Models::direction? + + attr_accessor first: Integer? + + attr_accessor last: Integer? + + attr_accessor statuses: ::Array[WhopSDK::Models::resolution_center_case_status]? + + def initialize: ( + ?after: String?, + ?before: String?, + ?company_id: String?, + ?created_after: Time?, + ?created_before: Time?, + ?direction: WhopSDK::Models::direction?, + ?first: Integer?, + ?last: Integer?, + ?statuses: ::Array[WhopSDK::Models::resolution_center_case_status]?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + after: String?, + before: String?, + company_id: String?, + created_after: Time?, + created_before: Time?, + direction: WhopSDK::Models::direction?, + first: Integer?, + last: Integer?, + statuses: ::Array[WhopSDK::Models::resolution_center_case_status]?, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_list_response.rbs b/sig/whop_sdk/models/resolution_center_case_list_response.rbs new file mode 100644 index 00000000..9793a9b3 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_list_response.rbs @@ -0,0 +1,116 @@ +module WhopSDK + module Models + type resolution_center_case_list_response = + { + id: String, + company: WhopSDK::Models::ResolutionCenterCaseListResponse::Company?, + created_at: Time, + customer_appealed: bool, + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], + due_date: Time?, + issue: WhopSDK::Models::resolution_center_case_issue_type, + merchant_appealed: bool, + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + payment: WhopSDK::Models::ResolutionCenterCaseListResponse::Payment, + status: WhopSDK::Models::resolution_center_case_status, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseListResponse::User + } + + class ResolutionCenterCaseListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor company: WhopSDK::Models::ResolutionCenterCaseListResponse::Company? + + attr_accessor created_at: Time + + attr_accessor customer_appealed: bool + + attr_accessor customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response] + + attr_accessor due_date: Time? + + attr_accessor issue: WhopSDK::Models::resolution_center_case_issue_type + + attr_accessor merchant_appealed: bool + + attr_accessor merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response] + + attr_accessor payment: WhopSDK::Models::ResolutionCenterCaseListResponse::Payment + + attr_accessor status: WhopSDK::Models::resolution_center_case_status + + attr_accessor updated_at: Time + + attr_accessor user: WhopSDK::Models::ResolutionCenterCaseListResponse::User + + def initialize: ( + id: String, + company: WhopSDK::Models::ResolutionCenterCaseListResponse::Company?, + created_at: Time, + customer_appealed: bool, + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], + due_date: Time?, + issue: WhopSDK::Models::resolution_center_case_issue_type, + merchant_appealed: bool, + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + payment: WhopSDK::Models::ResolutionCenterCaseListResponse::Payment, + status: WhopSDK::Models::resolution_center_case_status, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseListResponse::User + ) -> void + + def to_hash: -> { + id: String, + company: WhopSDK::Models::ResolutionCenterCaseListResponse::Company?, + created_at: Time, + customer_appealed: bool, + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], + due_date: Time?, + issue: WhopSDK::Models::resolution_center_case_issue_type, + merchant_appealed: bool, + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + payment: WhopSDK::Models::ResolutionCenterCaseListResponse::Payment, + status: WhopSDK::Models::resolution_center_case_status, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseListResponse::User + } + + type company = { id: String, title: String } + + class Company < 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 payment = { id: String } + + class Payment < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type user = { id: String, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor username: String + + def initialize: (id: String, name: String?, username: String) -> void + + def to_hash: -> { id: String, name: String?, username: String } + end + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_merchant_response.rbs b/sig/whop_sdk/models/resolution_center_case_merchant_response.rbs new file mode 100644 index 00000000..f1324d02 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_merchant_response.rbs @@ -0,0 +1,18 @@ +module WhopSDK + module Models + type resolution_center_case_merchant_response = + :accept | :deny | :request_more_info | :appeal | :respond + + module ResolutionCenterCaseMerchantResponse + extend WhopSDK::Internal::Type::Enum + + ACCEPT: :accept + DENY: :deny + REQUEST_MORE_INFO: :request_more_info + APPEAL: :appeal + RESPOND: :respond + + def self?.values: -> ::Array[WhopSDK::Models::resolution_center_case_merchant_response] + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_platform_response.rbs b/sig/whop_sdk/models/resolution_center_case_platform_response.rbs new file mode 100644 index 00000000..05258ec4 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_platform_response.rbs @@ -0,0 +1,22 @@ +module WhopSDK + module Models + type resolution_center_case_platform_response = + :request_buyer_info + | :request_merchant_info + | :merchant_wins + | :platform_refund + | :merchant_refund + + module ResolutionCenterCasePlatformResponse + extend WhopSDK::Internal::Type::Enum + + REQUEST_BUYER_INFO: :request_buyer_info + REQUEST_MERCHANT_INFO: :request_merchant_info + MERCHANT_WINS: :merchant_wins + PLATFORM_REFUND: :platform_refund + MERCHANT_REFUND: :merchant_refund + + def self?.values: -> ::Array[WhopSDK::Models::resolution_center_case_platform_response] + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_retrieve_params.rbs b/sig/whop_sdk/models/resolution_center_case_retrieve_params.rbs new file mode 100644 index 00000000..f675e000 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_retrieve_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type resolution_center_case_retrieve_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class ResolutionCenterCaseRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_retrieve_response.rbs b/sig/whop_sdk/models/resolution_center_case_retrieve_response.rbs new file mode 100644 index 00000000..016f3bb4 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_retrieve_response.rbs @@ -0,0 +1,254 @@ +module WhopSDK + module Models + type resolution_center_case_retrieve_response = + { + id: String, + company: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company?, + created_at: Time, + customer_appealed: bool, + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], + due_date: Time?, + issue: WhopSDK::Models::resolution_center_case_issue_type, + member: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member?, + merchant_appealed: bool, + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + payment: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment, + platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response], + resolution_events: ::Array[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent], + status: WhopSDK::Models::resolution_center_case_status, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User + } + + class ResolutionCenterCaseRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor company: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company? + + attr_accessor created_at: Time + + attr_accessor customer_appealed: bool + + attr_accessor customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response] + + attr_accessor due_date: Time? + + attr_accessor issue: WhopSDK::Models::resolution_center_case_issue_type + + attr_accessor member: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member? + + attr_accessor merchant_appealed: bool + + attr_accessor merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response] + + attr_accessor payment: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment + + attr_accessor platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response] + + attr_accessor resolution_events: ::Array[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent] + + attr_accessor status: WhopSDK::Models::resolution_center_case_status + + attr_accessor updated_at: Time + + attr_accessor user: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User + + def initialize: ( + id: String, + company: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company?, + created_at: Time, + customer_appealed: bool, + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], + due_date: Time?, + issue: WhopSDK::Models::resolution_center_case_issue_type, + member: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member?, + merchant_appealed: bool, + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + payment: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment, + platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response], + resolution_events: ::Array[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent], + status: WhopSDK::Models::resolution_center_case_status, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User + ) -> void + + def to_hash: -> { + id: String, + company: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company?, + created_at: Time, + customer_appealed: bool, + customer_response_actions: ::Array[WhopSDK::Models::resolution_center_case_customer_response], + due_date: Time?, + issue: WhopSDK::Models::resolution_center_case_issue_type, + member: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member?, + merchant_appealed: bool, + merchant_response_actions: ::Array[WhopSDK::Models::resolution_center_case_merchant_response], + payment: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment, + platform_response_actions: ::Array[WhopSDK::Models::resolution_center_case_platform_response], + resolution_events: ::Array[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent], + status: WhopSDK::Models::resolution_center_case_status, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User + } + + type company = { id: String, title: String } + + class Company < 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 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 payment = + { + id: String, + created_at: Time, + currency: WhopSDK::Models::currency?, + paid_at: Time?, + subtotal: Float?, + total: Float + } + + class Payment < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor currency: WhopSDK::Models::currency? + + attr_accessor paid_at: Time? + + attr_accessor subtotal: Float? + + attr_accessor total: Float + + def initialize: ( + id: String, + created_at: Time, + currency: WhopSDK::Models::currency?, + paid_at: Time?, + subtotal: Float?, + total: Float + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + currency: WhopSDK::Models::currency?, + paid_at: Time?, + subtotal: Float?, + total: Float + } + end + + type resolution_event = + { + id: String, + action: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::action, + created_at: Time, + details: String?, + reporter_type: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::reporter_type + } + + class ResolutionEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor action: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::action + + attr_accessor created_at: Time + + attr_accessor details: String? + + attr_accessor reporter_type: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::reporter_type + + def initialize: ( + id: String, + action: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::action, + created_at: Time, + details: String?, + reporter_type: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::reporter_type + ) -> void + + def to_hash: -> { + id: String, + action: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::action, + created_at: Time, + details: String?, + reporter_type: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::reporter_type + } + + type action = + :created + | :responded + | :accepted + | :denied + | :appealed + | :withdrew + | :requested_more_info + | :escalated + | :dispute_opened + | :dispute_customer_won + | :dispute_merchant_won + + module Action + extend WhopSDK::Internal::Type::Enum + + CREATED: :created + RESPONDED: :responded + ACCEPTED: :accepted + DENIED: :denied + APPEALED: :appealed + WITHDREW: :withdrew + REQUESTED_MORE_INFO: :requested_more_info + ESCALATED: :escalated + DISPUTE_OPENED: :dispute_opened + DISPUTE_CUSTOMER_WON: :dispute_customer_won + DISPUTE_MERCHANT_WON: :dispute_merchant_won + + def self?.values: -> ::Array[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::action] + end + + type reporter_type = :merchant | :customer | :platform | :system + + module ReporterType + extend WhopSDK::Internal::Type::Enum + + MERCHANT: :merchant + CUSTOMER: :customer + PLATFORM: :platform + SYSTEM: :system + + def self?.values: -> ::Array[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent::reporter_type] + end + end + + type user = { id: String, name: String?, username: String } + + class User < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor username: String + + def initialize: (id: String, name: String?, username: String) -> void + + def to_hash: -> { id: String, name: String?, username: String } + end + end + end +end diff --git a/sig/whop_sdk/models/resolution_center_case_status.rbs b/sig/whop_sdk/models/resolution_center_case_status.rbs new file mode 100644 index 00000000..adae3229 --- /dev/null +++ b/sig/whop_sdk/models/resolution_center_case_status.rbs @@ -0,0 +1,28 @@ +module WhopSDK + module Models + type resolution_center_case_status = + :merchant_response_needed + | :customer_response_needed + | :merchant_info_needed + | :customer_info_needed + | :under_platform_review + | :customer_won + | :merchant_won + | :customer_withdrew + + module ResolutionCenterCaseStatus + extend WhopSDK::Internal::Type::Enum + + MERCHANT_RESPONSE_NEEDED: :merchant_response_needed + CUSTOMER_RESPONSE_NEEDED: :customer_response_needed + MERCHANT_INFO_NEEDED: :merchant_info_needed + CUSTOMER_INFO_NEEDED: :customer_info_needed + UNDER_PLATFORM_REVIEW: :under_platform_review + CUSTOMER_WON: :customer_won + MERCHANT_WON: :merchant_won + CUSTOMER_WITHDREW: :customer_withdrew + + def self?.values: -> ::Array[WhopSDK::Models::resolution_center_case_status] + end + end +end diff --git a/sig/whop_sdk/resources/authorized_users.rbs b/sig/whop_sdk/resources/authorized_users.rbs index 3bc8604e..87c2ff8a 100644 --- a/sig/whop_sdk/resources/authorized_users.rbs +++ b/sig/whop_sdk/resources/authorized_users.rbs @@ -7,12 +7,12 @@ module WhopSDK user_id: String, ?send_emails: bool?, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::AuthorizedUserCreateResponse + ) -> WhopSDK::AuthorizedUser def retrieve: ( String id, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Models::AuthorizedUserRetrieveResponse + ) -> WhopSDK::AuthorizedUser def list: ( ?after: String?, diff --git a/sig/whop_sdk/resources/resolution_center_cases.rbs b/sig/whop_sdk/resources/resolution_center_cases.rbs new file mode 100644 index 00000000..fbce6e0b --- /dev/null +++ b/sig/whop_sdk/resources/resolution_center_cases.rbs @@ -0,0 +1,25 @@ +module WhopSDK + module Resources + class ResolutionCenterCases + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::ResolutionCenterCaseRetrieveResponse + + def list: ( + ?after: String?, + ?before: String?, + ?company_id: String?, + ?created_after: Time?, + ?created_before: Time?, + ?direction: WhopSDK::Models::direction?, + ?first: Integer?, + ?last: Integer?, + ?statuses: ::Array[WhopSDK::Models::resolution_center_case_status]?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::ResolutionCenterCaseListResponse] + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/test/whop_sdk/resources/authorized_users_test.rb b/test/whop_sdk/resources/authorized_users_test.rb index 4763bb32..b93e1974 100644 --- a/test/whop_sdk/resources/authorized_users_test.rb +++ b/test/whop_sdk/resources/authorized_users_test.rb @@ -14,15 +14,15 @@ def test_create_required_params ) assert_pattern do - response => WhopSDK::Models::AuthorizedUserCreateResponse + response => WhopSDK::AuthorizedUser end assert_pattern do response => { id: String, - company: WhopSDK::Models::AuthorizedUserCreateResponse::Company, + company: WhopSDK::AuthorizedUser::Company, role: WhopSDK::AuthorizedUserRoles, - user: WhopSDK::Models::AuthorizedUserCreateResponse::User + user: WhopSDK::AuthorizedUser::User } end end @@ -33,15 +33,15 @@ def test_retrieve response = @whop.authorized_users.retrieve("ausr_xxxxxxxxxxxxx") assert_pattern do - response => WhopSDK::Models::AuthorizedUserRetrieveResponse + response => WhopSDK::AuthorizedUser end assert_pattern do response => { id: String, - company: WhopSDK::Models::AuthorizedUserRetrieveResponse::Company, + company: WhopSDK::AuthorizedUser::Company, role: WhopSDK::AuthorizedUserRoles, - user: WhopSDK::Models::AuthorizedUserRetrieveResponse::User + user: WhopSDK::AuthorizedUser::User } end end diff --git a/test/whop_sdk/resources/resolution_center_cases_test.rb b/test/whop_sdk/resources/resolution_center_cases_test.rb new file mode 100644 index 00000000..3c01b465 --- /dev/null +++ b/test/whop_sdk/resources/resolution_center_cases_test.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::ResolutionCenterCasesTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.resolution_center_cases.retrieve("reso_xxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Models::ResolutionCenterCaseRetrieveResponse + end + + assert_pattern do + response => { + id: String, + company: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Company | nil, + created_at: Time, + customer_appealed: WhopSDK::Internal::Type::Boolean, + customer_response_actions: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseCustomerResponse]), + due_date: Time | nil, + issue: WhopSDK::ResolutionCenterCaseIssueType, + member: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Member | nil, + merchant_appealed: WhopSDK::Internal::Type::Boolean, + merchant_response_actions: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseMerchantResponse]), + payment: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::Payment, + platform_response_actions: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCasePlatformResponse]), + resolution_events: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::ResolutionEvent]), + status: WhopSDK::ResolutionCenterCaseStatus, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseRetrieveResponse::User + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @whop.resolution_center_cases.list + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::ResolutionCenterCaseListResponse + end + + assert_pattern do + row => { + id: String, + company: WhopSDK::Models::ResolutionCenterCaseListResponse::Company | nil, + created_at: Time, + customer_appealed: WhopSDK::Internal::Type::Boolean, + customer_response_actions: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseCustomerResponse]), + due_date: Time | nil, + issue: WhopSDK::ResolutionCenterCaseIssueType, + merchant_appealed: WhopSDK::Internal::Type::Boolean, + merchant_response_actions: ^(WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ResolutionCenterCaseMerchantResponse]), + payment: WhopSDK::Models::ResolutionCenterCaseListResponse::Payment, + status: WhopSDK::ResolutionCenterCaseStatus, + updated_at: Time, + user: WhopSDK::Models::ResolutionCenterCaseListResponse::User + } + end + end +end From 0dc83a8660880c8bfd748b6f7d961ef84f7d17d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 18:58:00 +0000 Subject: [PATCH 6/6] release: 0.0.32 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/whop_sdk/version.rb | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8149476d..41dea332 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.31" + ".": "0.0.32" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 161cd8fc..056a0ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 0.0.32 (2026-03-11) + +Full Changelog: [v0.0.31...v0.0.32](https://github.com/whopio/whopsdk-ruby/compare/v0.0.31...v0.0.32) + +### Features + +* **api:** api update ([6736597](https://github.com/whopio/whopsdk-ruby/commit/67365979c3472172bef736fc73574bb5719614e5)) +* **api:** api update ([d6af2cc](https://github.com/whopio/whopsdk-ruby/commit/d6af2cc7ea14659053aff192953d4062ce31a293)) +* **api:** api update ([e764995](https://github.com/whopio/whopsdk-ruby/commit/e764995aa75bd2b92fdc29592c81f75afd0abd49)) +* **api:** manual updates ([3539993](https://github.com/whopio/whopsdk-ruby/commit/3539993a158657780bdc730aecb8c3cad3c16d12)) +* **client:** add webhook support ([f1b05ca](https://github.com/whopio/whopsdk-ruby/commit/f1b05ca076a06579625ec9c3a78dc96b59d867fd)) + ## 0.0.31 (2026-03-10) Full Changelog: [v0.0.30...v0.0.31](https://github.com/whopio/whopsdk-ruby/compare/v0.0.30...v0.0.31) diff --git a/Gemfile.lock b/Gemfile.lock index 19438b7a..421ff44d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - whop_sdk (0.0.31) + whop_sdk (0.0.32) cgi connection_pool standardwebhooks diff --git a/README.md b/README.md index 9cd8d312..ec7f72b2 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "whop_sdk", "~> 0.0.31" +gem "whop_sdk", "~> 0.0.32" ``` diff --git a/lib/whop_sdk/version.rb b/lib/whop_sdk/version.rb index 4f73e2dc..95aac0f0 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.31" + VERSION = "0.0.32" end