From ab2cd25cd6c28433594ebb2bce482b059d380420 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 3 Jun 2026 07:17:19 +0000 Subject: [PATCH 01/17] update custom code Stainless-Generated-From: 4850341f4b05ba26576e558d4ae669328fd4c7d9 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0f033d96..96684255 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - whop_sdk (0.0.39) + whop_sdk (0.0.40) cgi connection_pool standardwebhooks From a8e4318c63bf95f8c6ca23c842e32286787e6b7f Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 3 Jun 2026 19:13:38 +0000 Subject: [PATCH 02/17] Feat(Invoices): Add plan currency to invoice API Stainless-Generated-From: a3ebbe4e2a4c95577a99f32ef0517fb2a27b4dec --- lib/whop_sdk/models/invoice_create_params.rb | 20 +++++++++++++++++-- lib/whop_sdk/models/invoice_update_params.rb | 10 +++++++++- rbi/whop_sdk/models/invoice_create_params.rbi | 16 +++++++++++++++ rbi/whop_sdk/models/invoice_update_params.rbi | 8 ++++++++ sig/whop_sdk/models/invoice_create_params.rbs | 10 ++++++++++ sig/whop_sdk/models/invoice_update_params.rbs | 5 +++++ 6 files changed, 66 insertions(+), 3 deletions(-) diff --git a/lib/whop_sdk/models/invoice_create_params.rb b/lib/whop_sdk/models/invoice_create_params.rb index 10f7ca8e..9d35eeb5 100644 --- a/lib/whop_sdk/models/invoice_create_params.rb +++ b/lib/whop_sdk/models/invoice_create_params.rb @@ -203,6 +203,12 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :billing_period, Integer, nil?: true + # @!attribute currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + optional :currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute custom_fields # An array of custom field objects. # @@ -301,7 +307,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) + # @!method initialize(billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan} # for more details. @@ -311,6 +317,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). # + # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # # @param custom_fields [Array, nil] An array of custom field objects. # # @param description [String, nil] The description of the plan. @@ -752,6 +760,12 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :billing_period, Integer, nil?: true + # @!attribute currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + optional :currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute custom_fields # An array of custom field objects. # @@ -850,7 +864,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) + # @!method initialize(billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan} # for more details. @@ -860,6 +874,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). # + # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # # @param custom_fields [Array, nil] An array of custom field objects. # # @param description [String, nil] The description of the plan. diff --git a/lib/whop_sdk/models/invoice_update_params.rb b/lib/whop_sdk/models/invoice_update_params.rb index 22ad2646..8ddf8acd 100644 --- a/lib/whop_sdk/models/invoice_update_params.rb +++ b/lib/whop_sdk/models/invoice_update_params.rb @@ -263,6 +263,12 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :billing_period, Integer, nil?: true + # @!attribute currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + optional :currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute custom_fields # An array of custom field objects. # @@ -357,7 +363,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) + # @!method initialize(billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::InvoiceUpdateParams::Plan} for more details. # @@ -365,6 +371,8 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). # + # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # # @param custom_fields [Array, nil] An array of custom field objects. # # @param description [String, nil] The description of the plan. diff --git a/rbi/whop_sdk/models/invoice_create_params.rbi b/rbi/whop_sdk/models/invoice_create_params.rbi index 4269b098..516f0051 100644 --- a/rbi/whop_sdk/models/invoice_create_params.rbi +++ b/rbi/whop_sdk/models/invoice_create_params.rbi @@ -342,6 +342,10 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :billing_period + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } + attr_accessor :currency + # An array of custom field objects. sig do returns( @@ -433,6 +437,7 @@ module WhopSDK sig do params( billing_period: T.nilable(Integer), + currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable( T::Array[ @@ -460,6 +465,8 @@ module WhopSDK def self.new( # The interval in days at which the plan charges (renewal plans). billing_period: nil, + # The available currencies on the platform + currency: nil, # An array of custom field objects. custom_fields: nil, # The description of the plan. @@ -501,6 +508,7 @@ module WhopSDK override.returns( { billing_period: T.nilable(Integer), + currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable( T::Array[ @@ -1133,6 +1141,10 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :billing_period + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } + attr_accessor :currency + # An array of custom field objects. sig do returns( @@ -1224,6 +1236,7 @@ module WhopSDK sig do params( billing_period: T.nilable(Integer), + currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable( T::Array[ @@ -1251,6 +1264,8 @@ module WhopSDK def self.new( # The interval in days at which the plan charges (renewal plans). billing_period: nil, + # The available currencies on the platform + currency: nil, # An array of custom field objects. custom_fields: nil, # The description of the plan. @@ -1292,6 +1307,7 @@ module WhopSDK override.returns( { billing_period: T.nilable(Integer), + currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable( T::Array[ diff --git a/rbi/whop_sdk/models/invoice_update_params.rbi b/rbi/whop_sdk/models/invoice_update_params.rbi index 62063d55..7af5ffef 100644 --- a/rbi/whop_sdk/models/invoice_update_params.rbi +++ b/rbi/whop_sdk/models/invoice_update_params.rbi @@ -346,6 +346,10 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :billing_period + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } + attr_accessor :currency + # An array of custom field objects. sig do returns( @@ -432,6 +436,7 @@ module WhopSDK sig do params( billing_period: T.nilable(Integer), + currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable( T::Array[ @@ -459,6 +464,8 @@ module WhopSDK def self.new( # The interval in days at which the plan charges (renewal plans). billing_period: nil, + # The available currencies on the platform + currency: nil, # An array of custom field objects. custom_fields: nil, # The description of the plan. @@ -500,6 +507,7 @@ module WhopSDK override.returns( { billing_period: T.nilable(Integer), + currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable( T::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField] diff --git a/sig/whop_sdk/models/invoice_create_params.rbs b/sig/whop_sdk/models/invoice_create_params.rbs index a5a4828c..d869c018 100644 --- a/sig/whop_sdk/models/invoice_create_params.rbs +++ b/sig/whop_sdk/models/invoice_create_params.rbs @@ -126,6 +126,7 @@ module WhopSDK type plan = { billing_period: Integer?, + currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, description: String?, expiration_days: Integer?, @@ -145,6 +146,8 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel attr_accessor billing_period: Integer? + attr_accessor currency: WhopSDK::Models::currency? + attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]? attr_accessor description: String? @@ -175,6 +178,7 @@ module WhopSDK def initialize: ( ?billing_period: Integer?, + ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, ?description: String?, ?expiration_days: Integer?, @@ -193,6 +197,7 @@ module WhopSDK def to_hash: -> { billing_period: Integer?, + currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, description: String?, expiration_days: Integer?, @@ -479,6 +484,7 @@ module WhopSDK type plan = { billing_period: Integer?, + currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, description: String?, expiration_days: Integer?, @@ -498,6 +504,8 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel attr_accessor billing_period: Integer? + attr_accessor currency: WhopSDK::Models::currency? + attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]? attr_accessor description: String? @@ -528,6 +536,7 @@ module WhopSDK def initialize: ( ?billing_period: Integer?, + ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, ?description: String?, ?expiration_days: Integer?, @@ -546,6 +555,7 @@ module WhopSDK def to_hash: -> { billing_period: Integer?, + currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, description: String?, expiration_days: Integer?, diff --git a/sig/whop_sdk/models/invoice_update_params.rbs b/sig/whop_sdk/models/invoice_update_params.rbs index c872033d..d6bf04d9 100644 --- a/sig/whop_sdk/models/invoice_update_params.rbs +++ b/sig/whop_sdk/models/invoice_update_params.rbs @@ -175,6 +175,7 @@ module WhopSDK type plan = { billing_period: Integer?, + currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, description: String?, expiration_days: Integer?, @@ -194,6 +195,8 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel attr_accessor billing_period: Integer? + attr_accessor currency: WhopSDK::Models::currency? + attr_accessor custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]? attr_accessor description: String? @@ -224,6 +227,7 @@ module WhopSDK def initialize: ( ?billing_period: Integer?, + ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, ?description: String?, ?expiration_days: Integer?, @@ -242,6 +246,7 @@ module WhopSDK def to_hash: -> { billing_period: Integer?, + currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, description: String?, expiration_days: Integer?, From e0deda068af280f9bd7c0c6e4585c846be944152 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 3 Jun 2026 22:54:16 +0000 Subject: [PATCH 03/17] fix(backend): update account fields Stainless-Generated-From: 20e59e82148f99ae0cc1f1d6246d8cd7e783fec6 --- lib/whop_sdk/models/account.rb | 117 +++++++++++++++- lib/whop_sdk/models/account_update_params.rb | 117 +++++++++++++++- lib/whop_sdk/resources/accounts.rb | 30 +++- rbi/whop_sdk/models/account.rbi | 112 +++++++++++++++ rbi/whop_sdk/models/account_update_params.rbi | 132 ++++++++++++++++++ rbi/whop_sdk/resources/accounts.rbi | 43 ++++++ sig/whop_sdk/models/account.rbs | 70 ++++++++++ sig/whop_sdk/models/account_update_params.rbs | 84 ++++++++++- sig/whop_sdk/resources/accounts.rbs | 14 ++ test/whop_sdk/resources/accounts_test.rb | 56 ++++++++ 10 files changed, 771 insertions(+), 4 deletions(-) diff --git a/lib/whop_sdk/models/account.rb b/lib/whop_sdk/models/account.rb index 28797ee5..447d5e3f 100644 --- a/lib/whop_sdk/models/account.rb +++ b/lib/whop_sdk/models/account.rb @@ -22,6 +22,12 @@ class Account < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :business_type, String, nil?: true + # @!attribute country + # The country the account is located in + # + # @return [String, nil] + required :country, String, nil?: true + # @!attribute created_at # When the account was created, as an ISO 8601 timestamp # @@ -40,6 +46,11 @@ class Account < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :email, String, nil?: true + # @!attribute home_preferences + # + # @return [Array] + required :home_preferences, WhopSDK::Internal::Type::ArrayOf[String] + # @!attribute industry_group # The industry group the account belongs to # @@ -52,6 +63,12 @@ class Account < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :industry_type, String, nil?: true + # @!attribute invoice_prefix + # The prefix used for account invoices + # + # @return [String, nil] + required :invoice_prefix, String, nil?: true + # @!attribute logo_url # The URL of the account logo image # @@ -64,12 +81,49 @@ class Account < WhopSDK::Internal::Type::BaseModel # @return [Object] required :metadata, WhopSDK::Internal::Type::Unknown + # @!attribute onboarding_type + # The type of onboarding the account has completed + # + # @return [String, nil] + required :onboarding_type, String, nil?: true + + # @!attribute opengraph_image_url + # The URL of the account Open Graph image + # + # @return [String, nil] + required :opengraph_image_url, String, nil?: true + + # @!attribute opengraph_image_variant + # The account Open Graph image variant + # + # @return [String, nil] + required :opengraph_image_variant, String, nil?: true + + # @!attribute other_business_description + # The description of the business type when business_type is other + # + # @return [String, nil] + required :other_business_description, String, nil?: true + + # @!attribute other_industry_description + # The description of the industry type when industry_type is other + # + # @return [String, nil] + required :other_industry_description, String, nil?: true + # @!attribute parent_account_id # The parent account ID for connected accounts # # @return [String, nil] required :parent_account_id, String, nil?: true + # @!attribute require_2fa + # Whether the account requires authorized users to have two-factor authentication + # enabled + # + # @return [Boolean] + required :require_2fa, WhopSDK::Internal::Type::Boolean + # @!attribute route # The account's public route identifier # @@ -82,11 +136,35 @@ class Account < WhopSDK::Internal::Type::BaseModel # @return [Boolean] required :send_customer_emails, WhopSDK::Internal::Type::Boolean + # @!attribute show_joined_whops + # Whether the account appears in joined whops on other accounts + # + # @return [Boolean] + required :show_joined_whops, WhopSDK::Internal::Type::Boolean + + # @!attribute show_reviews_dtc + # Whether reviews are displayed on direct-to-consumer product pages + # + # @return [Boolean] + required :show_reviews_dtc, WhopSDK::Internal::Type::Boolean + + # @!attribute show_user_directory + # Whether the account shows users in the user directory + # + # @return [Boolean] + required :show_user_directory, WhopSDK::Internal::Type::Boolean + # @!attribute social_links # # @return [Array] required :social_links, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AccountSocialLink] } + # @!attribute store_page_config + # Store page display configuration for the account + # + # @return [Object] + required :store_page_config, WhopSDK::Internal::Type::Unknown + # @!attribute target_audience # The target audience for this account # @@ -99,45 +177,82 @@ class Account < WhopSDK::Internal::Type::BaseModel # @return [String] required :title, String + # @!attribute use_logo_as_opengraph_image_fallback + # Whether the account uses its logo as the fallback Open Graph image + # + # @return [Boolean] + required :use_logo_as_opengraph_image_fallback, WhopSDK::Internal::Type::Boolean + # @!attribute wallet # The account's primary crypto wallet, or null if none has been provisioned # # @return [WhopSDK::Models::AccountWallet, nil] required :wallet, -> { WhopSDK::AccountWallet }, nil?: true - # @!method initialize(id:, banner_image_url:, business_type:, created_at:, description:, email:, industry_group:, industry_type:, logo_url:, metadata:, parent_account_id:, route:, send_customer_emails:, social_links:, target_audience:, title:, wallet:) + # @!method initialize(id:, banner_image_url:, business_type:, country:, created_at:, description:, email:, home_preferences:, industry_group:, industry_type:, invoice_prefix:, logo_url:, metadata:, onboarding_type:, opengraph_image_url:, opengraph_image_variant:, other_business_description:, other_industry_description:, parent_account_id:, require_2fa:, route:, send_customer_emails:, show_joined_whops:, show_reviews_dtc:, show_user_directory:, social_links:, store_page_config:, target_audience:, title:, use_logo_as_opengraph_image_fallback:, wallet:) + # Some parameter documentations has been truncated, see {WhopSDK::Models::Account} + # for more details. + # # @param id [String] The ID of the account, which will look like biz\_******\******* # # @param banner_image_url [String, nil] The URL of the account banner image # # @param business_type [String, nil] The high-level business category for the account # + # @param country [String, nil] The country the account is located in + # # @param created_at [String] When the account was created, as an ISO 8601 timestamp # # @param description [String, nil] A promotional description for the account # # @param email [String, nil] The email address of the account owner # + # @param home_preferences [Array] + # # @param industry_group [String, nil] The industry group the account belongs to # # @param industry_type [String, nil] The specific industry vertical the account operates in # + # @param invoice_prefix [String, nil] The prefix used for account invoices + # # @param logo_url [String, nil] The URL of the account logo image # # @param metadata [Object] Arbitrary key/value metadata supplied when the account was created # + # @param onboarding_type [String, nil] The type of onboarding the account has completed + # + # @param opengraph_image_url [String, nil] The URL of the account Open Graph image + # + # @param opengraph_image_variant [String, nil] The account Open Graph image variant + # + # @param other_business_description [String, nil] The description of the business type when business_type is other + # + # @param other_industry_description [String, nil] The description of the industry type when industry_type is other + # # @param parent_account_id [String, nil] The parent account ID for connected accounts # + # @param require_2fa [Boolean] Whether the account requires authorized users to have two-factor authentication + # # @param route [String] The account's public route identifier # # @param send_customer_emails [Boolean] Whether Whop sends transactional emails to customers on behalf of this account # + # @param show_joined_whops [Boolean] Whether the account appears in joined whops on other accounts + # + # @param show_reviews_dtc [Boolean] Whether reviews are displayed on direct-to-consumer product pages + # + # @param show_user_directory [Boolean] Whether the account shows users in the user directory + # # @param social_links [Array] # + # @param store_page_config [Object] Store page display configuration for the account + # # @param target_audience [String, nil] The target audience for this account # # @param title [String] The display name of the account # + # @param use_logo_as_opengraph_image_fallback [Boolean] Whether the account uses its logo as the fallback Open Graph image + # # @param wallet [WhopSDK::Models::AccountWallet, nil] The account's primary crypto wallet, or null if none has been provisioned end end diff --git a/lib/whop_sdk/models/account_update_params.rb b/lib/whop_sdk/models/account_update_params.rb index 8554fba7..a76efa16 100644 --- a/lib/whop_sdk/models/account_update_params.rb +++ b/lib/whop_sdk/models/account_update_params.rb @@ -37,6 +37,12 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :business_type, String, nil?: true + # @!attribute country + # The country the account is located in. + # + # @return [String, nil] + optional :country, String, nil?: true + # @!attribute description # A promotional description for the account. # @@ -49,6 +55,12 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :featured_affiliate_product_id, String, nil?: true + # @!attribute home_preferences + # Preferences for the public business home page. + # + # @return [Array, nil] + optional :home_preferences, WhopSDK::Internal::Type::ArrayOf[String] + # @!attribute industry_group # The industry group the account belongs to. # @@ -61,6 +73,12 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :industry_type, String, nil?: true + # @!attribute invoice_prefix + # The prefix to use for account invoices. + # + # @return [String, nil] + optional :invoice_prefix, String, nil?: true + # @!attribute logo # Attachment input for the account logo. # @@ -73,6 +91,43 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] + # @!attribute onboarding_type + # The type of onboarding the account has completed. + # + # @return [String, nil] + optional :onboarding_type, String, nil?: true + + # @!attribute opengraph_image + # Attachment input for the account Open Graph image. + # + # @return [Hash{Symbol=>Object}, nil] + optional :opengraph_image, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + + # @!attribute opengraph_image_variant + # The account Open Graph image variant. + # + # @return [String, nil] + optional :opengraph_image_variant, String, nil?: true + + # @!attribute other_business_description + # The description of the business type when business_type is other. + # + # @return [String, nil] + optional :other_business_description, String, nil?: true + + # @!attribute other_industry_description + # The description of the industry type when industry_type is other. + # + # @return [String, nil] + optional :other_industry_description, String, nil?: true + + # @!attribute require_2fa + # Whether the account requires authorized users to have two-factor authentication + # enabled. + # + # @return [Boolean, nil] + optional :require_2fa, WhopSDK::Internal::Type::Boolean + # @!attribute route # The unique URL slug for the account. # @@ -85,6 +140,24 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Boolean, nil] optional :send_customer_emails, WhopSDK::Internal::Type::Boolean + # @!attribute show_joined_whops + # Whether the account appears in joined whops on other accounts. + # + # @return [Boolean, nil] + optional :show_joined_whops, WhopSDK::Internal::Type::Boolean + + # @!attribute show_reviews_dtc + # Whether reviews are displayed on direct-to-consumer product pages. + # + # @return [Boolean, nil] + optional :show_reviews_dtc, WhopSDK::Internal::Type::Boolean + + # @!attribute show_user_directory + # Whether the account shows users in the user directory. + # + # @return [Boolean, nil] + optional :show_user_directory, WhopSDK::Internal::Type::Boolean + # @!attribute social_links # The full list of social links to display for the account. # @@ -92,6 +165,14 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel optional :social_links, WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]] + # @!attribute store_page_config + # Store page display configuration for the account. + # + # @return [Hash{Symbol=>Object}, nil] + optional :store_page_config, + WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], + nil?: true + # @!attribute target_audience # The target audience for this account. # @@ -104,7 +185,13 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :title, String, nil?: true - # @!method initialize(account_id:, affiliate_application_required: nil, affiliate_instructions: nil, banner_image: nil, business_type: nil, description: nil, featured_affiliate_product_id: nil, industry_group: nil, industry_type: nil, logo: nil, metadata: nil, route: nil, send_customer_emails: nil, social_links: nil, target_audience: nil, title: nil, request_options: {}) + # @!attribute use_logo_as_opengraph_image_fallback + # Whether the account uses its logo as the fallback Open Graph image. + # + # @return [Boolean, nil] + optional :use_logo_as_opengraph_image_fallback, WhopSDK::Internal::Type::Boolean + + # @!method initialize(account_id:, affiliate_application_required: nil, affiliate_instructions: nil, banner_image: nil, business_type: nil, country: nil, description: nil, featured_affiliate_product_id: nil, home_preferences: nil, industry_group: nil, industry_type: nil, invoice_prefix: nil, logo: nil, metadata: nil, onboarding_type: nil, opengraph_image: nil, opengraph_image_variant: nil, other_business_description: nil, other_industry_description: nil, require_2fa: nil, route: nil, send_customer_emails: nil, show_joined_whops: nil, show_reviews_dtc: nil, show_user_directory: nil, social_links: nil, store_page_config: nil, target_audience: nil, title: nil, use_logo_as_opengraph_image_fallback: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AccountUpdateParams} for more details. # @@ -118,28 +205,56 @@ class AccountUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param business_type [String, nil] The high-level business category for the account. # + # @param country [String, nil] The country the account is located in. + # # @param description [String, nil] A promotional description for the account. # # @param featured_affiliate_product_id [String, nil] The ID of the product to feature for affiliates. Pass null to clear. # + # @param home_preferences [Array] Preferences for the public business home page. + # # @param industry_group [String, nil] The industry group the account belongs to. # # @param industry_type [String, nil] The specific industry vertical the account operates in. # + # @param invoice_prefix [String, nil] The prefix to use for account invoices. + # # @param logo [Hash{Symbol=>Object}, nil] Attachment input for the account logo. # # @param metadata [Hash{Symbol=>Object}] Arbitrary key/value metadata to store on the account. # + # @param onboarding_type [String, nil] The type of onboarding the account has completed. + # + # @param opengraph_image [Hash{Symbol=>Object}, nil] Attachment input for the account Open Graph image. + # + # @param opengraph_image_variant [String, nil] The account Open Graph image variant. + # + # @param other_business_description [String, nil] The description of the business type when business_type is other. + # + # @param other_industry_description [String, nil] The description of the industry type when industry_type is other. + # + # @param require_2fa [Boolean] Whether the account requires authorized users to have two-factor authentication + # # @param route [String, nil] The unique URL slug for the account. # # @param send_customer_emails [Boolean] Whether Whop sends transactional emails to customers on behalf of this account. # + # @param show_joined_whops [Boolean] Whether the account appears in joined whops on other accounts. + # + # @param show_reviews_dtc [Boolean] Whether reviews are displayed on direct-to-consumer product pages. + # + # @param show_user_directory [Boolean] Whether the account shows users in the user directory. + # # @param social_links [ArrayObject}>] The full list of social links to display for the account. # + # @param store_page_config [Hash{Symbol=>Object}, nil] Store page display configuration for the account. + # # @param target_audience [String, nil] The target audience for this account. # # @param title [String, nil] The display name of the account. # + # @param use_logo_as_opengraph_image_fallback [Boolean] Whether the account uses its logo as the fallback Open Graph image. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/resources/accounts.rb b/lib/whop_sdk/resources/accounts.rb index 97004b0e..5694a85a 100644 --- a/lib/whop_sdk/resources/accounts.rb +++ b/lib/whop_sdk/resources/accounts.rb @@ -58,7 +58,7 @@ def retrieve(account_id, params = {}) # Updates an account. User tokens can update business accounts; business account # API keys can update connected accounts. # - # @overload update(account_id, affiliate_application_required: nil, affiliate_instructions: nil, banner_image: nil, business_type: nil, description: nil, featured_affiliate_product_id: nil, industry_group: nil, industry_type: nil, logo: nil, metadata: nil, route: nil, send_customer_emails: nil, social_links: nil, target_audience: nil, title: nil, request_options: {}) + # @overload update(account_id, affiliate_application_required: nil, affiliate_instructions: nil, banner_image: nil, business_type: nil, country: nil, description: nil, featured_affiliate_product_id: nil, home_preferences: nil, industry_group: nil, industry_type: nil, invoice_prefix: nil, logo: nil, metadata: nil, onboarding_type: nil, opengraph_image: nil, opengraph_image_variant: nil, other_business_description: nil, other_industry_description: nil, require_2fa: nil, route: nil, send_customer_emails: nil, show_joined_whops: nil, show_reviews_dtc: nil, show_user_directory: nil, social_links: nil, store_page_config: nil, target_audience: nil, title: nil, use_logo_as_opengraph_image_fallback: nil, request_options: {}) # # @param account_id [String] The ID of the account, which will look like biz\_******\******* # @@ -70,28 +70,56 @@ def retrieve(account_id, params = {}) # # @param business_type [String, nil] The high-level business category for the account. # + # @param country [String, nil] The country the account is located in. + # # @param description [String, nil] A promotional description for the account. # # @param featured_affiliate_product_id [String, nil] The ID of the product to feature for affiliates. Pass null to clear. # + # @param home_preferences [Array] Preferences for the public business home page. + # # @param industry_group [String, nil] The industry group the account belongs to. # # @param industry_type [String, nil] The specific industry vertical the account operates in. # + # @param invoice_prefix [String, nil] The prefix to use for account invoices. + # # @param logo [Hash{Symbol=>Object}, nil] Attachment input for the account logo. # # @param metadata [Hash{Symbol=>Object}] Arbitrary key/value metadata to store on the account. # + # @param onboarding_type [String, nil] The type of onboarding the account has completed. + # + # @param opengraph_image [Hash{Symbol=>Object}, nil] Attachment input for the account Open Graph image. + # + # @param opengraph_image_variant [String, nil] The account Open Graph image variant. + # + # @param other_business_description [String, nil] The description of the business type when business_type is other. + # + # @param other_industry_description [String, nil] The description of the industry type when industry_type is other. + # + # @param require_2fa [Boolean] Whether the account requires authorized users to have two-factor authentication + # # @param route [String, nil] The unique URL slug for the account. # # @param send_customer_emails [Boolean] Whether Whop sends transactional emails to customers on behalf of this account. # + # @param show_joined_whops [Boolean] Whether the account appears in joined whops on other accounts. + # + # @param show_reviews_dtc [Boolean] Whether reviews are displayed on direct-to-consumer product pages. + # + # @param show_user_directory [Boolean] Whether the account shows users in the user directory. + # # @param social_links [ArrayObject}>] The full list of social links to display for the account. # + # @param store_page_config [Hash{Symbol=>Object}, nil] Store page display configuration for the account. + # # @param target_audience [String, nil] The target audience for this account. # # @param title [String, nil] The display name of the account. # + # @param use_logo_as_opengraph_image_fallback [Boolean] Whether the account uses its logo as the fallback Open Graph image. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::Account] diff --git a/rbi/whop_sdk/models/account.rbi b/rbi/whop_sdk/models/account.rbi index 34ac5313..63a83df8 100644 --- a/rbi/whop_sdk/models/account.rbi +++ b/rbi/whop_sdk/models/account.rbi @@ -18,6 +18,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :business_type + # The country the account is located in + sig { returns(T.nilable(String)) } + attr_accessor :country + # When the account was created, as an ISO 8601 timestamp sig { returns(String) } attr_accessor :created_at @@ -30,6 +34,9 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :email + sig { returns(T::Array[String]) } + attr_accessor :home_preferences + # The industry group the account belongs to sig { returns(T.nilable(String)) } attr_accessor :industry_group @@ -38,6 +45,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :industry_type + # The prefix used for account invoices + sig { returns(T.nilable(String)) } + attr_accessor :invoice_prefix + # The URL of the account logo image sig { returns(T.nilable(String)) } attr_accessor :logo_url @@ -46,10 +57,35 @@ module WhopSDK sig { returns(T.anything) } attr_accessor :metadata + # The type of onboarding the account has completed + sig { returns(T.nilable(String)) } + attr_accessor :onboarding_type + + # The URL of the account Open Graph image + sig { returns(T.nilable(String)) } + attr_accessor :opengraph_image_url + + # The account Open Graph image variant + sig { returns(T.nilable(String)) } + attr_accessor :opengraph_image_variant + + # The description of the business type when business_type is other + sig { returns(T.nilable(String)) } + attr_accessor :other_business_description + + # The description of the industry type when industry_type is other + sig { returns(T.nilable(String)) } + attr_accessor :other_industry_description + # The parent account ID for connected accounts sig { returns(T.nilable(String)) } attr_accessor :parent_account_id + # Whether the account requires authorized users to have two-factor authentication + # enabled + sig { returns(T::Boolean) } + attr_accessor :require_2fa + # The account's public route identifier sig { returns(String) } attr_accessor :route @@ -58,9 +94,25 @@ module WhopSDK sig { returns(T::Boolean) } attr_accessor :send_customer_emails + # Whether the account appears in joined whops on other accounts + sig { returns(T::Boolean) } + attr_accessor :show_joined_whops + + # Whether reviews are displayed on direct-to-consumer product pages + sig { returns(T::Boolean) } + attr_accessor :show_reviews_dtc + + # Whether the account shows users in the user directory + sig { returns(T::Boolean) } + attr_accessor :show_user_directory + sig { returns(T::Array[WhopSDK::AccountSocialLink]) } attr_accessor :social_links + # Store page display configuration for the account + sig { returns(T.anything) } + attr_accessor :store_page_config + # The target audience for this account sig { returns(T.nilable(String)) } attr_accessor :target_audience @@ -69,6 +121,10 @@ module WhopSDK sig { returns(String) } attr_accessor :title + # Whether the account uses its logo as the fallback Open Graph image + sig { returns(T::Boolean) } + attr_accessor :use_logo_as_opengraph_image_fallback + # The account's primary crypto wallet, or null if none has been provisioned sig { returns(T.nilable(WhopSDK::AccountWallet)) } attr_reader :wallet @@ -81,19 +137,33 @@ module WhopSDK id: String, banner_image_url: T.nilable(String), business_type: T.nilable(String), + country: T.nilable(String), created_at: String, description: T.nilable(String), email: T.nilable(String), + home_preferences: T::Array[String], industry_group: T.nilable(String), industry_type: T.nilable(String), + invoice_prefix: T.nilable(String), logo_url: T.nilable(String), metadata: T.anything, + onboarding_type: T.nilable(String), + opengraph_image_url: T.nilable(String), + opengraph_image_variant: T.nilable(String), + other_business_description: T.nilable(String), + other_industry_description: T.nilable(String), parent_account_id: T.nilable(String), + require_2fa: T::Boolean, route: String, send_customer_emails: T::Boolean, + show_joined_whops: T::Boolean, + show_reviews_dtc: T::Boolean, + show_user_directory: T::Boolean, social_links: T::Array[WhopSDK::AccountSocialLink::OrHash], + store_page_config: T.anything, target_audience: T.nilable(String), title: String, + use_logo_as_opengraph_image_fallback: T::Boolean, wallet: T.nilable(WhopSDK::AccountWallet::OrHash) ).returns(T.attached_class) end @@ -104,31 +174,59 @@ module WhopSDK banner_image_url:, # The high-level business category for the account business_type:, + # The country the account is located in + country:, # When the account was created, as an ISO 8601 timestamp created_at:, # A promotional description for the account description:, # The email address of the account owner email:, + home_preferences:, # The industry group the account belongs to industry_group:, # The specific industry vertical the account operates in industry_type:, + # The prefix used for account invoices + invoice_prefix:, # The URL of the account logo image logo_url:, # Arbitrary key/value metadata supplied when the account was created metadata:, + # The type of onboarding the account has completed + onboarding_type:, + # The URL of the account Open Graph image + opengraph_image_url:, + # The account Open Graph image variant + opengraph_image_variant:, + # The description of the business type when business_type is other + other_business_description:, + # The description of the industry type when industry_type is other + other_industry_description:, # The parent account ID for connected accounts parent_account_id:, + # Whether the account requires authorized users to have two-factor authentication + # enabled + require_2fa:, # The account's public route identifier route:, # Whether Whop sends transactional emails to customers on behalf of this account send_customer_emails:, + # Whether the account appears in joined whops on other accounts + show_joined_whops:, + # Whether reviews are displayed on direct-to-consumer product pages + show_reviews_dtc:, + # Whether the account shows users in the user directory + show_user_directory:, social_links:, + # Store page display configuration for the account + store_page_config:, # The target audience for this account target_audience:, # The display name of the account title:, + # Whether the account uses its logo as the fallback Open Graph image + use_logo_as_opengraph_image_fallback:, # The account's primary crypto wallet, or null if none has been provisioned wallet: ) @@ -140,19 +238,33 @@ module WhopSDK id: String, banner_image_url: T.nilable(String), business_type: T.nilable(String), + country: T.nilable(String), created_at: String, description: T.nilable(String), email: T.nilable(String), + home_preferences: T::Array[String], industry_group: T.nilable(String), industry_type: T.nilable(String), + invoice_prefix: T.nilable(String), logo_url: T.nilable(String), metadata: T.anything, + onboarding_type: T.nilable(String), + opengraph_image_url: T.nilable(String), + opengraph_image_variant: T.nilable(String), + other_business_description: T.nilable(String), + other_industry_description: T.nilable(String), parent_account_id: T.nilable(String), + require_2fa: T::Boolean, route: String, send_customer_emails: T::Boolean, + show_joined_whops: T::Boolean, + show_reviews_dtc: T::Boolean, + show_user_directory: T::Boolean, social_links: T::Array[WhopSDK::AccountSocialLink], + store_page_config: T.anything, target_audience: T.nilable(String), title: String, + use_logo_as_opengraph_image_fallback: T::Boolean, wallet: T.nilable(WhopSDK::AccountWallet) } ) diff --git a/rbi/whop_sdk/models/account_update_params.rbi b/rbi/whop_sdk/models/account_update_params.rbi index 686ae83b..96363611 100644 --- a/rbi/whop_sdk/models/account_update_params.rbi +++ b/rbi/whop_sdk/models/account_update_params.rbi @@ -34,6 +34,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :business_type + # The country the account is located in. + sig { returns(T.nilable(String)) } + attr_accessor :country + # A promotional description for the account. sig { returns(T.nilable(String)) } attr_accessor :description @@ -42,6 +46,13 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :featured_affiliate_product_id + # Preferences for the public business home page. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :home_preferences + + sig { params(home_preferences: T::Array[String]).void } + attr_writer :home_preferences + # The industry group the account belongs to. sig { returns(T.nilable(String)) } attr_accessor :industry_group @@ -50,6 +61,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :industry_type + # The prefix to use for account invoices. + sig { returns(T.nilable(String)) } + attr_accessor :invoice_prefix + # Attachment input for the account logo. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :logo @@ -61,6 +76,34 @@ module WhopSDK sig { params(metadata: T::Hash[Symbol, T.anything]).void } attr_writer :metadata + # The type of onboarding the account has completed. + sig { returns(T.nilable(String)) } + attr_accessor :onboarding_type + + # Attachment input for the account Open Graph image. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :opengraph_image + + # The account Open Graph image variant. + sig { returns(T.nilable(String)) } + attr_accessor :opengraph_image_variant + + # The description of the business type when business_type is other. + sig { returns(T.nilable(String)) } + attr_accessor :other_business_description + + # The description of the industry type when industry_type is other. + sig { returns(T.nilable(String)) } + attr_accessor :other_industry_description + + # Whether the account requires authorized users to have two-factor authentication + # enabled. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_2fa + + sig { params(require_2fa: T::Boolean).void } + attr_writer :require_2fa + # The unique URL slug for the account. sig { returns(T.nilable(String)) } attr_accessor :route @@ -72,6 +115,27 @@ module WhopSDK sig { params(send_customer_emails: T::Boolean).void } attr_writer :send_customer_emails + # Whether the account appears in joined whops on other accounts. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :show_joined_whops + + sig { params(show_joined_whops: T::Boolean).void } + attr_writer :show_joined_whops + + # Whether reviews are displayed on direct-to-consumer product pages. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :show_reviews_dtc + + sig { params(show_reviews_dtc: T::Boolean).void } + attr_writer :show_reviews_dtc + + # Whether the account shows users in the user directory. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :show_user_directory + + sig { params(show_user_directory: T::Boolean).void } + attr_writer :show_user_directory + # The full list of social links to display for the account. sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) } attr_reader :social_links @@ -79,6 +143,10 @@ module WhopSDK sig { params(social_links: T::Array[T::Hash[Symbol, T.anything]]).void } attr_writer :social_links + # Store page display configuration for the account. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :store_page_config + # The target audience for this account. sig { returns(T.nilable(String)) } attr_accessor :target_audience @@ -87,6 +155,13 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :title + # Whether the account uses its logo as the fallback Open Graph image. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_logo_as_opengraph_image_fallback + + sig { params(use_logo_as_opengraph_image_fallback: T::Boolean).void } + attr_writer :use_logo_as_opengraph_image_fallback + sig do params( account_id: String, @@ -94,17 +169,31 @@ module WhopSDK affiliate_instructions: T.nilable(String), banner_image: T.nilable(T::Hash[Symbol, T.anything]), business_type: T.nilable(String), + country: T.nilable(String), description: T.nilable(String), featured_affiliate_product_id: T.nilable(String), + home_preferences: T::Array[String], industry_group: T.nilable(String), industry_type: T.nilable(String), + invoice_prefix: T.nilable(String), logo: T.nilable(T::Hash[Symbol, T.anything]), metadata: T::Hash[Symbol, T.anything], + onboarding_type: T.nilable(String), + opengraph_image: T.nilable(T::Hash[Symbol, T.anything]), + opengraph_image_variant: T.nilable(String), + other_business_description: T.nilable(String), + other_industry_description: T.nilable(String), + require_2fa: T::Boolean, route: T.nilable(String), send_customer_emails: T::Boolean, + show_joined_whops: T::Boolean, + show_reviews_dtc: T::Boolean, + show_user_directory: T::Boolean, social_links: T::Array[T::Hash[Symbol, T.anything]], + store_page_config: T.nilable(T::Hash[Symbol, T.anything]), target_audience: T.nilable(String), title: T.nilable(String), + use_logo_as_opengraph_image_fallback: T::Boolean, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -119,28 +208,57 @@ module WhopSDK banner_image: nil, # The high-level business category for the account. business_type: nil, + # The country the account is located in. + country: nil, # A promotional description for the account. description: nil, # The ID of the product to feature for affiliates. Pass null to clear. featured_affiliate_product_id: nil, + # Preferences for the public business home page. + home_preferences: nil, # The industry group the account belongs to. industry_group: nil, # The specific industry vertical the account operates in. industry_type: nil, + # The prefix to use for account invoices. + invoice_prefix: nil, # Attachment input for the account logo. logo: nil, # Arbitrary key/value metadata to store on the account. metadata: nil, + # The type of onboarding the account has completed. + onboarding_type: nil, + # Attachment input for the account Open Graph image. + opengraph_image: nil, + # The account Open Graph image variant. + opengraph_image_variant: nil, + # The description of the business type when business_type is other. + other_business_description: nil, + # The description of the industry type when industry_type is other. + other_industry_description: nil, + # Whether the account requires authorized users to have two-factor authentication + # enabled. + require_2fa: nil, # The unique URL slug for the account. route: nil, # Whether Whop sends transactional emails to customers on behalf of this account. send_customer_emails: nil, + # Whether the account appears in joined whops on other accounts. + show_joined_whops: nil, + # Whether reviews are displayed on direct-to-consumer product pages. + show_reviews_dtc: nil, + # Whether the account shows users in the user directory. + show_user_directory: nil, # The full list of social links to display for the account. social_links: nil, + # Store page display configuration for the account. + store_page_config: nil, # The target audience for this account. target_audience: nil, # The display name of the account. title: nil, + # Whether the account uses its logo as the fallback Open Graph image. + use_logo_as_opengraph_image_fallback: nil, request_options: {} ) end @@ -153,17 +271,31 @@ module WhopSDK affiliate_instructions: T.nilable(String), banner_image: T.nilable(T::Hash[Symbol, T.anything]), business_type: T.nilable(String), + country: T.nilable(String), description: T.nilable(String), featured_affiliate_product_id: T.nilable(String), + home_preferences: T::Array[String], industry_group: T.nilable(String), industry_type: T.nilable(String), + invoice_prefix: T.nilable(String), logo: T.nilable(T::Hash[Symbol, T.anything]), metadata: T::Hash[Symbol, T.anything], + onboarding_type: T.nilable(String), + opengraph_image: T.nilable(T::Hash[Symbol, T.anything]), + opengraph_image_variant: T.nilable(String), + other_business_description: T.nilable(String), + other_industry_description: T.nilable(String), + require_2fa: T::Boolean, route: T.nilable(String), send_customer_emails: T::Boolean, + show_joined_whops: T::Boolean, + show_reviews_dtc: T::Boolean, + show_user_directory: T::Boolean, social_links: T::Array[T::Hash[Symbol, T.anything]], + store_page_config: T.nilable(T::Hash[Symbol, T.anything]), target_audience: T.nilable(String), title: T.nilable(String), + use_logo_as_opengraph_image_fallback: T::Boolean, request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/resources/accounts.rbi b/rbi/whop_sdk/resources/accounts.rbi index b5c2323c..898aec2a 100644 --- a/rbi/whop_sdk/resources/accounts.rbi +++ b/rbi/whop_sdk/resources/accounts.rbi @@ -46,17 +46,31 @@ module WhopSDK affiliate_instructions: T.nilable(String), banner_image: T.nilable(T::Hash[Symbol, T.anything]), business_type: T.nilable(String), + country: T.nilable(String), description: T.nilable(String), featured_affiliate_product_id: T.nilable(String), + home_preferences: T::Array[String], industry_group: T.nilable(String), industry_type: T.nilable(String), + invoice_prefix: T.nilable(String), logo: T.nilable(T::Hash[Symbol, T.anything]), metadata: T::Hash[Symbol, T.anything], + onboarding_type: T.nilable(String), + opengraph_image: T.nilable(T::Hash[Symbol, T.anything]), + opengraph_image_variant: T.nilable(String), + other_business_description: T.nilable(String), + other_industry_description: T.nilable(String), + require_2fa: T::Boolean, route: T.nilable(String), send_customer_emails: T::Boolean, + show_joined_whops: T::Boolean, + show_reviews_dtc: T::Boolean, + show_user_directory: T::Boolean, social_links: T::Array[T::Hash[Symbol, T.anything]], + store_page_config: T.nilable(T::Hash[Symbol, T.anything]), target_audience: T.nilable(String), title: T.nilable(String), + use_logo_as_opengraph_image_fallback: T::Boolean, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Account) end @@ -72,28 +86,57 @@ module WhopSDK banner_image: nil, # The high-level business category for the account. business_type: nil, + # The country the account is located in. + country: nil, # A promotional description for the account. description: nil, # The ID of the product to feature for affiliates. Pass null to clear. featured_affiliate_product_id: nil, + # Preferences for the public business home page. + home_preferences: nil, # The industry group the account belongs to. industry_group: nil, # The specific industry vertical the account operates in. industry_type: nil, + # The prefix to use for account invoices. + invoice_prefix: nil, # Attachment input for the account logo. logo: nil, # Arbitrary key/value metadata to store on the account. metadata: nil, + # The type of onboarding the account has completed. + onboarding_type: nil, + # Attachment input for the account Open Graph image. + opengraph_image: nil, + # The account Open Graph image variant. + opengraph_image_variant: nil, + # The description of the business type when business_type is other. + other_business_description: nil, + # The description of the industry type when industry_type is other. + other_industry_description: nil, + # Whether the account requires authorized users to have two-factor authentication + # enabled. + require_2fa: nil, # The unique URL slug for the account. route: nil, # Whether Whop sends transactional emails to customers on behalf of this account. send_customer_emails: nil, + # Whether the account appears in joined whops on other accounts. + show_joined_whops: nil, + # Whether reviews are displayed on direct-to-consumer product pages. + show_reviews_dtc: nil, + # Whether the account shows users in the user directory. + show_user_directory: nil, # The full list of social links to display for the account. social_links: nil, + # Store page display configuration for the account. + store_page_config: nil, # The target audience for this account. target_audience: nil, # The display name of the account. title: nil, + # Whether the account uses its logo as the fallback Open Graph image. + use_logo_as_opengraph_image_fallback: nil, request_options: {} ) end diff --git a/sig/whop_sdk/models/account.rbs b/sig/whop_sdk/models/account.rbs index d633e226..210e05a1 100644 --- a/sig/whop_sdk/models/account.rbs +++ b/sig/whop_sdk/models/account.rbs @@ -5,19 +5,33 @@ module WhopSDK id: String, banner_image_url: String?, business_type: String?, + country: String?, created_at: String, description: String?, email: String?, + home_preferences: ::Array[String], industry_group: String?, industry_type: String?, + invoice_prefix: String?, logo_url: String?, metadata: top, + onboarding_type: String?, + opengraph_image_url: String?, + opengraph_image_variant: String?, + other_business_description: String?, + other_industry_description: String?, parent_account_id: String?, + :require_2fa => bool, route: String, send_customer_emails: bool, + show_joined_whops: bool, + show_reviews_dtc: bool, + show_user_directory: bool, social_links: ::Array[WhopSDK::AccountSocialLink], + store_page_config: top, target_audience: String?, title: String, + use_logo_as_opengraph_image_fallback: bool, wallet: WhopSDK::AccountWallet? } @@ -28,51 +42,93 @@ module WhopSDK attr_accessor business_type: String? + attr_accessor country: String? + attr_accessor created_at: String attr_accessor description: String? attr_accessor email: String? + attr_accessor home_preferences: ::Array[String] + attr_accessor industry_group: String? attr_accessor industry_type: String? + attr_accessor invoice_prefix: String? + attr_accessor logo_url: String? attr_accessor metadata: top + attr_accessor onboarding_type: String? + + attr_accessor opengraph_image_url: String? + + attr_accessor opengraph_image_variant: String? + + attr_accessor other_business_description: String? + + attr_accessor other_industry_description: String? + attr_accessor parent_account_id: String? + attr_accessor require_2fa: bool + attr_accessor route: String attr_accessor send_customer_emails: bool + attr_accessor show_joined_whops: bool + + attr_accessor show_reviews_dtc: bool + + attr_accessor show_user_directory: bool + attr_accessor social_links: ::Array[WhopSDK::AccountSocialLink] + attr_accessor store_page_config: top + attr_accessor target_audience: String? attr_accessor title: String + attr_accessor use_logo_as_opengraph_image_fallback: bool + attr_accessor wallet: WhopSDK::AccountWallet? def initialize: ( id: String, banner_image_url: String?, business_type: String?, + country: String?, created_at: String, description: String?, email: String?, + home_preferences: ::Array[String], industry_group: String?, industry_type: String?, + invoice_prefix: String?, logo_url: String?, metadata: top, + onboarding_type: String?, + opengraph_image_url: String?, + opengraph_image_variant: String?, + other_business_description: String?, + other_industry_description: String?, parent_account_id: String?, + require_2fa: bool, route: String, send_customer_emails: bool, + show_joined_whops: bool, + show_reviews_dtc: bool, + show_user_directory: bool, social_links: ::Array[WhopSDK::AccountSocialLink], + store_page_config: top, target_audience: String?, title: String, + use_logo_as_opengraph_image_fallback: bool, wallet: WhopSDK::AccountWallet? ) -> void @@ -80,19 +136,33 @@ module WhopSDK id: String, banner_image_url: String?, business_type: String?, + country: String?, created_at: String, description: String?, email: String?, + home_preferences: ::Array[String], industry_group: String?, industry_type: String?, + invoice_prefix: String?, logo_url: String?, metadata: top, + onboarding_type: String?, + opengraph_image_url: String?, + opengraph_image_variant: String?, + other_business_description: String?, + other_industry_description: String?, parent_account_id: String?, + :require_2fa => bool, route: String, send_customer_emails: bool, + show_joined_whops: bool, + show_reviews_dtc: bool, + show_user_directory: bool, social_links: ::Array[WhopSDK::AccountSocialLink], + store_page_config: top, target_audience: String?, title: String, + use_logo_as_opengraph_image_fallback: bool, wallet: WhopSDK::AccountWallet? } end diff --git a/sig/whop_sdk/models/account_update_params.rbs b/sig/whop_sdk/models/account_update_params.rbs index 9333626d..7cfd5923 100644 --- a/sig/whop_sdk/models/account_update_params.rbs +++ b/sig/whop_sdk/models/account_update_params.rbs @@ -7,17 +7,31 @@ module WhopSDK affiliate_instructions: String?, banner_image: ::Hash[Symbol, top]?, business_type: String?, + country: String?, description: String?, featured_affiliate_product_id: String?, + home_preferences: ::Array[String], industry_group: String?, industry_type: String?, + invoice_prefix: String?, logo: ::Hash[Symbol, top]?, metadata: ::Hash[Symbol, top], + onboarding_type: String?, + opengraph_image: ::Hash[Symbol, top]?, + opengraph_image_variant: String?, + other_business_description: String?, + other_industry_description: String?, + :require_2fa => bool, route: String?, send_customer_emails: bool, + show_joined_whops: bool, + show_reviews_dtc: bool, + show_user_directory: bool, social_links: ::Array[::Hash[Symbol, top]], + store_page_config: ::Hash[Symbol, top]?, target_audience: String?, - title: String? + title: String?, + use_logo_as_opengraph_image_fallback: bool } & WhopSDK::Internal::Type::request_parameters @@ -37,53 +51,107 @@ module WhopSDK attr_accessor business_type: String? + attr_accessor country: String? + attr_accessor description: String? attr_accessor featured_affiliate_product_id: String? + attr_reader home_preferences: ::Array[String]? + + def home_preferences=: (::Array[String]) -> ::Array[String] + attr_accessor industry_group: String? attr_accessor industry_type: String? + attr_accessor invoice_prefix: String? + attr_accessor logo: ::Hash[Symbol, top]? attr_reader metadata: ::Hash[Symbol, top]? def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + attr_accessor onboarding_type: String? + + attr_accessor opengraph_image: ::Hash[Symbol, top]? + + attr_accessor opengraph_image_variant: String? + + attr_accessor other_business_description: String? + + attr_accessor other_industry_description: String? + + attr_reader require_2fa: bool? + + def require_2fa=: (bool) -> bool + attr_accessor route: String? attr_reader send_customer_emails: bool? def send_customer_emails=: (bool) -> bool + attr_reader show_joined_whops: bool? + + def show_joined_whops=: (bool) -> bool + + attr_reader show_reviews_dtc: bool? + + def show_reviews_dtc=: (bool) -> bool + + attr_reader show_user_directory: bool? + + def show_user_directory=: (bool) -> bool + attr_reader social_links: ::Array[::Hash[Symbol, top]]? def social_links=: ( ::Array[::Hash[Symbol, top]] ) -> ::Array[::Hash[Symbol, top]] + attr_accessor store_page_config: ::Hash[Symbol, top]? + attr_accessor target_audience: String? attr_accessor title: String? + attr_reader use_logo_as_opengraph_image_fallback: bool? + + def use_logo_as_opengraph_image_fallback=: (bool) -> bool + def initialize: ( account_id: String, ?affiliate_application_required: bool, ?affiliate_instructions: String?, ?banner_image: ::Hash[Symbol, top]?, ?business_type: String?, + ?country: String?, ?description: String?, ?featured_affiliate_product_id: String?, + ?home_preferences: ::Array[String], ?industry_group: String?, ?industry_type: String?, + ?invoice_prefix: String?, ?logo: ::Hash[Symbol, top]?, ?metadata: ::Hash[Symbol, top], + ?onboarding_type: String?, + ?opengraph_image: ::Hash[Symbol, top]?, + ?opengraph_image_variant: String?, + ?other_business_description: String?, + ?other_industry_description: String?, + ?require_2fa: bool, ?route: String?, ?send_customer_emails: bool, + ?show_joined_whops: bool, + ?show_reviews_dtc: bool, + ?show_user_directory: bool, ?social_links: ::Array[::Hash[Symbol, top]], + ?store_page_config: ::Hash[Symbol, top]?, ?target_audience: String?, ?title: String?, + ?use_logo_as_opengraph_image_fallback: bool, ?request_options: WhopSDK::request_opts ) -> void @@ -93,17 +161,31 @@ module WhopSDK affiliate_instructions: String?, banner_image: ::Hash[Symbol, top]?, business_type: String?, + country: String?, description: String?, featured_affiliate_product_id: String?, + home_preferences: ::Array[String], industry_group: String?, industry_type: String?, + invoice_prefix: String?, logo: ::Hash[Symbol, top]?, metadata: ::Hash[Symbol, top], + onboarding_type: String?, + opengraph_image: ::Hash[Symbol, top]?, + opengraph_image_variant: String?, + other_business_description: String?, + other_industry_description: String?, + :require_2fa => bool, route: String?, send_customer_emails: bool, + show_joined_whops: bool, + show_reviews_dtc: bool, + show_user_directory: bool, social_links: ::Array[::Hash[Symbol, top]], + store_page_config: ::Hash[Symbol, top]?, target_audience: String?, title: String?, + use_logo_as_opengraph_image_fallback: bool, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/resources/accounts.rbs b/sig/whop_sdk/resources/accounts.rbs index cc431390..7fdfc857 100644 --- a/sig/whop_sdk/resources/accounts.rbs +++ b/sig/whop_sdk/resources/accounts.rbs @@ -18,17 +18,31 @@ module WhopSDK ?affiliate_instructions: String?, ?banner_image: ::Hash[Symbol, top]?, ?business_type: String?, + ?country: String?, ?description: String?, ?featured_affiliate_product_id: String?, + ?home_preferences: ::Array[String], ?industry_group: String?, ?industry_type: String?, + ?invoice_prefix: String?, ?logo: ::Hash[Symbol, top]?, ?metadata: ::Hash[Symbol, top], + ?onboarding_type: String?, + ?opengraph_image: ::Hash[Symbol, top]?, + ?opengraph_image_variant: String?, + ?other_business_description: String?, + ?other_industry_description: String?, + ?require_2fa: bool, ?route: String?, ?send_customer_emails: bool, + ?show_joined_whops: bool, + ?show_reviews_dtc: bool, + ?show_user_directory: bool, ?social_links: ::Array[::Hash[Symbol, top]], + ?store_page_config: ::Hash[Symbol, top]?, ?target_audience: String?, ?title: String?, + ?use_logo_as_opengraph_image_fallback: bool, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Account diff --git a/test/whop_sdk/resources/accounts_test.rb b/test/whop_sdk/resources/accounts_test.rb index 843c774e..4fa77d81 100644 --- a/test/whop_sdk/resources/accounts_test.rb +++ b/test/whop_sdk/resources/accounts_test.rb @@ -17,19 +17,33 @@ def test_create id: String, banner_image_url: String | nil, business_type: String | nil, + country: String | nil, created_at: String, description: String | nil, email: String | nil, + home_preferences: ^(WhopSDK::Internal::Type::ArrayOf[String]), industry_group: String | nil, industry_type: String | nil, + invoice_prefix: String | nil, logo_url: String | nil, metadata: WhopSDK::Internal::Type::Unknown, + onboarding_type: String | nil, + opengraph_image_url: String | nil, + opengraph_image_variant: String | nil, + other_business_description: String | nil, + other_industry_description: String | nil, parent_account_id: String | nil, + require_2fa: WhopSDK::Internal::Type::Boolean, route: String, send_customer_emails: WhopSDK::Internal::Type::Boolean, + show_joined_whops: WhopSDK::Internal::Type::Boolean, + show_reviews_dtc: WhopSDK::Internal::Type::Boolean, + show_user_directory: WhopSDK::Internal::Type::Boolean, social_links: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AccountSocialLink]), + store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, title: String, + use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, wallet: WhopSDK::AccountWallet | nil } end @@ -49,19 +63,33 @@ def test_retrieve id: String, banner_image_url: String | nil, business_type: String | nil, + country: String | nil, created_at: String, description: String | nil, email: String | nil, + home_preferences: ^(WhopSDK::Internal::Type::ArrayOf[String]), industry_group: String | nil, industry_type: String | nil, + invoice_prefix: String | nil, logo_url: String | nil, metadata: WhopSDK::Internal::Type::Unknown, + onboarding_type: String | nil, + opengraph_image_url: String | nil, + opengraph_image_variant: String | nil, + other_business_description: String | nil, + other_industry_description: String | nil, parent_account_id: String | nil, + require_2fa: WhopSDK::Internal::Type::Boolean, route: String, send_customer_emails: WhopSDK::Internal::Type::Boolean, + show_joined_whops: WhopSDK::Internal::Type::Boolean, + show_reviews_dtc: WhopSDK::Internal::Type::Boolean, + show_user_directory: WhopSDK::Internal::Type::Boolean, social_links: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AccountSocialLink]), + store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, title: String, + use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, wallet: WhopSDK::AccountWallet | nil } end @@ -81,19 +109,33 @@ def test_update id: String, banner_image_url: String | nil, business_type: String | nil, + country: String | nil, created_at: String, description: String | nil, email: String | nil, + home_preferences: ^(WhopSDK::Internal::Type::ArrayOf[String]), industry_group: String | nil, industry_type: String | nil, + invoice_prefix: String | nil, logo_url: String | nil, metadata: WhopSDK::Internal::Type::Unknown, + onboarding_type: String | nil, + opengraph_image_url: String | nil, + opengraph_image_variant: String | nil, + other_business_description: String | nil, + other_industry_description: String | nil, parent_account_id: String | nil, + require_2fa: WhopSDK::Internal::Type::Boolean, route: String, send_customer_emails: WhopSDK::Internal::Type::Boolean, + show_joined_whops: WhopSDK::Internal::Type::Boolean, + show_reviews_dtc: WhopSDK::Internal::Type::Boolean, + show_user_directory: WhopSDK::Internal::Type::Boolean, social_links: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AccountSocialLink]), + store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, title: String, + use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, wallet: WhopSDK::AccountWallet | nil } end @@ -130,19 +172,33 @@ def test_me id: String, banner_image_url: String | nil, business_type: String | nil, + country: String | nil, created_at: String, description: String | nil, email: String | nil, + home_preferences: ^(WhopSDK::Internal::Type::ArrayOf[String]), industry_group: String | nil, industry_type: String | nil, + invoice_prefix: String | nil, logo_url: String | nil, metadata: WhopSDK::Internal::Type::Unknown, + onboarding_type: String | nil, + opengraph_image_url: String | nil, + opengraph_image_variant: String | nil, + other_business_description: String | nil, + other_industry_description: String | nil, parent_account_id: String | nil, + require_2fa: WhopSDK::Internal::Type::Boolean, route: String, send_customer_emails: WhopSDK::Internal::Type::Boolean, + show_joined_whops: WhopSDK::Internal::Type::Boolean, + show_reviews_dtc: WhopSDK::Internal::Type::Boolean, + show_user_directory: WhopSDK::Internal::Type::Boolean, social_links: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AccountSocialLink]), + store_page_config: WhopSDK::Internal::Type::Unknown, target_audience: String | nil, title: String, + use_logo_as_opengraph_image_fallback: WhopSDK::Internal::Type::Boolean, wallet: WhopSDK::AccountWallet | nil } end From 610a21f3f59063d0280f0710d54bb3b7d5fcf453 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 5 Jun 2026 00:12:25 +0000 Subject: [PATCH 04/17] Route pixel conversions through worker proxy with edge geo Stainless-Generated-From: f5678538bfe00233476757ba9a057cad8a7838de --- .../models/conversion_create_params.rb | 169 ++++++++++++++++- lib/whop_sdk/resources/conversions.rb | 13 +- .../models/conversion_create_params.rbi | 174 +++++++++++++++++- rbi/whop_sdk/resources/conversions.rbi | 13 ++ .../models/conversion_create_params.rbs | 107 ++++++++++- sig/whop_sdk/resources/conversions.rbs | 4 + 6 files changed, 470 insertions(+), 10 deletions(-) diff --git a/lib/whop_sdk/models/conversion_create_params.rb b/lib/whop_sdk/models/conversion_create_params.rb index 50a5b678..ce351709 100644 --- a/lib/whop_sdk/models/conversion_create_params.rb +++ b/lib/whop_sdk/models/conversion_create_params.rb @@ -43,6 +43,12 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :custom_name, String, nil?: true + # @!attribute duration + # For 'leave' events: milliseconds the visitor spent on the page. + # + # @return [Integer, nil] + optional :duration, Integer, nil?: true + # @!attribute event_id # Client-provided identifier for deduplication. Generated if omitted. # @@ -73,6 +79,25 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :referrer_url, String, nil?: true + # @!attribute resumed + # For 'page' events: true when the page was restored from the back/forward cache. + # + # @return [Boolean, nil] + optional :resumed, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!attribute source + # For 'identify' events: where the identity was captured (url, form, manual, + # iframe). + # + # @return [String, nil] + optional :source, String, nil?: true + + # @!attribute title + # For 'page' events: the document title. + # + # @return [String, nil] + optional :title, String, nil?: true + # @!attribute url # The URL where the event occurred. # @@ -91,7 +116,10 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # @return [Float, nil] optional :value, Float, nil?: true - # @!method initialize(company_id:, event_name:, action_source: nil, context: nil, currency: nil, custom_name: nil, event_id: nil, event_time: nil, plan_id: nil, product_id: nil, referrer_url: nil, url: nil, user: nil, value: nil, request_options: {}) + # @!method initialize(company_id:, event_name:, action_source: nil, context: nil, currency: nil, custom_name: nil, duration: nil, event_id: nil, event_time: nil, plan_id: nil, product_id: nil, referrer_url: nil, resumed: nil, source: nil, title: nil, url: nil, user: nil, value: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ConversionCreateParams} for more details. + # # @param company_id [String] The company to associate with this event. # # @param event_name [Symbol, WhopSDK::Models::ConversionCreateParams::EventName] The type of event. @@ -104,6 +132,8 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # # @param custom_name [String, nil] Custom event name when event_name is 'custom'. # + # @param duration [Integer, nil] For 'leave' events: milliseconds the visitor spent on the page. + # # @param event_id [String, nil] Client-provided identifier for deduplication. Generated if omitted. # # @param event_time [Time, nil] When the event occurred. Defaults to now. @@ -114,6 +144,12 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # # @param referrer_url [String, nil] The referring URL. # + # @param resumed [Boolean, nil] For 'page' events: true when the page was restored from the back/forward cache. + # + # @param source [String, nil] For 'identify' events: where the identity was captured (url, form, manual, ifram + # + # @param title [String, nil] For 'page' events: the document title. + # # @param url [String, nil] The URL where the event occurred. # # @param user [WhopSDK::Models::ConversionCreateParams::User, nil] User identity and profile data. @@ -132,6 +168,9 @@ module EventName COMPLETE_REGISTRATION = :complete_registration SCHEDULE = :schedule CUSTOM = :custom + PAGE = :page + LEAVE = :leave + IDENTIFY = :identify # @!method self.values # @return [Array] @@ -174,6 +213,12 @@ class Context < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :ad_set_id, String, nil?: true + # @!attribute fbc + # Facebook click cookie (\_fbc, format fb.1.{timestamp}.{fbclid}). + # + # @return [String, nil] + optional :fbc, String, nil?: true + # @!attribute fbclid # Facebook click ID. # @@ -186,12 +231,30 @@ class Context < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :fbp, String, nil?: true + # @!attribute fingerprint + # Client-side device fingerprint. + # + # @return [String, nil] + optional :fingerprint, String, nil?: true + + # @!attribute fingerprint_confidence + # Confidence score (0-1) for the device fingerprint. + # + # @return [Float, nil] + optional :fingerprint_confidence, Float, nil?: true + # @!attribute ga # Google Analytics client ID. # # @return [String, nil] optional :ga, String, nil?: true + # @!attribute gbraid + # Google Ads gbraid click ID (iOS privacy). + # + # @return [String, nil] + optional :gbraid, String, nil?: true + # @!attribute gclid # Google click ID. # @@ -210,6 +273,48 @@ class Context < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :ip_address, String, nil?: true + # @!attribute language + # Browser language (e.g. en-US). + # + # @return [String, nil] + optional :language, String, nil?: true + + # @!attribute li_fat_id + # LinkedIn click ID. + # + # @return [String, nil] + optional :li_fat_id, String, nil?: true + + # @!attribute msclkid + # Microsoft Advertising (Bing) click ID. + # + # @return [String, nil] + optional :msclkid, String, nil?: true + + # @!attribute rdt_cid + # Reddit click ID. + # + # @return [String, nil] + optional :rdt_cid, String, nil?: true + + # @!attribute sccid + # Snapchat click ID. + # + # @return [String, nil] + optional :sccid, String, nil?: true + + # @!attribute screen_resolution + # Screen resolution (e.g. 1920x1080). + # + # @return [String, nil] + optional :screen_resolution, String, nil?: true + + # @!attribute timezone + # IANA timezone (e.g. America/New_York). + # + # @return [String, nil] + optional :timezone, String, nil?: true + # @!attribute ttclid # TikTok click ID. # @@ -222,6 +327,12 @@ class Context < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :ttp, String, nil?: true + # @!attribute twclid + # X (Twitter) click ID. + # + # @return [String, nil] + optional :twclid, String, nil?: true + # @!attribute user_agent # Browser user agent string. # @@ -264,7 +375,13 @@ class Context < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :utm_term, String, nil?: true - # @!method initialize(ad_campaign_id: nil, ad_id: nil, ad_set_id: nil, fbclid: nil, fbp: nil, ga: nil, gclid: nil, ig_sid: nil, ip_address: nil, ttclid: nil, ttp: nil, user_agent: nil, utm_campaign: nil, utm_content: nil, utm_id: nil, utm_medium: nil, utm_source: nil, utm_term: nil) + # @!attribute wbraid + # Google Ads wbraid click ID (iOS privacy). + # + # @return [String, nil] + optional :wbraid, String, nil?: true + + # @!method initialize(ad_campaign_id: nil, ad_id: nil, ad_set_id: nil, fbc: nil, fbclid: nil, fbp: nil, fingerprint: nil, fingerprint_confidence: nil, ga: nil, gbraid: nil, gclid: nil, ig_sid: nil, ip_address: nil, language: nil, li_fat_id: nil, msclkid: nil, rdt_cid: nil, sccid: nil, screen_resolution: nil, timezone: nil, ttclid: nil, ttp: nil, twclid: nil, user_agent: nil, utm_campaign: nil, utm_content: nil, utm_id: nil, utm_medium: nil, utm_source: nil, utm_term: nil, wbraid: nil) # Tracking and attribution context. # # @param ad_campaign_id [String, nil] Ad campaign ID. @@ -273,22 +390,46 @@ class Context < WhopSDK::Internal::Type::BaseModel # # @param ad_set_id [String, nil] Ad set ID. # + # @param fbc [String, nil] Facebook click cookie (\_fbc, format fb.1.{timestamp}.{fbclid}). + # # @param fbclid [String, nil] Facebook click ID. # # @param fbp [String, nil] Facebook browser pixel ID. # + # @param fingerprint [String, nil] Client-side device fingerprint. + # + # @param fingerprint_confidence [Float, nil] Confidence score (0-1) for the device fingerprint. + # # @param ga [String, nil] Google Analytics client ID. # + # @param gbraid [String, nil] Google Ads gbraid click ID (iOS privacy). + # # @param gclid [String, nil] Google click ID. # # @param ig_sid [String, nil] Instagram session ID. # # @param ip_address [String, nil] IP address. # + # @param language [String, nil] Browser language (e.g. en-US). + # + # @param li_fat_id [String, nil] LinkedIn click ID. + # + # @param msclkid [String, nil] Microsoft Advertising (Bing) click ID. + # + # @param rdt_cid [String, nil] Reddit click ID. + # + # @param sccid [String, nil] Snapchat click ID. + # + # @param screen_resolution [String, nil] Screen resolution (e.g. 1920x1080). + # + # @param timezone [String, nil] IANA timezone (e.g. America/New_York). + # # @param ttclid [String, nil] TikTok click ID. # # @param ttp [String, nil] TikTok pixel ID. # + # @param twclid [String, nil] X (Twitter) click ID. + # # @param user_agent [String, nil] Browser user agent string. # # @param utm_campaign [String, nil] UTM campaign parameter. @@ -302,6 +443,8 @@ class Context < WhopSDK::Internal::Type::BaseModel # @param utm_source [String, nil] UTM source parameter. # # @param utm_term [String, nil] UTM term parameter. + # + # @param wbraid [String, nil] Google Ads wbraid click ID (iOS privacy). end class User < WhopSDK::Internal::Type::BaseModel @@ -359,6 +502,19 @@ class User < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :last_name, String, nil?: true + # @!attribute linked_anonymous_id + # A second anonymous identifier to link to this user (e.g. captured across an + # iframe boundary). + # + # @return [String, nil] + optional :linked_anonymous_id, String, nil?: true + + # @!attribute linked_wuid + # A wuid from a linked frame, captured across an iframe boundary. + # + # @return [String, nil] + optional :linked_wuid, String, nil?: true + # @!attribute member_id # The Whop member ID. # @@ -407,7 +563,10 @@ class User < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :username, String, nil?: true - # @!method initialize(anonymous_id: nil, birthdate: nil, city: nil, country: nil, email: nil, external_id: nil, first_name: nil, gender: nil, last_name: nil, member_id: nil, membership_id: nil, name: nil, phone: nil, postal_code: nil, state: nil, user_id: nil, username: nil) + # @!method initialize(anonymous_id: nil, birthdate: nil, city: nil, country: nil, email: nil, external_id: nil, first_name: nil, gender: nil, last_name: nil, linked_anonymous_id: nil, linked_wuid: nil, member_id: nil, membership_id: nil, name: nil, phone: nil, postal_code: nil, state: nil, user_id: nil, username: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ConversionCreateParams::User} for more details. + # # User identity and profile data. # # @param anonymous_id [String, nil] An anonymous identifier for the user. @@ -428,6 +587,10 @@ class User < WhopSDK::Internal::Type::BaseModel # # @param last_name [String, nil] Last name. # + # @param linked_anonymous_id [String, nil] A second anonymous identifier to link to this user (e.g. captured across an ifra + # + # @param linked_wuid [String, nil] A wuid from a linked frame, captured across an iframe boundary. + # # @param member_id [String, nil] The Whop member ID. # # @param membership_id [String, nil] The Whop membership ID. diff --git a/lib/whop_sdk/resources/conversions.rb b/lib/whop_sdk/resources/conversions.rb index fcb00b99..c339040c 100644 --- a/lib/whop_sdk/resources/conversions.rb +++ b/lib/whop_sdk/resources/conversions.rb @@ -4,13 +4,16 @@ module WhopSDK module Resources # Conversions class Conversions + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::ConversionCreateParams} for more details. + # # Track a conversion or engagement event for a company. # # Required permissions: # # - `event:create` # - # @overload create(company_id:, event_name:, action_source: nil, context: nil, currency: nil, custom_name: nil, event_id: nil, event_time: nil, plan_id: nil, product_id: nil, referrer_url: nil, url: nil, user: nil, value: nil, request_options: {}) + # @overload create(company_id:, event_name:, action_source: nil, context: nil, currency: nil, custom_name: nil, duration: nil, event_id: nil, event_time: nil, plan_id: nil, product_id: nil, referrer_url: nil, resumed: nil, source: nil, title: nil, url: nil, user: nil, value: nil, request_options: {}) # # @param company_id [String] The company to associate with this event. # @@ -24,6 +27,8 @@ class Conversions # # @param custom_name [String, nil] Custom event name when event_name is 'custom'. # + # @param duration [Integer, nil] For 'leave' events: milliseconds the visitor spent on the page. + # # @param event_id [String, nil] Client-provided identifier for deduplication. Generated if omitted. # # @param event_time [Time, nil] When the event occurred. Defaults to now. @@ -34,6 +39,12 @@ class Conversions # # @param referrer_url [String, nil] The referring URL. # + # @param resumed [Boolean, nil] For 'page' events: true when the page was restored from the back/forward cache. + # + # @param source [String, nil] For 'identify' events: where the identity was captured (url, form, manual, ifram + # + # @param title [String, nil] For 'page' events: the document title. + # # @param url [String, nil] The URL where the event occurred. # # @param user [WhopSDK::Models::ConversionCreateParams::User, nil] User identity and profile data. diff --git a/rbi/whop_sdk/models/conversion_create_params.rbi b/rbi/whop_sdk/models/conversion_create_params.rbi index 60a3e2eb..619f43aa 100644 --- a/rbi/whop_sdk/models/conversion_create_params.rbi +++ b/rbi/whop_sdk/models/conversion_create_params.rbi @@ -46,6 +46,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :custom_name + # For 'leave' events: milliseconds the visitor spent on the page. + sig { returns(T.nilable(Integer)) } + attr_accessor :duration + # Client-provided identifier for deduplication. Generated if omitted. sig { returns(T.nilable(String)) } attr_accessor :event_id @@ -66,6 +70,19 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :referrer_url + # For 'page' events: true when the page was restored from the back/forward cache. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :resumed + + # For 'identify' events: where the identity was captured (url, form, manual, + # iframe). + sig { returns(T.nilable(String)) } + attr_accessor :source + + # For 'page' events: the document title. + sig { returns(T.nilable(String)) } + attr_accessor :title + # The URL where the event occurred. sig { returns(T.nilable(String)) } attr_accessor :url @@ -94,11 +111,15 @@ module WhopSDK context: T.nilable(WhopSDK::ConversionCreateParams::Context::OrHash), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_name: T.nilable(String), + duration: T.nilable(Integer), event_id: T.nilable(String), event_time: T.nilable(Time), plan_id: T.nilable(String), product_id: T.nilable(String), referrer_url: T.nilable(String), + resumed: T.nilable(T::Boolean), + source: T.nilable(String), + title: T.nilable(String), url: T.nilable(String), user: T.nilable(WhopSDK::ConversionCreateParams::User::OrHash), value: T.nilable(Float), @@ -118,6 +139,8 @@ module WhopSDK currency: nil, # Custom event name when event_name is 'custom'. custom_name: nil, + # For 'leave' events: milliseconds the visitor spent on the page. + duration: nil, # Client-provided identifier for deduplication. Generated if omitted. event_id: nil, # When the event occurred. Defaults to now. @@ -128,6 +151,13 @@ module WhopSDK product_id: nil, # The referring URL. referrer_url: nil, + # For 'page' events: true when the page was restored from the back/forward cache. + resumed: nil, + # For 'identify' events: where the identity was captured (url, form, manual, + # iframe). + source: nil, + # For 'page' events: the document title. + title: nil, # The URL where the event occurred. url: nil, # User identity and profile data. @@ -150,11 +180,15 @@ module WhopSDK context: T.nilable(WhopSDK::ConversionCreateParams::Context), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_name: T.nilable(String), + duration: T.nilable(Integer), event_id: T.nilable(String), event_time: T.nilable(Time), plan_id: T.nilable(String), product_id: T.nilable(String), referrer_url: T.nilable(String), + resumed: T.nilable(T::Boolean), + source: T.nilable(String), + title: T.nilable(String), url: T.nilable(String), user: T.nilable(WhopSDK::ConversionCreateParams::User), value: T.nilable(Float), @@ -202,6 +236,18 @@ module WhopSDK :custom, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol ) + PAGE = + T.let(:page, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol) + LEAVE = + T.let( + :leave, + WhopSDK::ConversionCreateParams::EventName::TaggedSymbol + ) + IDENTIFY = + T.let( + :identify, + WhopSDK::ConversionCreateParams::EventName::TaggedSymbol + ) sig do override.returns( @@ -300,6 +346,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :ad_set_id + # Facebook click cookie (\_fbc, format fb.1.{timestamp}.{fbclid}). + sig { returns(T.nilable(String)) } + attr_accessor :fbc + # Facebook click ID. sig { returns(T.nilable(String)) } attr_accessor :fbclid @@ -308,10 +358,22 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :fbp + # Client-side device fingerprint. + sig { returns(T.nilable(String)) } + attr_accessor :fingerprint + + # Confidence score (0-1) for the device fingerprint. + sig { returns(T.nilable(Float)) } + attr_accessor :fingerprint_confidence + # Google Analytics client ID. sig { returns(T.nilable(String)) } attr_accessor :ga + # Google Ads gbraid click ID (iOS privacy). + sig { returns(T.nilable(String)) } + attr_accessor :gbraid + # Google click ID. sig { returns(T.nilable(String)) } attr_accessor :gclid @@ -324,6 +386,34 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :ip_address + # Browser language (e.g. en-US). + sig { returns(T.nilable(String)) } + attr_accessor :language + + # LinkedIn click ID. + sig { returns(T.nilable(String)) } + attr_accessor :li_fat_id + + # Microsoft Advertising (Bing) click ID. + sig { returns(T.nilable(String)) } + attr_accessor :msclkid + + # Reddit click ID. + sig { returns(T.nilable(String)) } + attr_accessor :rdt_cid + + # Snapchat click ID. + sig { returns(T.nilable(String)) } + attr_accessor :sccid + + # Screen resolution (e.g. 1920x1080). + sig { returns(T.nilable(String)) } + attr_accessor :screen_resolution + + # IANA timezone (e.g. America/New_York). + sig { returns(T.nilable(String)) } + attr_accessor :timezone + # TikTok click ID. sig { returns(T.nilable(String)) } attr_accessor :ttclid @@ -332,6 +422,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :ttp + # X (Twitter) click ID. + sig { returns(T.nilable(String)) } + attr_accessor :twclid + # Browser user agent string. sig { returns(T.nilable(String)) } attr_accessor :user_agent @@ -360,27 +454,44 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :utm_term + # Google Ads wbraid click ID (iOS privacy). + sig { returns(T.nilable(String)) } + attr_accessor :wbraid + # Tracking and attribution context. sig do params( ad_campaign_id: T.nilable(String), ad_id: T.nilable(String), ad_set_id: T.nilable(String), + fbc: T.nilable(String), fbclid: T.nilable(String), fbp: T.nilable(String), + fingerprint: T.nilable(String), + fingerprint_confidence: T.nilable(Float), ga: T.nilable(String), + gbraid: T.nilable(String), gclid: T.nilable(String), ig_sid: T.nilable(String), ip_address: T.nilable(String), + language: T.nilable(String), + li_fat_id: T.nilable(String), + msclkid: T.nilable(String), + rdt_cid: T.nilable(String), + sccid: T.nilable(String), + screen_resolution: T.nilable(String), + timezone: T.nilable(String), ttclid: T.nilable(String), ttp: T.nilable(String), + twclid: T.nilable(String), user_agent: T.nilable(String), utm_campaign: T.nilable(String), utm_content: T.nilable(String), utm_id: T.nilable(String), utm_medium: T.nilable(String), utm_source: T.nilable(String), - utm_term: T.nilable(String) + utm_term: T.nilable(String), + wbraid: T.nilable(String) ).returns(T.attached_class) end def self.new( @@ -390,22 +501,46 @@ module WhopSDK ad_id: nil, # Ad set ID. ad_set_id: nil, + # Facebook click cookie (\_fbc, format fb.1.{timestamp}.{fbclid}). + fbc: nil, # Facebook click ID. fbclid: nil, # Facebook browser pixel ID. fbp: nil, + # Client-side device fingerprint. + fingerprint: nil, + # Confidence score (0-1) for the device fingerprint. + fingerprint_confidence: nil, # Google Analytics client ID. ga: nil, + # Google Ads gbraid click ID (iOS privacy). + gbraid: nil, # Google click ID. gclid: nil, # Instagram session ID. ig_sid: nil, # IP address. ip_address: nil, + # Browser language (e.g. en-US). + language: nil, + # LinkedIn click ID. + li_fat_id: nil, + # Microsoft Advertising (Bing) click ID. + msclkid: nil, + # Reddit click ID. + rdt_cid: nil, + # Snapchat click ID. + sccid: nil, + # Screen resolution (e.g. 1920x1080). + screen_resolution: nil, + # IANA timezone (e.g. America/New_York). + timezone: nil, # TikTok click ID. ttclid: nil, # TikTok pixel ID. ttp: nil, + # X (Twitter) click ID. + twclid: nil, # Browser user agent string. user_agent: nil, # UTM campaign parameter. @@ -419,7 +554,9 @@ module WhopSDK # UTM source parameter. utm_source: nil, # UTM term parameter. - utm_term: nil + utm_term: nil, + # Google Ads wbraid click ID (iOS privacy). + wbraid: nil ) end @@ -429,21 +566,34 @@ module WhopSDK ad_campaign_id: T.nilable(String), ad_id: T.nilable(String), ad_set_id: T.nilable(String), + fbc: T.nilable(String), fbclid: T.nilable(String), fbp: T.nilable(String), + fingerprint: T.nilable(String), + fingerprint_confidence: T.nilable(Float), ga: T.nilable(String), + gbraid: T.nilable(String), gclid: T.nilable(String), ig_sid: T.nilable(String), ip_address: T.nilable(String), + language: T.nilable(String), + li_fat_id: T.nilable(String), + msclkid: T.nilable(String), + rdt_cid: T.nilable(String), + sccid: T.nilable(String), + screen_resolution: T.nilable(String), + timezone: T.nilable(String), ttclid: T.nilable(String), ttp: T.nilable(String), + twclid: T.nilable(String), user_agent: T.nilable(String), utm_campaign: T.nilable(String), utm_content: T.nilable(String), utm_id: T.nilable(String), utm_medium: T.nilable(String), utm_source: T.nilable(String), - utm_term: T.nilable(String) + utm_term: T.nilable(String), + wbraid: T.nilable(String) } ) end @@ -500,6 +650,15 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :last_name + # A second anonymous identifier to link to this user (e.g. captured across an + # iframe boundary). + sig { returns(T.nilable(String)) } + attr_accessor :linked_anonymous_id + + # A wuid from a linked frame, captured across an iframe boundary. + sig { returns(T.nilable(String)) } + attr_accessor :linked_wuid + # The Whop member ID. sig { returns(T.nilable(String)) } attr_accessor :member_id @@ -547,6 +706,8 @@ module WhopSDK WhopSDK::ConversionCreateParams::User::Gender::OrSymbol ), last_name: T.nilable(String), + linked_anonymous_id: T.nilable(String), + linked_wuid: T.nilable(String), member_id: T.nilable(String), membership_id: T.nilable(String), name: T.nilable(String), @@ -576,6 +737,11 @@ module WhopSDK gender: nil, # Last name. last_name: nil, + # A second anonymous identifier to link to this user (e.g. captured across an + # iframe boundary). + linked_anonymous_id: nil, + # A wuid from a linked frame, captured across an iframe boundary. + linked_wuid: nil, # The Whop member ID. member_id: nil, # The Whop membership ID. @@ -610,6 +776,8 @@ module WhopSDK WhopSDK::ConversionCreateParams::User::Gender::OrSymbol ), last_name: T.nilable(String), + linked_anonymous_id: T.nilable(String), + linked_wuid: T.nilable(String), member_id: T.nilable(String), membership_id: T.nilable(String), name: T.nilable(String), diff --git a/rbi/whop_sdk/resources/conversions.rbi b/rbi/whop_sdk/resources/conversions.rbi index ae00c722..3b09d09b 100644 --- a/rbi/whop_sdk/resources/conversions.rbi +++ b/rbi/whop_sdk/resources/conversions.rbi @@ -18,11 +18,15 @@ module WhopSDK context: T.nilable(WhopSDK::ConversionCreateParams::Context::OrHash), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_name: T.nilable(String), + duration: T.nilable(Integer), event_id: T.nilable(String), event_time: T.nilable(Time), plan_id: T.nilable(String), product_id: T.nilable(String), referrer_url: T.nilable(String), + resumed: T.nilable(T::Boolean), + source: T.nilable(String), + title: T.nilable(String), url: T.nilable(String), user: T.nilable(WhopSDK::ConversionCreateParams::User::OrHash), value: T.nilable(Float), @@ -42,6 +46,8 @@ module WhopSDK currency: nil, # Custom event name when event_name is 'custom'. custom_name: nil, + # For 'leave' events: milliseconds the visitor spent on the page. + duration: nil, # Client-provided identifier for deduplication. Generated if omitted. event_id: nil, # When the event occurred. Defaults to now. @@ -52,6 +58,13 @@ module WhopSDK product_id: nil, # The referring URL. referrer_url: nil, + # For 'page' events: true when the page was restored from the back/forward cache. + resumed: nil, + # For 'identify' events: where the identity was captured (url, form, manual, + # iframe). + source: nil, + # For 'page' events: the document title. + title: nil, # The URL where the event occurred. url: nil, # User identity and profile data. diff --git a/sig/whop_sdk/models/conversion_create_params.rbs b/sig/whop_sdk/models/conversion_create_params.rbs index df5e080a..d4cda78c 100644 --- a/sig/whop_sdk/models/conversion_create_params.rbs +++ b/sig/whop_sdk/models/conversion_create_params.rbs @@ -8,11 +8,15 @@ module WhopSDK context: WhopSDK::ConversionCreateParams::Context?, currency: WhopSDK::Models::currency?, custom_name: String?, + duration: Integer?, event_id: String?, event_time: Time?, plan_id: String?, product_id: String?, referrer_url: String?, + resumed: bool?, + source: String?, + title: String?, url: String?, user: WhopSDK::ConversionCreateParams::User?, value: Float? @@ -35,6 +39,8 @@ module WhopSDK attr_accessor custom_name: String? + attr_accessor duration: Integer? + attr_accessor event_id: String? attr_accessor event_time: Time? @@ -45,6 +51,12 @@ module WhopSDK attr_accessor referrer_url: String? + attr_accessor resumed: bool? + + attr_accessor source: String? + + attr_accessor title: String? + attr_accessor url: String? attr_accessor user: WhopSDK::ConversionCreateParams::User? @@ -58,11 +70,15 @@ module WhopSDK ?context: WhopSDK::ConversionCreateParams::Context?, ?currency: WhopSDK::Models::currency?, ?custom_name: String?, + ?duration: Integer?, ?event_id: String?, ?event_time: Time?, ?plan_id: String?, ?product_id: String?, ?referrer_url: String?, + ?resumed: bool?, + ?source: String?, + ?title: String?, ?url: String?, ?user: WhopSDK::ConversionCreateParams::User?, ?value: Float?, @@ -76,11 +92,15 @@ module WhopSDK context: WhopSDK::ConversionCreateParams::Context?, currency: WhopSDK::Models::currency?, custom_name: String?, + duration: Integer?, event_id: String?, event_time: Time?, plan_id: String?, product_id: String?, referrer_url: String?, + resumed: bool?, + source: String?, + title: String?, url: String?, user: WhopSDK::ConversionCreateParams::User?, value: Float?, @@ -94,6 +114,9 @@ module WhopSDK | :complete_registration | :schedule | :custom + | :page + | :leave + | :identify module EventName extend WhopSDK::Internal::Type::Enum @@ -104,6 +127,9 @@ module WhopSDK COMPLETE_REGISTRATION: :complete_registration SCHEDULE: :schedule CUSTOM: :custom + PAGE: :page + LEAVE: :leave + IDENTIFY: :identify def self?.values: -> ::Array[WhopSDK::Models::ConversionCreateParams::event_name] end @@ -140,21 +166,34 @@ module WhopSDK ad_campaign_id: String?, ad_id: String?, ad_set_id: String?, + fbc: String?, fbclid: String?, fbp: String?, + fingerprint: String?, + fingerprint_confidence: Float?, ga: String?, + gbraid: String?, gclid: String?, ig_sid: String?, ip_address: String?, + language: String?, + li_fat_id: String?, + msclkid: String?, + rdt_cid: String?, + sccid: String?, + screen_resolution: String?, + timezone: String?, ttclid: String?, ttp: String?, + twclid: String?, user_agent: String?, utm_campaign: String?, utm_content: String?, utm_id: String?, utm_medium: String?, utm_source: String?, - utm_term: String? + utm_term: String?, + wbraid: String? } class Context < WhopSDK::Internal::Type::BaseModel @@ -164,22 +203,46 @@ module WhopSDK attr_accessor ad_set_id: String? + attr_accessor fbc: String? + attr_accessor fbclid: String? attr_accessor fbp: String? + attr_accessor fingerprint: String? + + attr_accessor fingerprint_confidence: Float? + attr_accessor ga: String? + attr_accessor gbraid: String? + attr_accessor gclid: String? attr_accessor ig_sid: String? attr_accessor ip_address: String? + attr_accessor language: String? + + attr_accessor li_fat_id: String? + + attr_accessor msclkid: String? + + attr_accessor rdt_cid: String? + + attr_accessor sccid: String? + + attr_accessor screen_resolution: String? + + attr_accessor timezone: String? + attr_accessor ttclid: String? attr_accessor ttp: String? + attr_accessor twclid: String? + attr_accessor user_agent: String? attr_accessor utm_campaign: String? @@ -194,46 +257,74 @@ module WhopSDK attr_accessor utm_term: String? + attr_accessor wbraid: String? + def initialize: ( ?ad_campaign_id: String?, ?ad_id: String?, ?ad_set_id: String?, + ?fbc: String?, ?fbclid: String?, ?fbp: String?, + ?fingerprint: String?, + ?fingerprint_confidence: Float?, ?ga: String?, + ?gbraid: String?, ?gclid: String?, ?ig_sid: String?, ?ip_address: String?, + ?language: String?, + ?li_fat_id: String?, + ?msclkid: String?, + ?rdt_cid: String?, + ?sccid: String?, + ?screen_resolution: String?, + ?timezone: String?, ?ttclid: String?, ?ttp: String?, + ?twclid: String?, ?user_agent: String?, ?utm_campaign: String?, ?utm_content: String?, ?utm_id: String?, ?utm_medium: String?, ?utm_source: String?, - ?utm_term: String? + ?utm_term: String?, + ?wbraid: String? ) -> void def to_hash: -> { ad_campaign_id: String?, ad_id: String?, ad_set_id: String?, + fbc: String?, fbclid: String?, fbp: String?, + fingerprint: String?, + fingerprint_confidence: Float?, ga: String?, + gbraid: String?, gclid: String?, ig_sid: String?, ip_address: String?, + language: String?, + li_fat_id: String?, + msclkid: String?, + rdt_cid: String?, + sccid: String?, + screen_resolution: String?, + timezone: String?, ttclid: String?, ttp: String?, + twclid: String?, user_agent: String?, utm_campaign: String?, utm_content: String?, utm_id: String?, utm_medium: String?, utm_source: String?, - utm_term: String? + utm_term: String?, + wbraid: String? } end @@ -248,6 +339,8 @@ module WhopSDK first_name: String?, gender: WhopSDK::Models::ConversionCreateParams::User::gender?, last_name: String?, + linked_anonymous_id: String?, + linked_wuid: String?, member_id: String?, membership_id: String?, name: String?, @@ -277,6 +370,10 @@ module WhopSDK attr_accessor last_name: String? + attr_accessor linked_anonymous_id: String? + + attr_accessor linked_wuid: String? + attr_accessor member_id: String? attr_accessor membership_id: String? @@ -303,6 +400,8 @@ module WhopSDK ?first_name: String?, ?gender: WhopSDK::Models::ConversionCreateParams::User::gender?, ?last_name: String?, + ?linked_anonymous_id: String?, + ?linked_wuid: String?, ?member_id: String?, ?membership_id: String?, ?name: String?, @@ -323,6 +422,8 @@ module WhopSDK first_name: String?, gender: WhopSDK::Models::ConversionCreateParams::User::gender?, last_name: String?, + linked_anonymous_id: String?, + linked_wuid: String?, member_id: String?, membership_id: String?, name: String?, diff --git a/sig/whop_sdk/resources/conversions.rbs b/sig/whop_sdk/resources/conversions.rbs index 2caaf39f..28f6899b 100644 --- a/sig/whop_sdk/resources/conversions.rbs +++ b/sig/whop_sdk/resources/conversions.rbs @@ -8,11 +8,15 @@ module WhopSDK ?context: WhopSDK::ConversionCreateParams::Context?, ?currency: WhopSDK::Models::currency?, ?custom_name: String?, + ?duration: Integer?, ?event_id: String?, ?event_time: Time?, ?plan_id: String?, ?product_id: String?, ?referrer_url: String?, + ?resumed: bool?, + ?source: String?, + ?title: String?, ?url: String?, ?user: WhopSDK::ConversionCreateParams::User?, ?value: Float?, From eafa99ed86b4e9d77fc478110daf3136a96ca13d Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 5 Jun 2026 07:45:41 +0000 Subject: [PATCH 05/17] feat(ads): ad campaigns, ad groups, and ads root tables + public API massive cleanup Stainless-Generated-From: 2b79a2f26bbedbac1ea55a35e0c48484fbc17dbe --- lib/whop_sdk/models/ad.rb | 248 +++++++- lib/whop_sdk/models/ad_campaign.rb | 360 ++++++----- .../models/ad_campaign_list_params.rb | 27 +- .../models/ad_campaign_list_response.rb | 254 +++++++- .../models/ad_campaign_retrieve_params.rb | 24 +- lib/whop_sdk/models/ad_group.rb | 254 +++++++- lib/whop_sdk/models/ad_group_list_params.rb | 58 +- lib/whop_sdk/models/ad_group_list_response.rb | 254 +++++++- .../models/ad_group_retrieve_params.rb | 24 +- lib/whop_sdk/models/ad_list_params.rb | 101 +++- lib/whop_sdk/models/ad_list_response.rb | 248 +++++++- .../models/ad_report_retrieve_params.rb | 46 +- .../models/ad_report_retrieve_response.rb | 100 +-- lib/whop_sdk/models/ad_retrieve_params.rb | 24 +- lib/whop_sdk/resources/ad_campaigns.rb | 25 +- lib/whop_sdk/resources/ad_groups.rb | 32 +- lib/whop_sdk/resources/ad_reports.rb | 21 +- lib/whop_sdk/resources/ads.rb | 42 +- rbi/whop_sdk/models/ad.rbi | 285 +++++++++ rbi/whop_sdk/models/ad_campaign.rbi | 568 ++++++++---------- .../models/ad_campaign_list_params.rbi | 24 +- .../models/ad_campaign_list_response.rbi | 319 +++++++++- .../models/ad_campaign_retrieve_params.rbi | 30 +- rbi/whop_sdk/models/ad_group.rbi | 302 +++++++++- rbi/whop_sdk/models/ad_group_list_params.rbi | 60 +- .../models/ad_group_list_response.rbi | 314 +++++++++- .../models/ad_group_retrieve_params.rbi | 30 +- rbi/whop_sdk/models/ad_list_params.rbi | 120 +++- rbi/whop_sdk/models/ad_list_response.rbi | 308 ++++++++++ .../models/ad_report_retrieve_params.rbi | 66 +- .../models/ad_report_retrieve_response.rbi | 116 ++-- rbi/whop_sdk/models/ad_retrieve_params.rbi | 30 +- rbi/whop_sdk/resources/ad_campaigns.rbi | 18 +- rbi/whop_sdk/resources/ad_groups.rbi | 33 +- rbi/whop_sdk/resources/ad_reports.rbi | 41 +- rbi/whop_sdk/resources/ads.rbi | 48 +- sig/whop_sdk/models/ad.rbs | 154 +++++ sig/whop_sdk/models/ad_campaign.rbs | 241 ++++---- .../models/ad_campaign_list_params.rbs | 10 + .../models/ad_campaign_list_response.rbs | 157 ++++- .../models/ad_campaign_retrieve_params.rbs | 16 +- sig/whop_sdk/models/ad_group.rbs | 154 +++++ sig/whop_sdk/models/ad_group_list_params.rbs | 25 +- .../models/ad_group_list_response.rbs | 154 +++++ .../models/ad_group_retrieve_params.rbs | 16 +- sig/whop_sdk/models/ad_list_params.rbs | 45 +- sig/whop_sdk/models/ad_list_response.rbs | 154 +++++ .../models/ad_report_retrieve_params.rbs | 24 +- .../models/ad_report_retrieve_response.rbs | 72 +-- sig/whop_sdk/models/ad_retrieve_params.rbs | 16 +- sig/whop_sdk/resources/ad_campaigns.rbs | 4 + sig/whop_sdk/resources/ad_groups.rbs | 7 +- sig/whop_sdk/resources/ad_reports.rbs | 6 +- sig/whop_sdk/resources/ads.rbs | 8 +- test/whop_sdk/resources/ad_campaigns_test.rb | 108 +++- test/whop_sdk/resources/ad_groups_test.rb | 95 +++ test/whop_sdk/resources/ads_test.rb | 76 +++ 57 files changed, 5339 insertions(+), 1057 deletions(-) diff --git a/lib/whop_sdk/models/ad.rb b/lib/whop_sdk/models/ad.rb index 8792f405..5eff4a29 100644 --- a/lib/whop_sdk/models/ad.rb +++ b/lib/whop_sdk/models/ad.rb @@ -22,18 +22,130 @@ class Ad < WhopSDK::Internal::Type::BaseModel # @return [WhopSDK::Models::Ad::AdGroup] required :ad_group, -> { WhopSDK::Ad::AdGroup } + # @!attribute click_through_rate + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @return [Float] + required :click_through_rate, Float + + # @!attribute clicks + # Total clicks on this ad in the stats window. + # + # @return [Integer] + required :clicks, Integer + + # @!attribute cost_per_click + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @return [Float] + required :cost_per_click, Float + + # @!attribute cost_per_lead + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + # + # @return [Float, nil] + required :cost_per_lead, Float, nil?: true + + # @!attribute cost_per_mille + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + # + # @return [Float] + required :cost_per_mille, Float + + # @!attribute cost_per_purchase + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + # + # @return [Float, nil] + required :cost_per_purchase, Float, nil?: true + + # @!attribute cost_per_result + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + # + # @return [Float, nil] + required :cost_per_result, Float, nil?: true + # @!attribute created_at # When the ad was created. # # @return [Time] required :created_at, Time + # @!attribute frequency + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + # + # @return [Float, nil] + required :frequency, Float, nil?: true + + # @!attribute impressions + # Total impressions (views) on this ad in the stats window. + # + # @return [Integer] + required :impressions, Integer + + # @!attribute issues + # Open platform issues affecting this ad, deduplicated per object. Empty when + # there are none. + # + # @return [Array] + required :issues, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue] } + + # @!attribute leads + # Number of Whop pixel-attributed leads (last-click) in the stats window. + # + # @return [Integer] + required :leads, Integer + # @!attribute platform # The external ad platform this ad is running on (e.g., meta, tiktok). # # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @!attribute purchase_value + # Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @return [Float] + required :purchase_value, Float + + # @!attribute purchases + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @return [Integer] + required :purchases, Integer + + # @!attribute reach + # Unique users reached in the stats window (deduplicated by the platform). + # + # @return [Integer] + required :reach, Integer + + # @!attribute return_on_ad_spend + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + # + # @return [Float] + required :return_on_ad_spend, Float + + # @!attribute spend + # Amount charged in dollars in the stats window. + # + # @return [Float] + required :spend, Float + + # @!attribute spend_currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute status # Current delivery status of the ad. # @@ -46,13 +158,29 @@ class Ad < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :title, String, nil?: true + # @!attribute unique_click_through_rate + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + # + # @return [Float, nil] + required :unique_click_through_rate, Float, nil?: true + + # @!attribute unique_clicks + # Unique clicks (deduplicated by the platform) in the stats window. + # + # @return [Integer] + required :unique_clicks, Integer + # @!attribute updated_at # When the ad was last updated. # # @return [Time] required :updated_at, Time - # @!method initialize(id:, ad_campaign:, ad_group:, created_at:, platform:, status:, title:, updated_at:) + # @!method initialize(id:, ad_campaign:, ad_group:, click_through_rate:, clicks:, cost_per_click:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, created_at:, frequency:, impressions:, issues:, leads:, platform:, purchase_value:, purchases:, reach:, return_on_ad_spend:, spend:, spend_currency:, status:, title:, unique_click_through_rate:, unique_clicks:, updated_at:) + # Some parameter documentations has been truncated, see {WhopSDK::Models::Ad} for + # more details. + # # An ad belonging to an ad group. # # @param id [String] The unique identifier for this ad. @@ -61,14 +189,52 @@ class Ad < WhopSDK::Internal::Type::BaseModel # # @param ad_group [WhopSDK::Models::Ad::AdGroup] The parent ad group this ad belongs to. # + # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @param clicks [Integer] Total clicks on this ad in the stats window. + # + # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # + # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # + # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # + # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # # @param created_at [Time] When the ad was created. # + # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # + # @param impressions [Integer] Total impressions (views) on this ad in the stats window. + # + # @param issues [Array] Open platform issues affecting this ad, deduplicated per object. Empty when ther + # + # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this ad is running on (e.g., meta, tiktok). # + # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # + # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # + # @param spend [Float] Amount charged in dollars in the stats window. + # + # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # # @param status [Symbol, WhopSDK::Models::ExternalAdStatus] Current delivery status of the ad. # # @param title [String, nil] The display title of the ad. Falls back to the creative set caption when unset. # + # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # + # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. + # # @param updated_at [Time] When the ad was last updated. # @see WhopSDK::Models::Ad#ad_campaign @@ -98,6 +264,86 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for this ad group. end + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute created_at + # When the issue was first reported. + # + # @return [Time] + required :created_at, Time + + # @!attribute error_code + # Platform-specific error code. + # + # @return [String, nil] + required :error_code, String, nil?: true + + # @!attribute error_message + # Full error detail from the platform. + # + # @return [String, nil] + required :error_message, String, nil?: true + + # @!attribute error_summary + # Short description of the issue. + # + # @return [String] + required :error_summary, String + + # @!attribute resolution_status + # Current resolution status. + # + # @return [Symbol, WhopSDK::Models::Ad::Issue::ResolutionStatus] + required :resolution_status, enum: -> { WhopSDK::Ad::Issue::ResolutionStatus } + + # @!attribute resource_id + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + # + # @return [String, nil] + required :resource_id, String, nil?: true + + # @!attribute resource_type + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + # + # @return [String] + required :resource_type, String + + # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::Ad::Issue} for more details. + # + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # + # @param created_at [Time] When the issue was first reported. + # + # @param error_code [String, nil] Platform-specific error code. + # + # @param error_message [String, nil] Full error detail from the platform. + # + # @param error_summary [String] Short description of the issue. + # + # @param resolution_status [Symbol, WhopSDK::Models::Ad::Issue::ResolutionStatus] Current resolution status. + # + # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N + # + # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + + # Current resolution status. + # + # @see WhopSDK::Models::Ad::Issue#resolution_status + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN = :open + RESOLVED = :resolved + ACKNOWLEDGED = :acknowledged + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/ad_campaign.rb b/lib/whop_sdk/models/ad_campaign.rb index 69a1158e..d4b49a43 100644 --- a/lib/whop_sdk/models/ad_campaign.rb +++ b/lib/whop_sdk/models/ad_campaign.rb @@ -22,24 +22,86 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AdBudgetType, nil] required :budget_type, enum: -> { WhopSDK::AdBudgetType }, nil?: true + # @!attribute click_through_rate + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @return [Float] + required :click_through_rate, Float + + # @!attribute clicks + # Total clicks on the campaign's ads in the stats window. + # + # @return [Integer] + required :clicks, Integer + + # @!attribute cost_per_click + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @return [Float] + required :cost_per_click, Float + + # @!attribute cost_per_lead + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + # + # @return [Float, nil] + required :cost_per_lead, Float, nil?: true + + # @!attribute cost_per_mille + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + # + # @return [Float] + required :cost_per_mille, Float + + # @!attribute cost_per_purchase + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + # + # @return [Float, nil] + required :cost_per_purchase, Float, nil?: true + + # @!attribute cost_per_result + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + # + # @return [Float, nil] + required :cost_per_result, Float, nil?: true + # @!attribute created_at # When the ad campaign was created. # # @return [Time] required :created_at, Time - # @!attribute created_by_user - # The user who created this ad campaign. + # @!attribute frequency + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. # - # @return [WhopSDK::Models::AdCampaign::CreatedByUser] - required :created_by_user, -> { WhopSDK::AdCampaign::CreatedByUser } + # @return [Float, nil] + required :frequency, Float, nil?: true - # @!attribute meta_config - # Meta-specific campaign configuration (objective, budget mode, etc.). Null for - # non-Meta campaigns. + # @!attribute impressions + # Total impressions (views) on the campaign's ads in the stats window. # - # @return [WhopSDK::Models::AdCampaign::MetaConfig, nil] - required :meta_config, -> { WhopSDK::AdCampaign::MetaConfig }, nil?: true + # @return [Integer] + required :impressions, Integer + + # @!attribute issues + # Open platform issues affecting this campaign and its descendant ad groups and + # ads, deduplicated per object. Empty when there are none. + # + # @return [Array] + required :issues, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue] } + + # @!attribute leads + # Number of Whop pixel-attributed leads (last-click) in the stats window. + # + # @return [Integer] + required :leads, Integer # @!attribute platform # The external ad platform this campaign is running on (e.g., meta, tiktok). @@ -47,8 +109,45 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @!attribute purchase_value + # Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @return [Float] + required :purchase_value, Float + + # @!attribute purchases + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @return [Integer] + required :purchases, Integer + + # @!attribute reach + # Unique users reached in the stats window (deduplicated by the platform). + # + # @return [Integer] + required :reach, Integer + + # @!attribute return_on_ad_spend + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + # + # @return [Float] + required :return_on_ad_spend, Float + + # @!attribute spend + # Amount charged in dollars in the stats window. + # + # @return [Float] + required :spend, Float + + # @!attribute spend_currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute status - # Current status of the campaign (active, paused, or inactive). + # Current status of the campaign. # # @return [Symbol, WhopSDK::Models::AdCampaignStatus] required :status, enum: -> { WhopSDK::AdCampaignStatus } @@ -59,11 +158,18 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @return [String] required :title, String - # @!attribute total_spend - # Total amount spent in dollars. + # @!attribute unique_click_through_rate + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). # - # @return [Float] - required :total_spend, Float + # @return [Float, nil] + required :unique_click_through_rate, Float, nil?: true + + # @!attribute unique_clicks + # Unique clicks (deduplicated by the platform) in the stats window. + # + # @return [Integer] + required :unique_clicks, Integer # @!attribute updated_at # When the ad campaign was last updated. @@ -71,7 +177,7 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @return [Time] required :updated_at, Time - # @!method initialize(id:, budget:, budget_type:, created_at:, created_by_user:, meta_config:, platform:, status:, title:, total_spend:, updated_at:) + # @!method initialize(id:, budget:, budget_type:, click_through_rate:, clicks:, cost_per_click:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, created_at:, frequency:, impressions:, issues:, leads:, platform:, purchase_value:, purchases:, reach:, return_on_ad_spend:, spend:, spend_currency:, status:, title:, unique_click_through_rate:, unique_clicks:, updated_at:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdCampaign} for more details. # @@ -83,192 +189,128 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. # + # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @param clicks [Integer] Total clicks on the campaign's ads in the stats window. + # + # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # + # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # + # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # + # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # # @param created_at [Time] When the ad campaign was created. # - # @param created_by_user [WhopSDK::Models::AdCampaign::CreatedByUser] The user who created this ad campaign. + # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # + # @param impressions [Integer] Total impressions (views) on the campaign's ads in the stats window. + # + # @param issues [Array] Open platform issues affecting this campaign and its descendant ad groups and ad # - # @param meta_config [WhopSDK::Models::AdCampaign::MetaConfig, nil] Meta-specific campaign configuration (objective, budget mode, etc.). Null for no + # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. # # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this campaign is running on (e.g., meta, tiktok). # - # @param status [Symbol, WhopSDK::Models::AdCampaignStatus] Current status of the campaign (active, paused, or inactive). + # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # + # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # + # @param spend [Float] Amount charged in dollars in the stats window. + # + # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # + # @param status [Symbol, WhopSDK::Models::AdCampaignStatus] Current status of the campaign. # # @param title [String] The campaign name shown in the Whop dashboard. # - # @param total_spend [Float] Total amount spent in dollars. + # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # + # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. # # @param updated_at [Time] When the ad campaign was last updated. - # @see WhopSDK::Models::AdCampaign#created_by_user - class CreatedByUser < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the user. + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute created_at + # When the issue was first reported. # - # @return [String] - required :id, String + # @return [Time] + required :created_at, Time - # @!attribute name - # The user's display name shown on their public profile. + # @!attribute error_code + # Platform-specific error code. # # @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 user who created this ad campaign. - # - # @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 - - # @see WhopSDK::Models::AdCampaign#meta_config - class MetaConfig < WhopSDK::Internal::Type::BaseModel - # @!attribute bid_amount - # Bid cap amount in cents. Only used when bid_strategy is bid_cap. - # - # @return [Integer, nil] - required :bid_amount, Integer, nil?: true - - # @!attribute bid_strategy - # The bidding strategy used to optimize spend for this campaign. - # - # @return [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::BidStrategy, nil] - required :bid_strategy, enum: -> { WhopSDK::AdCampaign::MetaConfig::BidStrategy }, nil?: true + required :error_code, String, nil?: true - # @!attribute budget_optimization - # Whether campaign budget optimization (CBO) is enabled, allowing the platform to - # distribute budget across ad groups. - # - # @return [Boolean, nil] - required :budget_optimization, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute effective_status - # The actual delivery status, accounting for platform overrides (e.g., in_review, - # rejected). - # - # @return [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::EffectiveStatus, nil] - required :effective_status, enum: -> { WhopSDK::AdCampaign::MetaConfig::EffectiveStatus }, nil?: true - - # @!attribute end_time - # The scheduled end time of the campaign (ISO8601). + # @!attribute error_message + # Full error detail from the platform. # # @return [String, nil] - required :end_time, String, nil?: true + required :error_message, String, nil?: true - # @!attribute objective - # The campaign objective that determines how Meta optimizes delivery. + # @!attribute error_summary + # Short description of the issue. # - # @return [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::Objective, nil] - required :objective, enum: -> { WhopSDK::AdCampaign::MetaConfig::Objective }, nil?: true + # @return [String] + required :error_summary, String - # @!attribute special_categories - # Special ad categories required by the platform (e.g., housing, employment, - # credit). + # @!attribute resolution_status + # Current resolution status. # - # @return [Array, nil] - required :special_categories, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + # @return [Symbol, WhopSDK::Models::AdCampaign::Issue::ResolutionStatus] + required :resolution_status, enum: -> { WhopSDK::AdCampaign::Issue::ResolutionStatus } - # @!attribute start_time - # The scheduled start time of the campaign (ISO8601). + # @!attribute resource_id + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. # # @return [String, nil] - required :start_time, String, nil?: true + required :resource_id, String, nil?: true - # @!attribute status - # The campaign status as set by the advertiser (active or paused). + # @!attribute resource_type + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. # - # @return [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::Status, nil] - required :status, enum: -> { WhopSDK::AdCampaign::MetaConfig::Status }, nil?: true + # @return [String] + required :resource_type, String - # @!method initialize(bid_amount:, bid_strategy:, budget_optimization:, effective_status:, end_time:, objective:, special_categories:, start_time:, status:) + # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::AdCampaign::MetaConfig} for more details. + # {WhopSDK::Models::AdCampaign::Issue} for more details. # - # Meta-specific campaign configuration (objective, budget mode, etc.). Null for - # non-Meta campaigns. + # A platform-reported issue on an ad object (rejection, policy flag, etc.). # - # @param bid_amount [Integer, nil] Bid cap amount in cents. Only used when bid_strategy is bid_cap. + # @param created_at [Time] When the issue was first reported. # - # @param bid_strategy [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::BidStrategy, nil] The bidding strategy used to optimize spend for this campaign. + # @param error_code [String, nil] Platform-specific error code. # - # @param budget_optimization [Boolean, nil] Whether campaign budget optimization (CBO) is enabled, allowing the platform to + # @param error_message [String, nil] Full error detail from the platform. # - # @param effective_status [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::EffectiveStatus, nil] The actual delivery status, accounting for platform overrides (e.g., in_review, + # @param error_summary [String] Short description of the issue. # - # @param end_time [String, nil] The scheduled end time of the campaign (ISO8601). + # @param resolution_status [Symbol, WhopSDK::Models::AdCampaign::Issue::ResolutionStatus] Current resolution status. # - # @param objective [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::Objective, nil] The campaign objective that determines how Meta optimizes delivery. + # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N # - # @param special_categories [Array, nil] Special ad categories required by the platform (e.g., housing, employment, credi - # - # @param start_time [String, nil] The scheduled start time of the campaign (ISO8601). - # - # @param status [Symbol, WhopSDK::Models::AdCampaign::MetaConfig::Status, nil] The campaign status as set by the advertiser (active or paused). - - # The bidding strategy used to optimize spend for this campaign. - # - # @see WhopSDK::Models::AdCampaign::MetaConfig#bid_strategy - module BidStrategy - extend WhopSDK::Internal::Type::Enum - - LOWEST_COST = :lowest_cost - BID_CAP = :bid_cap - COST_CAP = :cost_cap - - # @!method self.values - # @return [Array] - end - - # The actual delivery status, accounting for platform overrides (e.g., in_review, - # rejected). - # - # @see WhopSDK::Models::AdCampaign::MetaConfig#effective_status - module EffectiveStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE = :active - PAUSED = :paused - DELETED = :deleted - IN_REVIEW = :in_review - REJECTED = :rejected - WITH_ISSUES = :with_issues - - # @!method self.values - # @return [Array] - end - - # The campaign objective that determines how Meta optimizes delivery. - # - # @see WhopSDK::Models::AdCampaign::MetaConfig#objective - module Objective - extend WhopSDK::Internal::Type::Enum - - AWARENESS = :awareness - TRAFFIC = :traffic - ENGAGEMENT = :engagement - LEADS = :leads - SALES = :sales - - # @!method self.values - # @return [Array] - end + # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair - # The campaign status as set by the advertiser (active or paused). + # Current resolution status. # - # @see WhopSDK::Models::AdCampaign::MetaConfig#status - module Status + # @see WhopSDK::Models::AdCampaign::Issue#resolution_status + module ResolutionStatus extend WhopSDK::Internal::Type::Enum - ACTIVE = :active - PAUSED = :paused + OPEN = :open + RESOLVED = :resolved + ACKNOWLEDGED = :acknowledged # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/ad_campaign_list_params.rb b/lib/whop_sdk/models/ad_campaign_list_params.rb index 8340ac8f..69dd7f1b 100644 --- a/lib/whop_sdk/models/ad_campaign_list_params.rb +++ b/lib/whop_sdk/models/ad_campaign_list_params.rb @@ -50,18 +50,35 @@ class AdCampaignListParams < WhopSDK::Internal::Type::BaseModel optional :last, Integer, nil?: true # @!attribute query - # Case-insensitive substring match against the campaign title. + # Case-insensitive substring match against the campaign title or ID. # # @return [String, nil] optional :query, String, nil?: true + # @!attribute stats_from + # Inclusive start of the window for each campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_from, Time, nil?: true + + # @!attribute stats_to + # Inclusive end of the window for each campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_to, Time, nil?: true + # @!attribute status # The status of an ad campaign. # # @return [Symbol, WhopSDK::Models::AdCampaignStatus, nil] optional :status, enum: -> { WhopSDK::AdCampaignStatus }, nil?: true - # @!method initialize(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, status: nil, request_options: {}) + # @!method initialize(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCampaignListParams} for more details. + # # @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. @@ -76,7 +93,11 @@ class AdCampaignListParams < WhopSDK::Internal::Type::BaseModel # # @param last [Integer, nil] Returns the last _n_ elements from the list. # - # @param query [String, nil] Case-insensitive substring match against the campaign title. + # @param query [String, nil] Case-insensitive substring match against the campaign title or ID. + # + # @param stats_from [Time, nil] Inclusive start of the window for each campaign's metric fields (spend, impressi + # + # @param stats_to [Time, nil] Inclusive end of the window for each campaign's metric fields. Omit both statsFr # # @param status [Symbol, WhopSDK::Models::AdCampaignStatus, nil] The status of an ad campaign. # diff --git a/lib/whop_sdk/models/ad_campaign_list_response.rb b/lib/whop_sdk/models/ad_campaign_list_response.rb index 4a803b06..be3e1f28 100644 --- a/lib/whop_sdk/models/ad_campaign_list_response.rb +++ b/lib/whop_sdk/models/ad_campaign_list_response.rb @@ -22,20 +22,132 @@ class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AdBudgetType, nil] required :budget_type, enum: -> { WhopSDK::AdBudgetType }, nil?: true + # @!attribute click_through_rate + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @return [Float] + required :click_through_rate, Float + + # @!attribute clicks + # Total clicks on the campaign's ads in the stats window. + # + # @return [Integer] + required :clicks, Integer + + # @!attribute cost_per_click + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @return [Float] + required :cost_per_click, Float + + # @!attribute cost_per_lead + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + # + # @return [Float, nil] + required :cost_per_lead, Float, nil?: true + + # @!attribute cost_per_mille + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + # + # @return [Float] + required :cost_per_mille, Float + + # @!attribute cost_per_purchase + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + # + # @return [Float, nil] + required :cost_per_purchase, Float, nil?: true + + # @!attribute cost_per_result + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + # + # @return [Float, nil] + required :cost_per_result, Float, nil?: true + # @!attribute created_at # When the ad campaign was created. # # @return [Time] required :created_at, Time + # @!attribute frequency + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + # + # @return [Float, nil] + required :frequency, Float, nil?: true + + # @!attribute impressions + # Total impressions (views) on the campaign's ads in the stats window. + # + # @return [Integer] + required :impressions, Integer + + # @!attribute issues + # Open platform issues affecting this campaign and its descendant ad groups and + # ads, deduplicated per object. Empty when there are none. + # + # @return [Array] + required :issues, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdCampaignListResponse::Issue] } + + # @!attribute leads + # Number of Whop pixel-attributed leads (last-click) in the stats window. + # + # @return [Integer] + required :leads, Integer + # @!attribute platform # The external ad platform this campaign is running on (e.g., meta, tiktok). # # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @!attribute purchase_value + # Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @return [Float] + required :purchase_value, Float + + # @!attribute purchases + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @return [Integer] + required :purchases, Integer + + # @!attribute reach + # Unique users reached in the stats window (deduplicated by the platform). + # + # @return [Integer] + required :reach, Integer + + # @!attribute return_on_ad_spend + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + # + # @return [Float] + required :return_on_ad_spend, Float + + # @!attribute spend + # Amount charged in dollars in the stats window. + # + # @return [Float] + required :spend, Float + + # @!attribute spend_currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute status - # Current status of the campaign (active, paused, or inactive). + # Current status of the campaign. # # @return [Symbol, WhopSDK::Models::AdCampaignStatus] required :status, enum: -> { WhopSDK::AdCampaignStatus } @@ -46,11 +158,18 @@ class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel # @return [String] required :title, String - # @!attribute total_spend - # Total amount spent in dollars. + # @!attribute unique_click_through_rate + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). # - # @return [Float] - required :total_spend, Float + # @return [Float, nil] + required :unique_click_through_rate, Float, nil?: true + + # @!attribute unique_clicks + # Unique clicks (deduplicated by the platform) in the stats window. + # + # @return [Integer] + required :unique_clicks, Integer # @!attribute updated_at # When the ad campaign was last updated. @@ -58,7 +177,10 @@ class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel # @return [Time] required :updated_at, Time - # @!method initialize(id:, budget:, budget_type:, created_at:, platform:, status:, title:, total_spend:, updated_at:) + # @!method initialize(id:, budget:, budget_type:, click_through_rate:, clicks:, cost_per_click:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, created_at:, frequency:, impressions:, issues:, leads:, platform:, purchase_value:, purchases:, reach:, return_on_ad_spend:, spend:, spend_currency:, status:, title:, unique_click_through_rate:, unique_clicks:, updated_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCampaignListResponse} for more details. + # # An advertising campaign running on an external platform or within Whop. # # @param id [String] The unique identifier for this ad campaign. @@ -67,17 +189,133 @@ class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel # # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. # + # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @param clicks [Integer] Total clicks on the campaign's ads in the stats window. + # + # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # + # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # + # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # + # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # # @param created_at [Time] When the ad campaign was created. # + # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # + # @param impressions [Integer] Total impressions (views) on the campaign's ads in the stats window. + # + # @param issues [Array] Open platform issues affecting this campaign and its descendant ad groups and ad + # + # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this campaign is running on (e.g., meta, tiktok). # - # @param status [Symbol, WhopSDK::Models::AdCampaignStatus] Current status of the campaign (active, paused, or inactive). + # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # + # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # + # @param spend [Float] Amount charged in dollars in the stats window. + # + # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # + # @param status [Symbol, WhopSDK::Models::AdCampaignStatus] Current status of the campaign. # # @param title [String] The campaign name shown in the Whop dashboard. # - # @param total_spend [Float] Total amount spent in dollars. + # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # + # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. # # @param updated_at [Time] When the ad campaign was last updated. + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute created_at + # When the issue was first reported. + # + # @return [Time] + required :created_at, Time + + # @!attribute error_code + # Platform-specific error code. + # + # @return [String, nil] + required :error_code, String, nil?: true + + # @!attribute error_message + # Full error detail from the platform. + # + # @return [String, nil] + required :error_message, String, nil?: true + + # @!attribute error_summary + # Short description of the issue. + # + # @return [String] + required :error_summary, String + + # @!attribute resolution_status + # Current resolution status. + # + # @return [Symbol, WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus] + required :resolution_status, enum: -> { WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus } + + # @!attribute resource_id + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + # + # @return [String, nil] + required :resource_id, String, nil?: true + + # @!attribute resource_type + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + # + # @return [String] + required :resource_type, String + + # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCampaignListResponse::Issue} for more details. + # + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # + # @param created_at [Time] When the issue was first reported. + # + # @param error_code [String, nil] Platform-specific error code. + # + # @param error_message [String, nil] Full error detail from the platform. + # + # @param error_summary [String] Short description of the issue. + # + # @param resolution_status [Symbol, WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus] Current resolution status. + # + # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N + # + # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + + # Current resolution status. + # + # @see WhopSDK::Models::AdCampaignListResponse::Issue#resolution_status + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN = :open + RESOLVED = :resolved + ACKNOWLEDGED = :acknowledged + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/ad_campaign_retrieve_params.rb b/lib/whop_sdk/models/ad_campaign_retrieve_params.rb index 65bc58b6..747e7c02 100644 --- a/lib/whop_sdk/models/ad_campaign_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_campaign_retrieve_params.rb @@ -12,8 +12,30 @@ class AdCampaignRetrieveParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!method initialize(id:, request_options: {}) + # @!attribute stats_from + # Inclusive start of the window for the campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_from, Time, nil?: true + + # @!attribute stats_to + # Inclusive end of the window for the campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_to, Time, nil?: true + + # @!method initialize(id:, stats_from: nil, stats_to: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCampaignRetrieveParams} for more details. + # # @param id [String] + # + # @param stats_from [Time, nil] Inclusive start of the window for the campaign's metric fields (spend, impressio + # + # @param stats_to [Time, nil] Inclusive end of the window for the campaign's metric fields. Omit both statsFro + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/ad_group.rb b/lib/whop_sdk/models/ad_group.rb index 1f3e92c2..c4e8a0f5 100644 --- a/lib/whop_sdk/models/ad_group.rb +++ b/lib/whop_sdk/models/ad_group.rb @@ -28,18 +28,130 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AdBudgetType, nil] required :budget_type, enum: -> { WhopSDK::AdBudgetType }, nil?: true + # @!attribute click_through_rate + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @return [Float] + required :click_through_rate, Float + + # @!attribute clicks + # Total clicks on this ad group's ads in the stats window. + # + # @return [Integer] + required :clicks, Integer + + # @!attribute cost_per_click + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @return [Float] + required :cost_per_click, Float + + # @!attribute cost_per_lead + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + # + # @return [Float, nil] + required :cost_per_lead, Float, nil?: true + + # @!attribute cost_per_mille + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + # + # @return [Float] + required :cost_per_mille, Float + + # @!attribute cost_per_purchase + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + # + # @return [Float, nil] + required :cost_per_purchase, Float, nil?: true + + # @!attribute cost_per_result + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + # + # @return [Float, nil] + required :cost_per_result, Float, nil?: true + # @!attribute created_at # When the ad group was created. # # @return [Time] required :created_at, Time + # @!attribute frequency + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + # + # @return [Float, nil] + required :frequency, Float, nil?: true + + # @!attribute impressions + # Total impressions (views) on this ad group's ads in the stats window. + # + # @return [Integer] + required :impressions, Integer + + # @!attribute issues + # Open platform issues affecting this ad group and its descendant ads, + # deduplicated per object. Empty when there are none. + # + # @return [Array] + required :issues, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue] } + + # @!attribute leads + # Number of Whop pixel-attributed leads (last-click) in the stats window. + # + # @return [Integer] + required :leads, Integer + # @!attribute platform # The external ad platform this ad group is running on (e.g., meta, tiktok). # # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @!attribute purchase_value + # Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @return [Float] + required :purchase_value, Float + + # @!attribute purchases + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @return [Integer] + required :purchases, Integer + + # @!attribute reach + # Unique users reached in the stats window (deduplicated by the platform). + # + # @return [Integer] + required :reach, Integer + + # @!attribute return_on_ad_spend + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + # + # @return [Float] + required :return_on_ad_spend, Float + + # @!attribute spend + # Amount charged in dollars in the stats window. + # + # @return [Float] + required :spend, Float + + # @!attribute spend_currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute status # Current operational status of the ad group. # @@ -47,19 +159,35 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel required :status, enum: -> { WhopSDK::AdGroupStatus } # @!attribute title - # Human-readable name shown on the external platform. + # The ad group name shown in the Whop dashboard. # # @return [String, nil] required :title, String, nil?: true + # @!attribute unique_click_through_rate + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + # + # @return [Float, nil] + required :unique_click_through_rate, Float, nil?: true + + # @!attribute unique_clicks + # Unique clicks (deduplicated by the platform) in the stats window. + # + # @return [Integer] + required :unique_clicks, Integer + # @!attribute updated_at # When the ad group was last updated. # # @return [Time] required :updated_at, Time - # @!method initialize(id:, ad_campaign:, budget:, budget_type:, created_at:, platform:, status:, title:, updated_at:) - # An ad group (ad set) belonging to an ad campaign. + # @!method initialize(id:, ad_campaign:, budget:, budget_type:, click_through_rate:, clicks:, cost_per_click:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, created_at:, frequency:, impressions:, issues:, leads:, platform:, purchase_value:, purchases:, reach:, return_on_ad_spend:, spend:, spend_currency:, status:, title:, unique_click_through_rate:, unique_clicks:, updated_at:) + # Some parameter documentations has been truncated, see {WhopSDK::Models::AdGroup} + # for more details. + # + # An ad group belonging to an ad campaign. # # @param id [String] The unique identifier for this ad group. # @@ -69,13 +197,51 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. # + # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @param clicks [Integer] Total clicks on this ad group's ads in the stats window. + # + # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # + # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # + # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # + # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # # @param created_at [Time] When the ad group was created. # + # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # + # @param impressions [Integer] Total impressions (views) on this ad group's ads in the stats window. + # + # @param issues [Array] Open platform issues affecting this ad group and its descendant ads, deduplicate + # + # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this ad group is running on (e.g., meta, tiktok). # + # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # + # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # + # @param spend [Float] Amount charged in dollars in the stats window. + # + # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # # @param status [Symbol, WhopSDK::Models::AdGroupStatus] Current operational status of the ad group. # - # @param title [String, nil] Human-readable name shown on the external platform. + # @param title [String, nil] The ad group name shown in the Whop dashboard. + # + # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # + # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. # # @param updated_at [Time] When the ad group was last updated. @@ -92,6 +258,86 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for this ad campaign. end + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute created_at + # When the issue was first reported. + # + # @return [Time] + required :created_at, Time + + # @!attribute error_code + # Platform-specific error code. + # + # @return [String, nil] + required :error_code, String, nil?: true + + # @!attribute error_message + # Full error detail from the platform. + # + # @return [String, nil] + required :error_message, String, nil?: true + + # @!attribute error_summary + # Short description of the issue. + # + # @return [String] + required :error_summary, String + + # @!attribute resolution_status + # Current resolution status. + # + # @return [Symbol, WhopSDK::Models::AdGroup::Issue::ResolutionStatus] + required :resolution_status, enum: -> { WhopSDK::AdGroup::Issue::ResolutionStatus } + + # @!attribute resource_id + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + # + # @return [String, nil] + required :resource_id, String, nil?: true + + # @!attribute resource_type + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + # + # @return [String] + required :resource_type, String + + # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroup::Issue} for more details. + # + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # + # @param created_at [Time] When the issue was first reported. + # + # @param error_code [String, nil] Platform-specific error code. + # + # @param error_message [String, nil] Full error detail from the platform. + # + # @param error_summary [String] Short description of the issue. + # + # @param resolution_status [Symbol, WhopSDK::Models::AdGroup::Issue::ResolutionStatus] Current resolution status. + # + # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N + # + # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + + # Current resolution status. + # + # @see WhopSDK::Models::AdGroup::Issue#resolution_status + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN = :open + RESOLVED = :resolved + ACKNOWLEDGED = :acknowledged + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/ad_group_list_params.rb b/lib/whop_sdk/models/ad_group_list_params.rb index 75561fb8..36853347 100644 --- a/lib/whop_sdk/models/ad_group_list_params.rb +++ b/lib/whop_sdk/models/ad_group_list_params.rb @@ -7,6 +7,19 @@ class AdGroupListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + # @!attribute ad_campaign_id + # Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + # + # @return [String, nil] + optional :ad_campaign_id, String, nil?: true + + # @!attribute ad_campaign_ids + # Only return ad groups belonging to these ad campaigns (max 100). Can be combined + # with companyId or used on its own. + # + # @return [Array, nil] + optional :ad_campaign_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + # @!attribute after # Returns the elements in the list that come after the specified cursor. # @@ -20,13 +33,13 @@ class AdGroupListParams < WhopSDK::Internal::Type::BaseModel optional :before, String, nil?: true # @!attribute campaign_id - # Filter by campaign. Provide exactly one of campaign_id or company_id. + # Filter by campaign. # # @return [String, nil] optional :campaign_id, String, nil?: true # @!attribute company_id - # Filter by company. Provide exactly one of campaign_id or company_id. + # Filter by company. Provide companyId or adCampaignIds. # # @return [String, nil] optional :company_id, String, nil?: true @@ -49,13 +62,6 @@ class AdGroupListParams < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :first, Integer, nil?: true - # @!attribute include_paused - # When false, excludes paused ad groups so pagination matches the dashboard's - # hide-paused toggle. - # - # @return [Boolean, nil] - optional :include_paused, WhopSDK::Internal::Type::Boolean, nil?: true - # @!attribute last # Returns the last _n_ elements from the list. # @@ -63,28 +69,46 @@ class AdGroupListParams < WhopSDK::Internal::Type::BaseModel optional :last, Integer, nil?: true # @!attribute query - # Case-insensitive substring match against the ad group name. + # Case-insensitive substring match against the ad group name or ID. # # @return [String, nil] optional :query, String, nil?: true + # @!attribute stats_from + # Inclusive start of the window for each ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_from, Time, nil?: true + + # @!attribute stats_to + # Inclusive end of the window for each ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_to, Time, nil?: true + # @!attribute status # The status of an external ad group. # # @return [Symbol, WhopSDK::Models::AdGroupStatus, nil] optional :status, enum: -> { WhopSDK::AdGroupStatus }, nil?: true - # @!method initialize(after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, include_paused: nil, last: nil, query: nil, status: nil, request_options: {}) + # @!method initialize(ad_campaign_id: nil, ad_campaign_ids: nil, after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdGroupListParams} for more details. # + # @param ad_campaign_id [String, nil] Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + # + # @param ad_campaign_ids [Array, nil] Only return ad groups belonging to these ad campaigns (max 100). Can be combined + # # @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 campaign_id [String, nil] Filter by campaign. Provide exactly one of campaign_id or company_id. + # @param campaign_id [String, nil] Filter by campaign. # - # @param company_id [String, nil] Filter by company. Provide exactly one of campaign_id or company_id. + # @param company_id [String, nil] Filter by company. Provide companyId or adCampaignIds. # # @param created_after [Time, nil] Only return ad groups created after this timestamp. # @@ -92,11 +116,13 @@ class AdGroupListParams < WhopSDK::Internal::Type::BaseModel # # @param first [Integer, nil] Returns the first _n_ elements from the list. # - # @param include_paused [Boolean, nil] When false, excludes paused ad groups so pagination matches the dashboard's hide - # # @param last [Integer, nil] Returns the last _n_ elements from the list. # - # @param query [String, nil] Case-insensitive substring match against the ad group name. + # @param query [String, nil] Case-insensitive substring match against the ad group name or ID. + # + # @param stats_from [Time, nil] Inclusive start of the window for each ad group's metric fields (spend, impressi + # + # @param stats_to [Time, nil] Inclusive end of the window for each ad group's metric fields. Omit both statsFr # # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. # diff --git a/lib/whop_sdk/models/ad_group_list_response.rb b/lib/whop_sdk/models/ad_group_list_response.rb index 9c9a8d1f..3d72f100 100644 --- a/lib/whop_sdk/models/ad_group_list_response.rb +++ b/lib/whop_sdk/models/ad_group_list_response.rb @@ -28,18 +28,130 @@ class AdGroupListResponse < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AdBudgetType, nil] required :budget_type, enum: -> { WhopSDK::AdBudgetType }, nil?: true + # @!attribute click_through_rate + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @return [Float] + required :click_through_rate, Float + + # @!attribute clicks + # Total clicks on this ad group's ads in the stats window. + # + # @return [Integer] + required :clicks, Integer + + # @!attribute cost_per_click + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @return [Float] + required :cost_per_click, Float + + # @!attribute cost_per_lead + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + # + # @return [Float, nil] + required :cost_per_lead, Float, nil?: true + + # @!attribute cost_per_mille + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + # + # @return [Float] + required :cost_per_mille, Float + + # @!attribute cost_per_purchase + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + # + # @return [Float, nil] + required :cost_per_purchase, Float, nil?: true + + # @!attribute cost_per_result + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + # + # @return [Float, nil] + required :cost_per_result, Float, nil?: true + # @!attribute created_at # When the ad group was created. # # @return [Time] required :created_at, Time + # @!attribute frequency + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + # + # @return [Float, nil] + required :frequency, Float, nil?: true + + # @!attribute impressions + # Total impressions (views) on this ad group's ads in the stats window. + # + # @return [Integer] + required :impressions, Integer + + # @!attribute issues + # Open platform issues affecting this ad group and its descendant ads, + # deduplicated per object. Empty when there are none. + # + # @return [Array] + required :issues, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdGroupListResponse::Issue] } + + # @!attribute leads + # Number of Whop pixel-attributed leads (last-click) in the stats window. + # + # @return [Integer] + required :leads, Integer + # @!attribute platform # The external ad platform this ad group is running on (e.g., meta, tiktok). # # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @!attribute purchase_value + # Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @return [Float] + required :purchase_value, Float + + # @!attribute purchases + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @return [Integer] + required :purchases, Integer + + # @!attribute reach + # Unique users reached in the stats window (deduplicated by the platform). + # + # @return [Integer] + required :reach, Integer + + # @!attribute return_on_ad_spend + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + # + # @return [Float] + required :return_on_ad_spend, Float + + # @!attribute spend + # Amount charged in dollars in the stats window. + # + # @return [Float] + required :spend, Float + + # @!attribute spend_currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute status # Current operational status of the ad group. # @@ -47,19 +159,35 @@ class AdGroupListResponse < WhopSDK::Internal::Type::BaseModel required :status, enum: -> { WhopSDK::AdGroupStatus } # @!attribute title - # Human-readable name shown on the external platform. + # The ad group name shown in the Whop dashboard. # # @return [String, nil] required :title, String, nil?: true + # @!attribute unique_click_through_rate + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + # + # @return [Float, nil] + required :unique_click_through_rate, Float, nil?: true + + # @!attribute unique_clicks + # Unique clicks (deduplicated by the platform) in the stats window. + # + # @return [Integer] + required :unique_clicks, Integer + # @!attribute updated_at # When the ad group was last updated. # # @return [Time] required :updated_at, Time - # @!method initialize(id:, ad_campaign:, budget:, budget_type:, created_at:, platform:, status:, title:, updated_at:) - # An ad group (ad set) belonging to an ad campaign. + # @!method initialize(id:, ad_campaign:, budget:, budget_type:, click_through_rate:, clicks:, cost_per_click:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, created_at:, frequency:, impressions:, issues:, leads:, platform:, purchase_value:, purchases:, reach:, return_on_ad_spend:, spend:, spend_currency:, status:, title:, unique_click_through_rate:, unique_clicks:, updated_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroupListResponse} for more details. + # + # An ad group belonging to an ad campaign. # # @param id [String] The unique identifier for this ad group. # @@ -69,13 +197,51 @@ class AdGroupListResponse < WhopSDK::Internal::Type::BaseModel # # @param budget_type [Symbol, WhopSDK::Models::AdBudgetType, nil] The budget type for an ad campaign or ad group. # + # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @param clicks [Integer] Total clicks on this ad group's ads in the stats window. + # + # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # + # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # + # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # + # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # # @param created_at [Time] When the ad group was created. # + # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # + # @param impressions [Integer] Total impressions (views) on this ad group's ads in the stats window. + # + # @param issues [Array] Open platform issues affecting this ad group and its descendant ads, deduplicate + # + # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this ad group is running on (e.g., meta, tiktok). # + # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # + # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # + # @param spend [Float] Amount charged in dollars in the stats window. + # + # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # # @param status [Symbol, WhopSDK::Models::AdGroupStatus] Current operational status of the ad group. # - # @param title [String, nil] Human-readable name shown on the external platform. + # @param title [String, nil] The ad group name shown in the Whop dashboard. + # + # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # + # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. # # @param updated_at [Time] When the ad group was last updated. @@ -92,6 +258,86 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for this ad campaign. end + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute created_at + # When the issue was first reported. + # + # @return [Time] + required :created_at, Time + + # @!attribute error_code + # Platform-specific error code. + # + # @return [String, nil] + required :error_code, String, nil?: true + + # @!attribute error_message + # Full error detail from the platform. + # + # @return [String, nil] + required :error_message, String, nil?: true + + # @!attribute error_summary + # Short description of the issue. + # + # @return [String] + required :error_summary, String + + # @!attribute resolution_status + # Current resolution status. + # + # @return [Symbol, WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus] + required :resolution_status, enum: -> { WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus } + + # @!attribute resource_id + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + # + # @return [String, nil] + required :resource_id, String, nil?: true + + # @!attribute resource_type + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + # + # @return [String] + required :resource_type, String + + # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroupListResponse::Issue} for more details. + # + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # + # @param created_at [Time] When the issue was first reported. + # + # @param error_code [String, nil] Platform-specific error code. + # + # @param error_message [String, nil] Full error detail from the platform. + # + # @param error_summary [String] Short description of the issue. + # + # @param resolution_status [Symbol, WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus] Current resolution status. + # + # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N + # + # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + + # Current resolution status. + # + # @see WhopSDK::Models::AdGroupListResponse::Issue#resolution_status + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN = :open + RESOLVED = :resolved + ACKNOWLEDGED = :acknowledged + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/ad_group_retrieve_params.rb b/lib/whop_sdk/models/ad_group_retrieve_params.rb index 79b04841..ca03cbd0 100644 --- a/lib/whop_sdk/models/ad_group_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_group_retrieve_params.rb @@ -12,8 +12,30 @@ class AdGroupRetrieveParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!method initialize(id:, request_options: {}) + # @!attribute stats_from + # Inclusive start of the window for the ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_from, Time, nil?: true + + # @!attribute stats_to + # Inclusive end of the window for the ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_to, Time, nil?: true + + # @!method initialize(id:, stats_from: nil, stats_to: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroupRetrieveParams} for more details. + # # @param id [String] + # + # @param stats_from [Time, nil] Inclusive start of the window for the ad group's metric fields (spend, impressio + # + # @param stats_to [Time, nil] Inclusive end of the window for the ad group's metric fields. Omit both statsFro + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/ad_list_params.rb b/lib/whop_sdk/models/ad_list_params.rb index 75c21a90..2236de15 100644 --- a/lib/whop_sdk/models/ad_list_params.rb +++ b/lib/whop_sdk/models/ad_list_params.rb @@ -7,13 +7,34 @@ class AdListParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + # @!attribute ad_campaign_id + # Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or + # company_id. + # + # @return [String, nil] + optional :ad_campaign_id, String, nil?: true + + # @!attribute ad_campaign_ids + # Only return ads belonging to these ad campaigns (max 100). Can be combined with + # companyId or used on its own. + # + # @return [Array, nil] + optional :ad_campaign_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + # @!attribute ad_group_id - # Filter by ad group. Provide exactly one of ad_group_id, campaign_id, or + # Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. # # @return [String, nil] optional :ad_group_id, String, nil?: true + # @!attribute ad_group_ids + # Only return ads belonging to these ad groups (max 100). Can be combined with + # companyId or used on its own. + # + # @return [Array, nil] + optional :ad_group_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + # @!attribute after # Returns the elements in the list that come after the specified cursor. # @@ -27,14 +48,13 @@ class AdListParams < WhopSDK::Internal::Type::BaseModel optional :before, String, nil?: true # @!attribute campaign_id - # Filter by campaign. Provide exactly one of ad_group_id, campaign_id, or - # company_id. + # Filter by campaign. # # @return [String, nil] optional :campaign_id, String, nil?: true # @!attribute company_id - # Filter by company. Provide exactly one of ad_group_id, campaign_id, or + # Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. # # @return [String, nil] @@ -52,27 +72,32 @@ class AdListParams < WhopSDK::Internal::Type::BaseModel # @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 include_paused - # When false, excludes paused ads so pagination matches the dashboard's - # hide-paused toggle. - # - # @return [Boolean, nil] - optional :include_paused, WhopSDK::Internal::Type::Boolean, nil?: true - # @!attribute last # Returns the last _n_ elements from the list. # # @return [Integer, nil] optional :last, Integer, nil?: true + # @!attribute order + # The fields ad resources can be ordered by. + # + # @return [Symbol, WhopSDK::Models::AdListParams::Order, nil] + optional :order, enum: -> { WhopSDK::AdListParams::Order }, nil?: true + # @!attribute order_by - # Columns that the listAds query can sort by. + # Columns that the listAds query can sort by. Deprecated — use AdOrder. # # @return [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] optional :order_by, enum: -> { WhopSDK::AdListParams::OrderBy }, nil?: true @@ -84,19 +109,22 @@ class AdListParams < WhopSDK::Internal::Type::BaseModel optional :order_direction, enum: -> { WhopSDK::Direction }, nil?: true # @!attribute query - # Case-insensitive substring match against the ad title or tag. + # Case-insensitive substring match against the ad title or ID. # # @return [String, nil] optional :query, String, nil?: true # @!attribute stats_from - # Start of the stats date range used when order_by is a stats column. + # Inclusive start of the window for each ad's metric fields (spend, impressions, + # …) and for stats-column sorting. Omit both statsFrom and statsTo for all-time + # stats. # # @return [Time, nil] optional :stats_from, Time, nil?: true # @!attribute stats_to - # End of the stats date range used when order_by is a stats column. + # Inclusive end of the window for each ad's metric fields and for stats-column + # sorting. Omit both statsFrom and statsTo for all-time stats. # # @return [Time, nil] optional :stats_to, Time, nil?: true @@ -107,49 +135,70 @@ class AdListParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::ExternalAdStatus, nil] optional :status, enum: -> { WhopSDK::ExternalAdStatus }, nil?: true - # @!method initialize(ad_group_id: nil, after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, include_paused: nil, last: nil, order_by: nil, order_direction: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) + # @!method initialize(ad_campaign_id: nil, ad_campaign_ids: nil, ad_group_id: nil, ad_group_ids: nil, after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, order_by: nil, order_direction: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdListParams} for more details. # - # @param ad_group_id [String, nil] Filter by ad group. Provide exactly one of ad*group_id, campaign_id, or company* + # @param ad_campaign_id [String, nil] Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or co + # + # @param ad_campaign_ids [Array, nil] Only return ads belonging to these ad campaigns (max 100). Can be combined with + # + # @param ad_group_id [String, nil] Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or compa + # + # @param ad_group_ids [Array, nil] Only return ads belonging to these ad groups (max 100). Can be combined with com # # @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 campaign_id [String, nil] Filter by campaign. Provide exactly one of ad*group_id, campaign_id, or company* + # @param campaign_id [String, nil] Filter by campaign. # - # @param company_id [String, nil] Filter by company. Provide exactly one of ad_group_id, campaign_id, or company_i + # @param company_id [String, nil] Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or compan # # @param created_after [Time, nil] Only return ads created after this timestamp. # # @param created_before [Time, nil] Only return ads created before this timestamp. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. # - # @param include_paused [Boolean, nil] When false, excludes paused ads so pagination matches the dashboard's hide-pause + # @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 order_by [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] Columns that the listAds query can sort by. + # @param order [Symbol, WhopSDK::Models::AdListParams::Order, nil] The fields ad resources can be ordered by. + # + # @param order_by [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] Columns that the listAds query can sort by. Deprecated — use AdOrder. # # @param order_direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. # - # @param query [String, nil] Case-insensitive substring match against the ad title or tag. + # @param query [String, nil] Case-insensitive substring match against the ad title or ID. # - # @param stats_from [Time, nil] Start of the stats date range used when order_by is a stats column. + # @param stats_from [Time, nil] Inclusive start of the window for each ad's metric fields (spend, impressions, … # - # @param stats_to [Time, nil] End of the stats date range used when order_by is a stats column. + # @param stats_to [Time, nil] Inclusive end of the window for each ad's metric fields and for stats-column sor # # @param status [Symbol, WhopSDK::Models::ExternalAdStatus, nil] The status of an external ad. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # Columns that the listAds query can sort by. + # The fields ad resources can be ordered by. + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT = :created_at + SPEND = :spend + RETURN_ON_AD_SPEND = :return_on_ad_spend + + # @!method self.values + # @return [Array] + end + + # Columns that the listAds query can sort by. Deprecated — use AdOrder. module OrderBy extend WhopSDK::Internal::Type::Enum SPEND = :spend + RETURN_ON_AD_SPEND = :return_on_ad_spend ROAS = :roas # @!method self.values diff --git a/lib/whop_sdk/models/ad_list_response.rb b/lib/whop_sdk/models/ad_list_response.rb index abee5c2b..9b01f58b 100644 --- a/lib/whop_sdk/models/ad_list_response.rb +++ b/lib/whop_sdk/models/ad_list_response.rb @@ -22,18 +22,130 @@ class AdListResponse < WhopSDK::Internal::Type::BaseModel # @return [WhopSDK::Models::AdListResponse::AdGroup] required :ad_group, -> { WhopSDK::Models::AdListResponse::AdGroup } + # @!attribute click_through_rate + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @return [Float] + required :click_through_rate, Float + + # @!attribute clicks + # Total clicks on this ad in the stats window. + # + # @return [Integer] + required :clicks, Integer + + # @!attribute cost_per_click + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @return [Float] + required :cost_per_click, Float + + # @!attribute cost_per_lead + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + # + # @return [Float, nil] + required :cost_per_lead, Float, nil?: true + + # @!attribute cost_per_mille + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + # + # @return [Float] + required :cost_per_mille, Float + + # @!attribute cost_per_purchase + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + # + # @return [Float, nil] + required :cost_per_purchase, Float, nil?: true + + # @!attribute cost_per_result + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + # + # @return [Float, nil] + required :cost_per_result, Float, nil?: true + # @!attribute created_at # When the ad was created. # # @return [Time] required :created_at, Time + # @!attribute frequency + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + # + # @return [Float, nil] + required :frequency, Float, nil?: true + + # @!attribute impressions + # Total impressions (views) on this ad in the stats window. + # + # @return [Integer] + required :impressions, Integer + + # @!attribute issues + # Open platform issues affecting this ad, deduplicated per object. Empty when + # there are none. + # + # @return [Array] + required :issues, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdListResponse::Issue] } + + # @!attribute leads + # Number of Whop pixel-attributed leads (last-click) in the stats window. + # + # @return [Integer] + required :leads, Integer + # @!attribute platform # The external ad platform this ad is running on (e.g., meta, tiktok). # # @return [Symbol, WhopSDK::Models::AdCampaignPlatform] required :platform, enum: -> { WhopSDK::AdCampaignPlatform } + # @!attribute purchase_value + # Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @return [Float] + required :purchase_value, Float + + # @!attribute purchases + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @return [Integer] + required :purchases, Integer + + # @!attribute reach + # Unique users reached in the stats window (deduplicated by the platform). + # + # @return [Integer] + required :reach, Integer + + # @!attribute return_on_ad_spend + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + # + # @return [Float] + required :return_on_ad_spend, Float + + # @!attribute spend + # Amount charged in dollars in the stats window. + # + # @return [Float] + required :spend, Float + + # @!attribute spend_currency + # The available currencies on the platform + # + # @return [Symbol, WhopSDK::Models::Currency, nil] + required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true + # @!attribute status # Current delivery status of the ad. # @@ -46,13 +158,29 @@ class AdListResponse < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :title, String, nil?: true + # @!attribute unique_click_through_rate + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + # + # @return [Float, nil] + required :unique_click_through_rate, Float, nil?: true + + # @!attribute unique_clicks + # Unique clicks (deduplicated by the platform) in the stats window. + # + # @return [Integer] + required :unique_clicks, Integer + # @!attribute updated_at # When the ad was last updated. # # @return [Time] required :updated_at, Time - # @!method initialize(id:, ad_campaign:, ad_group:, created_at:, platform:, status:, title:, updated_at:) + # @!method initialize(id:, ad_campaign:, ad_group:, click_through_rate:, clicks:, cost_per_click:, cost_per_lead:, cost_per_mille:, cost_per_purchase:, cost_per_result:, created_at:, frequency:, impressions:, issues:, leads:, platform:, purchase_value:, purchases:, reach:, return_on_ad_spend:, spend:, spend_currency:, status:, title:, unique_click_through_rate:, unique_clicks:, updated_at:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdListResponse} for more details. + # # An ad belonging to an ad group. # # @param id [String] The unique identifier for this ad. @@ -61,14 +189,52 @@ class AdListResponse < WhopSDK::Internal::Type::BaseModel # # @param ad_group [WhopSDK::Models::AdListResponse::AdGroup] The parent ad group this ad belongs to. # + # @param click_through_rate [Float] Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + # + # @param clicks [Integer] Total clicks on this ad in the stats window. + # + # @param cost_per_click [Float] Cost per click in dollars (spend / clicks). 0 when there are no clicks. + # + # @param cost_per_lead [Float, nil] Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # + # @param cost_per_mille [Float] Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # + # @param cost_per_purchase [Float, nil] Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when p + # + # @param cost_per_result [Float, nil] Cost in dollars per optimization result (spend / results). 0 when a result is be + # # @param created_at [Time] When the ad was created. # + # @param frequency [Float, nil] Average number of times each person saw an ad (impressions / reach), as reported + # + # @param impressions [Integer] Total impressions (views) on this ad in the stats window. + # + # @param issues [Array] Open platform issues affecting this ad, deduplicated per object. Empty when ther + # + # @param leads [Integer] Number of Whop pixel-attributed leads (last-click) in the stats window. + # # @param platform [Symbol, WhopSDK::Models::AdCampaignPlatform] The external ad platform this ad is running on (e.g., meta, tiktok). # + # @param purchase_value [Float] Total USD value of Whop pixel-attributed purchases in the stats window. + # + # @param purchases [Integer] Number of Whop pixel-attributed purchases (last-click) in the stats window. + # + # @param reach [Integer] Unique users reached in the stats window (deduplicated by the platform). + # + # @param return_on_ad_spend [Float] Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of attri + # + # @param spend [Float] Amount charged in dollars in the stats window. + # + # @param spend_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # # @param status [Symbol, WhopSDK::Models::ExternalAdStatus] Current delivery status of the ad. # # @param title [String, nil] The display title of the ad. Falls back to the creative set caption when unset. # + # @param unique_click_through_rate [Float, nil] Unique click-through rate as a fraction of impressions (unique clicks / impressi + # + # @param unique_clicks [Integer] Unique clicks (deduplicated by the platform) in the stats window. + # # @param updated_at [Time] When the ad was last updated. # @see WhopSDK::Models::AdListResponse#ad_campaign @@ -98,6 +264,86 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel # # @param id [String] The unique identifier for this ad group. end + + class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute created_at + # When the issue was first reported. + # + # @return [Time] + required :created_at, Time + + # @!attribute error_code + # Platform-specific error code. + # + # @return [String, nil] + required :error_code, String, nil?: true + + # @!attribute error_message + # Full error detail from the platform. + # + # @return [String, nil] + required :error_message, String, nil?: true + + # @!attribute error_summary + # Short description of the issue. + # + # @return [String] + required :error_summary, String + + # @!attribute resolution_status + # Current resolution status. + # + # @return [Symbol, WhopSDK::Models::AdListResponse::Issue::ResolutionStatus] + required :resolution_status, enum: -> { WhopSDK::Models::AdListResponse::Issue::ResolutionStatus } + + # @!attribute resource_id + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + # + # @return [String, nil] + required :resource_id, String, nil?: true + + # @!attribute resource_type + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + # + # @return [String] + required :resource_type, String + + # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdListResponse::Issue} for more details. + # + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + # + # @param created_at [Time] When the issue was first reported. + # + # @param error_code [String, nil] Platform-specific error code. + # + # @param error_message [String, nil] Full error detail from the platform. + # + # @param error_summary [String] Short description of the issue. + # + # @param resolution_status [Symbol, WhopSDK::Models::AdListResponse::Issue::ResolutionStatus] Current resolution status. + # + # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N + # + # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + + # Current resolution status. + # + # @see WhopSDK::Models::AdListResponse::Issue#resolution_status + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN = :open + RESOLVED = :resolved + ACKNOWLEDGED = :acknowledged + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/whop_sdk/models/ad_report_retrieve_params.rb b/lib/whop_sdk/models/ad_report_retrieve_params.rb index 1f59ec77..b87ba492 100644 --- a/lib/whop_sdk/models/ad_report_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_report_retrieve_params.rb @@ -19,26 +19,26 @@ class AdReportRetrieveParams < WhopSDK::Internal::Type::BaseModel # @return [Time] required :to, Time - # @!attribute ad_campaign_id - # The unique identifier of an ad campaign. Mutually exclusive with `companyId`, - # `adGroupId`, and `adId`. + # @!attribute ad_campaign_ids + # Scope the report to these ad campaigns (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. # - # @return [String, nil] - optional :ad_campaign_id, String, nil?: true + # @return [Array, nil] + optional :ad_campaign_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - # @!attribute ad_group_id - # The unique identifier of an ad group. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adId`. + # @!attribute ad_group_ids + # Scope the report to these ad groups (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. # - # @return [String, nil] - optional :ad_group_id, String, nil?: true + # @return [Array, nil] + optional :ad_group_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true - # @!attribute ad_id - # The unique identifier of an ad. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adGroupId`. + # @!attribute ad_ids + # Scope the report to these ads (max 100); stats are summed across them. Mutually + # exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. # - # @return [String, nil] - optional :ad_id, String, nil?: true + # @return [Array, nil] + optional :ad_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true # @!attribute breakdown # Entity level to group an ad report by. @@ -47,9 +47,9 @@ class AdReportRetrieveParams < WhopSDK::Internal::Type::BaseModel optional :breakdown, enum: -> { WhopSDK::AdReportRetrieveParams::Breakdown }, nil?: true # @!attribute company_id - # The unique identifier of a company. Mutually exclusive with `adCampaignId`, - # `adGroupId`, and `adId`. Use with `breakdown` to fan out across every campaign, - # ad group, or ad in the company without paging. + # The unique identifier of a company. Mutually exclusive with `adCampaignIds`, + # `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every + # campaign, ad group, or ad in the company without paging. # # @return [String, nil] optional :company_id, String, nil?: true @@ -67,7 +67,7 @@ class AdReportRetrieveParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Granularities, nil] optional :granularity, enum: -> { WhopSDK::Granularities }, nil?: true - # @!method initialize(from:, to:, ad_campaign_id: nil, ad_group_id: nil, ad_id: nil, breakdown: nil, company_id: nil, currency: nil, granularity: nil, request_options: {}) + # @!method initialize(from:, to:, ad_campaign_ids: nil, ad_group_ids: nil, ad_ids: nil, breakdown: nil, company_id: nil, currency: nil, granularity: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdReportRetrieveParams} for more details. # @@ -75,15 +75,15 @@ class AdReportRetrieveParams < WhopSDK::Internal::Type::BaseModel # # @param to [Time] Inclusive end of the reporting window. # - # @param ad_campaign_id [String, nil] The unique identifier of an ad campaign. Mutually exclusive with `companyId`, `a + # @param ad_campaign_ids [Array, nil] Scope the report to these ad campaigns (max 100); stats are summed across them. # - # @param ad_group_id [String, nil] The unique identifier of an ad group. Mutually exclusive with `companyId`, `adCa + # @param ad_group_ids [Array, nil] Scope the report to these ad groups (max 100); stats are summed across them. Mut # - # @param ad_id [String, nil] The unique identifier of an ad. Mutually exclusive with `companyId`, `adCampaign + # @param ad_ids [Array, nil] Scope the report to these ads (max 100); stats are summed across them. Mutually # # @param breakdown [Symbol, WhopSDK::Models::AdReportRetrieveParams::Breakdown, nil] Entity level to group an ad report by. # - # @param company_id [String, nil] The unique identifier of a company. Mutually exclusive with `adCampaignId`, `adG + # @param company_id [String, nil] The unique identifier of a company. Mutually exclusive with `adCampaignIds`, `ad # # @param currency [String, nil] ISO 4217 currency code to report `spend` in. Defaults to the company's ads repor # diff --git a/lib/whop_sdk/models/ad_report_retrieve_response.rb b/lib/whop_sdk/models/ad_report_retrieve_response.rb index bf92756c..4c789a31 100644 --- a/lib/whop_sdk/models/ad_report_retrieve_response.rb +++ b/lib/whop_sdk/models/ad_report_retrieve_response.rb @@ -224,35 +224,35 @@ module Level # @see WhopSDK::Models::AdReportRetrieveResponse::Breakdown#summary class Summary < WhopSDK::Internal::Type::BaseModel + # @!attribute click_through_rate + # Click-through rate (clicks / impressions). + # + # @return [Float] + required :click_through_rate, Float + # @!attribute clicks # Total clicks over the date range. # # @return [Integer] required :clicks, Integer - # @!attribute cost_per_result - # Spend divided by `resultCount`. Null when there are no results. - # - # @return [Float, nil] - required :cost_per_result, Float, nil?: true - - # @!attribute cpc + # @!attribute cost_per_click # Cost per click in the requested reporting currency. # # @return [Float] - required :cpc, Float + required :cost_per_click, Float - # @!attribute cpm + # @!attribute cost_per_mille # Cost per thousand impressions in the requested reporting currency. # # @return [Float, nil] - required :cpm, Float, nil?: true + required :cost_per_mille, Float, nil?: true - # @!attribute ctr - # Click-through rate (clicks / impressions). + # @!attribute cost_per_result + # Spend divided by `resultCount`. Null when there are no results. # - # @return [Float] - required :ctr, Float + # @return [Float, nil] + required :cost_per_result, Float, nil?: true # @!attribute frequency # Average number of times each reached user saw an ad. @@ -291,12 +291,12 @@ class Summary < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :result_label_override, String, nil?: true - # @!attribute roas - # Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the - # external ad platform. + # @!attribute return_on_ad_spend + # Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as + # reported by the external ad platform. # # @return [Float, nil] - required :roas, Float, nil?: true + required :return_on_ad_spend, Float, nil?: true # @!attribute spend # Total spend over the date range in the requested reporting currency. @@ -310,22 +310,22 @@ class Summary < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Currency, nil] required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true - # @!method initialize(clicks:, cost_per_result:, cpc:, cpm:, ctr:, frequency:, impressions:, reach:, result_count:, result_label_key:, result_label_override:, roas:, spend:, spend_currency:) + # @!method initialize(click_through_rate:, clicks:, cost_per_click:, cost_per_mille:, cost_per_result:, frequency:, impressions:, reach:, result_count:, result_label_key:, result_label_override:, return_on_ad_spend:, spend:, spend_currency:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdReportRetrieveResponse::Breakdown::Summary} for more # details. # # Aggregate totals and rates for this entity over the date range. # - # @param clicks [Integer] Total clicks over the date range. + # @param click_through_rate [Float] Click-through rate (clicks / impressions). # - # @param cost_per_result [Float, nil] Spend divided by `resultCount`. Null when there are no results. + # @param clicks [Integer] Total clicks over the date range. # - # @param cpc [Float] Cost per click in the requested reporting currency. + # @param cost_per_click [Float] Cost per click in the requested reporting currency. # - # @param cpm [Float, nil] Cost per thousand impressions in the requested reporting currency. + # @param cost_per_mille [Float, nil] Cost per thousand impressions in the requested reporting currency. # - # @param ctr [Float] Click-through rate (clicks / impressions). + # @param cost_per_result [Float, nil] Spend divided by `resultCount`. Null when there are no results. # # @param frequency [Float, nil] Average number of times each reached user saw an ad. # @@ -339,7 +339,7 @@ class Summary < WhopSDK::Internal::Type::BaseModel # # @param result_label_override [String, nil] Advertiser-defined label for the result when `resultLabelKey` is `custom`. # - # @param roas [Float, nil] Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the + # @param return_on_ad_spend [Float, nil] Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as repor # # @param spend [Float] Total spend over the date range in the requested reporting currency. # @@ -460,35 +460,35 @@ class Granularity < WhopSDK::Internal::Type::BaseModel # @see WhopSDK::Models::AdReportRetrieveResponse#summary class Summary < WhopSDK::Internal::Type::BaseModel + # @!attribute click_through_rate + # Click-through rate (clicks / impressions). + # + # @return [Float] + required :click_through_rate, Float + # @!attribute clicks # Total clicks over the date range. # # @return [Integer] required :clicks, Integer - # @!attribute cost_per_result - # Spend divided by `resultCount`. Null when there are no results. - # - # @return [Float, nil] - required :cost_per_result, Float, nil?: true - - # @!attribute cpc + # @!attribute cost_per_click # Cost per click in the requested reporting currency. # # @return [Float] - required :cpc, Float + required :cost_per_click, Float - # @!attribute cpm + # @!attribute cost_per_mille # Cost per thousand impressions in the requested reporting currency. # # @return [Float, nil] - required :cpm, Float, nil?: true + required :cost_per_mille, Float, nil?: true - # @!attribute ctr - # Click-through rate (clicks / impressions). + # @!attribute cost_per_result + # Spend divided by `resultCount`. Null when there are no results. # - # @return [Float] - required :ctr, Float + # @return [Float, nil] + required :cost_per_result, Float, nil?: true # @!attribute frequency # Average number of times each reached user saw an ad. @@ -527,12 +527,12 @@ class Summary < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :result_label_override, String, nil?: true - # @!attribute roas - # Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the - # external ad platform. + # @!attribute return_on_ad_spend + # Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as + # reported by the external ad platform. # # @return [Float, nil] - required :roas, Float, nil?: true + required :return_on_ad_spend, Float, nil?: true # @!attribute spend # Total spend over the date range in the requested reporting currency. @@ -546,21 +546,21 @@ class Summary < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Currency, nil] required :spend_currency, enum: -> { WhopSDK::Currency }, nil?: true - # @!method initialize(clicks:, cost_per_result:, cpc:, cpm:, ctr:, frequency:, impressions:, reach:, result_count:, result_label_key:, result_label_override:, roas:, spend:, spend_currency:) + # @!method initialize(click_through_rate:, clicks:, cost_per_click:, cost_per_mille:, cost_per_result:, frequency:, impressions:, reach:, result_count:, result_label_key:, result_label_override:, return_on_ad_spend:, spend:, spend_currency:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdReportRetrieveResponse::Summary} for more details. # # Aggregate totals and rates over the date range. # - # @param clicks [Integer] Total clicks over the date range. + # @param click_through_rate [Float] Click-through rate (clicks / impressions). # - # @param cost_per_result [Float, nil] Spend divided by `resultCount`. Null when there are no results. + # @param clicks [Integer] Total clicks over the date range. # - # @param cpc [Float] Cost per click in the requested reporting currency. + # @param cost_per_click [Float] Cost per click in the requested reporting currency. # - # @param cpm [Float, nil] Cost per thousand impressions in the requested reporting currency. + # @param cost_per_mille [Float, nil] Cost per thousand impressions in the requested reporting currency. # - # @param ctr [Float] Click-through rate (clicks / impressions). + # @param cost_per_result [Float, nil] Spend divided by `resultCount`. Null when there are no results. # # @param frequency [Float, nil] Average number of times each reached user saw an ad. # @@ -574,7 +574,7 @@ class Summary < WhopSDK::Internal::Type::BaseModel # # @param result_label_override [String, nil] Advertiser-defined label for the result when `resultLabelKey` is `custom`. # - # @param roas [Float, nil] Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the + # @param return_on_ad_spend [Float, nil] Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as repor # # @param spend [Float] Total spend over the date range in the requested reporting currency. # diff --git a/lib/whop_sdk/models/ad_retrieve_params.rb b/lib/whop_sdk/models/ad_retrieve_params.rb index 48772f97..6d542ca0 100644 --- a/lib/whop_sdk/models/ad_retrieve_params.rb +++ b/lib/whop_sdk/models/ad_retrieve_params.rb @@ -12,8 +12,30 @@ class AdRetrieveParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!method initialize(id:, request_options: {}) + # @!attribute stats_from + # Inclusive start of the window for the ad's metric fields (spend, impressions, + # …). Omit both statsFrom and statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_from, Time, nil?: true + + # @!attribute stats_to + # Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # statsTo for all-time stats. + # + # @return [Time, nil] + optional :stats_to, Time, nil?: true + + # @!method initialize(id:, stats_from: nil, stats_to: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdRetrieveParams} for more details. + # # @param id [String] + # + # @param stats_from [Time, nil] Inclusive start of the window for the ad's metric fields (spend, impressions, …) + # + # @param stats_to [Time, nil] Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/resources/ad_campaigns.rb b/lib/whop_sdk/resources/ad_campaigns.rb index af941335..62194fbe 100644 --- a/lib/whop_sdk/resources/ad_campaigns.rb +++ b/lib/whop_sdk/resources/ad_campaigns.rb @@ -4,27 +4,37 @@ module WhopSDK module Resources # Ad campaigns class AdCampaigns + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCampaignRetrieveParams} for more details. + # # Retrieves a single ad campaign by its unique identifier. # # Required permissions: # # - `ad_campaign:basic:read` # - # @overload retrieve(id, request_options: {}) + # @overload retrieve(id, stats_from: nil, stats_to: nil, request_options: {}) # # @param id [String] The unique identifier of the ad campaign. # + # @param stats_from [Time, nil] Inclusive start of the window for the campaign's metric fields (spend, impressio + # + # @param stats_to [Time, nil] Inclusive end of the window for the campaign's metric fields. Omit both statsFro + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::AdCampaign] # # @see WhopSDK::Models::AdCampaignRetrieveParams def retrieve(id, params = {}) + parsed, options = WhopSDK::AdCampaignRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["ad_campaigns/%1$s", id], + query: query, model: WhopSDK::AdCampaign, - options: params[:request_options] + options: options ) end @@ -59,6 +69,9 @@ def update(id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdCampaignListParams} for more details. + # # Returns a paginated list of ad campaigns for a company, with optional filtering # by status, and creation date. # @@ -66,7 +79,7 @@ def update(id, params = {}) # # - `ad_campaign:basic:read` # - # @overload list(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, status: nil, request_options: {}) + # @overload list(after: nil, before: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) # # @param after [String, nil] Returns the elements in the list that come after the specified cursor. # @@ -82,7 +95,11 @@ def update(id, params = {}) # # @param last [Integer, nil] Returns the last _n_ elements from the list. # - # @param query [String, nil] Case-insensitive substring match against the campaign title. + # @param query [String, nil] Case-insensitive substring match against the campaign title or ID. + # + # @param stats_from [Time, nil] Inclusive start of the window for each campaign's metric fields (spend, impressi + # + # @param stats_to [Time, nil] Inclusive end of the window for each campaign's metric fields. Omit both statsFr # # @param status [Symbol, WhopSDK::Models::AdCampaignStatus, nil] The status of an ad campaign. # diff --git a/lib/whop_sdk/resources/ad_groups.rb b/lib/whop_sdk/resources/ad_groups.rb index b005bd70..a26eee65 100644 --- a/lib/whop_sdk/resources/ad_groups.rb +++ b/lib/whop_sdk/resources/ad_groups.rb @@ -4,27 +4,37 @@ module WhopSDK module Resources # Ad groups class AdGroups + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdGroupRetrieveParams} for more details. + # # Retrieves a single ad group by its unique identifier. # # Required permissions: # # - `ad_campaign:basic:read` # - # @overload retrieve(id, request_options: {}) + # @overload retrieve(id, stats_from: nil, stats_to: nil, request_options: {}) # # @param id [String] The unique identifier of the ad group. # + # @param stats_from [Time, nil] Inclusive start of the window for the ad group's metric fields (spend, impressio + # + # @param stats_to [Time, nil] Inclusive end of the window for the ad group's metric fields. Omit both statsFro + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::AdGroup] # # @see WhopSDK::Models::AdGroupRetrieveParams def retrieve(id, params = {}) + parsed, options = WhopSDK::AdGroupRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["ad_groups/%1$s", id], + query: query, model: WhopSDK::AdGroup, - options: params[:request_options] + options: options ) end @@ -79,15 +89,19 @@ def update(id, params = {}) # # - `ad_campaign:basic:read` # - # @overload list(after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, include_paused: nil, last: nil, query: nil, status: nil, request_options: {}) + # @overload list(ad_campaign_id: nil, ad_campaign_ids: nil, after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, last: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) + # + # @param ad_campaign_id [String, nil] Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + # + # @param ad_campaign_ids [Array, nil] Only return ad groups belonging to these ad campaigns (max 100). Can be combined # # @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 campaign_id [String, nil] Filter by campaign. Provide exactly one of campaign_id or company_id. + # @param campaign_id [String, nil] Filter by campaign. # - # @param company_id [String, nil] Filter by company. Provide exactly one of campaign_id or company_id. + # @param company_id [String, nil] Filter by company. Provide companyId or adCampaignIds. # # @param created_after [Time, nil] Only return ad groups created after this timestamp. # @@ -95,11 +109,13 @@ def update(id, params = {}) # # @param first [Integer, nil] Returns the first _n_ elements from the list. # - # @param include_paused [Boolean, nil] When false, excludes paused ad groups so pagination matches the dashboard's hide - # # @param last [Integer, nil] Returns the last _n_ elements from the list. # - # @param query [String, nil] Case-insensitive substring match against the ad group name. + # @param query [String, nil] Case-insensitive substring match against the ad group name or ID. + # + # @param stats_from [Time, nil] Inclusive start of the window for each ad group's metric fields (spend, impressi + # + # @param stats_to [Time, nil] Inclusive end of the window for each ad group's metric fields. Omit both statsFr # # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. # diff --git a/lib/whop_sdk/resources/ad_reports.rb b/lib/whop_sdk/resources/ad_reports.rb index c5fe497d..5a718b1b 100644 --- a/lib/whop_sdk/resources/ad_reports.rb +++ b/lib/whop_sdk/resources/ad_reports.rb @@ -7,31 +7,32 @@ class AdReports # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdReportRetrieveParams} for more details. # - # Performance report for a company, ad campaign, ad group, or ad. Always returns - # aggregate `summary` totals. Set `granularity` (`daily`/`hourly`) to additionally - # get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) to - # additionally get per-entity rows inside the requested scope. Exactly one of - # `companyId`, `adCampaignId`, `adGroupId`, or `adId` must be provided. + # Performance report for a company, ad campaigns, ad groups, or ads. Always + # returns aggregate `summary` totals summed across the scope. Set `granularity` + # (`daily`/`hourly`) to additionally get a time series, or set `breakdown` + # (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the + # requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or + # `adIds` must be provided. # # Required permissions: # # - `ad_campaign:stats:read` # - # @overload retrieve(from:, to:, ad_campaign_id: nil, ad_group_id: nil, ad_id: nil, breakdown: nil, company_id: nil, currency: nil, granularity: nil, request_options: {}) + # @overload retrieve(from:, to:, ad_campaign_ids: nil, ad_group_ids: nil, ad_ids: nil, breakdown: nil, company_id: nil, currency: nil, granularity: nil, request_options: {}) # # @param from [Time] Inclusive start of the reporting window. # # @param to [Time] Inclusive end of the reporting window. # - # @param ad_campaign_id [String, nil] The unique identifier of an ad campaign. Mutually exclusive with `companyId`, `a + # @param ad_campaign_ids [Array, nil] Scope the report to these ad campaigns (max 100); stats are summed across them. # - # @param ad_group_id [String, nil] The unique identifier of an ad group. Mutually exclusive with `companyId`, `adCa + # @param ad_group_ids [Array, nil] Scope the report to these ad groups (max 100); stats are summed across them. Mut # - # @param ad_id [String, nil] The unique identifier of an ad. Mutually exclusive with `companyId`, `adCampaign + # @param ad_ids [Array, nil] Scope the report to these ads (max 100); stats are summed across them. Mutually # # @param breakdown [Symbol, WhopSDK::Models::AdReportRetrieveParams::Breakdown, nil] Entity level to group an ad report by. # - # @param company_id [String, nil] The unique identifier of a company. Mutually exclusive with `adCampaignId`, `adG + # @param company_id [String, nil] The unique identifier of a company. Mutually exclusive with `adCampaignIds`, `ad # # @param currency [String, nil] ISO 4217 currency code to report `spend` in. Defaults to the company's ads repor # diff --git a/lib/whop_sdk/resources/ads.rb b/lib/whop_sdk/resources/ads.rb index 5a6488ee..4640ddb3 100644 --- a/lib/whop_sdk/resources/ads.rb +++ b/lib/whop_sdk/resources/ads.rb @@ -4,27 +4,37 @@ module WhopSDK module Resources # Ads class Ads + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::AdRetrieveParams} for more details. + # # Retrieve an ad by its unique identifier. # # Required permissions: # # - `ad_campaign:basic:read` # - # @overload retrieve(id, request_options: {}) + # @overload retrieve(id, stats_from: nil, stats_to: nil, request_options: {}) # # @param id [String] The unique identifier of the ad. # + # @param stats_from [Time, nil] Inclusive start of the window for the ad's metric fields (spend, impressions, …) + # + # @param stats_to [Time, nil] Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::Ad] # # @see WhopSDK::Models::AdRetrieveParams def retrieve(id, params = {}) + parsed, options = WhopSDK::AdRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["ads/%1$s", id], + query: query, model: WhopSDK::Ad, - options: params[:request_options] + options: options ) end @@ -37,37 +47,45 @@ def retrieve(id, params = {}) # # - `ad_campaign:basic:read` # - # @overload list(ad_group_id: nil, after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, first: nil, include_paused: nil, last: nil, order_by: nil, order_direction: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) + # @overload list(ad_campaign_id: nil, ad_campaign_ids: nil, ad_group_id: nil, ad_group_ids: nil, after: nil, before: nil, campaign_id: nil, company_id: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, order_by: nil, order_direction: nil, query: nil, stats_from: nil, stats_to: nil, status: nil, request_options: {}) + # + # @param ad_campaign_id [String, nil] Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or co + # + # @param ad_campaign_ids [Array, nil] Only return ads belonging to these ad campaigns (max 100). Can be combined with + # + # @param ad_group_id [String, nil] Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or compa # - # @param ad_group_id [String, nil] Filter by ad group. Provide exactly one of ad*group_id, campaign_id, or company* + # @param ad_group_ids [Array, nil] Only return ads belonging to these ad groups (max 100). Can be combined with com # # @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 campaign_id [String, nil] Filter by campaign. Provide exactly one of ad*group_id, campaign_id, or company* + # @param campaign_id [String, nil] Filter by campaign. # - # @param company_id [String, nil] Filter by company. Provide exactly one of ad_group_id, campaign_id, or company_i + # @param company_id [String, nil] Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or compan # # @param created_after [Time, nil] Only return ads created after this timestamp. # # @param created_before [Time, nil] Only return ads created before this timestamp. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. # - # @param include_paused [Boolean, nil] When false, excludes paused ads so pagination matches the dashboard's hide-pause + # @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 order_by [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] Columns that the listAds query can sort by. + # @param order [Symbol, WhopSDK::Models::AdListParams::Order, nil] The fields ad resources can be ordered by. + # + # @param order_by [Symbol, WhopSDK::Models::AdListParams::OrderBy, nil] Columns that the listAds query can sort by. Deprecated — use AdOrder. # # @param order_direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. # - # @param query [String, nil] Case-insensitive substring match against the ad title or tag. + # @param query [String, nil] Case-insensitive substring match against the ad title or ID. # - # @param stats_from [Time, nil] Start of the stats date range used when order_by is a stats column. + # @param stats_from [Time, nil] Inclusive start of the window for each ad's metric fields (spend, impressions, … # - # @param stats_to [Time, nil] End of the stats date range used when order_by is a stats column. + # @param stats_to [Time, nil] Inclusive end of the window for each ad's metric fields and for stats-column sor # # @param status [Symbol, WhopSDK::Models::ExternalAdStatus, nil] The status of an external ad. # diff --git a/rbi/whop_sdk/models/ad.rbi b/rbi/whop_sdk/models/ad.rbi index c6359b03..44defebb 100644 --- a/rbi/whop_sdk/models/ad.rbi +++ b/rbi/whop_sdk/models/ad.rbi @@ -23,14 +23,92 @@ module WhopSDK sig { params(ad_group: WhopSDK::Ad::AdGroup::OrHash).void } attr_writer :ad_group + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + sig { returns(Float) } + attr_accessor :click_through_rate + + # Total clicks on this ad in the stats window. + sig { returns(Integer) } + attr_accessor :clicks + + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + sig { returns(Float) } + attr_accessor :cost_per_click + + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_lead + + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + sig { returns(Float) } + attr_accessor :cost_per_mille + + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_purchase + + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result + # When the ad was created. sig { returns(Time) } attr_accessor :created_at + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + sig { returns(T.nilable(Float)) } + attr_accessor :frequency + + # Total impressions (views) on this ad in the stats window. + sig { returns(Integer) } + attr_accessor :impressions + + # Open platform issues affecting this ad, deduplicated per object. Empty when + # there are none. + sig { returns(T::Array[WhopSDK::Ad::Issue]) } + attr_accessor :issues + + # Number of Whop pixel-attributed leads (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :leads + # The external ad platform this ad is running on (e.g., meta, tiktok). sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } attr_accessor :platform + # Total USD value of Whop pixel-attributed purchases in the stats window. + sig { returns(Float) } + attr_accessor :purchase_value + + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :purchases + + # Unique users reached in the stats window (deduplicated by the platform). + sig { returns(Integer) } + attr_accessor :reach + + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + sig { returns(Float) } + attr_accessor :return_on_ad_spend + + # Amount charged in dollars in the stats window. + sig { returns(Float) } + attr_accessor :spend + + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + attr_accessor :spend_currency + # Current delivery status of the ad. sig { returns(WhopSDK::ExternalAdStatus::TaggedSymbol) } attr_accessor :status @@ -39,6 +117,15 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :title + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + sig { returns(T.nilable(Float)) } + attr_accessor :unique_click_through_rate + + # Unique clicks (deduplicated by the platform) in the stats window. + sig { returns(Integer) } + attr_accessor :unique_clicks + # When the ad was last updated. sig { returns(Time) } attr_accessor :updated_at @@ -49,10 +136,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Ad::AdCampaign::OrHash, ad_group: WhopSDK::Ad::AdGroup::OrHash, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::Ad::Issue::OrHash], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::OrSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), status: WhopSDK::ExternalAdStatus::OrSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time ).returns(T.attached_class) end @@ -63,14 +169,63 @@ module WhopSDK ad_campaign:, # The parent ad group this ad belongs to. ad_group:, + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + click_through_rate:, + # Total clicks on this ad in the stats window. + clicks:, + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + cost_per_click:, + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + cost_per_lead:, + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + cost_per_mille:, + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + cost_per_purchase:, + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + cost_per_result:, # When the ad was created. created_at:, + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + frequency:, + # Total impressions (views) on this ad in the stats window. + impressions:, + # Open platform issues affecting this ad, deduplicated per object. Empty when + # there are none. + issues:, + # Number of Whop pixel-attributed leads (last-click) in the stats window. + leads:, # The external ad platform this ad is running on (e.g., meta, tiktok). platform:, + # Total USD value of Whop pixel-attributed purchases in the stats window. + purchase_value:, + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + purchases:, + # Unique users reached in the stats window (deduplicated by the platform). + reach:, + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + return_on_ad_spend:, + # Amount charged in dollars in the stats window. + spend:, + # The available currencies on the platform + spend_currency:, # Current delivery status of the ad. status:, # The display title of the ad. Falls back to the creative set caption when unset. title:, + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + unique_click_through_rate:, + # Unique clicks (deduplicated by the platform) in the stats window. + unique_clicks:, # When the ad was last updated. updated_at: ) @@ -82,10 +237,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::Ad::Issue], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), status: WhopSDK::ExternalAdStatus::TaggedSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time } ) @@ -138,6 +312,117 @@ module WhopSDK def to_hash end end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(WhopSDK::Ad::Issue, WhopSDK::Internal::AnyHash) } + + # When the issue was first reported. + sig { returns(Time) } + attr_accessor :created_at + + # Platform-specific error code. + sig { returns(T.nilable(String)) } + attr_accessor :error_code + + # Full error detail from the platform. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Short description of the issue. + sig { returns(String) } + attr_accessor :error_summary + + # Current resolution status. + sig { returns(WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol) } + attr_accessor :resolution_status + + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + sig { returns(T.nilable(String)) } + attr_accessor :resource_id + + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + sig { returns(String) } + attr_accessor :resource_type + + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + sig do + params( + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: WhopSDK::Ad::Issue::ResolutionStatus::OrSymbol, + resource_id: T.nilable(String), + resource_type: String + ).returns(T.attached_class) + end + def self.new( + # When the issue was first reported. + created_at:, + # Platform-specific error code. + error_code:, + # Full error detail from the platform. + error_message:, + # Short description of the issue. + error_summary:, + # Current resolution status. + resolution_status:, + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + resource_id:, + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + resource_type: + ) + end + + sig do + override.returns( + { + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol, + resource_id: T.nilable(String), + resource_type: String + } + ) + end + def to_hash + end + + # Current resolution status. + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::Ad::Issue::ResolutionStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let(:open, WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol) + RESOLVED = + T.let(:resolved, WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol) + ACKNOWLEDGED = + T.let( + :acknowledged, + WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/ad_campaign.rbi b/rbi/whop_sdk/models/ad_campaign.rbi index 3ad3f5b4..18f8aff3 100644 --- a/rbi/whop_sdk/models/ad_campaign.rbi +++ b/rbi/whop_sdk/models/ad_campaign.rbi @@ -18,36 +18,93 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::AdBudgetType::TaggedSymbol)) } attr_accessor :budget_type + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + sig { returns(Float) } + attr_accessor :click_through_rate + + # Total clicks on the campaign's ads in the stats window. + sig { returns(Integer) } + attr_accessor :clicks + + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + sig { returns(Float) } + attr_accessor :cost_per_click + + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_lead + + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + sig { returns(Float) } + attr_accessor :cost_per_mille + + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_purchase + + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result + # When the ad campaign was created. sig { returns(Time) } attr_accessor :created_at - # The user who created this ad campaign. - sig { returns(WhopSDK::AdCampaign::CreatedByUser) } - attr_reader :created_by_user + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + sig { returns(T.nilable(Float)) } + attr_accessor :frequency - sig do - params(created_by_user: WhopSDK::AdCampaign::CreatedByUser::OrHash).void - end - attr_writer :created_by_user + # Total impressions (views) on the campaign's ads in the stats window. + sig { returns(Integer) } + attr_accessor :impressions - # Meta-specific campaign configuration (objective, budget mode, etc.). Null for - # non-Meta campaigns. - sig { returns(T.nilable(WhopSDK::AdCampaign::MetaConfig)) } - attr_reader :meta_config + # Open platform issues affecting this campaign and its descendant ad groups and + # ads, deduplicated per object. Empty when there are none. + sig { returns(T::Array[WhopSDK::AdCampaign::Issue]) } + attr_accessor :issues - sig do - params( - meta_config: T.nilable(WhopSDK::AdCampaign::MetaConfig::OrHash) - ).void - end - attr_writer :meta_config + # Number of Whop pixel-attributed leads (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :leads # The external ad platform this campaign is running on (e.g., meta, tiktok). sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } attr_accessor :platform - # Current status of the campaign (active, paused, or inactive). + # Total USD value of Whop pixel-attributed purchases in the stats window. + sig { returns(Float) } + attr_accessor :purchase_value + + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :purchases + + # Unique users reached in the stats window (deduplicated by the platform). + sig { returns(Integer) } + attr_accessor :reach + + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + sig { returns(Float) } + attr_accessor :return_on_ad_spend + + # Amount charged in dollars in the stats window. + sig { returns(Float) } + attr_accessor :spend + + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + attr_accessor :spend_currency + + # Current status of the campaign. sig { returns(WhopSDK::AdCampaignStatus::TaggedSymbol) } attr_accessor :status @@ -55,9 +112,14 @@ module WhopSDK sig { returns(String) } attr_accessor :title - # Total amount spent in dollars. - sig { returns(Float) } - attr_accessor :total_spend + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + sig { returns(T.nilable(Float)) } + attr_accessor :unique_click_through_rate + + # Unique clicks (deduplicated by the platform) in the stats window. + sig { returns(Integer) } + attr_accessor :unique_clicks # When the ad campaign was last updated. sig { returns(Time) } @@ -69,13 +131,29 @@ module WhopSDK id: String, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser::OrHash, - meta_config: T.nilable(WhopSDK::AdCampaign::MetaConfig::OrHash), + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::AdCampaign::Issue::OrHash], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::OrSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), status: WhopSDK::AdCampaignStatus::OrSymbol, title: String, - total_spend: Float, + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time ).returns(T.attached_class) end @@ -86,21 +164,63 @@ module WhopSDK budget:, # The budget type for an ad campaign or ad group. budget_type:, + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + click_through_rate:, + # Total clicks on the campaign's ads in the stats window. + clicks:, + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + cost_per_click:, + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + cost_per_lead:, + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + cost_per_mille:, + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + cost_per_purchase:, + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + cost_per_result:, # When the ad campaign was created. created_at:, - # The user who created this ad campaign. - created_by_user:, - # Meta-specific campaign configuration (objective, budget mode, etc.). Null for - # non-Meta campaigns. - meta_config:, + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + frequency:, + # Total impressions (views) on the campaign's ads in the stats window. + impressions:, + # Open platform issues affecting this campaign and its descendant ad groups and + # ads, deduplicated per object. Empty when there are none. + issues:, + # Number of Whop pixel-attributed leads (last-click) in the stats window. + leads:, # The external ad platform this campaign is running on (e.g., meta, tiktok). platform:, - # Current status of the campaign (active, paused, or inactive). + # Total USD value of Whop pixel-attributed purchases in the stats window. + purchase_value:, + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + purchases:, + # Unique users reached in the stats window (deduplicated by the platform). + reach:, + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + return_on_ad_spend:, + # Amount charged in dollars in the stats window. + spend:, + # The available currencies on the platform + spend_currency:, + # Current status of the campaign. status:, # The campaign name shown in the Whop dashboard. title:, - # Total amount spent in dollars. - total_spend:, + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + unique_click_through_rate:, + # Unique clicks (deduplicated by the platform) in the stats window. + unique_clicks:, # When the ad campaign was last updated. updated_at: ) @@ -112,13 +232,29 @@ module WhopSDK id: String, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::TaggedSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: T.nilable(WhopSDK::AdCampaign::MetaConfig), + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::AdCampaign::Issue], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), status: WhopSDK::AdCampaignStatus::TaggedSymbol, title: String, - total_spend: Float, + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time } ) @@ -126,354 +262,130 @@ module WhopSDK def to_hash end - class CreatedByUser < WhopSDK::Internal::Type::BaseModel + class Issue < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do - T.any( - WhopSDK::AdCampaign::CreatedByUser, - WhopSDK::Internal::AnyHash - ) + T.any(WhopSDK::AdCampaign::Issue, WhopSDK::Internal::AnyHash) end - # The unique identifier for the user. - sig { returns(String) } - attr_accessor :id + # When the issue was first reported. + sig { returns(Time) } + attr_accessor :created_at - # The user's display name shown on their public profile. + # Platform-specific error code. 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 who created this ad campaign. - 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 - - class MetaConfig < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::AdCampaign::MetaConfig, WhopSDK::Internal::AnyHash) - end - - # Bid cap amount in cents. Only used when bid_strategy is bid_cap. - sig { returns(T.nilable(Integer)) } - attr_accessor :bid_amount - - # The bidding strategy used to optimize spend for this campaign. - sig do - returns( - T.nilable( - WhopSDK::AdCampaign::MetaConfig::BidStrategy::TaggedSymbol - ) - ) - end - attr_accessor :bid_strategy - - # Whether campaign budget optimization (CBO) is enabled, allowing the platform to - # distribute budget across ad groups. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :budget_optimization - - # The actual delivery status, accounting for platform overrides (e.g., in_review, - # rejected). - sig do - returns( - T.nilable( - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ) - ) - end - attr_accessor :effective_status + attr_accessor :error_code - # The scheduled end time of the campaign (ISO8601). + # Full error detail from the platform. sig { returns(T.nilable(String)) } - attr_accessor :end_time + attr_accessor :error_message - # The campaign objective that determines how Meta optimizes delivery. + # Short description of the issue. + sig { returns(String) } + attr_accessor :error_summary + + # Current resolution status. sig do - returns( - T.nilable(WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol) - ) + returns(WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol) end - attr_accessor :objective - - # Special ad categories required by the platform (e.g., housing, employment, - # credit). - sig { returns(T.nilable(T::Array[String])) } - attr_accessor :special_categories + attr_accessor :resolution_status - # The scheduled start time of the campaign (ISO8601). + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. sig { returns(T.nilable(String)) } - attr_accessor :start_time + attr_accessor :resource_id - # The campaign status as set by the advertiser (active or paused). - sig do - returns( - T.nilable(WhopSDK::AdCampaign::MetaConfig::Status::TaggedSymbol) - ) - end - attr_accessor :status + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + sig { returns(String) } + attr_accessor :resource_type - # Meta-specific campaign configuration (objective, budget mode, etc.). Null for - # non-Meta campaigns. + # A platform-reported issue on an ad object (rejection, policy flag, etc.). sig do params( - bid_amount: T.nilable(Integer), - bid_strategy: - T.nilable(WhopSDK::AdCampaign::MetaConfig::BidStrategy::OrSymbol), - budget_optimization: T.nilable(T::Boolean), - effective_status: - T.nilable( - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::OrSymbol - ), - end_time: T.nilable(String), - objective: - T.nilable(WhopSDK::AdCampaign::MetaConfig::Objective::OrSymbol), - special_categories: T.nilable(T::Array[String]), - start_time: T.nilable(String), - status: T.nilable(WhopSDK::AdCampaign::MetaConfig::Status::OrSymbol) + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::AdCampaign::Issue::ResolutionStatus::OrSymbol, + resource_id: T.nilable(String), + resource_type: String ).returns(T.attached_class) end def self.new( - # Bid cap amount in cents. Only used when bid_strategy is bid_cap. - bid_amount:, - # The bidding strategy used to optimize spend for this campaign. - bid_strategy:, - # Whether campaign budget optimization (CBO) is enabled, allowing the platform to - # distribute budget across ad groups. - budget_optimization:, - # The actual delivery status, accounting for platform overrides (e.g., in_review, - # rejected). - effective_status:, - # The scheduled end time of the campaign (ISO8601). - end_time:, - # The campaign objective that determines how Meta optimizes delivery. - objective:, - # Special ad categories required by the platform (e.g., housing, employment, - # credit). - special_categories:, - # The scheduled start time of the campaign (ISO8601). - start_time:, - # The campaign status as set by the advertiser (active or paused). - status: + # When the issue was first reported. + created_at:, + # Platform-specific error code. + error_code:, + # Full error detail from the platform. + error_message:, + # Short description of the issue. + error_summary:, + # Current resolution status. + resolution_status:, + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + resource_id:, + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + resource_type: ) end sig do override.returns( { - bid_amount: T.nilable(Integer), - bid_strategy: - T.nilable( - WhopSDK::AdCampaign::MetaConfig::BidStrategy::TaggedSymbol - ), - budget_optimization: T.nilable(T::Boolean), - effective_status: - T.nilable( - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ), - end_time: T.nilable(String), - objective: - T.nilable( - WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol - ), - special_categories: T.nilable(T::Array[String]), - start_time: T.nilable(String), - status: - T.nilable(WhopSDK::AdCampaign::MetaConfig::Status::TaggedSymbol) + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol, + resource_id: T.nilable(String), + resource_type: String } ) end def to_hash end - # The bidding strategy used to optimize spend for this campaign. - module BidStrategy + # Current resolution status. + module ResolutionStatus extend WhopSDK::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, WhopSDK::AdCampaign::MetaConfig::BidStrategy) + T.all(Symbol, WhopSDK::AdCampaign::Issue::ResolutionStatus) end OrSymbol = T.type_alias { T.any(Symbol, String) } - LOWEST_COST = + OPEN = T.let( - :lowest_cost, - WhopSDK::AdCampaign::MetaConfig::BidStrategy::TaggedSymbol + :open, + WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol ) - BID_CAP = + RESOLVED = T.let( - :bid_cap, - WhopSDK::AdCampaign::MetaConfig::BidStrategy::TaggedSymbol + :resolved, + WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol ) - COST_CAP = + ACKNOWLEDGED = T.let( - :cost_cap, - WhopSDK::AdCampaign::MetaConfig::BidStrategy::TaggedSymbol + :acknowledged, + WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol ) sig do override.returns( T::Array[ - WhopSDK::AdCampaign::MetaConfig::BidStrategy::TaggedSymbol + WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol ] ) end def self.values end end - - # The actual delivery status, accounting for platform overrides (e.g., in_review, - # rejected). - module EffectiveStatus - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdCampaign::MetaConfig::EffectiveStatus) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ACTIVE = - T.let( - :active, - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ) - PAUSED = - T.let( - :paused, - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ) - DELETED = - T.let( - :deleted, - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ) - IN_REVIEW = - T.let( - :in_review, - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ) - REJECTED = - T.let( - :rejected, - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ) - WITH_ISSUES = - T.let( - :with_issues, - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::AdCampaign::MetaConfig::EffectiveStatus::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The campaign objective that determines how Meta optimizes delivery. - module Objective - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdCampaign::MetaConfig::Objective) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AWARENESS = - T.let( - :awareness, - WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol - ) - TRAFFIC = - T.let( - :traffic, - WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol - ) - ENGAGEMENT = - T.let( - :engagement, - WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol - ) - LEADS = - T.let( - :leads, - WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol - ) - SALES = - T.let( - :sales, - WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol - ) - - sig do - override.returns( - T::Array[WhopSDK::AdCampaign::MetaConfig::Objective::TaggedSymbol] - ) - end - def self.values - end - end - - # The campaign status as set by the advertiser (active or paused). - module Status - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::AdCampaign::MetaConfig::Status) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ACTIVE = - T.let( - :active, - WhopSDK::AdCampaign::MetaConfig::Status::TaggedSymbol - ) - PAUSED = - T.let( - :paused, - WhopSDK::AdCampaign::MetaConfig::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[WhopSDK::AdCampaign::MetaConfig::Status::TaggedSymbol] - ) - end - def self.values - end - end end end end diff --git a/rbi/whop_sdk/models/ad_campaign_list_params.rbi b/rbi/whop_sdk/models/ad_campaign_list_params.rbi index 5d952288..5a5b1765 100644 --- a/rbi/whop_sdk/models/ad_campaign_list_params.rbi +++ b/rbi/whop_sdk/models/ad_campaign_list_params.rbi @@ -39,10 +39,20 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :last - # Case-insensitive substring match against the campaign title. + # Case-insensitive substring match against the campaign title or ID. sig { returns(T.nilable(String)) } attr_accessor :query + # Inclusive start of the window for each campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_from + + # Inclusive end of the window for each campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_to + # The status of an ad campaign. sig { returns(T.nilable(WhopSDK::AdCampaignStatus::OrSymbol)) } attr_accessor :status @@ -57,6 +67,8 @@ module WhopSDK first: T.nilable(Integer), last: T.nilable(Integer), query: T.nilable(String), + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), status: T.nilable(WhopSDK::AdCampaignStatus::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) @@ -76,8 +88,14 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, - # Case-insensitive substring match against the campaign title. + # Case-insensitive substring match against the campaign title or ID. query: nil, + # Inclusive start of the window for each campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for each campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, # The status of an ad campaign. status: nil, request_options: {} @@ -95,6 +113,8 @@ module WhopSDK first: T.nilable(Integer), last: T.nilable(Integer), query: T.nilable(String), + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), status: T.nilable(WhopSDK::AdCampaignStatus::OrSymbol), request_options: WhopSDK::RequestOptions } diff --git a/rbi/whop_sdk/models/ad_campaign_list_response.rbi b/rbi/whop_sdk/models/ad_campaign_list_response.rbi index 0de2ba00..b97d5ac3 100644 --- a/rbi/whop_sdk/models/ad_campaign_list_response.rbi +++ b/rbi/whop_sdk/models/ad_campaign_list_response.rbi @@ -23,15 +23,93 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::AdBudgetType::TaggedSymbol)) } attr_accessor :budget_type + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + sig { returns(Float) } + attr_accessor :click_through_rate + + # Total clicks on the campaign's ads in the stats window. + sig { returns(Integer) } + attr_accessor :clicks + + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + sig { returns(Float) } + attr_accessor :cost_per_click + + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_lead + + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + sig { returns(Float) } + attr_accessor :cost_per_mille + + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_purchase + + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result + # When the ad campaign was created. sig { returns(Time) } attr_accessor :created_at + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + sig { returns(T.nilable(Float)) } + attr_accessor :frequency + + # Total impressions (views) on the campaign's ads in the stats window. + sig { returns(Integer) } + attr_accessor :impressions + + # Open platform issues affecting this campaign and its descendant ad groups and + # ads, deduplicated per object. Empty when there are none. + sig { returns(T::Array[WhopSDK::Models::AdCampaignListResponse::Issue]) } + attr_accessor :issues + + # Number of Whop pixel-attributed leads (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :leads + # The external ad platform this campaign is running on (e.g., meta, tiktok). sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } attr_accessor :platform - # Current status of the campaign (active, paused, or inactive). + # Total USD value of Whop pixel-attributed purchases in the stats window. + sig { returns(Float) } + attr_accessor :purchase_value + + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :purchases + + # Unique users reached in the stats window (deduplicated by the platform). + sig { returns(Integer) } + attr_accessor :reach + + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + sig { returns(Float) } + attr_accessor :return_on_ad_spend + + # Amount charged in dollars in the stats window. + sig { returns(Float) } + attr_accessor :spend + + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + attr_accessor :spend_currency + + # Current status of the campaign. sig { returns(WhopSDK::AdCampaignStatus::TaggedSymbol) } attr_accessor :status @@ -39,9 +117,14 @@ module WhopSDK sig { returns(String) } attr_accessor :title - # Total amount spent in dollars. - sig { returns(Float) } - attr_accessor :total_spend + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + sig { returns(T.nilable(Float)) } + attr_accessor :unique_click_through_rate + + # Unique clicks (deduplicated by the platform) in the stats window. + sig { returns(Integer) } + attr_accessor :unique_clicks # When the ad campaign was last updated. sig { returns(Time) } @@ -53,11 +136,30 @@ module WhopSDK id: String, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: + T::Array[WhopSDK::Models::AdCampaignListResponse::Issue::OrHash], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::OrSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), status: WhopSDK::AdCampaignStatus::OrSymbol, title: String, - total_spend: Float, + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time ).returns(T.attached_class) end @@ -68,16 +170,63 @@ module WhopSDK budget:, # The budget type for an ad campaign or ad group. budget_type:, + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + click_through_rate:, + # Total clicks on the campaign's ads in the stats window. + clicks:, + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + cost_per_click:, + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + cost_per_lead:, + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + cost_per_mille:, + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + cost_per_purchase:, + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + cost_per_result:, # When the ad campaign was created. created_at:, + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + frequency:, + # Total impressions (views) on the campaign's ads in the stats window. + impressions:, + # Open platform issues affecting this campaign and its descendant ad groups and + # ads, deduplicated per object. Empty when there are none. + issues:, + # Number of Whop pixel-attributed leads (last-click) in the stats window. + leads:, # The external ad platform this campaign is running on (e.g., meta, tiktok). platform:, - # Current status of the campaign (active, paused, or inactive). + # Total USD value of Whop pixel-attributed purchases in the stats window. + purchase_value:, + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + purchases:, + # Unique users reached in the stats window (deduplicated by the platform). + reach:, + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + return_on_ad_spend:, + # Amount charged in dollars in the stats window. + spend:, + # The available currencies on the platform + spend_currency:, + # Current status of the campaign. status:, # The campaign name shown in the Whop dashboard. title:, - # Total amount spent in dollars. - total_spend:, + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + unique_click_through_rate:, + # Unique clicks (deduplicated by the platform) in the stats window. + unique_clicks:, # When the ad campaign was last updated. updated_at: ) @@ -89,17 +238,169 @@ module WhopSDK id: String, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::TaggedSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::Models::AdCampaignListResponse::Issue], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), status: WhopSDK::AdCampaignStatus::TaggedSymbol, title: String, - total_spend: Float, + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time } ) end def to_hash end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AdCampaignListResponse::Issue, + WhopSDK::Internal::AnyHash + ) + end + + # When the issue was first reported. + sig { returns(Time) } + attr_accessor :created_at + + # Platform-specific error code. + sig { returns(T.nilable(String)) } + attr_accessor :error_code + + # Full error detail from the platform. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Short description of the issue. + sig { returns(String) } + attr_accessor :error_summary + + # Current resolution status. + sig do + returns( + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + end + attr_accessor :resolution_status + + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + sig { returns(T.nilable(String)) } + attr_accessor :resource_id + + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + sig { returns(String) } + attr_accessor :resource_type + + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + sig do + params( + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::OrSymbol, + resource_id: T.nilable(String), + resource_type: String + ).returns(T.attached_class) + end + def self.new( + # When the issue was first reported. + created_at:, + # Platform-specific error code. + error_code:, + # Full error detail from the platform. + error_message:, + # Short description of the issue. + error_summary:, + # Current resolution status. + resolution_status:, + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + resource_id:, + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + resource_type: + ) + end + + sig do + override.returns( + { + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol, + resource_id: T.nilable(String), + resource_type: String + } + ) + end + def to_hash + end + + # Current resolution status. + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :open, + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + RESOLVED = + T.let( + :resolved, + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + ACKNOWLEDGED = + T.let( + :acknowledged, + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/ad_campaign_retrieve_params.rbi b/rbi/whop_sdk/models/ad_campaign_retrieve_params.rbi index 6afe2710..5591f1b3 100644 --- a/rbi/whop_sdk/models/ad_campaign_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_campaign_retrieve_params.rbi @@ -14,18 +14,44 @@ module WhopSDK sig { returns(String) } attr_accessor :id + # Inclusive start of the window for the campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_from + + # Inclusive end of the window for the campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_to + sig do params( id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, request_options: {}) + def self.new( + id:, + # Inclusive start of the window for the campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for the campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, + request_options: {} + ) end sig do override.returns( - { id: String, request_options: WhopSDK::RequestOptions } + { + id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), + request_options: WhopSDK::RequestOptions + } ) end def to_hash diff --git a/rbi/whop_sdk/models/ad_group.rbi b/rbi/whop_sdk/models/ad_group.rbi index 19d43cb2..4e91a03c 100644 --- a/rbi/whop_sdk/models/ad_group.rbi +++ b/rbi/whop_sdk/models/ad_group.rbi @@ -25,37 +25,143 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::AdBudgetType::TaggedSymbol)) } attr_accessor :budget_type + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + sig { returns(Float) } + attr_accessor :click_through_rate + + # Total clicks on this ad group's ads in the stats window. + sig { returns(Integer) } + attr_accessor :clicks + + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + sig { returns(Float) } + attr_accessor :cost_per_click + + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_lead + + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + sig { returns(Float) } + attr_accessor :cost_per_mille + + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_purchase + + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result + # When the ad group was created. sig { returns(Time) } attr_accessor :created_at + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + sig { returns(T.nilable(Float)) } + attr_accessor :frequency + + # Total impressions (views) on this ad group's ads in the stats window. + sig { returns(Integer) } + attr_accessor :impressions + + # Open platform issues affecting this ad group and its descendant ads, + # deduplicated per object. Empty when there are none. + sig { returns(T::Array[WhopSDK::AdGroup::Issue]) } + attr_accessor :issues + + # Number of Whop pixel-attributed leads (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :leads + # The external ad platform this ad group is running on (e.g., meta, tiktok). sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } attr_accessor :platform + # Total USD value of Whop pixel-attributed purchases in the stats window. + sig { returns(Float) } + attr_accessor :purchase_value + + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :purchases + + # Unique users reached in the stats window (deduplicated by the platform). + sig { returns(Integer) } + attr_accessor :reach + + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + sig { returns(Float) } + attr_accessor :return_on_ad_spend + + # Amount charged in dollars in the stats window. + sig { returns(Float) } + attr_accessor :spend + + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + attr_accessor :spend_currency + # Current operational status of the ad group. sig { returns(WhopSDK::AdGroupStatus::TaggedSymbol) } attr_accessor :status - # Human-readable name shown on the external platform. + # The ad group name shown in the Whop dashboard. sig { returns(T.nilable(String)) } attr_accessor :title + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + sig { returns(T.nilable(Float)) } + attr_accessor :unique_click_through_rate + + # Unique clicks (deduplicated by the platform) in the stats window. + sig { returns(Integer) } + attr_accessor :unique_clicks + # When the ad group was last updated. sig { returns(Time) } attr_accessor :updated_at - # An ad group (ad set) belonging to an ad campaign. + # An ad group belonging to an ad campaign. sig do params( id: String, ad_campaign: WhopSDK::AdGroup::AdCampaign::OrHash, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::AdGroup::Issue::OrHash], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::OrSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), status: WhopSDK::AdGroupStatus::OrSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time ).returns(T.attached_class) end @@ -68,14 +174,63 @@ module WhopSDK budget:, # The budget type for an ad campaign or ad group. budget_type:, + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + click_through_rate:, + # Total clicks on this ad group's ads in the stats window. + clicks:, + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + cost_per_click:, + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + cost_per_lead:, + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + cost_per_mille:, + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + cost_per_purchase:, + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + cost_per_result:, # When the ad group was created. created_at:, + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + frequency:, + # Total impressions (views) on this ad group's ads in the stats window. + impressions:, + # Open platform issues affecting this ad group and its descendant ads, + # deduplicated per object. Empty when there are none. + issues:, + # Number of Whop pixel-attributed leads (last-click) in the stats window. + leads:, # The external ad platform this ad group is running on (e.g., meta, tiktok). platform:, + # Total USD value of Whop pixel-attributed purchases in the stats window. + purchase_value:, + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + purchases:, + # Unique users reached in the stats window (deduplicated by the platform). + reach:, + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + return_on_ad_spend:, + # Amount charged in dollars in the stats window. + spend:, + # The available currencies on the platform + spend_currency:, # Current operational status of the ad group. status:, - # Human-readable name shown on the external platform. + # The ad group name shown in the Whop dashboard. title:, + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + unique_click_through_rate:, + # Unique clicks (deduplicated by the platform) in the stats window. + unique_clicks:, # When the ad group was last updated. updated_at: ) @@ -88,10 +243,29 @@ module WhopSDK ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::TaggedSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::AdGroup::Issue], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), status: WhopSDK::AdGroupStatus::TaggedSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time } ) @@ -121,6 +295,128 @@ module WhopSDK def to_hash end end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::AdGroup::Issue, WhopSDK::Internal::AnyHash) + end + + # When the issue was first reported. + sig { returns(Time) } + attr_accessor :created_at + + # Platform-specific error code. + sig { returns(T.nilable(String)) } + attr_accessor :error_code + + # Full error detail from the platform. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Short description of the issue. + sig { returns(String) } + attr_accessor :error_summary + + # Current resolution status. + sig { returns(WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol) } + attr_accessor :resolution_status + + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + sig { returns(T.nilable(String)) } + attr_accessor :resource_id + + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + sig { returns(String) } + attr_accessor :resource_type + + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + sig do + params( + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::AdGroup::Issue::ResolutionStatus::OrSymbol, + resource_id: T.nilable(String), + resource_type: String + ).returns(T.attached_class) + end + def self.new( + # When the issue was first reported. + created_at:, + # Platform-specific error code. + error_code:, + # Full error detail from the platform. + error_message:, + # Short description of the issue. + error_summary:, + # Current resolution status. + resolution_status:, + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + resource_id:, + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + resource_type: + ) + end + + sig do + override.returns( + { + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol, + resource_id: T.nilable(String), + resource_type: String + } + ) + end + def to_hash + end + + # Current resolution status. + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::AdGroup::Issue::ResolutionStatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :open, + WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol + ) + RESOLVED = + T.let( + :resolved, + WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol + ) + ACKNOWLEDGED = + T.let( + :acknowledged, + WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/ad_group_list_params.rbi b/rbi/whop_sdk/models/ad_group_list_params.rbi index b5c0b0b5..8df5ea8a 100644 --- a/rbi/whop_sdk/models/ad_group_list_params.rbi +++ b/rbi/whop_sdk/models/ad_group_list_params.rbi @@ -11,6 +11,15 @@ module WhopSDK T.any(WhopSDK::AdGroupListParams, WhopSDK::Internal::AnyHash) end + # Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + sig { returns(T.nilable(String)) } + attr_accessor :ad_campaign_id + + # Only return ad groups belonging to these ad campaigns (max 100). Can be combined + # with companyId or used on its own. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :ad_campaign_ids + # Returns the elements in the list that come after the specified cursor. sig { returns(T.nilable(String)) } attr_accessor :after @@ -19,11 +28,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :before - # Filter by campaign. Provide exactly one of campaign_id or company_id. + # Filter by campaign. sig { returns(T.nilable(String)) } attr_accessor :campaign_id - # Filter by company. Provide exactly one of campaign_id or company_id. + # Filter by company. Provide companyId or adCampaignIds. sig { returns(T.nilable(String)) } attr_accessor :company_id @@ -39,25 +48,32 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :first - # When false, excludes paused ad groups so pagination matches the dashboard's - # hide-paused toggle. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :include_paused - # Returns the last _n_ elements from the list. sig { returns(T.nilable(Integer)) } attr_accessor :last - # Case-insensitive substring match against the ad group name. + # Case-insensitive substring match against the ad group name or ID. sig { returns(T.nilable(String)) } attr_accessor :query + # Inclusive start of the window for each ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_from + + # Inclusive end of the window for each ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_to + # The status of an external ad group. sig { returns(T.nilable(WhopSDK::AdGroupStatus::OrSymbol)) } attr_accessor :status sig do params( + ad_campaign_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), after: T.nilable(String), before: T.nilable(String), campaign_id: T.nilable(String), @@ -65,21 +81,27 @@ module WhopSDK created_after: T.nilable(Time), created_before: T.nilable(Time), first: T.nilable(Integer), - include_paused: T.nilable(T::Boolean), last: T.nilable(Integer), query: T.nilable(String), + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + ad_campaign_id: nil, + # Only return ad groups belonging to these ad campaigns (max 100). Can be combined + # with companyId or used on its own. + ad_campaign_ids: nil, # Returns the elements in the list that come after the specified cursor. after: nil, # Returns the elements in the list that come before the specified cursor. before: nil, - # Filter by campaign. Provide exactly one of campaign_id or company_id. + # Filter by campaign. campaign_id: nil, - # Filter by company. Provide exactly one of campaign_id or company_id. + # Filter by company. Provide companyId or adCampaignIds. company_id: nil, # Only return ad groups created after this timestamp. created_after: nil, @@ -87,13 +109,16 @@ module WhopSDK created_before: nil, # Returns the first _n_ elements from the list. first: nil, - # When false, excludes paused ad groups so pagination matches the dashboard's - # hide-paused toggle. - include_paused: nil, # Returns the last _n_ elements from the list. last: nil, - # Case-insensitive substring match against the ad group name. + # Case-insensitive substring match against the ad group name or ID. query: nil, + # Inclusive start of the window for each ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for each ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, # The status of an external ad group. status: nil, request_options: {} @@ -103,6 +128,8 @@ module WhopSDK sig do override.returns( { + ad_campaign_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), after: T.nilable(String), before: T.nilable(String), campaign_id: T.nilable(String), @@ -110,9 +137,10 @@ module WhopSDK created_after: T.nilable(Time), created_before: T.nilable(Time), first: T.nilable(Integer), - include_paused: T.nilable(T::Boolean), last: T.nilable(Integer), query: T.nilable(String), + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), request_options: WhopSDK::RequestOptions } diff --git a/rbi/whop_sdk/models/ad_group_list_response.rbi b/rbi/whop_sdk/models/ad_group_list_response.rbi index b19a6566..4ef68045 100644 --- a/rbi/whop_sdk/models/ad_group_list_response.rbi +++ b/rbi/whop_sdk/models/ad_group_list_response.rbi @@ -34,37 +34,143 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::AdBudgetType::TaggedSymbol)) } attr_accessor :budget_type + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + sig { returns(Float) } + attr_accessor :click_through_rate + + # Total clicks on this ad group's ads in the stats window. + sig { returns(Integer) } + attr_accessor :clicks + + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + sig { returns(Float) } + attr_accessor :cost_per_click + + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_lead + + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + sig { returns(Float) } + attr_accessor :cost_per_mille + + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_purchase + + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result + # When the ad group was created. sig { returns(Time) } attr_accessor :created_at + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + sig { returns(T.nilable(Float)) } + attr_accessor :frequency + + # Total impressions (views) on this ad group's ads in the stats window. + sig { returns(Integer) } + attr_accessor :impressions + + # Open platform issues affecting this ad group and its descendant ads, + # deduplicated per object. Empty when there are none. + sig { returns(T::Array[WhopSDK::Models::AdGroupListResponse::Issue]) } + attr_accessor :issues + + # Number of Whop pixel-attributed leads (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :leads + # The external ad platform this ad group is running on (e.g., meta, tiktok). sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } attr_accessor :platform + # Total USD value of Whop pixel-attributed purchases in the stats window. + sig { returns(Float) } + attr_accessor :purchase_value + + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :purchases + + # Unique users reached in the stats window (deduplicated by the platform). + sig { returns(Integer) } + attr_accessor :reach + + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + sig { returns(Float) } + attr_accessor :return_on_ad_spend + + # Amount charged in dollars in the stats window. + sig { returns(Float) } + attr_accessor :spend + + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + attr_accessor :spend_currency + # Current operational status of the ad group. sig { returns(WhopSDK::AdGroupStatus::TaggedSymbol) } attr_accessor :status - # Human-readable name shown on the external platform. + # The ad group name shown in the Whop dashboard. sig { returns(T.nilable(String)) } attr_accessor :title + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + sig { returns(T.nilable(Float)) } + attr_accessor :unique_click_through_rate + + # Unique clicks (deduplicated by the platform) in the stats window. + sig { returns(Integer) } + attr_accessor :unique_clicks + # When the ad group was last updated. sig { returns(Time) } attr_accessor :updated_at - # An ad group (ad set) belonging to an ad campaign. + # An ad group belonging to an ad campaign. sig do params( id: String, ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign::OrHash, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::OrSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::Models::AdGroupListResponse::Issue::OrHash], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::OrSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), status: WhopSDK::AdGroupStatus::OrSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time ).returns(T.attached_class) end @@ -77,14 +183,63 @@ module WhopSDK budget:, # The budget type for an ad campaign or ad group. budget_type:, + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + click_through_rate:, + # Total clicks on this ad group's ads in the stats window. + clicks:, + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + cost_per_click:, + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + cost_per_lead:, + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + cost_per_mille:, + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + cost_per_purchase:, + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + cost_per_result:, # When the ad group was created. created_at:, + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + frequency:, + # Total impressions (views) on this ad group's ads in the stats window. + impressions:, + # Open platform issues affecting this ad group and its descendant ads, + # deduplicated per object. Empty when there are none. + issues:, + # Number of Whop pixel-attributed leads (last-click) in the stats window. + leads:, # The external ad platform this ad group is running on (e.g., meta, tiktok). platform:, + # Total USD value of Whop pixel-attributed purchases in the stats window. + purchase_value:, + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + purchases:, + # Unique users reached in the stats window (deduplicated by the platform). + reach:, + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + return_on_ad_spend:, + # Amount charged in dollars in the stats window. + spend:, + # The available currencies on the platform + spend_currency:, # Current operational status of the ad group. status:, - # Human-readable name shown on the external platform. + # The ad group name shown in the Whop dashboard. title:, + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + unique_click_through_rate:, + # Unique clicks (deduplicated by the platform) in the stats window. + unique_clicks:, # When the ad group was last updated. updated_at: ) @@ -97,10 +252,29 @@ module WhopSDK ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign, budget: T.nilable(Float), budget_type: T.nilable(WhopSDK::AdBudgetType::TaggedSymbol), + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::Models::AdGroupListResponse::Issue], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), status: WhopSDK::AdGroupStatus::TaggedSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time } ) @@ -133,6 +307,140 @@ module WhopSDK def to_hash end end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AdGroupListResponse::Issue, + WhopSDK::Internal::AnyHash + ) + end + + # When the issue was first reported. + sig { returns(Time) } + attr_accessor :created_at + + # Platform-specific error code. + sig { returns(T.nilable(String)) } + attr_accessor :error_code + + # Full error detail from the platform. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Short description of the issue. + sig { returns(String) } + attr_accessor :error_summary + + # Current resolution status. + sig do + returns( + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + end + attr_accessor :resolution_status + + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + sig { returns(T.nilable(String)) } + attr_accessor :resource_id + + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + sig { returns(String) } + attr_accessor :resource_type + + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + sig do + params( + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::OrSymbol, + resource_id: T.nilable(String), + resource_type: String + ).returns(T.attached_class) + end + def self.new( + # When the issue was first reported. + created_at:, + # Platform-specific error code. + error_code:, + # Full error detail from the platform. + error_message:, + # Short description of the issue. + error_summary:, + # Current resolution status. + resolution_status:, + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + resource_id:, + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + resource_type: + ) + end + + sig do + override.returns( + { + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol, + resource_id: T.nilable(String), + resource_type: String + } + ) + end + def to_hash + end + + # Current resolution status. + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :open, + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + RESOLVED = + T.let( + :resolved, + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + ACKNOWLEDGED = + T.let( + :acknowledged, + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/ad_group_retrieve_params.rbi b/rbi/whop_sdk/models/ad_group_retrieve_params.rbi index 91441b48..76a2d130 100644 --- a/rbi/whop_sdk/models/ad_group_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_group_retrieve_params.rbi @@ -14,18 +14,44 @@ module WhopSDK sig { returns(String) } attr_accessor :id + # Inclusive start of the window for the ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_from + + # Inclusive end of the window for the ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_to + sig do params( id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, request_options: {}) + def self.new( + id:, + # Inclusive start of the window for the ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for the ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, + request_options: {} + ) end sig do override.returns( - { id: String, request_options: WhopSDK::RequestOptions } + { + id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), + request_options: WhopSDK::RequestOptions + } ) end def to_hash diff --git a/rbi/whop_sdk/models/ad_list_params.rbi b/rbi/whop_sdk/models/ad_list_params.rbi index 7f9a32c3..9107b322 100644 --- a/rbi/whop_sdk/models/ad_list_params.rbi +++ b/rbi/whop_sdk/models/ad_list_params.rbi @@ -11,11 +11,26 @@ module WhopSDK T.any(WhopSDK::AdListParams, WhopSDK::Internal::AnyHash) end - # Filter by ad group. Provide exactly one of ad_group_id, campaign_id, or + # Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or + # company_id. + sig { returns(T.nilable(String)) } + attr_accessor :ad_campaign_id + + # Only return ads belonging to these ad campaigns (max 100). Can be combined with + # companyId or used on its own. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :ad_campaign_ids + + # Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. sig { returns(T.nilable(String)) } attr_accessor :ad_group_id + # Only return ads belonging to these ad groups (max 100). Can be combined with + # companyId or used on its own. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :ad_group_ids + # Returns the elements in the list that come after the specified cursor. sig { returns(T.nilable(String)) } attr_accessor :after @@ -24,12 +39,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :before - # Filter by campaign. Provide exactly one of ad_group_id, campaign_id, or - # company_id. + # Filter by campaign. sig { returns(T.nilable(String)) } attr_accessor :campaign_id - # Filter by company. Provide exactly one of ad_group_id, campaign_id, or + # Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. sig { returns(T.nilable(String)) } attr_accessor :company_id @@ -42,20 +56,23 @@ module WhopSDK 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 - # When false, excludes paused ads so pagination matches the dashboard's - # hide-paused toggle. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :include_paused - # Returns the last _n_ elements from the list. sig { returns(T.nilable(Integer)) } attr_accessor :last - # Columns that the listAds query can sort by. + # The fields ad resources can be ordered by. + sig { returns(T.nilable(WhopSDK::AdListParams::Order::OrSymbol)) } + attr_accessor :order + + # Columns that the listAds query can sort by. Deprecated — use AdOrder. sig { returns(T.nilable(WhopSDK::AdListParams::OrderBy::OrSymbol)) } attr_accessor :order_by @@ -63,15 +80,18 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) } attr_accessor :order_direction - # Case-insensitive substring match against the ad title or tag. + # Case-insensitive substring match against the ad title or ID. sig { returns(T.nilable(String)) } attr_accessor :query - # Start of the stats date range used when order_by is a stats column. + # Inclusive start of the window for each ad's metric fields (spend, impressions, + # …) and for stats-column sorting. Omit both statsFrom and statsTo for all-time + # stats. sig { returns(T.nilable(Time)) } attr_accessor :stats_from - # End of the stats date range used when order_by is a stats column. + # Inclusive end of the window for each ad's metric fields and for stats-column + # sorting. Omit both statsFrom and statsTo for all-time stats. sig { returns(T.nilable(Time)) } attr_accessor :stats_to @@ -81,16 +101,20 @@ module WhopSDK sig do params( + ad_campaign_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), ad_group_id: T.nilable(String), + ad_group_ids: T.nilable(T::Array[String]), after: T.nilable(String), before: T.nilable(String), campaign_id: 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), - include_paused: T.nilable(T::Boolean), last: T.nilable(Integer), + order: T.nilable(WhopSDK::AdListParams::Order::OrSymbol), order_by: T.nilable(WhopSDK::AdListParams::OrderBy::OrSymbol), order_direction: T.nilable(WhopSDK::Direction::OrSymbol), query: T.nilable(String), @@ -101,39 +125,51 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # Filter by ad group. Provide exactly one of ad_group_id, campaign_id, or + # Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or + # company_id. + ad_campaign_id: nil, + # Only return ads belonging to these ad campaigns (max 100). Can be combined with + # companyId or used on its own. + ad_campaign_ids: nil, + # Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. ad_group_id: nil, + # Only return ads belonging to these ad groups (max 100). Can be combined with + # companyId or used on its own. + ad_group_ids: nil, # Returns the elements in the list that come after the specified cursor. after: nil, # Returns the elements in the list that come before the specified cursor. before: nil, - # Filter by campaign. Provide exactly one of ad_group_id, campaign_id, or - # company_id. + # Filter by campaign. campaign_id: nil, - # Filter by company. Provide exactly one of ad_group_id, campaign_id, or + # Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. company_id: nil, # Only return ads created after this timestamp. created_after: nil, # Only return ads created before this timestamp. created_before: nil, + # The direction of the sort. + direction: nil, # Returns the first _n_ elements from the list. first: nil, - # When false, excludes paused ads so pagination matches the dashboard's - # hide-paused toggle. - include_paused: nil, # Returns the last _n_ elements from the list. last: nil, - # Columns that the listAds query can sort by. + # The fields ad resources can be ordered by. + order: nil, + # Columns that the listAds query can sort by. Deprecated — use AdOrder. order_by: nil, # The direction of the sort. order_direction: nil, - # Case-insensitive substring match against the ad title or tag. + # Case-insensitive substring match against the ad title or ID. query: nil, - # Start of the stats date range used when order_by is a stats column. + # Inclusive start of the window for each ad's metric fields (spend, impressions, + # …) and for stats-column sorting. Omit both statsFrom and statsTo for all-time + # stats. stats_from: nil, - # End of the stats date range used when order_by is a stats column. + # Inclusive end of the window for each ad's metric fields and for stats-column + # sorting. Omit both statsFrom and statsTo for all-time stats. stats_to: nil, # The status of an external ad. status: nil, @@ -144,16 +180,20 @@ module WhopSDK sig do override.returns( { + ad_campaign_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), ad_group_id: T.nilable(String), + ad_group_ids: T.nilable(T::Array[String]), after: T.nilable(String), before: T.nilable(String), campaign_id: 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), - include_paused: T.nilable(T::Boolean), last: T.nilable(Integer), + order: T.nilable(WhopSDK::AdListParams::Order::OrSymbol), order_by: T.nilable(WhopSDK::AdListParams::OrderBy::OrSymbol), order_direction: T.nilable(WhopSDK::Direction::OrSymbol), query: T.nilable(String), @@ -167,7 +207,28 @@ module WhopSDK def to_hash end - # Columns that the listAds query can sort by. + # The fields ad resources can be ordered by. + module Order + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdListParams::Order) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT = + T.let(:created_at, WhopSDK::AdListParams::Order::TaggedSymbol) + SPEND = T.let(:spend, WhopSDK::AdListParams::Order::TaggedSymbol) + RETURN_ON_AD_SPEND = + T.let(:return_on_ad_spend, WhopSDK::AdListParams::Order::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::AdListParams::Order::TaggedSymbol]) + end + def self.values + end + end + + # Columns that the listAds query can sort by. Deprecated — use AdOrder. module OrderBy extend WhopSDK::Internal::Type::Enum @@ -176,6 +237,11 @@ module WhopSDK OrSymbol = T.type_alias { T.any(Symbol, String) } SPEND = T.let(:spend, WhopSDK::AdListParams::OrderBy::TaggedSymbol) + RETURN_ON_AD_SPEND = + T.let( + :return_on_ad_spend, + WhopSDK::AdListParams::OrderBy::TaggedSymbol + ) ROAS = T.let(:roas, WhopSDK::AdListParams::OrderBy::TaggedSymbol) sig do diff --git a/rbi/whop_sdk/models/ad_list_response.rbi b/rbi/whop_sdk/models/ad_list_response.rbi index e217021f..4b372780 100644 --- a/rbi/whop_sdk/models/ad_list_response.rbi +++ b/rbi/whop_sdk/models/ad_list_response.rbi @@ -32,14 +32,92 @@ module WhopSDK end attr_writer :ad_group + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + sig { returns(Float) } + attr_accessor :click_through_rate + + # Total clicks on this ad in the stats window. + sig { returns(Integer) } + attr_accessor :clicks + + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + sig { returns(Float) } + attr_accessor :cost_per_click + + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_lead + + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + sig { returns(Float) } + attr_accessor :cost_per_mille + + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_purchase + + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result + # When the ad was created. sig { returns(Time) } attr_accessor :created_at + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + sig { returns(T.nilable(Float)) } + attr_accessor :frequency + + # Total impressions (views) on this ad in the stats window. + sig { returns(Integer) } + attr_accessor :impressions + + # Open platform issues affecting this ad, deduplicated per object. Empty when + # there are none. + sig { returns(T::Array[WhopSDK::Models::AdListResponse::Issue]) } + attr_accessor :issues + + # Number of Whop pixel-attributed leads (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :leads + # The external ad platform this ad is running on (e.g., meta, tiktok). sig { returns(WhopSDK::AdCampaignPlatform::TaggedSymbol) } attr_accessor :platform + # Total USD value of Whop pixel-attributed purchases in the stats window. + sig { returns(Float) } + attr_accessor :purchase_value + + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + sig { returns(Integer) } + attr_accessor :purchases + + # Unique users reached in the stats window (deduplicated by the platform). + sig { returns(Integer) } + attr_accessor :reach + + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + sig { returns(Float) } + attr_accessor :return_on_ad_spend + + # Amount charged in dollars in the stats window. + sig { returns(Float) } + attr_accessor :spend + + # The available currencies on the platform + sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) } + attr_accessor :spend_currency + # Current delivery status of the ad. sig { returns(WhopSDK::ExternalAdStatus::TaggedSymbol) } attr_accessor :status @@ -48,6 +126,15 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :title + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + sig { returns(T.nilable(Float)) } + attr_accessor :unique_click_through_rate + + # Unique clicks (deduplicated by the platform) in the stats window. + sig { returns(Integer) } + attr_accessor :unique_clicks + # When the ad was last updated. sig { returns(Time) } attr_accessor :updated_at @@ -58,10 +145,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign::OrHash, ad_group: WhopSDK::Models::AdListResponse::AdGroup::OrHash, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::Models::AdListResponse::Issue::OrHash], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::OrSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::OrSymbol), status: WhopSDK::ExternalAdStatus::OrSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time ).returns(T.attached_class) end @@ -72,14 +178,63 @@ module WhopSDK ad_campaign:, # The parent ad group this ad belongs to. ad_group:, + # Click-through rate as a fraction of impressions (clicks / impressions, 0–1). + click_through_rate:, + # Total clicks on this ad in the stats window. + clicks:, + # Cost per click in dollars (spend / clicks). 0 when there are no clicks. + cost_per_click:, + # Cost in dollars per Whop pixel-attributed lead (spend / leads). 0 when leads are + # tracked but none happened yet; null when leads are not a goal and none were + # attributed. + cost_per_lead:, + # Cost per 1,000 impressions in dollars (spend / impressions × 1000). 0 when there + # are no impressions. + cost_per_mille:, + # Cost in dollars per Whop pixel-attributed purchase (spend / purchases). 0 when + # purchases are tracked but none happened yet; null when purchases are not a goal + # and none were attributed. + cost_per_purchase:, + # Cost in dollars per optimization result (spend / results). 0 when a result is + # being optimized for but none happened yet; null when nothing is being optimized + # for. + cost_per_result:, # When the ad was created. created_at:, + # Average number of times each person saw an ad (impressions / reach), as reported + # by the platform. + frequency:, + # Total impressions (views) on this ad in the stats window. + impressions:, + # Open platform issues affecting this ad, deduplicated per object. Empty when + # there are none. + issues:, + # Number of Whop pixel-attributed leads (last-click) in the stats window. + leads:, # The external ad platform this ad is running on (e.g., meta, tiktok). platform:, + # Total USD value of Whop pixel-attributed purchases in the stats window. + purchase_value:, + # Number of Whop pixel-attributed purchases (last-click) in the stats window. + purchases:, + # Unique users reached in the stats window (deduplicated by the platform). + reach:, + # Return on ad spend as a ratio (purchaseValue / spend) — 2.5 means $2.50 of + # attributed purchase value per $1 spent. 0 when there is no spend. + return_on_ad_spend:, + # Amount charged in dollars in the stats window. + spend:, + # The available currencies on the platform + spend_currency:, # Current delivery status of the ad. status:, # The display title of the ad. Falls back to the creative set caption when unset. title:, + # Unique click-through rate as a fraction of impressions (unique clicks / + # impressions, 0–1). + unique_click_through_rate:, + # Unique clicks (deduplicated by the platform) in the stats window. + unique_clicks:, # When the ad was last updated. updated_at: ) @@ -91,10 +246,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign, ad_group: WhopSDK::Models::AdListResponse::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: T.nilable(Float), + cost_per_mille: Float, + cost_per_purchase: T.nilable(Float), + cost_per_result: T.nilable(Float), created_at: Time, + frequency: T.nilable(Float), + impressions: Integer, + issues: T::Array[WhopSDK::Models::AdListResponse::Issue], + leads: Integer, platform: WhopSDK::AdCampaignPlatform::TaggedSymbol, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol), status: WhopSDK::ExternalAdStatus::TaggedSymbol, title: T.nilable(String), + unique_click_through_rate: T.nilable(Float), + unique_clicks: Integer, updated_at: Time } ) @@ -153,6 +327,140 @@ module WhopSDK def to_hash end end + + class Issue < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::AdListResponse::Issue, + WhopSDK::Internal::AnyHash + ) + end + + # When the issue was first reported. + sig { returns(Time) } + attr_accessor :created_at + + # Platform-specific error code. + sig { returns(T.nilable(String)) } + attr_accessor :error_code + + # Full error detail from the platform. + sig { returns(T.nilable(String)) } + attr_accessor :error_message + + # Short description of the issue. + sig { returns(String) } + attr_accessor :error_summary + + # Current resolution status. + sig do + returns( + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + end + attr_accessor :resolution_status + + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + sig { returns(T.nilable(String)) } + attr_accessor :resource_id + + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + sig { returns(String) } + attr_accessor :resource_type + + # A platform-reported issue on an ad object (rejection, policy flag, etc.). + sig do + params( + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::OrSymbol, + resource_id: T.nilable(String), + resource_type: String + ).returns(T.attached_class) + end + def self.new( + # When the issue was first reported. + created_at:, + # Platform-specific error code. + error_code:, + # Full error detail from the platform. + error_message:, + # Short description of the issue. + error_summary:, + # Current resolution status. + resolution_status:, + # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). + # Null when the issue isn't tied to a local object. + resource_id:, + # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. + # Pairs with `resourceId`. + resource_type: + ) + end + + sig do + override.returns( + { + created_at: Time, + error_code: T.nilable(String), + error_message: T.nilable(String), + error_summary: String, + resolution_status: + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol, + resource_id: T.nilable(String), + resource_type: String + } + ) + end + def to_hash + end + + # Current resolution status. + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :open, + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + RESOLVED = + T.let( + :resolved, + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + ACKNOWLEDGED = + T.let( + :acknowledged, + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/whop_sdk/models/ad_report_retrieve_params.rbi b/rbi/whop_sdk/models/ad_report_retrieve_params.rbi index 1455c953..b4ed5a66 100644 --- a/rbi/whop_sdk/models/ad_report_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_report_retrieve_params.rbi @@ -19,20 +19,20 @@ module WhopSDK sig { returns(Time) } attr_accessor :to - # The unique identifier of an ad campaign. Mutually exclusive with `companyId`, - # `adGroupId`, and `adId`. - sig { returns(T.nilable(String)) } - attr_accessor :ad_campaign_id + # Scope the report to these ad campaigns (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :ad_campaign_ids - # The unique identifier of an ad group. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adId`. - sig { returns(T.nilable(String)) } - attr_accessor :ad_group_id + # Scope the report to these ad groups (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :ad_group_ids - # The unique identifier of an ad. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adGroupId`. - sig { returns(T.nilable(String)) } - attr_accessor :ad_id + # Scope the report to these ads (max 100); stats are summed across them. Mutually + # exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :ad_ids # Entity level to group an ad report by. sig do @@ -40,9 +40,9 @@ module WhopSDK end attr_accessor :breakdown - # The unique identifier of a company. Mutually exclusive with `adCampaignId`, - # `adGroupId`, and `adId`. Use with `breakdown` to fan out across every campaign, - # ad group, or ad in the company without paging. + # The unique identifier of a company. Mutually exclusive with `adCampaignIds`, + # `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every + # campaign, ad group, or ad in the company without paging. sig { returns(T.nilable(String)) } attr_accessor :company_id @@ -59,9 +59,9 @@ module WhopSDK params( from: Time, to: Time, - ad_campaign_id: T.nilable(String), - ad_group_id: T.nilable(String), - ad_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), + ad_group_ids: T.nilable(T::Array[String]), + ad_ids: T.nilable(T::Array[String]), breakdown: T.nilable(WhopSDK::AdReportRetrieveParams::Breakdown::OrSymbol), company_id: T.nilable(String), @@ -75,20 +75,20 @@ module WhopSDK from:, # Inclusive end of the reporting window. to:, - # The unique identifier of an ad campaign. Mutually exclusive with `companyId`, - # `adGroupId`, and `adId`. - ad_campaign_id: nil, - # The unique identifier of an ad group. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adId`. - ad_group_id: nil, - # The unique identifier of an ad. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adGroupId`. - ad_id: nil, + # Scope the report to these ad campaigns (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. + ad_campaign_ids: nil, + # Scope the report to these ad groups (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. + ad_group_ids: nil, + # Scope the report to these ads (max 100); stats are summed across them. Mutually + # exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. + ad_ids: nil, # Entity level to group an ad report by. breakdown: nil, - # The unique identifier of a company. Mutually exclusive with `adCampaignId`, - # `adGroupId`, and `adId`. Use with `breakdown` to fan out across every campaign, - # ad group, or ad in the company without paging. + # The unique identifier of a company. Mutually exclusive with `adCampaignIds`, + # `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every + # campaign, ad group, or ad in the company without paging. company_id: nil, # ISO 4217 currency code to report `spend` in. Defaults to the company's ads # reporting currency. @@ -104,9 +104,9 @@ module WhopSDK { from: Time, to: Time, - ad_campaign_id: T.nilable(String), - ad_group_id: T.nilable(String), - ad_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), + ad_group_ids: T.nilable(T::Array[String]), + ad_ids: T.nilable(T::Array[String]), breakdown: T.nilable(WhopSDK::AdReportRetrieveParams::Breakdown::OrSymbol), company_id: T.nilable(String), diff --git a/rbi/whop_sdk/models/ad_report_retrieve_response.rbi b/rbi/whop_sdk/models/ad_report_retrieve_response.rbi index 30c4ebdd..f3264aa3 100644 --- a/rbi/whop_sdk/models/ad_report_retrieve_response.rbi +++ b/rbi/whop_sdk/models/ad_report_retrieve_response.rbi @@ -393,25 +393,25 @@ module WhopSDK ) end + # Click-through rate (clicks / impressions). + sig { returns(Float) } + attr_accessor :click_through_rate + # Total clicks over the date range. sig { returns(Integer) } attr_accessor :clicks - # Spend divided by `resultCount`. Null when there are no results. - sig { returns(T.nilable(Float)) } - attr_accessor :cost_per_result - # Cost per click in the requested reporting currency. sig { returns(Float) } - attr_accessor :cpc + attr_accessor :cost_per_click # Cost per thousand impressions in the requested reporting currency. sig { returns(T.nilable(Float)) } - attr_accessor :cpm + attr_accessor :cost_per_mille - # Click-through rate (clicks / impressions). - sig { returns(Float) } - attr_accessor :ctr + # Spend divided by `resultCount`. Null when there are no results. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result # Average number of times each reached user saw an ad. sig { returns(T.nilable(Float)) } @@ -438,10 +438,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :result_label_override - # Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the - # external ad platform. + # Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as + # reported by the external ad platform. sig { returns(T.nilable(Float)) } - attr_accessor :roas + attr_accessor :return_on_ad_spend # Total spend over the date range in the requested reporting currency. sig { returns(Float) } @@ -454,33 +454,33 @@ module WhopSDK # Aggregate totals and rates for this entity over the date range. sig do params( + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: T.nilable(Float), cost_per_result: T.nilable(Float), - cpc: Float, - cpm: T.nilable(Float), - ctr: Float, frequency: T.nilable(Float), impressions: Integer, reach: Integer, result_count: T.nilable(Integer), result_label_key: T.nilable(WhopSDK::ResultLabelKeys::OrSymbol), result_label_override: T.nilable(String), - roas: T.nilable(Float), + return_on_ad_spend: T.nilable(Float), spend: Float, spend_currency: T.nilable(WhopSDK::Currency::OrSymbol) ).returns(T.attached_class) end def self.new( + # Click-through rate (clicks / impressions). + click_through_rate:, # Total clicks over the date range. clicks:, - # Spend divided by `resultCount`. Null when there are no results. - cost_per_result:, # Cost per click in the requested reporting currency. - cpc:, + cost_per_click:, # Cost per thousand impressions in the requested reporting currency. - cpm:, - # Click-through rate (clicks / impressions). - ctr:, + cost_per_mille:, + # Spend divided by `resultCount`. Null when there are no results. + cost_per_result:, # Average number of times each reached user saw an ad. frequency:, # Total impressions over the date range. @@ -494,9 +494,9 @@ module WhopSDK result_label_key:, # Advertiser-defined label for the result when `resultLabelKey` is `custom`. result_label_override:, - # Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the - # external ad platform. - roas:, + # Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as + # reported by the external ad platform. + return_on_ad_spend:, # Total spend over the date range in the requested reporting currency. spend:, # The available currencies on the platform @@ -507,11 +507,11 @@ module WhopSDK sig do override.returns( { + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: T.nilable(Float), cost_per_result: T.nilable(Float), - cpc: Float, - cpm: T.nilable(Float), - ctr: Float, frequency: T.nilable(Float), impressions: Integer, reach: Integer, @@ -519,7 +519,7 @@ module WhopSDK result_label_key: T.nilable(WhopSDK::ResultLabelKeys::TaggedSymbol), result_label_override: T.nilable(String), - roas: T.nilable(Float), + return_on_ad_spend: T.nilable(Float), spend: Float, spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol) } @@ -677,25 +677,25 @@ module WhopSDK ) end + # Click-through rate (clicks / impressions). + sig { returns(Float) } + attr_accessor :click_through_rate + # Total clicks over the date range. sig { returns(Integer) } attr_accessor :clicks - # Spend divided by `resultCount`. Null when there are no results. - sig { returns(T.nilable(Float)) } - attr_accessor :cost_per_result - # Cost per click in the requested reporting currency. sig { returns(Float) } - attr_accessor :cpc + attr_accessor :cost_per_click # Cost per thousand impressions in the requested reporting currency. sig { returns(T.nilable(Float)) } - attr_accessor :cpm + attr_accessor :cost_per_mille - # Click-through rate (clicks / impressions). - sig { returns(Float) } - attr_accessor :ctr + # Spend divided by `resultCount`. Null when there are no results. + sig { returns(T.nilable(Float)) } + attr_accessor :cost_per_result # Average number of times each reached user saw an ad. sig { returns(T.nilable(Float)) } @@ -722,10 +722,10 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :result_label_override - # Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the - # external ad platform. + # Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as + # reported by the external ad platform. sig { returns(T.nilable(Float)) } - attr_accessor :roas + attr_accessor :return_on_ad_spend # Total spend over the date range in the requested reporting currency. sig { returns(Float) } @@ -738,33 +738,33 @@ module WhopSDK # Aggregate totals and rates over the date range. sig do params( + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: T.nilable(Float), cost_per_result: T.nilable(Float), - cpc: Float, - cpm: T.nilable(Float), - ctr: Float, frequency: T.nilable(Float), impressions: Integer, reach: Integer, result_count: T.nilable(Integer), result_label_key: T.nilable(WhopSDK::ResultLabelKeys::OrSymbol), result_label_override: T.nilable(String), - roas: T.nilable(Float), + return_on_ad_spend: T.nilable(Float), spend: Float, spend_currency: T.nilable(WhopSDK::Currency::OrSymbol) ).returns(T.attached_class) end def self.new( + # Click-through rate (clicks / impressions). + click_through_rate:, # Total clicks over the date range. clicks:, - # Spend divided by `resultCount`. Null when there are no results. - cost_per_result:, # Cost per click in the requested reporting currency. - cpc:, + cost_per_click:, # Cost per thousand impressions in the requested reporting currency. - cpm:, - # Click-through rate (clicks / impressions). - ctr:, + cost_per_mille:, + # Spend divided by `resultCount`. Null when there are no results. + cost_per_result:, # Average number of times each reached user saw an ad. frequency:, # Total impressions over the date range. @@ -778,9 +778,9 @@ module WhopSDK result_label_key:, # Advertiser-defined label for the result when `resultLabelKey` is `custom`. result_label_override:, - # Alias for `purchaseRoas` — return on ad spend for purchases, as reported by the - # external ad platform. - roas:, + # Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as + # reported by the external ad platform. + return_on_ad_spend:, # Total spend over the date range in the requested reporting currency. spend:, # The available currencies on the platform @@ -791,11 +791,11 @@ module WhopSDK sig do override.returns( { + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: T.nilable(Float), cost_per_result: T.nilable(Float), - cpc: Float, - cpm: T.nilable(Float), - ctr: Float, frequency: T.nilable(Float), impressions: Integer, reach: Integer, @@ -803,7 +803,7 @@ module WhopSDK result_label_key: T.nilable(WhopSDK::ResultLabelKeys::TaggedSymbol), result_label_override: T.nilable(String), - roas: T.nilable(Float), + return_on_ad_spend: T.nilable(Float), spend: Float, spend_currency: T.nilable(WhopSDK::Currency::TaggedSymbol) } diff --git a/rbi/whop_sdk/models/ad_retrieve_params.rbi b/rbi/whop_sdk/models/ad_retrieve_params.rbi index 83373d17..4308c21f 100644 --- a/rbi/whop_sdk/models/ad_retrieve_params.rbi +++ b/rbi/whop_sdk/models/ad_retrieve_params.rbi @@ -14,18 +14,44 @@ module WhopSDK sig { returns(String) } attr_accessor :id + # Inclusive start of the window for the ad's metric fields (spend, impressions, + # …). Omit both statsFrom and statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_from + + # Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # statsTo for all-time stats. + sig { returns(T.nilable(Time)) } + attr_accessor :stats_to + sig do params( id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(id:, request_options: {}) + def self.new( + id:, + # Inclusive start of the window for the ad's metric fields (spend, impressions, + # …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # statsTo for all-time stats. + stats_to: nil, + request_options: {} + ) end sig do override.returns( - { id: String, request_options: WhopSDK::RequestOptions } + { + id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), + request_options: WhopSDK::RequestOptions + } ) end def to_hash diff --git a/rbi/whop_sdk/resources/ad_campaigns.rbi b/rbi/whop_sdk/resources/ad_campaigns.rbi index 3a38e5c4..774d632a 100644 --- a/rbi/whop_sdk/resources/ad_campaigns.rbi +++ b/rbi/whop_sdk/resources/ad_campaigns.rbi @@ -12,12 +12,20 @@ module WhopSDK sig do params( id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdCampaign) end def retrieve( # The unique identifier of the ad campaign. id, + # Inclusive start of the window for the campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for the campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, request_options: {} ) end @@ -60,6 +68,8 @@ module WhopSDK first: T.nilable(Integer), last: T.nilable(Integer), query: T.nilable(String), + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), status: T.nilable(WhopSDK::AdCampaignStatus::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash ).returns( @@ -81,8 +91,14 @@ module WhopSDK first: nil, # Returns the last _n_ elements from the list. last: nil, - # Case-insensitive substring match against the campaign title. + # Case-insensitive substring match against the campaign title or ID. query: nil, + # Inclusive start of the window for each campaign's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for each campaign's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, # The status of an ad campaign. status: nil, request_options: {} diff --git a/rbi/whop_sdk/resources/ad_groups.rbi b/rbi/whop_sdk/resources/ad_groups.rbi index a2701c63..390ca26f 100644 --- a/rbi/whop_sdk/resources/ad_groups.rbi +++ b/rbi/whop_sdk/resources/ad_groups.rbi @@ -12,12 +12,20 @@ module WhopSDK sig do params( id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdGroup) end def retrieve( # The unique identifier of the ad group. id, + # Inclusive start of the window for the ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for the ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, request_options: {} ) end @@ -71,6 +79,8 @@ module WhopSDK # - `ad_campaign:basic:read` sig do params( + ad_campaign_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), after: T.nilable(String), before: T.nilable(String), campaign_id: T.nilable(String), @@ -78,9 +88,10 @@ module WhopSDK created_after: T.nilable(Time), created_before: T.nilable(Time), first: T.nilable(Integer), - include_paused: T.nilable(T::Boolean), last: T.nilable(Integer), query: T.nilable(String), + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), request_options: WhopSDK::RequestOptions::OrHash ).returns( @@ -88,13 +99,18 @@ module WhopSDK ) end def list( + # Filter by ad campaign. Provide exactly one of ad_campaign_id or company_id. + ad_campaign_id: nil, + # Only return ad groups belonging to these ad campaigns (max 100). Can be combined + # with companyId or used on its own. + ad_campaign_ids: nil, # Returns the elements in the list that come after the specified cursor. after: nil, # Returns the elements in the list that come before the specified cursor. before: nil, - # Filter by campaign. Provide exactly one of campaign_id or company_id. + # Filter by campaign. campaign_id: nil, - # Filter by company. Provide exactly one of campaign_id or company_id. + # Filter by company. Provide companyId or adCampaignIds. company_id: nil, # Only return ad groups created after this timestamp. created_after: nil, @@ -102,13 +118,16 @@ module WhopSDK created_before: nil, # Returns the first _n_ elements from the list. first: nil, - # When false, excludes paused ad groups so pagination matches the dashboard's - # hide-paused toggle. - include_paused: nil, # Returns the last _n_ elements from the list. last: nil, - # Case-insensitive substring match against the ad group name. + # Case-insensitive substring match against the ad group name or ID. query: nil, + # Inclusive start of the window for each ad group's metric fields (spend, + # impressions, …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for each ad group's metric fields. Omit both + # statsFrom and statsTo for all-time stats. + stats_to: nil, # The status of an external ad group. status: nil, request_options: {} diff --git a/rbi/whop_sdk/resources/ad_reports.rbi b/rbi/whop_sdk/resources/ad_reports.rbi index 4ab25247..82a26556 100644 --- a/rbi/whop_sdk/resources/ad_reports.rbi +++ b/rbi/whop_sdk/resources/ad_reports.rbi @@ -4,11 +4,12 @@ module WhopSDK module Resources # Ad reports class AdReports - # Performance report for a company, ad campaign, ad group, or ad. Always returns - # aggregate `summary` totals. Set `granularity` (`daily`/`hourly`) to additionally - # get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) to - # additionally get per-entity rows inside the requested scope. Exactly one of - # `companyId`, `adCampaignId`, `adGroupId`, or `adId` must be provided. + # Performance report for a company, ad campaigns, ad groups, or ads. Always + # returns aggregate `summary` totals summed across the scope. Set `granularity` + # (`daily`/`hourly`) to additionally get a time series, or set `breakdown` + # (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the + # requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or + # `adIds` must be provided. # # Required permissions: # @@ -17,9 +18,9 @@ module WhopSDK params( from: Time, to: Time, - ad_campaign_id: T.nilable(String), - ad_group_id: T.nilable(String), - ad_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), + ad_group_ids: T.nilable(T::Array[String]), + ad_ids: T.nilable(T::Array[String]), breakdown: T.nilable(WhopSDK::AdReportRetrieveParams::Breakdown::OrSymbol), company_id: T.nilable(String), @@ -33,20 +34,20 @@ module WhopSDK from:, # Inclusive end of the reporting window. to:, - # The unique identifier of an ad campaign. Mutually exclusive with `companyId`, - # `adGroupId`, and `adId`. - ad_campaign_id: nil, - # The unique identifier of an ad group. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adId`. - ad_group_id: nil, - # The unique identifier of an ad. Mutually exclusive with `companyId`, - # `adCampaignId`, and `adGroupId`. - ad_id: nil, + # Scope the report to these ad campaigns (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. + ad_campaign_ids: nil, + # Scope the report to these ad groups (max 100); stats are summed across them. + # Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. + ad_group_ids: nil, + # Scope the report to these ads (max 100); stats are summed across them. Mutually + # exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. + ad_ids: nil, # Entity level to group an ad report by. breakdown: nil, - # The unique identifier of a company. Mutually exclusive with `adCampaignId`, - # `adGroupId`, and `adId`. Use with `breakdown` to fan out across every campaign, - # ad group, or ad in the company without paging. + # The unique identifier of a company. Mutually exclusive with `adCampaignIds`, + # `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every + # campaign, ad group, or ad in the company without paging. company_id: nil, # ISO 4217 currency code to report `spend` in. Defaults to the company's ads # reporting currency. diff --git a/rbi/whop_sdk/resources/ads.rbi b/rbi/whop_sdk/resources/ads.rbi index 8232174c..805b66a9 100644 --- a/rbi/whop_sdk/resources/ads.rbi +++ b/rbi/whop_sdk/resources/ads.rbi @@ -12,12 +12,20 @@ module WhopSDK sig do params( id: String, + stats_from: T.nilable(Time), + stats_to: T.nilable(Time), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Ad) end def retrieve( # The unique identifier of the ad. id, + # Inclusive start of the window for the ad's metric fields (spend, impressions, + # …). Omit both statsFrom and statsTo for all-time stats. + stats_from: nil, + # Inclusive end of the window for the ad's metric fields. Omit both statsFrom and + # statsTo for all-time stats. + stats_to: nil, request_options: {} ) end @@ -29,16 +37,20 @@ module WhopSDK # - `ad_campaign:basic:read` sig do params( + ad_campaign_id: T.nilable(String), + ad_campaign_ids: T.nilable(T::Array[String]), ad_group_id: T.nilable(String), + ad_group_ids: T.nilable(T::Array[String]), after: T.nilable(String), before: T.nilable(String), campaign_id: 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), - include_paused: T.nilable(T::Boolean), last: T.nilable(Integer), + order: T.nilable(WhopSDK::AdListParams::Order::OrSymbol), order_by: T.nilable(WhopSDK::AdListParams::OrderBy::OrSymbol), order_direction: T.nilable(WhopSDK::Direction::OrSymbol), query: T.nilable(String), @@ -51,39 +63,51 @@ module WhopSDK ) end def list( - # Filter by ad group. Provide exactly one of ad_group_id, campaign_id, or + # Filter by ad campaign. Provide exactly one of ad_group_id, ad_campaign_id, or + # company_id. + ad_campaign_id: nil, + # Only return ads belonging to these ad campaigns (max 100). Can be combined with + # companyId or used on its own. + ad_campaign_ids: nil, + # Filter by ad group. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. ad_group_id: nil, + # Only return ads belonging to these ad groups (max 100). Can be combined with + # companyId or used on its own. + ad_group_ids: nil, # Returns the elements in the list that come after the specified cursor. after: nil, # Returns the elements in the list that come before the specified cursor. before: nil, - # Filter by campaign. Provide exactly one of ad_group_id, campaign_id, or - # company_id. + # Filter by campaign. campaign_id: nil, - # Filter by company. Provide exactly one of ad_group_id, campaign_id, or + # Filter by company. Provide exactly one of ad_group_id, ad_campaign_id, or # company_id. company_id: nil, # Only return ads created after this timestamp. created_after: nil, # Only return ads created before this timestamp. created_before: nil, + # The direction of the sort. + direction: nil, # Returns the first _n_ elements from the list. first: nil, - # When false, excludes paused ads so pagination matches the dashboard's - # hide-paused toggle. - include_paused: nil, # Returns the last _n_ elements from the list. last: nil, - # Columns that the listAds query can sort by. + # The fields ad resources can be ordered by. + order: nil, + # Columns that the listAds query can sort by. Deprecated — use AdOrder. order_by: nil, # The direction of the sort. order_direction: nil, - # Case-insensitive substring match against the ad title or tag. + # Case-insensitive substring match against the ad title or ID. query: nil, - # Start of the stats date range used when order_by is a stats column. + # Inclusive start of the window for each ad's metric fields (spend, impressions, + # …) and for stats-column sorting. Omit both statsFrom and statsTo for all-time + # stats. stats_from: nil, - # End of the stats date range used when order_by is a stats column. + # Inclusive end of the window for each ad's metric fields and for stats-column + # sorting. Omit both statsFrom and statsTo for all-time stats. stats_to: nil, # The status of an external ad. status: nil, diff --git a/sig/whop_sdk/models/ad.rbs b/sig/whop_sdk/models/ad.rbs index db94687d..ff05d11b 100644 --- a/sig/whop_sdk/models/ad.rbs +++ b/sig/whop_sdk/models/ad.rbs @@ -5,10 +5,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Ad::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::external_ad_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -19,24 +38,81 @@ module WhopSDK attr_accessor ad_group: WhopSDK::Ad::AdGroup + attr_accessor click_through_rate: Float + + attr_accessor clicks: Integer + + attr_accessor cost_per_click: Float + + attr_accessor cost_per_lead: Float? + + attr_accessor cost_per_mille: Float + + attr_accessor cost_per_purchase: Float? + + attr_accessor cost_per_result: Float? + attr_accessor created_at: Time + attr_accessor frequency: Float? + + attr_accessor impressions: Integer + + attr_accessor issues: ::Array[WhopSDK::Ad::Issue] + + attr_accessor leads: Integer + attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor purchase_value: Float + + attr_accessor purchases: Integer + + attr_accessor reach: Integer + + attr_accessor return_on_ad_spend: Float + + attr_accessor spend: Float + + attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor status: WhopSDK::Models::external_ad_status attr_accessor title: String? + attr_accessor unique_click_through_rate: Float? + + attr_accessor unique_clicks: Integer + attr_accessor updated_at: Time def initialize: ( id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Ad::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::external_ad_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time ) -> void @@ -44,10 +120,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Ad::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::external_ad_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -70,6 +165,65 @@ module WhopSDK def to_hash: -> { id: String } end + + type issue = + { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + class Issue < WhopSDK::Internal::Type::BaseModel + attr_accessor created_at: Time + + attr_accessor error_code: String? + + attr_accessor error_message: String? + + attr_accessor error_summary: String + + attr_accessor resolution_status: WhopSDK::Models::Ad::Issue::resolution_status + + attr_accessor resource_id: String? + + attr_accessor resource_type: String + + def initialize: ( + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, + resource_id: String?, + resource_type: String + ) -> void + + def to_hash: -> { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + type resolution_status = :open | :resolved | :acknowledged + + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN: :open + RESOLVED: :resolved + ACKNOWLEDGED: :acknowledged + + def self?.values: -> ::Array[WhopSDK::Models::Ad::Issue::resolution_status] + end + end end end end diff --git a/sig/whop_sdk/models/ad_campaign.rbs b/sig/whop_sdk/models/ad_campaign.rbs index 82b90791..01c7acfc 100644 --- a/sig/whop_sdk/models/ad_campaign.rbs +++ b/sig/whop_sdk/models/ad_campaign.rbs @@ -5,13 +5,29 @@ module WhopSDK id: String, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: WhopSDK::AdCampaign::MetaConfig?, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::AdCampaign::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_campaign_status, title: String, - total_spend: Float, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -22,19 +38,51 @@ module WhopSDK attr_accessor budget_type: WhopSDK::Models::ad_budget_type? + attr_accessor click_through_rate: Float + + attr_accessor clicks: Integer + + attr_accessor cost_per_click: Float + + attr_accessor cost_per_lead: Float? + + attr_accessor cost_per_mille: Float + + attr_accessor cost_per_purchase: Float? + + attr_accessor cost_per_result: Float? + attr_accessor created_at: Time - attr_accessor created_by_user: WhopSDK::AdCampaign::CreatedByUser + attr_accessor frequency: Float? + + attr_accessor impressions: Integer + + attr_accessor issues: ::Array[WhopSDK::AdCampaign::Issue] - attr_accessor meta_config: WhopSDK::AdCampaign::MetaConfig? + attr_accessor leads: Integer attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor purchase_value: Float + + attr_accessor purchases: Integer + + attr_accessor reach: Integer + + attr_accessor return_on_ad_spend: Float + + attr_accessor spend: Float + + attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor status: WhopSDK::Models::ad_campaign_status attr_accessor title: String - attr_accessor total_spend: Float + attr_accessor unique_click_through_rate: Float? + + attr_accessor unique_clicks: Integer attr_accessor updated_at: Time @@ -42,13 +90,29 @@ module WhopSDK id: String, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: WhopSDK::AdCampaign::MetaConfig?, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::AdCampaign::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_campaign_status, title: String, - total_spend: Float, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time ) -> void @@ -56,137 +120,88 @@ module WhopSDK id: String, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: WhopSDK::AdCampaign::MetaConfig?, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::AdCampaign::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_campaign_status, title: String, - total_spend: Float, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } - type created_by_user = { id: String, name: String?, username: String } - - class CreatedByUser < 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 - - type meta_config = + type issue = { - bid_amount: Integer?, - bid_strategy: WhopSDK::Models::AdCampaign::MetaConfig::bid_strategy?, - budget_optimization: bool?, - effective_status: WhopSDK::Models::AdCampaign::MetaConfig::effective_status?, - end_time: String?, - objective: WhopSDK::Models::AdCampaign::MetaConfig::objective?, - special_categories: ::Array[String]?, - start_time: String?, - status: WhopSDK::Models::AdCampaign::MetaConfig::status? + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, + resource_id: String?, + resource_type: String } - class MetaConfig < WhopSDK::Internal::Type::BaseModel - attr_accessor bid_amount: Integer? - - attr_accessor bid_strategy: WhopSDK::Models::AdCampaign::MetaConfig::bid_strategy? - - attr_accessor budget_optimization: bool? + class Issue < WhopSDK::Internal::Type::BaseModel + attr_accessor created_at: Time - attr_accessor effective_status: WhopSDK::Models::AdCampaign::MetaConfig::effective_status? + attr_accessor error_code: String? - attr_accessor end_time: String? + attr_accessor error_message: String? - attr_accessor objective: WhopSDK::Models::AdCampaign::MetaConfig::objective? + attr_accessor error_summary: String - attr_accessor special_categories: ::Array[String]? + attr_accessor resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status - attr_accessor start_time: String? + attr_accessor resource_id: String? - attr_accessor status: WhopSDK::Models::AdCampaign::MetaConfig::status? + attr_accessor resource_type: String def initialize: ( - bid_amount: Integer?, - bid_strategy: WhopSDK::Models::AdCampaign::MetaConfig::bid_strategy?, - budget_optimization: bool?, - effective_status: WhopSDK::Models::AdCampaign::MetaConfig::effective_status?, - end_time: String?, - objective: WhopSDK::Models::AdCampaign::MetaConfig::objective?, - special_categories: ::Array[String]?, - start_time: String?, - status: WhopSDK::Models::AdCampaign::MetaConfig::status? + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, + resource_id: String?, + resource_type: String ) -> void def to_hash: -> { - bid_amount: Integer?, - bid_strategy: WhopSDK::Models::AdCampaign::MetaConfig::bid_strategy?, - budget_optimization: bool?, - effective_status: WhopSDK::Models::AdCampaign::MetaConfig::effective_status?, - end_time: String?, - objective: WhopSDK::Models::AdCampaign::MetaConfig::objective?, - special_categories: ::Array[String]?, - start_time: String?, - status: WhopSDK::Models::AdCampaign::MetaConfig::status? + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, + resource_id: String?, + resource_type: String } - type bid_strategy = :lowest_cost | :bid_cap | :cost_cap - - module BidStrategy - extend WhopSDK::Internal::Type::Enum - - LOWEST_COST: :lowest_cost - BID_CAP: :bid_cap - COST_CAP: :cost_cap - - def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::MetaConfig::bid_strategy] - end - - type effective_status = - :active | :paused | :deleted | :in_review | :rejected | :with_issues - - module EffectiveStatus - extend WhopSDK::Internal::Type::Enum - - ACTIVE: :active - PAUSED: :paused - DELETED: :deleted - IN_REVIEW: :in_review - REJECTED: :rejected - WITH_ISSUES: :with_issues - - def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::MetaConfig::effective_status] - end - - type objective = :awareness | :traffic | :engagement | :leads | :sales - - module Objective - extend WhopSDK::Internal::Type::Enum - - AWARENESS: :awareness - TRAFFIC: :traffic - ENGAGEMENT: :engagement - LEADS: :leads - SALES: :sales - - def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::MetaConfig::objective] - end - - type status = :active | :paused + type resolution_status = :open | :resolved | :acknowledged - module Status + module ResolutionStatus extend WhopSDK::Internal::Type::Enum - ACTIVE: :active - PAUSED: :paused + OPEN: :open + RESOLVED: :resolved + ACKNOWLEDGED: :acknowledged - def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::MetaConfig::status] + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::Issue::resolution_status] end end end diff --git a/sig/whop_sdk/models/ad_campaign_list_params.rbs b/sig/whop_sdk/models/ad_campaign_list_params.rbs index d3549be0..a387ceb7 100644 --- a/sig/whop_sdk/models/ad_campaign_list_params.rbs +++ b/sig/whop_sdk/models/ad_campaign_list_params.rbs @@ -10,6 +10,8 @@ module WhopSDK first: Integer?, last: Integer?, query: String?, + stats_from: Time?, + stats_to: Time?, status: WhopSDK::Models::ad_campaign_status? } & WhopSDK::Internal::Type::request_parameters @@ -34,6 +36,10 @@ module WhopSDK attr_accessor query: String? + attr_accessor stats_from: Time? + + attr_accessor stats_to: Time? + attr_accessor status: WhopSDK::Models::ad_campaign_status? def initialize: ( @@ -45,6 +51,8 @@ module WhopSDK ?first: Integer?, ?last: Integer?, ?query: String?, + ?stats_from: Time?, + ?stats_to: Time?, ?status: WhopSDK::Models::ad_campaign_status?, ?request_options: WhopSDK::request_opts ) -> void @@ -58,6 +66,8 @@ module WhopSDK first: Integer?, last: Integer?, query: String?, + stats_from: Time?, + stats_to: Time?, status: WhopSDK::Models::ad_campaign_status?, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/models/ad_campaign_list_response.rbs b/sig/whop_sdk/models/ad_campaign_list_response.rbs index f39921d2..c434f748 100644 --- a/sig/whop_sdk/models/ad_campaign_list_response.rbs +++ b/sig/whop_sdk/models/ad_campaign_list_response.rbs @@ -5,11 +5,29 @@ module WhopSDK id: String, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdCampaignListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_campaign_status, title: String, - total_spend: Float, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -20,15 +38,51 @@ module WhopSDK attr_accessor budget_type: WhopSDK::Models::ad_budget_type? + attr_accessor click_through_rate: Float + + attr_accessor clicks: Integer + + attr_accessor cost_per_click: Float + + attr_accessor cost_per_lead: Float? + + attr_accessor cost_per_mille: Float + + attr_accessor cost_per_purchase: Float? + + attr_accessor cost_per_result: Float? + attr_accessor created_at: Time + attr_accessor frequency: Float? + + attr_accessor impressions: Integer + + attr_accessor issues: ::Array[WhopSDK::Models::AdCampaignListResponse::Issue] + + attr_accessor leads: Integer + attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor purchase_value: Float + + attr_accessor purchases: Integer + + attr_accessor reach: Integer + + attr_accessor return_on_ad_spend: Float + + attr_accessor spend: Float + + attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor status: WhopSDK::Models::ad_campaign_status attr_accessor title: String - attr_accessor total_spend: Float + attr_accessor unique_click_through_rate: Float? + + attr_accessor unique_clicks: Integer attr_accessor updated_at: Time @@ -36,11 +90,29 @@ module WhopSDK id: String, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdCampaignListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_campaign_status, title: String, - total_spend: Float, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time ) -> void @@ -48,13 +120,90 @@ module WhopSDK id: String, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdCampaignListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_campaign_status, title: String, - total_spend: Float, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } + + type issue = + { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + class Issue < WhopSDK::Internal::Type::BaseModel + attr_accessor created_at: Time + + attr_accessor error_code: String? + + attr_accessor error_message: String? + + attr_accessor error_summary: String + + attr_accessor resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status + + attr_accessor resource_id: String? + + attr_accessor resource_type: String + + def initialize: ( + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + ) -> void + + def to_hash: -> { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + type resolution_status = :open | :resolved | :acknowledged + + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN: :open + RESOLVED: :resolved + ACKNOWLEDGED: :acknowledged + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status] + end + end end end end diff --git a/sig/whop_sdk/models/ad_campaign_retrieve_params.rbs b/sig/whop_sdk/models/ad_campaign_retrieve_params.rbs index ec681b75..f0d7d198 100644 --- a/sig/whop_sdk/models/ad_campaign_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_campaign_retrieve_params.rbs @@ -1,7 +1,8 @@ module WhopSDK module Models type ad_campaign_retrieve_params = - { id: String } & WhopSDK::Internal::Type::request_parameters + { id: String, stats_from: Time?, stats_to: Time? } + & WhopSDK::Internal::Type::request_parameters class AdCampaignRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter @@ -9,12 +10,23 @@ module WhopSDK attr_accessor id: String + attr_accessor stats_from: Time? + + attr_accessor stats_to: Time? + def initialize: ( id: String, + ?stats_from: Time?, + ?stats_to: Time?, ?request_options: WhopSDK::request_opts ) -> void - def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + def to_hash: -> { + id: String, + stats_from: Time?, + stats_to: Time?, + request_options: WhopSDK::RequestOptions + } end end end diff --git a/sig/whop_sdk/models/ad_group.rbs b/sig/whop_sdk/models/ad_group.rbs index d8f967b1..d92fa899 100644 --- a/sig/whop_sdk/models/ad_group.rbs +++ b/sig/whop_sdk/models/ad_group.rbs @@ -6,10 +6,29 @@ module WhopSDK ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::AdGroup::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_group_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -22,14 +41,52 @@ module WhopSDK attr_accessor budget_type: WhopSDK::Models::ad_budget_type? + attr_accessor click_through_rate: Float + + attr_accessor clicks: Integer + + attr_accessor cost_per_click: Float + + attr_accessor cost_per_lead: Float? + + attr_accessor cost_per_mille: Float + + attr_accessor cost_per_purchase: Float? + + attr_accessor cost_per_result: Float? + attr_accessor created_at: Time + attr_accessor frequency: Float? + + attr_accessor impressions: Integer + + attr_accessor issues: ::Array[WhopSDK::AdGroup::Issue] + + attr_accessor leads: Integer + attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor purchase_value: Float + + attr_accessor purchases: Integer + + attr_accessor reach: Integer + + attr_accessor return_on_ad_spend: Float + + attr_accessor spend: Float + + attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor status: WhopSDK::Models::ad_group_status attr_accessor title: String? + attr_accessor unique_click_through_rate: Float? + + attr_accessor unique_clicks: Integer + attr_accessor updated_at: Time def initialize: ( @@ -37,10 +94,29 @@ module WhopSDK ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::AdGroup::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_group_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time ) -> void @@ -49,10 +125,29 @@ module WhopSDK ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::AdGroup::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_group_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -65,6 +160,65 @@ module WhopSDK def to_hash: -> { id: String } end + + type issue = + { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + class Issue < WhopSDK::Internal::Type::BaseModel + attr_accessor created_at: Time + + attr_accessor error_code: String? + + attr_accessor error_message: String? + + attr_accessor error_summary: String + + attr_accessor resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status + + attr_accessor resource_id: String? + + attr_accessor resource_type: String + + def initialize: ( + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, + resource_id: String?, + resource_type: String + ) -> void + + def to_hash: -> { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + type resolution_status = :open | :resolved | :acknowledged + + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN: :open + RESOLVED: :resolved + ACKNOWLEDGED: :acknowledged + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::Issue::resolution_status] + end + end end end end diff --git a/sig/whop_sdk/models/ad_group_list_params.rbs b/sig/whop_sdk/models/ad_group_list_params.rbs index 5578ed81..e3204bb6 100644 --- a/sig/whop_sdk/models/ad_group_list_params.rbs +++ b/sig/whop_sdk/models/ad_group_list_params.rbs @@ -2,6 +2,8 @@ module WhopSDK module Models type ad_group_list_params = { + ad_campaign_id: String?, + ad_campaign_ids: ::Array[String]?, after: String?, before: String?, campaign_id: String?, @@ -9,9 +11,10 @@ module WhopSDK created_after: Time?, created_before: Time?, first: Integer?, - include_paused: bool?, last: Integer?, query: String?, + stats_from: Time?, + stats_to: Time?, status: WhopSDK::Models::ad_group_status? } & WhopSDK::Internal::Type::request_parameters @@ -20,6 +23,10 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + attr_accessor ad_campaign_id: String? + + attr_accessor ad_campaign_ids: ::Array[String]? + attr_accessor after: String? attr_accessor before: String? @@ -34,15 +41,19 @@ module WhopSDK attr_accessor first: Integer? - attr_accessor include_paused: bool? - attr_accessor last: Integer? attr_accessor query: String? + attr_accessor stats_from: Time? + + attr_accessor stats_to: Time? + attr_accessor status: WhopSDK::Models::ad_group_status? def initialize: ( + ?ad_campaign_id: String?, + ?ad_campaign_ids: ::Array[String]?, ?after: String?, ?before: String?, ?campaign_id: String?, @@ -50,14 +61,17 @@ module WhopSDK ?created_after: Time?, ?created_before: Time?, ?first: Integer?, - ?include_paused: bool?, ?last: Integer?, ?query: String?, + ?stats_from: Time?, + ?stats_to: Time?, ?status: WhopSDK::Models::ad_group_status?, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { + ad_campaign_id: String?, + ad_campaign_ids: ::Array[String]?, after: String?, before: String?, campaign_id: String?, @@ -65,9 +79,10 @@ module WhopSDK created_after: Time?, created_before: Time?, first: Integer?, - include_paused: bool?, last: Integer?, query: String?, + stats_from: Time?, + stats_to: Time?, status: WhopSDK::Models::ad_group_status?, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/models/ad_group_list_response.rbs b/sig/whop_sdk/models/ad_group_list_response.rbs index 905a38d0..f41996b8 100644 --- a/sig/whop_sdk/models/ad_group_list_response.rbs +++ b/sig/whop_sdk/models/ad_group_list_response.rbs @@ -6,10 +6,29 @@ module WhopSDK ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdGroupListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_group_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -22,14 +41,52 @@ module WhopSDK attr_accessor budget_type: WhopSDK::Models::ad_budget_type? + attr_accessor click_through_rate: Float + + attr_accessor clicks: Integer + + attr_accessor cost_per_click: Float + + attr_accessor cost_per_lead: Float? + + attr_accessor cost_per_mille: Float + + attr_accessor cost_per_purchase: Float? + + attr_accessor cost_per_result: Float? + attr_accessor created_at: Time + attr_accessor frequency: Float? + + attr_accessor impressions: Integer + + attr_accessor issues: ::Array[WhopSDK::Models::AdGroupListResponse::Issue] + + attr_accessor leads: Integer + attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor purchase_value: Float + + attr_accessor purchases: Integer + + attr_accessor reach: Integer + + attr_accessor return_on_ad_spend: Float + + attr_accessor spend: Float + + attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor status: WhopSDK::Models::ad_group_status attr_accessor title: String? + attr_accessor unique_click_through_rate: Float? + + attr_accessor unique_clicks: Integer + attr_accessor updated_at: Time def initialize: ( @@ -37,10 +94,29 @@ module WhopSDK ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdGroupListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_group_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time ) -> void @@ -49,10 +125,29 @@ module WhopSDK ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign, budget: Float?, budget_type: WhopSDK::Models::ad_budget_type?, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdGroupListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::ad_group_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -65,6 +160,65 @@ module WhopSDK def to_hash: -> { id: String } end + + type issue = + { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + class Issue < WhopSDK::Internal::Type::BaseModel + attr_accessor created_at: Time + + attr_accessor error_code: String? + + attr_accessor error_message: String? + + attr_accessor error_summary: String + + attr_accessor resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status + + attr_accessor resource_id: String? + + attr_accessor resource_type: String + + def initialize: ( + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + ) -> void + + def to_hash: -> { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + type resolution_status = :open | :resolved | :acknowledged + + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN: :open + RESOLVED: :resolved + ACKNOWLEDGED: :acknowledged + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupListResponse::Issue::resolution_status] + end + end end end end diff --git a/sig/whop_sdk/models/ad_group_retrieve_params.rbs b/sig/whop_sdk/models/ad_group_retrieve_params.rbs index 7cd89f6b..c3439d81 100644 --- a/sig/whop_sdk/models/ad_group_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_group_retrieve_params.rbs @@ -1,7 +1,8 @@ module WhopSDK module Models type ad_group_retrieve_params = - { id: String } & WhopSDK::Internal::Type::request_parameters + { id: String, stats_from: Time?, stats_to: Time? } + & WhopSDK::Internal::Type::request_parameters class AdGroupRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter @@ -9,12 +10,23 @@ module WhopSDK attr_accessor id: String + attr_accessor stats_from: Time? + + attr_accessor stats_to: Time? + def initialize: ( id: String, + ?stats_from: Time?, + ?stats_to: Time?, ?request_options: WhopSDK::request_opts ) -> void - def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + def to_hash: -> { + id: String, + stats_from: Time?, + stats_to: Time?, + request_options: WhopSDK::RequestOptions + } end end end diff --git a/sig/whop_sdk/models/ad_list_params.rbs b/sig/whop_sdk/models/ad_list_params.rbs index f28672c9..de38b533 100644 --- a/sig/whop_sdk/models/ad_list_params.rbs +++ b/sig/whop_sdk/models/ad_list_params.rbs @@ -2,16 +2,20 @@ module WhopSDK module Models type ad_list_params = { + ad_campaign_id: String?, + ad_campaign_ids: ::Array[String]?, ad_group_id: String?, + ad_group_ids: ::Array[String]?, after: String?, before: String?, campaign_id: String?, company_id: String?, created_after: Time?, created_before: Time?, + direction: WhopSDK::Models::direction?, first: Integer?, - include_paused: bool?, last: Integer?, + order: WhopSDK::Models::AdListParams::order?, order_by: WhopSDK::Models::AdListParams::order_by?, order_direction: WhopSDK::Models::direction?, query: String?, @@ -25,8 +29,14 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + attr_accessor ad_campaign_id: String? + + attr_accessor ad_campaign_ids: ::Array[String]? + attr_accessor ad_group_id: String? + attr_accessor ad_group_ids: ::Array[String]? + attr_accessor after: String? attr_accessor before: String? @@ -39,12 +49,14 @@ module WhopSDK attr_accessor created_before: Time? - attr_accessor first: Integer? + attr_accessor direction: WhopSDK::Models::direction? - attr_accessor include_paused: bool? + attr_accessor first: Integer? attr_accessor last: Integer? + attr_accessor order: WhopSDK::Models::AdListParams::order? + attr_accessor order_by: WhopSDK::Models::AdListParams::order_by? attr_accessor order_direction: WhopSDK::Models::direction? @@ -58,16 +70,20 @@ module WhopSDK attr_accessor status: WhopSDK::Models::external_ad_status? def initialize: ( + ?ad_campaign_id: String?, + ?ad_campaign_ids: ::Array[String]?, ?ad_group_id: String?, + ?ad_group_ids: ::Array[String]?, ?after: String?, ?before: String?, ?campaign_id: String?, ?company_id: String?, ?created_after: Time?, ?created_before: Time?, + ?direction: WhopSDK::Models::direction?, ?first: Integer?, - ?include_paused: bool?, ?last: Integer?, + ?order: WhopSDK::Models::AdListParams::order?, ?order_by: WhopSDK::Models::AdListParams::order_by?, ?order_direction: WhopSDK::Models::direction?, ?query: String?, @@ -78,16 +94,20 @@ module WhopSDK ) -> void def to_hash: -> { + ad_campaign_id: String?, + ad_campaign_ids: ::Array[String]?, ad_group_id: String?, + ad_group_ids: ::Array[String]?, after: String?, before: String?, campaign_id: String?, company_id: String?, created_after: Time?, created_before: Time?, + direction: WhopSDK::Models::direction?, first: Integer?, - include_paused: bool?, last: Integer?, + order: WhopSDK::Models::AdListParams::order?, order_by: WhopSDK::Models::AdListParams::order_by?, order_direction: WhopSDK::Models::direction?, query: String?, @@ -97,12 +117,25 @@ module WhopSDK request_options: WhopSDK::RequestOptions } - type order_by = :spend | :roas + type order = :created_at | :spend | :return_on_ad_spend + + module Order + extend WhopSDK::Internal::Type::Enum + + CREATED_AT: :created_at + SPEND: :spend + RETURN_ON_AD_SPEND: :return_on_ad_spend + + def self?.values: -> ::Array[WhopSDK::Models::AdListParams::order] + end + + type order_by = :spend | :return_on_ad_spend | :roas module OrderBy extend WhopSDK::Internal::Type::Enum SPEND: :spend + RETURN_ON_AD_SPEND: :return_on_ad_spend ROAS: :roas def self?.values: -> ::Array[WhopSDK::Models::AdListParams::order_by] diff --git a/sig/whop_sdk/models/ad_list_response.rbs b/sig/whop_sdk/models/ad_list_response.rbs index 67533307..101ec02d 100644 --- a/sig/whop_sdk/models/ad_list_response.rbs +++ b/sig/whop_sdk/models/ad_list_response.rbs @@ -5,10 +5,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign, ad_group: WhopSDK::Models::AdListResponse::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::external_ad_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -19,24 +38,81 @@ module WhopSDK attr_accessor ad_group: WhopSDK::Models::AdListResponse::AdGroup + attr_accessor click_through_rate: Float + + attr_accessor clicks: Integer + + attr_accessor cost_per_click: Float + + attr_accessor cost_per_lead: Float? + + attr_accessor cost_per_mille: Float + + attr_accessor cost_per_purchase: Float? + + attr_accessor cost_per_result: Float? + attr_accessor created_at: Time + attr_accessor frequency: Float? + + attr_accessor impressions: Integer + + attr_accessor issues: ::Array[WhopSDK::Models::AdListResponse::Issue] + + attr_accessor leads: Integer + attr_accessor platform: WhopSDK::Models::ad_campaign_platform + attr_accessor purchase_value: Float + + attr_accessor purchases: Integer + + attr_accessor reach: Integer + + attr_accessor return_on_ad_spend: Float + + attr_accessor spend: Float + + attr_accessor spend_currency: WhopSDK::Models::currency? + attr_accessor status: WhopSDK::Models::external_ad_status attr_accessor title: String? + attr_accessor unique_click_through_rate: Float? + + attr_accessor unique_clicks: Integer + attr_accessor updated_at: Time def initialize: ( id: String, ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign, ad_group: WhopSDK::Models::AdListResponse::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::external_ad_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time ) -> void @@ -44,10 +120,29 @@ module WhopSDK id: String, ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign, ad_group: WhopSDK::Models::AdListResponse::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float?, + cost_per_mille: Float, + cost_per_purchase: Float?, + cost_per_result: Float?, created_at: Time, + frequency: Float?, + impressions: Integer, + issues: ::Array[WhopSDK::Models::AdListResponse::Issue], + leads: Integer, platform: WhopSDK::Models::ad_campaign_platform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Models::currency?, status: WhopSDK::Models::external_ad_status, title: String?, + unique_click_through_rate: Float?, + unique_clicks: Integer, updated_at: Time } @@ -70,6 +165,65 @@ module WhopSDK def to_hash: -> { id: String } end + + type issue = + { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + class Issue < WhopSDK::Internal::Type::BaseModel + attr_accessor created_at: Time + + attr_accessor error_code: String? + + attr_accessor error_message: String? + + attr_accessor error_summary: String + + attr_accessor resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status + + attr_accessor resource_id: String? + + attr_accessor resource_type: String + + def initialize: ( + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + ) -> void + + def to_hash: -> { + created_at: Time, + error_code: String?, + error_message: String?, + error_summary: String, + resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, + resource_id: String?, + resource_type: String + } + + type resolution_status = :open | :resolved | :acknowledged + + module ResolutionStatus + extend WhopSDK::Internal::Type::Enum + + OPEN: :open + RESOLVED: :resolved + ACKNOWLEDGED: :acknowledged + + def self?.values: -> ::Array[WhopSDK::Models::AdListResponse::Issue::resolution_status] + end + end end end end diff --git a/sig/whop_sdk/models/ad_report_retrieve_params.rbs b/sig/whop_sdk/models/ad_report_retrieve_params.rbs index b89e17a3..124b05db 100644 --- a/sig/whop_sdk/models/ad_report_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_report_retrieve_params.rbs @@ -4,9 +4,9 @@ module WhopSDK { from: Time, to: Time, - ad_campaign_id: String?, - ad_group_id: String?, - ad_id: String?, + ad_campaign_ids: ::Array[String]?, + ad_group_ids: ::Array[String]?, + ad_ids: ::Array[String]?, breakdown: WhopSDK::Models::AdReportRetrieveParams::breakdown?, company_id: String?, currency: String?, @@ -22,11 +22,11 @@ module WhopSDK attr_accessor to: Time - attr_accessor ad_campaign_id: String? + attr_accessor ad_campaign_ids: ::Array[String]? - attr_accessor ad_group_id: String? + attr_accessor ad_group_ids: ::Array[String]? - attr_accessor ad_id: String? + attr_accessor ad_ids: ::Array[String]? attr_accessor breakdown: WhopSDK::Models::AdReportRetrieveParams::breakdown? @@ -39,9 +39,9 @@ module WhopSDK def initialize: ( from: Time, to: Time, - ?ad_campaign_id: String?, - ?ad_group_id: String?, - ?ad_id: String?, + ?ad_campaign_ids: ::Array[String]?, + ?ad_group_ids: ::Array[String]?, + ?ad_ids: ::Array[String]?, ?breakdown: WhopSDK::Models::AdReportRetrieveParams::breakdown?, ?company_id: String?, ?currency: String?, @@ -52,9 +52,9 @@ module WhopSDK def to_hash: -> { from: Time, to: Time, - ad_campaign_id: String?, - ad_group_id: String?, - ad_id: String?, + ad_campaign_ids: ::Array[String]?, + ad_group_ids: ::Array[String]?, + ad_ids: ::Array[String]?, breakdown: WhopSDK::Models::AdReportRetrieveParams::breakdown?, company_id: String?, currency: String?, diff --git a/sig/whop_sdk/models/ad_report_retrieve_response.rbs b/sig/whop_sdk/models/ad_report_retrieve_response.rbs index e7917c36..99ed4fe8 100644 --- a/sig/whop_sdk/models/ad_report_retrieve_response.rbs +++ b/sig/whop_sdk/models/ad_report_retrieve_response.rbs @@ -148,32 +148,32 @@ module WhopSDK type summary = { + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: Float?, cost_per_result: Float?, - cpc: Float, - cpm: Float?, - ctr: Float, frequency: Float?, impressions: Integer, reach: Integer, result_count: Integer?, result_label_key: WhopSDK::Models::result_label_keys?, result_label_override: String?, - roas: Float?, + return_on_ad_spend: Float?, spend: Float, spend_currency: WhopSDK::Models::currency? } class Summary < WhopSDK::Internal::Type::BaseModel - attr_accessor clicks: Integer + attr_accessor click_through_rate: Float - attr_accessor cost_per_result: Float? + attr_accessor clicks: Integer - attr_accessor cpc: Float + attr_accessor cost_per_click: Float - attr_accessor cpm: Float? + attr_accessor cost_per_mille: Float? - attr_accessor ctr: Float + attr_accessor cost_per_result: Float? attr_accessor frequency: Float? @@ -187,42 +187,42 @@ module WhopSDK attr_accessor result_label_override: String? - attr_accessor roas: Float? + attr_accessor return_on_ad_spend: Float? attr_accessor spend: Float attr_accessor spend_currency: WhopSDK::Models::currency? def initialize: ( + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: Float?, cost_per_result: Float?, - cpc: Float, - cpm: Float?, - ctr: Float, frequency: Float?, impressions: Integer, reach: Integer, result_count: Integer?, result_label_key: WhopSDK::Models::result_label_keys?, result_label_override: String?, - roas: Float?, + return_on_ad_spend: Float?, spend: Float, spend_currency: WhopSDK::Models::currency? ) -> void def to_hash: -> { + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: Float?, cost_per_result: Float?, - cpc: Float, - cpm: Float?, - ctr: Float, frequency: Float?, impressions: Integer, reach: Integer, result_count: Integer?, result_label_key: WhopSDK::Models::result_label_keys?, result_label_override: String?, - roas: Float?, + return_on_ad_spend: Float?, spend: Float, spend_currency: WhopSDK::Models::currency? } @@ -303,32 +303,32 @@ module WhopSDK type summary = { + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: Float?, cost_per_result: Float?, - cpc: Float, - cpm: Float?, - ctr: Float, frequency: Float?, impressions: Integer, reach: Integer, result_count: Integer?, result_label_key: WhopSDK::Models::result_label_keys?, result_label_override: String?, - roas: Float?, + return_on_ad_spend: Float?, spend: Float, spend_currency: WhopSDK::Models::currency? } class Summary < WhopSDK::Internal::Type::BaseModel - attr_accessor clicks: Integer + attr_accessor click_through_rate: Float - attr_accessor cost_per_result: Float? + attr_accessor clicks: Integer - attr_accessor cpc: Float + attr_accessor cost_per_click: Float - attr_accessor cpm: Float? + attr_accessor cost_per_mille: Float? - attr_accessor ctr: Float + attr_accessor cost_per_result: Float? attr_accessor frequency: Float? @@ -342,42 +342,42 @@ module WhopSDK attr_accessor result_label_override: String? - attr_accessor roas: Float? + attr_accessor return_on_ad_spend: Float? attr_accessor spend: Float attr_accessor spend_currency: WhopSDK::Models::currency? def initialize: ( + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: Float?, cost_per_result: Float?, - cpc: Float, - cpm: Float?, - ctr: Float, frequency: Float?, impressions: Integer, reach: Integer, result_count: Integer?, result_label_key: WhopSDK::Models::result_label_keys?, result_label_override: String?, - roas: Float?, + return_on_ad_spend: Float?, spend: Float, spend_currency: WhopSDK::Models::currency? ) -> void def to_hash: -> { + click_through_rate: Float, clicks: Integer, + cost_per_click: Float, + cost_per_mille: Float?, cost_per_result: Float?, - cpc: Float, - cpm: Float?, - ctr: Float, frequency: Float?, impressions: Integer, reach: Integer, result_count: Integer?, result_label_key: WhopSDK::Models::result_label_keys?, result_label_override: String?, - roas: Float?, + return_on_ad_spend: Float?, spend: Float, spend_currency: WhopSDK::Models::currency? } diff --git a/sig/whop_sdk/models/ad_retrieve_params.rbs b/sig/whop_sdk/models/ad_retrieve_params.rbs index ce0c56f4..5f9059d9 100644 --- a/sig/whop_sdk/models/ad_retrieve_params.rbs +++ b/sig/whop_sdk/models/ad_retrieve_params.rbs @@ -1,7 +1,8 @@ module WhopSDK module Models type ad_retrieve_params = - { id: String } & WhopSDK::Internal::Type::request_parameters + { id: String, stats_from: Time?, stats_to: Time? } + & WhopSDK::Internal::Type::request_parameters class AdRetrieveParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter @@ -9,12 +10,23 @@ module WhopSDK attr_accessor id: String + attr_accessor stats_from: Time? + + attr_accessor stats_to: Time? + def initialize: ( id: String, + ?stats_from: Time?, + ?stats_to: Time?, ?request_options: WhopSDK::request_opts ) -> void - def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + def to_hash: -> { + id: String, + stats_from: Time?, + stats_to: Time?, + request_options: WhopSDK::RequestOptions + } end end end diff --git a/sig/whop_sdk/resources/ad_campaigns.rbs b/sig/whop_sdk/resources/ad_campaigns.rbs index 1f12e864..46da0c86 100644 --- a/sig/whop_sdk/resources/ad_campaigns.rbs +++ b/sig/whop_sdk/resources/ad_campaigns.rbs @@ -3,6 +3,8 @@ module WhopSDK class AdCampaigns def retrieve: ( String id, + ?stats_from: Time?, + ?stats_to: Time?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdCampaign @@ -21,6 +23,8 @@ module WhopSDK ?first: Integer?, ?last: Integer?, ?query: String?, + ?stats_from: Time?, + ?stats_to: Time?, ?status: WhopSDK::Models::ad_campaign_status?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::AdCampaignListResponse] diff --git a/sig/whop_sdk/resources/ad_groups.rbs b/sig/whop_sdk/resources/ad_groups.rbs index ce78ad84..6e98edd3 100644 --- a/sig/whop_sdk/resources/ad_groups.rbs +++ b/sig/whop_sdk/resources/ad_groups.rbs @@ -3,6 +3,8 @@ module WhopSDK class AdGroups def retrieve: ( String id, + ?stats_from: Time?, + ?stats_to: Time?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdGroup @@ -19,6 +21,8 @@ module WhopSDK ) -> WhopSDK::AdGroup def list: ( + ?ad_campaign_id: String?, + ?ad_campaign_ids: ::Array[String]?, ?after: String?, ?before: String?, ?campaign_id: String?, @@ -26,9 +30,10 @@ module WhopSDK ?created_after: Time?, ?created_before: Time?, ?first: Integer?, - ?include_paused: bool?, ?last: Integer?, ?query: String?, + ?stats_from: Time?, + ?stats_to: Time?, ?status: WhopSDK::Models::ad_group_status?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::AdGroupListResponse] diff --git a/sig/whop_sdk/resources/ad_reports.rbs b/sig/whop_sdk/resources/ad_reports.rbs index 42c0c885..c6c0e8ef 100644 --- a/sig/whop_sdk/resources/ad_reports.rbs +++ b/sig/whop_sdk/resources/ad_reports.rbs @@ -4,9 +4,9 @@ module WhopSDK def retrieve: ( from: Time, to: Time, - ?ad_campaign_id: String?, - ?ad_group_id: String?, - ?ad_id: String?, + ?ad_campaign_ids: ::Array[String]?, + ?ad_group_ids: ::Array[String]?, + ?ad_ids: ::Array[String]?, ?breakdown: WhopSDK::Models::AdReportRetrieveParams::breakdown?, ?company_id: String?, ?currency: String?, diff --git a/sig/whop_sdk/resources/ads.rbs b/sig/whop_sdk/resources/ads.rbs index 51f8533f..7e6a88b0 100644 --- a/sig/whop_sdk/resources/ads.rbs +++ b/sig/whop_sdk/resources/ads.rbs @@ -3,20 +3,26 @@ module WhopSDK class Ads def retrieve: ( String id, + ?stats_from: Time?, + ?stats_to: Time?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Ad def list: ( + ?ad_campaign_id: String?, + ?ad_campaign_ids: ::Array[String]?, ?ad_group_id: String?, + ?ad_group_ids: ::Array[String]?, ?after: String?, ?before: String?, ?campaign_id: String?, ?company_id: String?, ?created_after: Time?, ?created_before: Time?, + ?direction: WhopSDK::Models::direction?, ?first: Integer?, - ?include_paused: bool?, ?last: Integer?, + ?order: WhopSDK::Models::AdListParams::order?, ?order_by: WhopSDK::Models::AdListParams::order_by?, ?order_direction: WhopSDK::Models::direction?, ?query: String?, diff --git a/test/whop_sdk/resources/ad_campaigns_test.rb b/test/whop_sdk/resources/ad_campaigns_test.rb index 770cb62b..d84a154c 100644 --- a/test/whop_sdk/resources/ad_campaigns_test.rb +++ b/test/whop_sdk/resources/ad_campaigns_test.rb @@ -17,13 +17,29 @@ def test_retrieve id: String, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: WhopSDK::AdCampaign::MetaConfig | nil, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdCampaignStatus, title: String, - total_spend: Float, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -43,13 +59,29 @@ def test_update id: String, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: WhopSDK::AdCampaign::MetaConfig | nil, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdCampaignStatus, title: String, - total_spend: Float, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -76,11 +108,29 @@ def test_list id: String, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdCampaignListResponse::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdCampaignStatus, title: String, - total_spend: Float, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -100,13 +150,29 @@ def test_pause id: String, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: WhopSDK::AdCampaign::MetaConfig | nil, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdCampaignStatus, title: String, - total_spend: Float, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -126,13 +192,29 @@ def test_unpause id: String, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, - created_by_user: WhopSDK::AdCampaign::CreatedByUser, - meta_config: WhopSDK::AdCampaign::MetaConfig | nil, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdCampaign::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdCampaignStatus, title: String, - total_spend: Float, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end diff --git a/test/whop_sdk/resources/ad_groups_test.rb b/test/whop_sdk/resources/ad_groups_test.rb index 8a8838d3..c5d483e1 100644 --- a/test/whop_sdk/resources/ad_groups_test.rb +++ b/test/whop_sdk/resources/ad_groups_test.rb @@ -18,10 +18,29 @@ def test_retrieve ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdGroupStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -42,10 +61,29 @@ def test_update ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdGroupStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -73,10 +111,29 @@ def test_list ad_campaign: WhopSDK::Models::AdGroupListResponse::AdCampaign, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdGroupListResponse::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdGroupStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -107,10 +164,29 @@ def test_pause ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdGroupStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -131,10 +207,29 @@ def test_unpause ad_campaign: WhopSDK::AdGroup::AdCampaign, budget: Float | nil, budget_type: WhopSDK::AdBudgetType | nil, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::AdGroup::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::AdGroupStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end diff --git a/test/whop_sdk/resources/ads_test.rb b/test/whop_sdk/resources/ads_test.rb index 55c04959..3db3c1d9 100644 --- a/test/whop_sdk/resources/ads_test.rb +++ b/test/whop_sdk/resources/ads_test.rb @@ -17,10 +17,29 @@ def test_retrieve id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::ExternalAdStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -47,10 +66,29 @@ def test_list id: String, ad_campaign: WhopSDK::Models::AdListResponse::AdCampaign, ad_group: WhopSDK::Models::AdListResponse::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::AdListResponse::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::ExternalAdStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -70,10 +108,29 @@ def test_pause id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::ExternalAdStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end @@ -93,10 +150,29 @@ def test_unpause id: String, ad_campaign: WhopSDK::Ad::AdCampaign, ad_group: WhopSDK::Ad::AdGroup, + click_through_rate: Float, + clicks: Integer, + cost_per_click: Float, + cost_per_lead: Float | nil, + cost_per_mille: Float, + cost_per_purchase: Float | nil, + cost_per_result: Float | nil, created_at: Time, + frequency: Float | nil, + impressions: Integer, + issues: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Ad::Issue]), + leads: Integer, platform: WhopSDK::AdCampaignPlatform, + purchase_value: Float, + purchases: Integer, + reach: Integer, + return_on_ad_spend: Float, + spend: Float, + spend_currency: WhopSDK::Currency | nil, status: WhopSDK::ExternalAdStatus, title: String | nil, + unique_click_through_rate: Float | nil, + unique_clicks: Integer, updated_at: Time } end From dc3cd22a9863185313e171d29de4de1957141a34 Mon Sep 17 00:00:00 2001 From: danielschwartz4 <52050264+danielschwartz4@users.noreply.github.com> Date: Fri, 5 Jun 2026 01:44:27 -0700 Subject: [PATCH 06/17] Build SDK Stainless-Generated-From: a7610d4c902d896b656268a69a3ee6224bb1619a --- .stats.yml | 2 +- lib/whop_sdk.rb | 4 + lib/whop_sdk/models.rb | 4 + lib/whop_sdk/models/swap_create_params.rb | 89 ++++++++++++++ lib/whop_sdk/models/swap_create_response.rb | 62 ++++++++++ lib/whop_sdk/models/swap_retrieve_params.rb | 20 +++ lib/whop_sdk/models/swap_retrieve_response.rb | 50 ++++++++ lib/whop_sdk/resources/swaps.rb | 55 +++++++++ rbi/whop_sdk/models.rbi | 4 + rbi/whop_sdk/models/swap_create_params.rbi | 114 ++++++++++++++++++ rbi/whop_sdk/models/swap_create_response.rbi | 107 ++++++++++++++++ rbi/whop_sdk/models/swap_retrieve_params.rbi | 35 ++++++ .../models/swap_retrieve_response.rbi | 84 +++++++++++++ rbi/whop_sdk/resources/swaps.rbi | 44 +++++++ sig/whop_sdk/models.rbs | 4 + sig/whop_sdk/models/swap_create_params.rbs | 72 +++++++++++ sig/whop_sdk/models/swap_create_response.rbs | 68 +++++++++++ sig/whop_sdk/models/swap_retrieve_params.rbs | 23 ++++ .../models/swap_retrieve_response.rbs | 50 ++++++++ sig/whop_sdk/resources/swaps.rbs | 16 +++ test/whop_sdk/resources/swaps_test.rb | 48 ++++++++ 21 files changed, 954 insertions(+), 1 deletion(-) create mode 100644 lib/whop_sdk/models/swap_create_params.rb create mode 100644 lib/whop_sdk/models/swap_create_response.rb create mode 100644 lib/whop_sdk/models/swap_retrieve_params.rb create mode 100644 lib/whop_sdk/models/swap_retrieve_response.rb create mode 100644 rbi/whop_sdk/models/swap_create_params.rbi create mode 100644 rbi/whop_sdk/models/swap_create_response.rbi create mode 100644 rbi/whop_sdk/models/swap_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/swap_retrieve_response.rbi create mode 100644 sig/whop_sdk/models/swap_create_params.rbs create mode 100644 sig/whop_sdk/models/swap_create_response.rbs create mode 100644 sig/whop_sdk/models/swap_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/swap_retrieve_response.rbs diff --git a/.stats.yml b/.stats.yml index a5722ed0..a9737a87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 226 +configured_endpoints: 228 diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index 9bf9c29b..c75c92cd 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -511,8 +511,12 @@ require_relative "whop_sdk/models/support_channel_list_params" require_relative "whop_sdk/models/support_channel_list_response" require_relative "whop_sdk/models/support_channel_retrieve_params" +require_relative "whop_sdk/models/swap_create_params" require_relative "whop_sdk/models/swap_create_quote_params" require_relative "whop_sdk/models/swap_create_quote_response" +require_relative "whop_sdk/models/swap_create_response" +require_relative "whop_sdk/models/swap_retrieve_params" +require_relative "whop_sdk/models/swap_retrieve_response" require_relative "whop_sdk/models/tax_identifier_type" require_relative "whop_sdk/models/tax_type" require_relative "whop_sdk/models/topup_create_params" diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 6b30b452..abb3ef53 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -745,8 +745,12 @@ module WhopSDK SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + SwapCreateParams = WhopSDK::Models::SwapCreateParams + SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams + TaxIdentifierType = WhopSDK::Models::TaxIdentifierType TaxType = WhopSDK::Models::TaxType diff --git a/lib/whop_sdk/models/swap_create_params.rb b/lib/whop_sdk/models/swap_create_params.rb new file mode 100644 index 00000000..0d4ae643 --- /dev/null +++ b/lib/whop_sdk/models/swap_create_params.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#create + class SwapCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # The business or user account ID whose wallet should execute the swap. + # + # @return [String] + required :account_id, String + + # @!attribute amount + # Input token amount. + # + # @return [String] + required :amount, String + + # @!attribute from_token + # Source token contract address. + # + # @return [String] + required :from_token, String + + # @!attribute to_token + # Destination token contract address. + # + # @return [String] + required :to_token, String + + # @!attribute from_chain + # + # @return [String, Integer, nil] + optional :from_chain, union: -> { WhopSDK::SwapCreateParams::FromChain }, nil?: true + + # @!attribute slippage_bps + # + # @return [Integer, nil] + optional :slippage_bps, Integer, nil?: true + + # @!attribute to_chain + # + # @return [String, Integer, nil] + optional :to_chain, union: -> { WhopSDK::SwapCreateParams::ToChain }, nil?: true + + # @!method initialize(account_id:, amount:, from_token:, to_token:, from_chain: nil, slippage_bps: nil, to_chain: nil, request_options: {}) + # @param account_id [String] The business or user account ID whose wallet should execute the swap. + # + # @param amount [String] Input token amount. + # + # @param from_token [String] Source token contract address. + # + # @param to_token [String] Destination token contract address. + # + # @param from_chain [String, Integer, nil] + # + # @param slippage_bps [Integer, nil] + # + # @param to_chain [String, Integer, nil] + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + module FromChain + extend WhopSDK::Internal::Type::Union + + variant String + + variant Integer + + # @!method self.variants + # @return [Array(String, Integer)] + end + + module ToChain + extend WhopSDK::Internal::Type::Union + + variant String + + variant Integer + + # @!method self.variants + # @return [Array(String, Integer)] + end + end + end +end diff --git a/lib/whop_sdk/models/swap_create_response.rb b/lib/whop_sdk/models/swap_create_response.rb new file mode 100644 index 00000000..a5d792d2 --- /dev/null +++ b/lib/whop_sdk/models/swap_create_response.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#create + class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::SwapCreateResponse::Object] + required :object, enum: -> { WhopSDK::Models::SwapCreateResponse::Object } + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute amount_out_expected + # + # @return [String, nil] + optional :amount_out_expected, String + + # @!attribute amount_out_min + # + # @return [String, nil] + optional :amount_out_min, String + + # @!attribute rate + # + # @return [String, nil] + optional :rate, String + + # @!attribute to_chain + # + # @return [String, nil] + optional :to_chain, String + + # @!method initialize(account_id:, object:, status:, amount_out_expected: nil, amount_out_min: nil, rate: nil, to_chain: nil) + # @param account_id [String] + # @param object [Symbol, WhopSDK::Models::SwapCreateResponse::Object] + # @param status [String] + # @param amount_out_expected [String] + # @param amount_out_min [String] + # @param rate [String] + # @param to_chain [String] + + # @see WhopSDK::Models::SwapCreateResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP = :swap + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/swap_retrieve_params.rb b/lib/whop_sdk/models/swap_retrieve_params.rb new file mode 100644 index 00000000..64ee4d3b --- /dev/null +++ b/lib/whop_sdk/models/swap_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#retrieve + class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!method initialize(account_id:, request_options: {}) + # @param account_id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/swap_retrieve_response.rb b/lib/whop_sdk/models/swap_retrieve_response.rb new file mode 100644 index 00000000..7f21eda6 --- /dev/null +++ b/lib/whop_sdk/models/swap_retrieve_response.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#retrieve + class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::SwapRetrieveResponse::Object] + required :object, enum: -> { WhopSDK::Models::SwapRetrieveResponse::Object } + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute tx_hashes + # + # @return [Array] + required :tx_hashes, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute error + # + # @return [String, nil] + optional :error, String, nil?: true + + # @!method initialize(account_id:, object:, status:, tx_hashes:, error: nil) + # @param account_id [String] + # @param object [Symbol, WhopSDK::Models::SwapRetrieveResponse::Object] + # @param status [String] + # @param tx_hashes [Array] + # @param error [String, nil] + + # @see WhopSDK::Models::SwapRetrieveResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP = :swap + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/resources/swaps.rb b/lib/whop_sdk/resources/swaps.rb index f3a40db7..c6dba22f 100644 --- a/lib/whop_sdk/resources/swaps.rb +++ b/lib/whop_sdk/resources/swaps.rb @@ -3,6 +3,61 @@ module WhopSDK module Resources class Swaps + # Executes a swap from an account's wallet. The swap runs asynchronously; poll GET + # /swaps/{account_id} for status. + # + # @overload create(account_id:, amount:, from_token:, to_token:, from_chain: nil, slippage_bps: nil, to_chain: nil, request_options: {}) + # + # @param account_id [String] The business or user account ID whose wallet should execute the swap. + # + # @param amount [String] Input token amount. + # + # @param from_token [String] Source token contract address. + # + # @param to_token [String] Destination token contract address. + # + # @param from_chain [String, Integer, nil] + # + # @param slippage_bps [Integer, nil] + # + # @param to_chain [String, Integer, nil] + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::SwapCreateResponse] + # + # @see WhopSDK::Models::SwapCreateParams + def create(params) + parsed, options = WhopSDK::SwapCreateParams.dump_request(params) + @client.request( + method: :post, + path: "swaps", + body: parsed, + model: WhopSDK::Models::SwapCreateResponse, + options: options + ) + end + + # Returns the status of an account's in-flight or most recent swap. + # + # @overload retrieve(account_id, request_options: {}) + # + # @param account_id [String] The business or user account ID whose swap status should be returned. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::SwapRetrieveResponse] + # + # @see WhopSDK::Models::SwapRetrieveParams + def retrieve(account_id, params = {}) + @client.request( + method: :get, + path: ["swaps/%1$s", account_id], + model: WhopSDK::Models::SwapRetrieveResponse, + options: params[:request_options] + ) + end + # Returns a stateless swap price preview. No funds move and nothing is persisted. # # @overload create_quote(amount:, from_token:, to_token:, from_address: nil, from_chain: nil, metadata: nil, slippage_bps: nil, to_address: nil, to_chain: nil, request_options: {}) diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index 2e45639d..13b19aaa 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -742,8 +742,12 @@ module WhopSDK SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + SwapCreateParams = WhopSDK::Models::SwapCreateParams + SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams + TaxIdentifierType = WhopSDK::Models::TaxIdentifierType TaxType = WhopSDK::Models::TaxType diff --git a/rbi/whop_sdk/models/swap_create_params.rbi b/rbi/whop_sdk/models/swap_create_params.rbi new file mode 100644 index 00000000..0bda2d14 --- /dev/null +++ b/rbi/whop_sdk/models/swap_create_params.rbi @@ -0,0 +1,114 @@ +# typed: strong + +module WhopSDK + module Models + class SwapCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SwapCreateParams, WhopSDK::Internal::AnyHash) + end + + # The business or user account ID whose wallet should execute the swap. + sig { returns(String) } + attr_accessor :account_id + + # Input token amount. + sig { returns(String) } + attr_accessor :amount + + # Source token contract address. + sig { returns(String) } + attr_accessor :from_token + + # Destination token contract address. + sig { returns(String) } + attr_accessor :to_token + + sig { returns(T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants)) } + attr_accessor :from_chain + + sig { returns(T.nilable(Integer)) } + attr_accessor :slippage_bps + + sig { returns(T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants)) } + attr_accessor :to_chain + + sig do + params( + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants), + slippage_bps: T.nilable(Integer), + to_chain: T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The business or user account ID whose wallet should execute the swap. + account_id:, + # Input token amount. + amount:, + # Source token contract address. + from_token:, + # Destination token contract address. + to_token:, + from_chain: nil, + slippage_bps: nil, + to_chain: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: + T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants), + slippage_bps: T.nilable(Integer), + to_chain: T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + module FromChain + extend WhopSDK::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Integer) } + + sig do + override.returns( + T::Array[WhopSDK::SwapCreateParams::FromChain::Variants] + ) + end + def self.variants + end + end + + module ToChain + extend WhopSDK::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Integer) } + + sig do + override.returns( + T::Array[WhopSDK::SwapCreateParams::ToChain::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/whop_sdk/models/swap_create_response.rbi b/rbi/whop_sdk/models/swap_create_response.rbi new file mode 100644 index 00000000..92668357 --- /dev/null +++ b/rbi/whop_sdk/models/swap_create_response.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module WhopSDK + module Models + class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::SwapCreateResponse, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_id + + sig { returns(WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol) } + attr_accessor :object + + sig { returns(String) } + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_reader :amount_out_expected + + sig { params(amount_out_expected: String).void } + attr_writer :amount_out_expected + + sig { returns(T.nilable(String)) } + attr_reader :amount_out_min + + sig { params(amount_out_min: String).void } + attr_writer :amount_out_min + + sig { returns(T.nilable(String)) } + attr_reader :rate + + sig { params(rate: String).void } + attr_writer :rate + + sig { returns(T.nilable(String)) } + attr_reader :to_chain + + sig { params(to_chain: String).void } + attr_writer :to_chain + + sig do + params( + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::Object::OrSymbol, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + ).returns(T.attached_class) + end + def self.new( + account_id:, + object:, + status:, + amount_out_expected: nil, + amount_out_min: nil, + rate: nil, + to_chain: nil + ) + end + + sig do + override.returns( + { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::SwapCreateResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWAP = + T.let( + :swap, + WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/swap_retrieve_params.rbi b/rbi/whop_sdk/models/swap_retrieve_params.rbi new file mode 100644 index 00000000..6cb64bec --- /dev/null +++ b/rbi/whop_sdk/models/swap_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SwapRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_id + + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_id:, request_options: {}) + end + + sig do + override.returns( + { account_id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/swap_retrieve_response.rbi b/rbi/whop_sdk/models/swap_retrieve_response.rbi new file mode 100644 index 00000000..8e9f1209 --- /dev/null +++ b/rbi/whop_sdk/models/swap_retrieve_response.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module WhopSDK + module Models + class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::SwapRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_id + + sig do + returns(WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol) + end + attr_accessor :object + + sig { returns(String) } + attr_accessor :status + + sig { returns(T::Array[String]) } + attr_accessor :tx_hashes + + sig { returns(T.nilable(String)) } + attr_accessor :error + + sig do + params( + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::Object::OrSymbol, + status: String, + tx_hashes: T::Array[String], + error: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(account_id:, object:, status:, tx_hashes:, error: nil) + end + + sig do + override.returns( + { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol, + status: String, + tx_hashes: T::Array[String], + error: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::SwapRetrieveResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWAP = + T.let( + :swap, + WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/swaps.rbi b/rbi/whop_sdk/resources/swaps.rbi index 3e26ed1f..c787114c 100644 --- a/rbi/whop_sdk/resources/swaps.rbi +++ b/rbi/whop_sdk/resources/swaps.rbi @@ -3,6 +3,50 @@ module WhopSDK module Resources class Swaps + # Executes a swap from an account's wallet. The swap runs asynchronously; poll GET + # /swaps/{account_id} for status. + sig do + params( + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants), + slippage_bps: T.nilable(Integer), + to_chain: T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::SwapCreateResponse) + end + def create( + # The business or user account ID whose wallet should execute the swap. + account_id:, + # Input token amount. + amount:, + # Source token contract address. + from_token:, + # Destination token contract address. + to_token:, + from_chain: nil, + slippage_bps: nil, + to_chain: nil, + request_options: {} + ) + end + + # Returns the status of an account's in-flight or most recent swap. + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::SwapRetrieveResponse) + end + def retrieve( + # The business or user account ID whose swap status should be returned. + account_id, + request_options: {} + ) + end + # Returns a stateless swap price preview. No funds move and nothing is persisted. sig do params( diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index e91393d7..c2d1641a 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -703,8 +703,12 @@ module WhopSDK class SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + class SwapCreateParams = WhopSDK::Models::SwapCreateParams + class SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + class SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams + module TaxIdentifierType = WhopSDK::Models::TaxIdentifierType module TaxType = WhopSDK::Models::TaxType diff --git a/sig/whop_sdk/models/swap_create_params.rbs b/sig/whop_sdk/models/swap_create_params.rbs new file mode 100644 index 00000000..9d5c2dc3 --- /dev/null +++ b/sig/whop_sdk/models/swap_create_params.rbs @@ -0,0 +1,72 @@ +module WhopSDK + module Models + type swap_create_params = + { + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + slippage_bps: Integer?, + to_chain: WhopSDK::Models::SwapCreateParams::to_chain? + } + & WhopSDK::Internal::Type::request_parameters + + class SwapCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_accessor amount: String + + attr_accessor from_token: String + + attr_accessor to_token: String + + attr_accessor from_chain: WhopSDK::Models::SwapCreateParams::from_chain? + + attr_accessor slippage_bps: Integer? + + attr_accessor to_chain: WhopSDK::Models::SwapCreateParams::to_chain? + + def initialize: ( + account_id: String, + amount: String, + from_token: String, + to_token: String, + ?from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + ?slippage_bps: Integer?, + ?to_chain: WhopSDK::Models::SwapCreateParams::to_chain?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + slippage_bps: Integer?, + to_chain: WhopSDK::Models::SwapCreateParams::to_chain?, + request_options: WhopSDK::RequestOptions + } + + type from_chain = String | Integer + + module FromChain + extend WhopSDK::Internal::Type::Union + + def self?.variants: -> ::Array[WhopSDK::Models::SwapCreateParams::from_chain] + end + + type to_chain = String | Integer + + module ToChain + extend WhopSDK::Internal::Type::Union + + def self?.variants: -> ::Array[WhopSDK::Models::SwapCreateParams::to_chain] + end + end + end +end diff --git a/sig/whop_sdk/models/swap_create_response.rbs b/sig/whop_sdk/models/swap_create_response.rbs new file mode 100644 index 00000000..9950edde --- /dev/null +++ b/sig/whop_sdk/models/swap_create_response.rbs @@ -0,0 +1,68 @@ +module WhopSDK + module Models + type swap_create_response = + { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::object, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + } + + class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + attr_accessor object: WhopSDK::Models::SwapCreateResponse::object + + attr_accessor status: String + + attr_reader amount_out_expected: String? + + def amount_out_expected=: (String) -> String + + attr_reader amount_out_min: String? + + def amount_out_min=: (String) -> String + + attr_reader rate: String? + + def rate=: (String) -> String + + attr_reader to_chain: String? + + def to_chain=: (String) -> String + + def initialize: ( + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::object, + status: String, + ?amount_out_expected: String, + ?amount_out_min: String, + ?rate: String, + ?to_chain: String + ) -> void + + def to_hash: -> { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::object, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + } + + type object = :swap + + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP: :swap + + def self?.values: -> ::Array[WhopSDK::Models::SwapCreateResponse::object] + end + end + end +end diff --git a/sig/whop_sdk/models/swap_retrieve_params.rbs b/sig/whop_sdk/models/swap_retrieve_params.rbs new file mode 100644 index 00000000..4fdedbe8 --- /dev/null +++ b/sig/whop_sdk/models/swap_retrieve_params.rbs @@ -0,0 +1,23 @@ +module WhopSDK + module Models + type swap_retrieve_params = + { account_id: String } & WhopSDK::Internal::Type::request_parameters + + class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + def initialize: ( + account_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/swap_retrieve_response.rbs b/sig/whop_sdk/models/swap_retrieve_response.rbs new file mode 100644 index 00000000..3305507f --- /dev/null +++ b/sig/whop_sdk/models/swap_retrieve_response.rbs @@ -0,0 +1,50 @@ +module WhopSDK + module Models + type swap_retrieve_response = + { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::object, + status: String, + tx_hashes: ::Array[String], + error: String? + } + + class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + attr_accessor object: WhopSDK::Models::SwapRetrieveResponse::object + + attr_accessor status: String + + attr_accessor tx_hashes: ::Array[String] + + attr_accessor error: String? + + def initialize: ( + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::object, + status: String, + tx_hashes: ::Array[String], + ?error: String? + ) -> void + + def to_hash: -> { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::object, + status: String, + tx_hashes: ::Array[String], + error: String? + } + + type object = :swap + + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP: :swap + + def self?.values: -> ::Array[WhopSDK::Models::SwapRetrieveResponse::object] + end + end + end +end diff --git a/sig/whop_sdk/resources/swaps.rbs b/sig/whop_sdk/resources/swaps.rbs index 6abb664f..d66f3822 100644 --- a/sig/whop_sdk/resources/swaps.rbs +++ b/sig/whop_sdk/resources/swaps.rbs @@ -1,6 +1,22 @@ module WhopSDK module Resources class Swaps + def create: ( + account_id: String, + amount: String, + from_token: String, + to_token: String, + ?from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + ?slippage_bps: Integer?, + ?to_chain: WhopSDK::Models::SwapCreateParams::to_chain?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::SwapCreateResponse + + def retrieve: ( + String account_id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::SwapRetrieveResponse + def create_quote: ( amount: String, from_token: String, diff --git a/test/whop_sdk/resources/swaps_test.rb b/test/whop_sdk/resources/swaps_test.rb index 7d8c5905..441b6df0 100644 --- a/test/whop_sdk/resources/swaps_test.rb +++ b/test/whop_sdk/resources/swaps_test.rb @@ -3,6 +3,54 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::SwapsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @whop.swaps.create( + account_id: "account_id", + amount: "amount", + from_token: "from_token", + to_token: "to_token" + ) + + assert_pattern do + response => WhopSDK::Models::SwapCreateResponse + end + + assert_pattern do + response => { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::Object, + status: String, + amount_out_expected: String | nil, + amount_out_min: String | nil, + rate: String | nil, + to_chain: String | nil + } + end + end + + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.swaps.retrieve("account_id") + + assert_pattern do + response => WhopSDK::Models::SwapRetrieveResponse + end + + assert_pattern do + response => { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::Object, + status: String, + tx_hashes: ^(WhopSDK::Internal::Type::ArrayOf[String]), + error: String | nil + } + end + end + def test_create_quote_required_params skip("Mock server tests are disabled") From b29a465d9c57f26298fd7f1cb0bf9d5622b27faa Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 5 Jun 2026 09:03:02 +0000 Subject: [PATCH 07/17] Document swap execute/status endpoints in OpenAPI + SDK Stainless-Generated-From: e5856091d5410fa298dc77bf770d7fb5660f98d9 --- .stats.yml | 2 +- lib/whop_sdk.rb | 4 + lib/whop_sdk/models.rb | 4 + lib/whop_sdk/models/swap_create_params.rb | 89 ++++++++++++++ lib/whop_sdk/models/swap_create_response.rb | 62 ++++++++++ lib/whop_sdk/models/swap_retrieve_params.rb | 20 +++ lib/whop_sdk/models/swap_retrieve_response.rb | 50 ++++++++ lib/whop_sdk/resources/swaps.rb | 55 +++++++++ rbi/whop_sdk/models.rbi | 4 + rbi/whop_sdk/models/swap_create_params.rbi | 114 ++++++++++++++++++ rbi/whop_sdk/models/swap_create_response.rbi | 107 ++++++++++++++++ rbi/whop_sdk/models/swap_retrieve_params.rbi | 35 ++++++ .../models/swap_retrieve_response.rbi | 84 +++++++++++++ rbi/whop_sdk/resources/swaps.rbi | 44 +++++++ sig/whop_sdk/models.rbs | 4 + sig/whop_sdk/models/swap_create_params.rbs | 72 +++++++++++ sig/whop_sdk/models/swap_create_response.rbs | 68 +++++++++++ sig/whop_sdk/models/swap_retrieve_params.rbs | 23 ++++ .../models/swap_retrieve_response.rbs | 50 ++++++++ sig/whop_sdk/resources/swaps.rbs | 16 +++ test/whop_sdk/resources/swaps_test.rb | 48 ++++++++ 21 files changed, 954 insertions(+), 1 deletion(-) create mode 100644 lib/whop_sdk/models/swap_create_params.rb create mode 100644 lib/whop_sdk/models/swap_create_response.rb create mode 100644 lib/whop_sdk/models/swap_retrieve_params.rb create mode 100644 lib/whop_sdk/models/swap_retrieve_response.rb create mode 100644 rbi/whop_sdk/models/swap_create_params.rbi create mode 100644 rbi/whop_sdk/models/swap_create_response.rbi create mode 100644 rbi/whop_sdk/models/swap_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/swap_retrieve_response.rbi create mode 100644 sig/whop_sdk/models/swap_create_params.rbs create mode 100644 sig/whop_sdk/models/swap_create_response.rbs create mode 100644 sig/whop_sdk/models/swap_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/swap_retrieve_response.rbs diff --git a/.stats.yml b/.stats.yml index a5722ed0..a9737a87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 226 +configured_endpoints: 228 diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index 9bf9c29b..c75c92cd 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -511,8 +511,12 @@ require_relative "whop_sdk/models/support_channel_list_params" require_relative "whop_sdk/models/support_channel_list_response" require_relative "whop_sdk/models/support_channel_retrieve_params" +require_relative "whop_sdk/models/swap_create_params" require_relative "whop_sdk/models/swap_create_quote_params" require_relative "whop_sdk/models/swap_create_quote_response" +require_relative "whop_sdk/models/swap_create_response" +require_relative "whop_sdk/models/swap_retrieve_params" +require_relative "whop_sdk/models/swap_retrieve_response" require_relative "whop_sdk/models/tax_identifier_type" require_relative "whop_sdk/models/tax_type" require_relative "whop_sdk/models/topup_create_params" diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 6b30b452..abb3ef53 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -745,8 +745,12 @@ module WhopSDK SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + SwapCreateParams = WhopSDK::Models::SwapCreateParams + SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams + TaxIdentifierType = WhopSDK::Models::TaxIdentifierType TaxType = WhopSDK::Models::TaxType diff --git a/lib/whop_sdk/models/swap_create_params.rb b/lib/whop_sdk/models/swap_create_params.rb new file mode 100644 index 00000000..df65c8bb --- /dev/null +++ b/lib/whop_sdk/models/swap_create_params.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#create + class SwapCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # Business or user account ID (biz*\* / user*\*). + # + # @return [String] + required :account_id, String + + # @!attribute amount + # Input token amount. + # + # @return [String] + required :amount, String + + # @!attribute from_token + # Source token contract address. + # + # @return [String] + required :from_token, String + + # @!attribute to_token + # Destination token contract address. + # + # @return [String] + required :to_token, String + + # @!attribute from_chain + # + # @return [String, Integer, nil] + optional :from_chain, union: -> { WhopSDK::SwapCreateParams::FromChain }, nil?: true + + # @!attribute slippage_bps + # + # @return [Integer, nil] + optional :slippage_bps, Integer, nil?: true + + # @!attribute to_chain + # + # @return [String, Integer, nil] + optional :to_chain, union: -> { WhopSDK::SwapCreateParams::ToChain }, nil?: true + + # @!method initialize(account_id:, amount:, from_token:, to_token:, from_chain: nil, slippage_bps: nil, to_chain: nil, request_options: {}) + # @param account_id [String] Business or user account ID (biz*\* / user*\*). + # + # @param amount [String] Input token amount. + # + # @param from_token [String] Source token contract address. + # + # @param to_token [String] Destination token contract address. + # + # @param from_chain [String, Integer, nil] + # + # @param slippage_bps [Integer, nil] + # + # @param to_chain [String, Integer, nil] + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + module FromChain + extend WhopSDK::Internal::Type::Union + + variant String + + variant Integer + + # @!method self.variants + # @return [Array(String, Integer)] + end + + module ToChain + extend WhopSDK::Internal::Type::Union + + variant String + + variant Integer + + # @!method self.variants + # @return [Array(String, Integer)] + end + end + end +end diff --git a/lib/whop_sdk/models/swap_create_response.rb b/lib/whop_sdk/models/swap_create_response.rb new file mode 100644 index 00000000..a5d792d2 --- /dev/null +++ b/lib/whop_sdk/models/swap_create_response.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#create + class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::SwapCreateResponse::Object] + required :object, enum: -> { WhopSDK::Models::SwapCreateResponse::Object } + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute amount_out_expected + # + # @return [String, nil] + optional :amount_out_expected, String + + # @!attribute amount_out_min + # + # @return [String, nil] + optional :amount_out_min, String + + # @!attribute rate + # + # @return [String, nil] + optional :rate, String + + # @!attribute to_chain + # + # @return [String, nil] + optional :to_chain, String + + # @!method initialize(account_id:, object:, status:, amount_out_expected: nil, amount_out_min: nil, rate: nil, to_chain: nil) + # @param account_id [String] + # @param object [Symbol, WhopSDK::Models::SwapCreateResponse::Object] + # @param status [String] + # @param amount_out_expected [String] + # @param amount_out_min [String] + # @param rate [String] + # @param to_chain [String] + + # @see WhopSDK::Models::SwapCreateResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP = :swap + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/models/swap_retrieve_params.rb b/lib/whop_sdk/models/swap_retrieve_params.rb new file mode 100644 index 00000000..64ee4d3b --- /dev/null +++ b/lib/whop_sdk/models/swap_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#retrieve + class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!method initialize(account_id:, request_options: {}) + # @param account_id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/swap_retrieve_response.rb b/lib/whop_sdk/models/swap_retrieve_response.rb new file mode 100644 index 00000000..7f21eda6 --- /dev/null +++ b/lib/whop_sdk/models/swap_retrieve_response.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Swaps#retrieve + class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute account_id + # + # @return [String] + required :account_id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::SwapRetrieveResponse::Object] + required :object, enum: -> { WhopSDK::Models::SwapRetrieveResponse::Object } + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute tx_hashes + # + # @return [Array] + required :tx_hashes, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute error + # + # @return [String, nil] + optional :error, String, nil?: true + + # @!method initialize(account_id:, object:, status:, tx_hashes:, error: nil) + # @param account_id [String] + # @param object [Symbol, WhopSDK::Models::SwapRetrieveResponse::Object] + # @param status [String] + # @param tx_hashes [Array] + # @param error [String, nil] + + # @see WhopSDK::Models::SwapRetrieveResponse#object + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP = :swap + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/whop_sdk/resources/swaps.rb b/lib/whop_sdk/resources/swaps.rb index f3a40db7..bd6aef81 100644 --- a/lib/whop_sdk/resources/swaps.rb +++ b/lib/whop_sdk/resources/swaps.rb @@ -3,6 +3,61 @@ module WhopSDK module Resources class Swaps + # Executes a swap from the account's wallet. Runs asynchronously — poll GET + # /swaps/{account_id} for status. + # + # @overload create(account_id:, amount:, from_token:, to_token:, from_chain: nil, slippage_bps: nil, to_chain: nil, request_options: {}) + # + # @param account_id [String] Business or user account ID (biz*\* / user*\*). + # + # @param amount [String] Input token amount. + # + # @param from_token [String] Source token contract address. + # + # @param to_token [String] Destination token contract address. + # + # @param from_chain [String, Integer, nil] + # + # @param slippage_bps [Integer, nil] + # + # @param to_chain [String, Integer, nil] + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::SwapCreateResponse] + # + # @see WhopSDK::Models::SwapCreateParams + def create(params) + parsed, options = WhopSDK::SwapCreateParams.dump_request(params) + @client.request( + method: :post, + path: "swaps", + body: parsed, + model: WhopSDK::Models::SwapCreateResponse, + options: options + ) + end + + # Returns the status of the account's in-flight or most recent swap. + # + # @overload retrieve(account_id, request_options: {}) + # + # @param account_id [String] Business or user account ID (biz*\* / user*\*). + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::SwapRetrieveResponse] + # + # @see WhopSDK::Models::SwapRetrieveParams + def retrieve(account_id, params = {}) + @client.request( + method: :get, + path: ["swaps/%1$s", account_id], + model: WhopSDK::Models::SwapRetrieveResponse, + options: params[:request_options] + ) + end + # Returns a stateless swap price preview. No funds move and nothing is persisted. # # @overload create_quote(amount:, from_token:, to_token:, from_address: nil, from_chain: nil, metadata: nil, slippage_bps: nil, to_address: nil, to_chain: nil, request_options: {}) diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index 2e45639d..13b19aaa 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -742,8 +742,12 @@ module WhopSDK SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + SwapCreateParams = WhopSDK::Models::SwapCreateParams + SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams + TaxIdentifierType = WhopSDK::Models::TaxIdentifierType TaxType = WhopSDK::Models::TaxType diff --git a/rbi/whop_sdk/models/swap_create_params.rbi b/rbi/whop_sdk/models/swap_create_params.rbi new file mode 100644 index 00000000..d1ed16e5 --- /dev/null +++ b/rbi/whop_sdk/models/swap_create_params.rbi @@ -0,0 +1,114 @@ +# typed: strong + +module WhopSDK + module Models + class SwapCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SwapCreateParams, WhopSDK::Internal::AnyHash) + end + + # Business or user account ID (biz*\* / user*\*). + sig { returns(String) } + attr_accessor :account_id + + # Input token amount. + sig { returns(String) } + attr_accessor :amount + + # Source token contract address. + sig { returns(String) } + attr_accessor :from_token + + # Destination token contract address. + sig { returns(String) } + attr_accessor :to_token + + sig { returns(T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants)) } + attr_accessor :from_chain + + sig { returns(T.nilable(Integer)) } + attr_accessor :slippage_bps + + sig { returns(T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants)) } + attr_accessor :to_chain + + sig do + params( + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants), + slippage_bps: T.nilable(Integer), + to_chain: T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Business or user account ID (biz*\* / user*\*). + account_id:, + # Input token amount. + amount:, + # Source token contract address. + from_token:, + # Destination token contract address. + to_token:, + from_chain: nil, + slippage_bps: nil, + to_chain: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: + T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants), + slippage_bps: T.nilable(Integer), + to_chain: T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + module FromChain + extend WhopSDK::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Integer) } + + sig do + override.returns( + T::Array[WhopSDK::SwapCreateParams::FromChain::Variants] + ) + end + def self.variants + end + end + + module ToChain + extend WhopSDK::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Integer) } + + sig do + override.returns( + T::Array[WhopSDK::SwapCreateParams::ToChain::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/whop_sdk/models/swap_create_response.rbi b/rbi/whop_sdk/models/swap_create_response.rbi new file mode 100644 index 00000000..92668357 --- /dev/null +++ b/rbi/whop_sdk/models/swap_create_response.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module WhopSDK + module Models + class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(WhopSDK::Models::SwapCreateResponse, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_id + + sig { returns(WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol) } + attr_accessor :object + + sig { returns(String) } + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_reader :amount_out_expected + + sig { params(amount_out_expected: String).void } + attr_writer :amount_out_expected + + sig { returns(T.nilable(String)) } + attr_reader :amount_out_min + + sig { params(amount_out_min: String).void } + attr_writer :amount_out_min + + sig { returns(T.nilable(String)) } + attr_reader :rate + + sig { params(rate: String).void } + attr_writer :rate + + sig { returns(T.nilable(String)) } + attr_reader :to_chain + + sig { params(to_chain: String).void } + attr_writer :to_chain + + sig do + params( + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::Object::OrSymbol, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + ).returns(T.attached_class) + end + def self.new( + account_id:, + object:, + status:, + amount_out_expected: nil, + amount_out_min: nil, + rate: nil, + to_chain: nil + ) + end + + sig do + override.returns( + { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::SwapCreateResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWAP = + T.let( + :swap, + WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::Models::SwapCreateResponse::Object::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/models/swap_retrieve_params.rbi b/rbi/whop_sdk/models/swap_retrieve_params.rbi new file mode 100644 index 00000000..6cb64bec --- /dev/null +++ b/rbi/whop_sdk/models/swap_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::SwapRetrieveParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_id + + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_id:, request_options: {}) + end + + sig do + override.returns( + { account_id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/swap_retrieve_response.rbi b/rbi/whop_sdk/models/swap_retrieve_response.rbi new file mode 100644 index 00000000..8e9f1209 --- /dev/null +++ b/rbi/whop_sdk/models/swap_retrieve_response.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module WhopSDK + module Models + class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::SwapRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_id + + sig do + returns(WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol) + end + attr_accessor :object + + sig { returns(String) } + attr_accessor :status + + sig { returns(T::Array[String]) } + attr_accessor :tx_hashes + + sig { returns(T.nilable(String)) } + attr_accessor :error + + sig do + params( + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::Object::OrSymbol, + status: String, + tx_hashes: T::Array[String], + error: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(account_id:, object:, status:, tx_hashes:, error: nil) + end + + sig do + override.returns( + { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol, + status: String, + tx_hashes: T::Array[String], + error: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::SwapRetrieveResponse::Object) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWAP = + T.let( + :swap, + WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::SwapRetrieveResponse::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/swaps.rbi b/rbi/whop_sdk/resources/swaps.rbi index 3e26ed1f..20f92c67 100644 --- a/rbi/whop_sdk/resources/swaps.rbi +++ b/rbi/whop_sdk/resources/swaps.rbi @@ -3,6 +3,50 @@ module WhopSDK module Resources class Swaps + # Executes a swap from the account's wallet. Runs asynchronously — poll GET + # /swaps/{account_id} for status. + sig do + params( + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: T.nilable(WhopSDK::SwapCreateParams::FromChain::Variants), + slippage_bps: T.nilable(Integer), + to_chain: T.nilable(WhopSDK::SwapCreateParams::ToChain::Variants), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::SwapCreateResponse) + end + def create( + # Business or user account ID (biz*\* / user*\*). + account_id:, + # Input token amount. + amount:, + # Source token contract address. + from_token:, + # Destination token contract address. + to_token:, + from_chain: nil, + slippage_bps: nil, + to_chain: nil, + request_options: {} + ) + end + + # Returns the status of the account's in-flight or most recent swap. + sig do + params( + account_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::SwapRetrieveResponse) + end + def retrieve( + # Business or user account ID (biz*\* / user*\*). + account_id, + request_options: {} + ) + end + # Returns a stateless swap price preview. No funds move and nothing is persisted. sig do params( diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index e91393d7..c2d1641a 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -703,8 +703,12 @@ module WhopSDK class SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + class SwapCreateParams = WhopSDK::Models::SwapCreateParams + class SwapCreateQuoteParams = WhopSDK::Models::SwapCreateQuoteParams + class SwapRetrieveParams = WhopSDK::Models::SwapRetrieveParams + module TaxIdentifierType = WhopSDK::Models::TaxIdentifierType module TaxType = WhopSDK::Models::TaxType diff --git a/sig/whop_sdk/models/swap_create_params.rbs b/sig/whop_sdk/models/swap_create_params.rbs new file mode 100644 index 00000000..9d5c2dc3 --- /dev/null +++ b/sig/whop_sdk/models/swap_create_params.rbs @@ -0,0 +1,72 @@ +module WhopSDK + module Models + type swap_create_params = + { + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + slippage_bps: Integer?, + to_chain: WhopSDK::Models::SwapCreateParams::to_chain? + } + & WhopSDK::Internal::Type::request_parameters + + class SwapCreateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_accessor amount: String + + attr_accessor from_token: String + + attr_accessor to_token: String + + attr_accessor from_chain: WhopSDK::Models::SwapCreateParams::from_chain? + + attr_accessor slippage_bps: Integer? + + attr_accessor to_chain: WhopSDK::Models::SwapCreateParams::to_chain? + + def initialize: ( + account_id: String, + amount: String, + from_token: String, + to_token: String, + ?from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + ?slippage_bps: Integer?, + ?to_chain: WhopSDK::Models::SwapCreateParams::to_chain?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + amount: String, + from_token: String, + to_token: String, + from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + slippage_bps: Integer?, + to_chain: WhopSDK::Models::SwapCreateParams::to_chain?, + request_options: WhopSDK::RequestOptions + } + + type from_chain = String | Integer + + module FromChain + extend WhopSDK::Internal::Type::Union + + def self?.variants: -> ::Array[WhopSDK::Models::SwapCreateParams::from_chain] + end + + type to_chain = String | Integer + + module ToChain + extend WhopSDK::Internal::Type::Union + + def self?.variants: -> ::Array[WhopSDK::Models::SwapCreateParams::to_chain] + end + end + end +end diff --git a/sig/whop_sdk/models/swap_create_response.rbs b/sig/whop_sdk/models/swap_create_response.rbs new file mode 100644 index 00000000..9950edde --- /dev/null +++ b/sig/whop_sdk/models/swap_create_response.rbs @@ -0,0 +1,68 @@ +module WhopSDK + module Models + type swap_create_response = + { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::object, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + } + + class SwapCreateResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + attr_accessor object: WhopSDK::Models::SwapCreateResponse::object + + attr_accessor status: String + + attr_reader amount_out_expected: String? + + def amount_out_expected=: (String) -> String + + attr_reader amount_out_min: String? + + def amount_out_min=: (String) -> String + + attr_reader rate: String? + + def rate=: (String) -> String + + attr_reader to_chain: String? + + def to_chain=: (String) -> String + + def initialize: ( + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::object, + status: String, + ?amount_out_expected: String, + ?amount_out_min: String, + ?rate: String, + ?to_chain: String + ) -> void + + def to_hash: -> { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::object, + status: String, + amount_out_expected: String, + amount_out_min: String, + rate: String, + to_chain: String + } + + type object = :swap + + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP: :swap + + def self?.values: -> ::Array[WhopSDK::Models::SwapCreateResponse::object] + end + end + end +end diff --git a/sig/whop_sdk/models/swap_retrieve_params.rbs b/sig/whop_sdk/models/swap_retrieve_params.rbs new file mode 100644 index 00000000..4fdedbe8 --- /dev/null +++ b/sig/whop_sdk/models/swap_retrieve_params.rbs @@ -0,0 +1,23 @@ +module WhopSDK + module Models + type swap_retrieve_params = + { account_id: String } & WhopSDK::Internal::Type::request_parameters + + class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor account_id: String + + def initialize: ( + account_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/swap_retrieve_response.rbs b/sig/whop_sdk/models/swap_retrieve_response.rbs new file mode 100644 index 00000000..3305507f --- /dev/null +++ b/sig/whop_sdk/models/swap_retrieve_response.rbs @@ -0,0 +1,50 @@ +module WhopSDK + module Models + type swap_retrieve_response = + { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::object, + status: String, + tx_hashes: ::Array[String], + error: String? + } + + class SwapRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor account_id: String + + attr_accessor object: WhopSDK::Models::SwapRetrieveResponse::object + + attr_accessor status: String + + attr_accessor tx_hashes: ::Array[String] + + attr_accessor error: String? + + def initialize: ( + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::object, + status: String, + tx_hashes: ::Array[String], + ?error: String? + ) -> void + + def to_hash: -> { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::object, + status: String, + tx_hashes: ::Array[String], + error: String? + } + + type object = :swap + + module Object + extend WhopSDK::Internal::Type::Enum + + SWAP: :swap + + def self?.values: -> ::Array[WhopSDK::Models::SwapRetrieveResponse::object] + end + end + end +end diff --git a/sig/whop_sdk/resources/swaps.rbs b/sig/whop_sdk/resources/swaps.rbs index 6abb664f..d66f3822 100644 --- a/sig/whop_sdk/resources/swaps.rbs +++ b/sig/whop_sdk/resources/swaps.rbs @@ -1,6 +1,22 @@ module WhopSDK module Resources class Swaps + def create: ( + account_id: String, + amount: String, + from_token: String, + to_token: String, + ?from_chain: WhopSDK::Models::SwapCreateParams::from_chain?, + ?slippage_bps: Integer?, + ?to_chain: WhopSDK::Models::SwapCreateParams::to_chain?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::SwapCreateResponse + + def retrieve: ( + String account_id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::SwapRetrieveResponse + def create_quote: ( amount: String, from_token: String, diff --git a/test/whop_sdk/resources/swaps_test.rb b/test/whop_sdk/resources/swaps_test.rb index 7d8c5905..441b6df0 100644 --- a/test/whop_sdk/resources/swaps_test.rb +++ b/test/whop_sdk/resources/swaps_test.rb @@ -3,6 +3,54 @@ require_relative "../test_helper" class WhopSDK::Test::Resources::SwapsTest < WhopSDK::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @whop.swaps.create( + account_id: "account_id", + amount: "amount", + from_token: "from_token", + to_token: "to_token" + ) + + assert_pattern do + response => WhopSDK::Models::SwapCreateResponse + end + + assert_pattern do + response => { + account_id: String, + object: WhopSDK::Models::SwapCreateResponse::Object, + status: String, + amount_out_expected: String | nil, + amount_out_min: String | nil, + rate: String | nil, + to_chain: String | nil + } + end + end + + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.swaps.retrieve("account_id") + + assert_pattern do + response => WhopSDK::Models::SwapRetrieveResponse + end + + assert_pattern do + response => { + account_id: String, + object: WhopSDK::Models::SwapRetrieveResponse::Object, + status: String, + tx_hashes: ^(WhopSDK::Internal::Type::ArrayOf[String]), + error: String | nil + } + end + end + def test_create_quote_required_params skip("Mock server tests are disabled") From 78da32b56a2ba8987bcec18a5b2f7ca9c0d8f6ea Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 8 Jun 2026 05:54:47 +0000 Subject: [PATCH 08/17] Add GET /api/v1/financial-activity endpoint Stainless-Generated-From: 144cf43603193d727a5bf9b6e9867e910285f657 --- .stats.yml | 2 +- lib/whop_sdk.rb | 3 + lib/whop_sdk/client.rb | 4 + lib/whop_sdk/models.rb | 2 + .../models/financial_activity_list_params.rb | 78 ++ .../financial_activity_list_response.rb | 581 +++++++++ lib/whop_sdk/resources/financial_activity.rb | 54 + rbi/whop_sdk/client.rbi | 3 + rbi/whop_sdk/models.rbi | 2 + .../models/financial_activity_list_params.rbi | 126 ++ .../financial_activity_list_response.rbi | 1160 +++++++++++++++++ rbi/whop_sdk/resources/financial_activity.rbi | 50 + sig/whop_sdk/client.rbs | 2 + sig/whop_sdk/models.rbs | 2 + .../models/financial_activity_list_params.rbs | 77 ++ .../financial_activity_list_response.rbs | 569 ++++++++ sig/whop_sdk/resources/financial_activity.rbs | 19 + .../resources/financial_activity_test.rb | 22 + 18 files changed, 2755 insertions(+), 1 deletion(-) create mode 100644 lib/whop_sdk/models/financial_activity_list_params.rb create mode 100644 lib/whop_sdk/models/financial_activity_list_response.rb create mode 100644 lib/whop_sdk/resources/financial_activity.rb create mode 100644 rbi/whop_sdk/models/financial_activity_list_params.rbi create mode 100644 rbi/whop_sdk/models/financial_activity_list_response.rbi create mode 100644 rbi/whop_sdk/resources/financial_activity.rbi create mode 100644 sig/whop_sdk/models/financial_activity_list_params.rbs create mode 100644 sig/whop_sdk/models/financial_activity_list_response.rbs create mode 100644 sig/whop_sdk/resources/financial_activity.rbs create mode 100644 test/whop_sdk/resources/financial_activity_test.rb diff --git a/.stats.yml b/.stats.yml index a9737a87..f1fe8e08 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 228 +configured_endpoints: 229 diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index c75c92cd..96bbf9f0 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -311,6 +311,8 @@ require_relative "whop_sdk/models/file_retrieve_params" require_relative "whop_sdk/models/file_retrieve_response" require_relative "whop_sdk/models/file_visibility" +require_relative "whop_sdk/models/financial_activity_list_params" +require_relative "whop_sdk/models/financial_activity_list_response" require_relative "whop_sdk/models/forum" require_relative "whop_sdk/models/forum_list_params" require_relative "whop_sdk/models/forum_list_response" @@ -609,6 +611,7 @@ require_relative "whop_sdk/resources/experiences" require_relative "whop_sdk/resources/fee_markups" require_relative "whop_sdk/resources/files" +require_relative "whop_sdk/resources/financial_activity" require_relative "whop_sdk/resources/forum_posts" require_relative "whop_sdk/resources/forums" require_relative "whop_sdk/resources/invoices" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index cb51edf1..91fdef72 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -195,6 +195,9 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::Wallets] attr_reader :wallets + # @return [WhopSDK::Resources::FinancialActivity] + attr_reader :financial_activity + # @return [WhopSDK::Resources::Swaps] attr_reader :swaps @@ -412,6 +415,7 @@ def initialize( @account_links = WhopSDK::Resources::AccountLinks.new(client: self) @accounts = WhopSDK::Resources::Accounts.new(client: self) @wallets = WhopSDK::Resources::Wallets.new(client: self) + @financial_activity = WhopSDK::Resources::FinancialActivity.new(client: self) @swaps = WhopSDK::Resources::Swaps.new(client: self) @deposits = WhopSDK::Resources::Deposits.new(client: self) @setup_intents = WhopSDK::Resources::SetupIntents.new(client: self) diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index abb3ef53..a9a5c3e7 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -418,6 +418,8 @@ module WhopSDK FileVisibility = WhopSDK::Models::FileVisibility + FinancialActivityListParams = WhopSDK::Models::FinancialActivityListParams + Forum = WhopSDK::Models::Forum ForumListParams = WhopSDK::Models::ForumListParams diff --git a/lib/whop_sdk/models/financial_activity_list_params.rb b/lib/whop_sdk/models/financial_activity_list_params.rb new file mode 100644 index 00000000..54252781 --- /dev/null +++ b/lib/whop_sdk/models/financial_activity_list_params.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::FinancialActivity#list + class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute currency + # Optional currency code filter, for example usd. + # + # @return [String, nil] + optional :currency, String + + # @!attribute cursor + # Cursor returned by the previous page. + # + # @return [String, nil] + optional :cursor, String + + # @!attribute limit + # Maximum number of rows to return. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute line_types + # Optional ledger line categories to include. + # + # @return [Array, nil] + optional :line_types, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute posted_after + # Only include rows posted after this ISO 8601 timestamp. + # + # @return [Time, nil] + optional :posted_after, Time + + # @!attribute posted_before + # Only include rows posted before this ISO 8601 timestamp. + # + # @return [Time, nil] + optional :posted_before, Time + + # @!attribute user_id + # The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @return [String, nil] + optional :user_id, String + + # @!method initialize(account_id: nil, currency: nil, cursor: nil, limit: nil, line_types: nil, posted_after: nil, posted_before: nil, user_id: nil, request_options: {}) + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param currency [String] Optional currency code filter, for example usd. + # + # @param cursor [String] Cursor returned by the previous page. + # + # @param limit [Integer] Maximum number of rows to return. + # + # @param line_types [Array] Optional ledger line categories to include. + # + # @param posted_after [Time] Only include rows posted after this ISO 8601 timestamp. + # + # @param posted_before [Time] Only include rows posted before this ISO 8601 timestamp. + # + # @param user_id [String] The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/financial_activity_list_response.rb b/lib/whop_sdk/models/financial_activity_list_response.rb new file mode 100644 index 00000000..77bfd25d --- /dev/null +++ b/lib/whop_sdk/models/financial_activity_list_response.rb @@ -0,0 +1,581 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::FinancialActivity#list + class FinancialActivityListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::FinancialActivityListResponse::Data] } + + # @!attribute page_info + # + # @return [WhopSDK::Models::FinancialActivityListResponse::PageInfo] + required :page_info, -> { WhopSDK::Models::FinancialActivityListResponse::PageInfo } + + # @!method initialize(data:, page_info:) + # @param data [Array] + # @param page_info [WhopSDK::Models::FinancialActivityListResponse::PageInfo] + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # Signed amount in the currency's smallest precision units. + # + # @return [String] + required :amount, String + + # @!attribute currency + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] + required :currency, -> { WhopSDK::Models::FinancialActivityListResponse::Data::Currency } + + # @!attribute line_type + # + # @return [String] + required :line_type, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Object] + required :object, enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Object } + + # @!attribute posted_at + # + # @return [Time] + required :posted_at, Time + + # @!attribute resource + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, nil] + required :resource, + union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource }, + nil?: true + + # @!attribute source + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Source, nil] + required :source, -> { WhopSDK::Models::FinancialActivityListResponse::Data::Source }, nil?: true + + # @!method initialize(id:, amount:, currency:, line_type:, object:, posted_at:, resource:, source:) + # @param id [String] + # + # @param amount [String] Signed amount in the currency's smallest precision units. + # + # @param currency [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] + # + # @param line_type [String] + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Object] + # + # @param posted_at [Time] + # + # @param resource [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, nil] + # + # @param source [WhopSDK::Models::FinancialActivityListResponse::Data::Source, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#currency + class Currency < WhopSDK::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute precision + # Precision factor for the currency, for example 100000000 for USD. + # + # @return [String] + required :precision, String + + # @!method initialize(code:, precision:) + # @param code [String] + # + # @param precision [String] Precision factor for the currency, for example 100000000 for USD. + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#object + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACTIVITY = :ledger_activity + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#resource + module Resource + extend WhopSDK::Internal::Type::Union + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute logo_url + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object } + + # @!attribute route + # + # @return [String, nil] + required :route, String, nil?: true + + # @!attribute title + # + # @return [String, nil] + required :title, String, nil?: true + + # @!method initialize(id:, logo_url:, object:, route:, title:) + # @param id [String] + # @param logo_url [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object] + # @param route [String, nil] + # @param title [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0#object + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT = :account + + # @!method self.values + # @return [Array] + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object } + + # @!attribute profile_picture_url + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!method initialize(id:, name:, object:, profile_picture_url:, username:) + # @param id [String] + # @param name [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object] + # @param profile_picture_url [String, nil] + # @param username [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1#object + module Object + extend WhopSDK::Internal::Type::Enum + + USER = :user + + # @!method self.values + # @return [Array] + end + end + + class UnionMember2 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object } + + # @!attribute owner + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, nil] + required :owner, + union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner }, + nil?: true + + # @!method initialize(id:, object:, owner:) + # @param id [String] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object] + # @param owner [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2#object + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACCOUNT = :ledger_account + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2#owner + module Owner + extend WhopSDK::Internal::Type::Union + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute logo_url + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object } + + # @!attribute route + # + # @return [String, nil] + required :route, String, nil?: true + + # @!attribute title + # + # @return [String, nil] + required :title, String, nil?: true + + # @!method initialize(id:, logo_url:, object:, route:, title:) + # @param id [String] + # @param logo_url [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object] + # @param route [String, nil] + # @param title [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0#object + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT = :account + + # @!method self.values + # @return [Array] + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object } + + # @!attribute profile_picture_url + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!method initialize(id:, name:, object:, profile_picture_url:, username:) + # @param id [String] + # @param name [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object] + # @param profile_picture_url [String, nil] + # @param username [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1#object + module Object + extend WhopSDK::Internal::Type::Enum + + USER = :user + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1)] + end + end + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute bank + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, nil] + required :bank, + -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank }, + nil?: true + + # @!attribute card + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, nil] + required :card, + -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card }, + nil?: true + + # @!attribute email_identifier + # + # @return [String, nil] + required :email_identifier, String, nil?: true + + # @!attribute gateway_type + # + # @return [String, nil] + required :gateway_type, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object } + + # @!attribute payment_method_type + # + # @return [String, nil] + required :payment_method_type, String, nil?: true + + # @!method initialize(id:, bank:, card:, email_identifier:, gateway_type:, object:, payment_method_type:) + # @param id [String] + # @param bank [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, nil] + # @param card [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, nil] + # @param email_identifier [String, nil] + # @param gateway_type [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object] + # @param payment_method_type [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#bank + class Bank < WhopSDK::Internal::Type::BaseModel + # @!attribute account_name + # + # @return [String, nil] + required :account_name, String, nil?: true + + # @!attribute account_type + # + # @return [String, nil] + required :account_type, String, nil?: true + + # @!attribute bank_name + # + # @return [String, nil] + required :bank_name, String, nil?: true + + # @!attribute last4 + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!method initialize(account_name:, account_type:, bank_name:, last4:) + # @param account_name [String, nil] + # @param account_type [String, nil] + # @param bank_name [String, nil] + # @param last4 [String, nil] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#card + class Card < WhopSDK::Internal::Type::BaseModel + # @!attribute brand + # + # @return [String, nil] + required :brand, String, nil?: true + + # @!attribute exp_month + # + # @return [Integer, nil] + required :exp_month, Integer, nil?: true + + # @!attribute exp_year + # + # @return [Integer, nil] + required :exp_year, Integer, nil?: true + + # @!attribute last4 + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!method initialize(brand:, exp_month:, exp_year:, last4:) + # @param brand [String, nil] + # @param exp_month [Integer, nil] + # @param exp_year [Integer, nil] + # @param last4 [String, nil] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#object + module Object + extend WhopSDK::Internal::Type::Enum + + PAYMENT_METHOD = :payment_method + + # @!method self.values + # @return [Array] + end + end + + class UnionMember4 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account_reference + # + # @return [String, nil] + required :account_reference, String, nil?: true + + # @!attribute destination_currency_code + # + # @return [String, nil] + required :destination_currency_code, String, nil?: true + + # @!attribute institution_name + # + # @return [String, nil] + required :institution_name, String, nil?: true + + # @!attribute nickname + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object } + + # @!attribute provider + # + # @return [String, nil] + required :provider, String, nil?: true + + # @!method initialize(id:, account_reference:, destination_currency_code:, institution_name:, nickname:, object:, provider:) + # @param id [String] + # @param account_reference [String, nil] + # @param destination_currency_code [String, nil] + # @param institution_name [String, nil] + # @param nickname [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object] + # @param provider [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4#object + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT_METHOD = :payout_method + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4)] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#source + class Source < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute object + # + # @return [String] + required :object, String + + # @!method initialize(id:, object:) + # @param id [String] + # @param object [String] + end + end + + # @see WhopSDK::Models::FinancialActivityListResponse#page_info + class PageInfo < WhopSDK::Internal::Type::BaseModel + # @!attribute end_cursor + # + # @return [String, nil] + required :end_cursor, String, nil?: true + + # @!attribute has_next_page + # + # @return [Boolean] + required :has_next_page, WhopSDK::Internal::Type::Boolean + + # @!attribute has_previous_page + # + # @return [Boolean] + required :has_previous_page, WhopSDK::Internal::Type::Boolean + + # @!attribute start_cursor + # + # @return [String, nil] + required :start_cursor, String, nil?: true + + # @!method initialize(end_cursor:, has_next_page:, has_previous_page:, start_cursor:) + # @param end_cursor [String, nil] + # @param has_next_page [Boolean] + # @param has_previous_page [Boolean] + # @param start_cursor [String, nil] + end + end + end +end diff --git a/lib/whop_sdk/resources/financial_activity.rb b/lib/whop_sdk/resources/financial_activity.rb new file mode 100644 index 00000000..b43efc2d --- /dev/null +++ b/lib/whop_sdk/resources/financial_activity.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class FinancialActivity + # Lists financial activity rows for a ledger account. Rows are derived from ledger + # lines and include typed resource and source objects that clients can use for + # presentation and navigation. The ledger's owner is passed as exactly one of + # account*id (a biz* identifier) or user*id (a user* identifier). + # + # @overload list(account_id: nil, currency: nil, cursor: nil, limit: nil, line_types: nil, posted_after: nil, posted_before: nil, user_id: nil, request_options: {}) + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param currency [String] Optional currency code filter, for example usd. + # + # @param cursor [String] Cursor returned by the previous page. + # + # @param limit [Integer] Maximum number of rows to return. + # + # @param line_types [Array] Optional ledger line categories to include. + # + # @param posted_after [Time] Only include rows posted after this ISO 8601 timestamp. + # + # @param posted_before [Time] Only include rows posted before this ISO 8601 timestamp. + # + # @param user_id [String] The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::FinancialActivityListResponse] + # + # @see WhopSDK::Models::FinancialActivityListParams + def list(params = {}) + parsed, options = WhopSDK::FinancialActivityListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "financial-activity", + query: query, + model: WhopSDK::Models::FinancialActivityListResponse, + 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 c17c6e29..15f51099 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -178,6 +178,9 @@ module WhopSDK sig { returns(WhopSDK::Resources::Wallets) } attr_reader :wallets + sig { returns(WhopSDK::Resources::FinancialActivity) } + attr_reader :financial_activity + sig { returns(WhopSDK::Resources::Swaps) } attr_reader :swaps diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index 13b19aaa..43f0a4d8 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -393,6 +393,8 @@ module WhopSDK FileVisibility = WhopSDK::Models::FileVisibility + FinancialActivityListParams = WhopSDK::Models::FinancialActivityListParams + Forum = WhopSDK::Models::Forum ForumListParams = WhopSDK::Models::ForumListParams diff --git a/rbi/whop_sdk/models/financial_activity_list_params.rbi b/rbi/whop_sdk/models/financial_activity_list_params.rbi new file mode 100644 index 00000000..de9de9f2 --- /dev/null +++ b/rbi/whop_sdk/models/financial_activity_list_params.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module WhopSDK + module Models + class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::FinancialActivityListParams, + WhopSDK::Internal::AnyHash + ) + end + + # The owning account ID (a biz\_ identifier). Provide this or user_id. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # Optional currency code filter, for example usd. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # Cursor returned by the previous page. + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + # Maximum number of rows to return. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Optional ledger line categories to include. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :line_types + + sig { params(line_types: T::Array[String]).void } + attr_writer :line_types + + # Only include rows posted after this ISO 8601 timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :posted_after + + sig { params(posted_after: Time).void } + attr_writer :posted_after + + # Only include rows posted before this ISO 8601 timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :posted_before + + sig { params(posted_before: Time).void } + attr_writer :posted_before + + # The owning user ID (a user\_ identifier). Provide this or account_id. + sig { returns(T.nilable(String)) } + attr_reader :user_id + + sig { params(user_id: String).void } + attr_writer :user_id + + sig do + params( + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: T::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # Optional currency code filter, for example usd. + currency: nil, + # Cursor returned by the previous page. + cursor: nil, + # Maximum number of rows to return. + limit: nil, + # Optional ledger line categories to include. + line_types: nil, + # Only include rows posted after this ISO 8601 timestamp. + posted_after: nil, + # Only include rows posted before this ISO 8601 timestamp. + posted_before: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: T::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/financial_activity_list_response.rbi b/rbi/whop_sdk/models/financial_activity_list_response.rbi new file mode 100644 index 00000000..e6db1b7d --- /dev/null +++ b/rbi/whop_sdk/models/financial_activity_list_response.rbi @@ -0,0 +1,1160 @@ +# typed: strong + +module WhopSDK + module Models + class FinancialActivityListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns(T::Array[WhopSDK::Models::FinancialActivityListResponse::Data]) + end + attr_accessor :data + + sig { returns(WhopSDK::Models::FinancialActivityListResponse::PageInfo) } + attr_reader :page_info + + sig do + params( + page_info: + WhopSDK::Models::FinancialActivityListResponse::PageInfo::OrHash + ).void + end + attr_writer :page_info + + sig do + params( + data: + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::OrHash + ], + page_info: + WhopSDK::Models::FinancialActivityListResponse::PageInfo::OrHash + ).returns(T.attached_class) + end + def self.new(data:, page_info:) + end + + sig do + override.returns( + { + data: + T::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Signed amount in the currency's smallest precision units. + sig { returns(String) } + attr_accessor :amount + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Currency + ) + end + attr_reader :currency + + sig do + params( + currency: + WhopSDK::Models::FinancialActivityListResponse::Data::Currency::OrHash + ).void + end + attr_writer :currency + + sig { returns(String) } + attr_accessor :line_type + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(Time) } + attr_accessor :posted_at + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::Variants + ) + ) + end + attr_accessor :resource + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source + ) + ) + end + attr_reader :source + + sig do + params( + source: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::OrHash + ) + ).void + end + attr_writer :source + + sig do + params( + id: String, + amount: String, + currency: + WhopSDK::Models::FinancialActivityListResponse::Data::Currency::OrHash, + line_type: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Object::OrSymbol, + posted_at: Time, + resource: + T.nilable( + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::OrHash + ) + ), + source: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + id:, + # Signed amount in the currency's smallest precision units. + amount:, + currency:, + line_type:, + object:, + posted_at:, + resource:, + source: + ) + end + + sig do + override.returns( + { + id: String, + amount: String, + currency: + WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol, + posted_at: Time, + resource: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::Variants + ), + source: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source + ) + } + ) + end + def to_hash + end + + class Currency < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + # Precision factor for the currency, for example 100000000 for USD. + sig { returns(String) } + attr_accessor :precision + + sig do + params(code: String, precision: String).returns(T.attached_class) + end + def self.new( + code:, + # Precision factor for the currency, for example 100000000 for USD. + precision: + ) + end + + sig { override.returns({ code: String, precision: String }) } + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEDGER_ACTIVITY = + T.let( + :ledger_activity, + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Resource + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 + ) + end + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :route + + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::OrSymbol, + route: T.nilable(String), + title: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, logo_url:, object:, route:, title:) + end + + sig do + override.returns( + { + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT = + T.let( + :account, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig do + params( + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::OrSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name:, object:, profile_picture_url:, username:) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember2 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + ) + ) + end + attr_accessor :owner + + sig do + params( + id: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::OrSymbol, + owner: + T.nilable( + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::OrHash + ) + ) + ).returns(T.attached_class) + end + def self.new(id:, object:, owner:) + end + + sig do + override.returns( + { + id: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol, + owner: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + ) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEDGER_ACCOUNT = + T.let( + :ledger_account, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Owner + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 + ) + end + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :route + + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::OrSymbol, + route: T.nilable(String), + title: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, logo_url:, object:, route:, title:) + end + + sig do + override.returns( + { + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT = + T.let( + :account, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig do + params( + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::OrSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + name:, + object:, + profile_picture_url:, + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + ] + ) + end + def self.variants + end + end + end + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank + ) + ) + end + attr_reader :bank + + sig do + params( + bank: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank::OrHash + ) + ).void + end + attr_writer :bank + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card + ) + ) + end + attr_reader :card + + sig do + params( + card: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card::OrHash + ) + ).void + end + attr_writer :card + + sig { returns(T.nilable(String)) } + attr_accessor :email_identifier + + sig { returns(T.nilable(String)) } + attr_accessor :gateway_type + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :payment_method_type + + sig do + params( + id: String, + bank: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank::OrHash + ), + card: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card::OrHash + ), + email_identifier: T.nilable(String), + gateway_type: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::OrSymbol, + payment_method_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + bank:, + card:, + email_identifier:, + gateway_type:, + object:, + payment_method_type: + ) + end + + sig do + override.returns( + { + id: String, + bank: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank + ), + card: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card + ), + email_identifier: T.nilable(String), + gateway_type: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol, + payment_method_type: T.nilable(String) + } + ) + end + def to_hash + end + + class Bank < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :account_name + + sig { returns(T.nilable(String)) } + attr_accessor :account_type + + sig { returns(T.nilable(String)) } + attr_accessor :bank_name + + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + sig do + params( + account_name: T.nilable(String), + account_type: T.nilable(String), + bank_name: T.nilable(String), + last4: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(account_name:, account_type:, bank_name:, last4:) + end + + sig do + override.returns( + { + account_name: T.nilable(String), + account_type: T.nilable(String), + bank_name: T.nilable(String), + last4: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Card < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :brand + + sig { returns(T.nilable(Integer)) } + attr_accessor :exp_month + + sig { returns(T.nilable(Integer)) } + attr_accessor :exp_year + + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + sig do + params( + brand: T.nilable(String), + exp_month: T.nilable(Integer), + exp_year: T.nilable(Integer), + last4: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(brand:, exp_month:, exp_year:, last4:) + end + + sig do + override.returns( + { + brand: T.nilable(String), + exp_month: T.nilable(Integer), + exp_year: T.nilable(Integer), + last4: T.nilable(String) + } + ) + end + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYMENT_METHOD = + T.let( + :payment_method, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember4 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :account_reference + + sig { returns(T.nilable(String)) } + attr_accessor :destination_currency_code + + sig { returns(T.nilable(String)) } + attr_accessor :institution_name + + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :provider + + sig do + params( + id: String, + account_reference: T.nilable(String), + destination_currency_code: T.nilable(String), + institution_name: T.nilable(String), + nickname: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::OrSymbol, + provider: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + account_reference:, + destination_currency_code:, + institution_name:, + nickname:, + object:, + provider: + ) + end + + sig do + override.returns( + { + id: String, + account_reference: T.nilable(String), + destination_currency_code: T.nilable(String), + institution_name: T.nilable(String), + nickname: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol, + provider: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYOUT_METHOD = + T.let( + :payout_method, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::Variants + ] + ) + end + def self.variants + end + end + + class Source < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Source, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :object + + sig { params(id: String, object: String).returns(T.attached_class) } + def self.new(id:, object:) + end + + sig { override.returns({ id: String, object: String }) } + def to_hash + end + end + end + + class PageInfo < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::PageInfo, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :end_cursor + + sig { returns(T::Boolean) } + attr_accessor :has_next_page + + sig { returns(T::Boolean) } + attr_accessor :has_previous_page + + sig { returns(T.nilable(String)) } + attr_accessor :start_cursor + + sig do + params( + end_cursor: T.nilable(String), + has_next_page: T::Boolean, + has_previous_page: T::Boolean, + start_cursor: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + end_cursor:, + has_next_page:, + has_previous_page:, + start_cursor: + ) + end + + sig do + override.returns( + { + end_cursor: T.nilable(String), + has_next_page: T::Boolean, + has_previous_page: T::Boolean, + start_cursor: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/resources/financial_activity.rbi b/rbi/whop_sdk/resources/financial_activity.rbi new file mode 100644 index 00000000..cdb67559 --- /dev/null +++ b/rbi/whop_sdk/resources/financial_activity.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module WhopSDK + module Resources + class FinancialActivity + # Lists financial activity rows for a ledger account. Rows are derived from ledger + # lines and include typed resource and source objects that clients can use for + # presentation and navigation. The ledger's owner is passed as exactly one of + # account*id (a biz* identifier) or user*id (a user* identifier). + sig do + params( + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: T::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::FinancialActivityListResponse) + end + def list( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # Optional currency code filter, for example usd. + currency: nil, + # Cursor returned by the previous page. + cursor: nil, + # Maximum number of rows to return. + limit: nil, + # Optional ledger line categories to include. + line_types: nil, + # Only include rows posted after this ISO 8601 timestamp. + posted_after: nil, + # Only include rows posted before this ISO 8601 timestamp. + posted_before: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: 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 52916981..7dbffbb3 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -92,6 +92,8 @@ module WhopSDK attr_reader wallets: WhopSDK::Resources::Wallets + attr_reader financial_activity: WhopSDK::Resources::FinancialActivity + attr_reader swaps: WhopSDK::Resources::Swaps attr_reader deposits: WhopSDK::Resources::Deposits diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index c2d1641a..20ba47aa 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -377,6 +377,8 @@ module WhopSDK module FileVisibility = WhopSDK::Models::FileVisibility + class FinancialActivityListParams = WhopSDK::Models::FinancialActivityListParams + class Forum = WhopSDK::Models::Forum class ForumListParams = WhopSDK::Models::ForumListParams diff --git a/sig/whop_sdk/models/financial_activity_list_params.rbs b/sig/whop_sdk/models/financial_activity_list_params.rbs new file mode 100644 index 00000000..6503585f --- /dev/null +++ b/sig/whop_sdk/models/financial_activity_list_params.rbs @@ -0,0 +1,77 @@ +module WhopSDK + module Models + type financial_activity_list_params = + { + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: ::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader line_types: ::Array[String]? + + def line_types=: (::Array[String]) -> ::Array[String] + + attr_reader posted_after: Time? + + def posted_after=: (Time) -> Time + + attr_reader posted_before: Time? + + def posted_before=: (Time) -> Time + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?account_id: String, + ?currency: String, + ?cursor: String, + ?limit: Integer, + ?line_types: ::Array[String], + ?posted_after: Time, + ?posted_before: Time, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: ::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/financial_activity_list_response.rbs b/sig/whop_sdk/models/financial_activity_list_response.rbs new file mode 100644 index 00000000..3a42b265 --- /dev/null +++ b/sig/whop_sdk/models/financial_activity_list_response.rbs @@ -0,0 +1,569 @@ +module WhopSDK + module Models + type financial_activity_list_response = + { + data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + + class FinancialActivityListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data] + + attr_accessor page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + + def initialize: ( + data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + + type data = + { + id: String, + amount: String, + currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::object, + posted_at: Time, + resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource?, + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency + + attr_accessor line_type: String + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::object + + attr_accessor posted_at: Time + + attr_accessor resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource? + + attr_accessor source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + + def initialize: ( + id: String, + amount: String, + currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::object, + posted_at: Time, + resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource?, + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + ) -> void + + def to_hash: -> { + id: String, + amount: String, + currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::object, + posted_at: Time, + resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource?, + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + } + + type currency = { code: String, precision: String } + + class Currency < WhopSDK::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor precision: String + + def initialize: (code: String, precision: String) -> void + + def to_hash: -> { code: String, precision: String } + end + + type object = :ledger_activity + + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACTIVITY: :ledger_activity + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::object] + end + + type resource = + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 + + module Resource + extend WhopSDK::Internal::Type::Union + + type union_member0 = + { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object, + route: String?, + title: String? + } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor logo_url: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object + + attr_accessor route: String? + + attr_accessor title: String? + + def initialize: ( + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object, + route: String?, + title: String? + ) -> void + + def to_hash: -> { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object, + route: String?, + title: String? + } + + type object = :account + + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT: :account + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object] + end + end + + type union_member1 = + { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object + + attr_accessor profile_picture_url: String? + + attr_accessor username: String? + + def initialize: ( + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object, + profile_picture_url: String?, + username: String? + ) -> void + + def to_hash: -> { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + type object = :user + + module Object + extend WhopSDK::Internal::Type::Enum + + USER: :user + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object] + end + end + + type union_member2 = + { + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + } + + class UnionMember2 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object + + attr_accessor owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + + def initialize: ( + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + ) -> void + + def to_hash: -> { + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + } + + type object = :ledger_account + + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACCOUNT: :ledger_account + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object] + end + + type owner = + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 + + module Owner + extend WhopSDK::Internal::Type::Union + + type union_member0 = + { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + route: String?, + title: String? + } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor logo_url: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object + + attr_accessor route: String? + + attr_accessor title: String? + + def initialize: ( + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + route: String?, + title: String? + ) -> void + + def to_hash: -> { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + route: String?, + title: String? + } + + type object = :account + + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT: :account + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object] + end + end + + type union_member1 = + { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object + + attr_accessor profile_picture_url: String? + + attr_accessor username: String? + + def initialize: ( + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + profile_picture_url: String?, + username: String? + ) -> void + + def to_hash: -> { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + type object = :user + + module Object + extend WhopSDK::Internal::Type::Enum + + USER: :user + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object] + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner] + end + end + + type union_member3 = + { + id: String, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card?, + email_identifier: String?, + gateway_type: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + payment_method_type: String? + } + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank? + + attr_accessor card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card? + + attr_accessor email_identifier: String? + + attr_accessor gateway_type: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object + + attr_accessor payment_method_type: String? + + def initialize: ( + id: String, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card?, + email_identifier: String?, + gateway_type: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + payment_method_type: String? + ) -> void + + def to_hash: -> { + id: String, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card?, + email_identifier: String?, + gateway_type: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + payment_method_type: String? + } + + type bank = + { + account_name: String?, + account_type: String?, + bank_name: String?, + :last4 => String? + } + + class Bank < WhopSDK::Internal::Type::BaseModel + attr_accessor account_name: String? + + attr_accessor account_type: String? + + attr_accessor bank_name: String? + + attr_accessor last4: String? + + def initialize: ( + account_name: String?, + account_type: String?, + bank_name: String?, + last4: String? + ) -> void + + def to_hash: -> { + account_name: String?, + account_type: String?, + bank_name: String?, + :last4 => String? + } + end + + type card = + { + brand: String?, + exp_month: Integer?, + exp_year: Integer?, + :last4 => String? + } + + class Card < WhopSDK::Internal::Type::BaseModel + attr_accessor brand: String? + + attr_accessor exp_month: Integer? + + attr_accessor exp_year: Integer? + + attr_accessor last4: String? + + def initialize: ( + brand: String?, + exp_month: Integer?, + exp_year: Integer?, + last4: String? + ) -> void + + def to_hash: -> { + brand: String?, + exp_month: Integer?, + exp_year: Integer?, + :last4 => String? + } + end + + type object = :payment_method + + module Object + extend WhopSDK::Internal::Type::Enum + + PAYMENT_METHOD: :payment_method + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object] + end + end + + type union_member4 = + { + id: String, + account_reference: String?, + destination_currency_code: String?, + institution_name: String?, + nickname: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + provider: String? + } + + class UnionMember4 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account_reference: String? + + attr_accessor destination_currency_code: String? + + attr_accessor institution_name: String? + + attr_accessor nickname: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object + + attr_accessor provider: String? + + def initialize: ( + id: String, + account_reference: String?, + destination_currency_code: String?, + institution_name: String?, + nickname: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + provider: String? + ) -> void + + def to_hash: -> { + id: String, + account_reference: String?, + destination_currency_code: String?, + institution_name: String?, + nickname: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + provider: String? + } + + type object = :payout_method + + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT_METHOD: :payout_method + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object] + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::resource] + end + + type source = { id: String, object: String } + + class Source < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor object: String + + def initialize: (id: String, object: String) -> void + + def to_hash: -> { id: String, object: String } + end + end + + type page_info = + { + end_cursor: String?, + has_next_page: bool, + has_previous_page: bool, + start_cursor: String? + } + + class PageInfo < WhopSDK::Internal::Type::BaseModel + attr_accessor end_cursor: String? + + attr_accessor has_next_page: bool + + attr_accessor has_previous_page: bool + + attr_accessor start_cursor: String? + + def initialize: ( + end_cursor: String?, + has_next_page: bool, + has_previous_page: bool, + start_cursor: String? + ) -> void + + def to_hash: -> { + end_cursor: String?, + has_next_page: bool, + has_previous_page: bool, + start_cursor: String? + } + end + end + end +end diff --git a/sig/whop_sdk/resources/financial_activity.rbs b/sig/whop_sdk/resources/financial_activity.rbs new file mode 100644 index 00000000..448d522e --- /dev/null +++ b/sig/whop_sdk/resources/financial_activity.rbs @@ -0,0 +1,19 @@ +module WhopSDK + module Resources + class FinancialActivity + def list: ( + ?account_id: String, + ?currency: String, + ?cursor: String, + ?limit: Integer, + ?line_types: ::Array[String], + ?posted_after: Time, + ?posted_before: Time, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::FinancialActivityListResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/test/whop_sdk/resources/financial_activity_test.rb b/test/whop_sdk/resources/financial_activity_test.rb new file mode 100644 index 00000000..29220050 --- /dev/null +++ b/test/whop_sdk/resources/financial_activity_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::FinancialActivityTest < WhopSDK::Test::ResourceTest + def test_list + skip("Mock server tests are disabled") + + response = @whop.financial_activity.list + + assert_pattern do + response => WhopSDK::Models::FinancialActivityListResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::FinancialActivityListResponse::Data]), + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + end + end +end From 6663034b5224d5a429baab7e0dd048e8f30cadd9 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 8 Jun 2026 21:56:41 +0000 Subject: [PATCH 09/17] fix(ads): move ad group titles to `title` column and add indexes Stainless-Generated-From: 9d4f0f8417a2061571ba9309fee6c9e65b65b6e8 --- lib/whop_sdk/models/ad_group_update_params.rb | 10 +++++- lib/whop_sdk/models/swap_retrieve_params.rb | 4 ++- lib/whop_sdk/models/wallet_balance_params.rb | 4 ++- lib/whop_sdk/models/wallet_send_params.rb | 3 +- lib/whop_sdk/resources/ad_groups.rb | 4 ++- lib/whop_sdk/resources/swaps.rb | 13 +++++--- lib/whop_sdk/resources/wallets.rb | 31 ++++++++++++------- .../models/ad_group_update_params.rbi | 8 +++++ rbi/whop_sdk/models/swap_retrieve_params.rbi | 7 ++++- rbi/whop_sdk/models/wallet_balance_params.rbi | 7 ++++- rbi/whop_sdk/models/wallet_send_params.rbi | 2 ++ rbi/whop_sdk/resources/ad_groups.rbi | 3 ++ rbi/whop_sdk/resources/swaps.rbi | 4 +-- rbi/whop_sdk/resources/wallets.rbi | 10 +++--- .../models/ad_group_update_params.rbs | 7 ++++- sig/whop_sdk/resources/ad_groups.rbs | 1 + sig/whop_sdk/resources/swaps.rbs | 2 +- sig/whop_sdk/resources/wallets.rbs | 4 +-- test/whop_sdk/resources/swaps_test.rb | 4 +-- test/whop_sdk/resources/wallets_test.rb | 6 ++-- 20 files changed, 95 insertions(+), 39 deletions(-) diff --git a/lib/whop_sdk/models/ad_group_update_params.rb b/lib/whop_sdk/models/ad_group_update_params.rb index c97be738..729a9f53 100644 --- a/lib/whop_sdk/models/ad_group_update_params.rb +++ b/lib/whop_sdk/models/ad_group_update_params.rb @@ -54,7 +54,13 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AdGroupStatus, nil] optional :status, enum: -> { WhopSDK::AdGroupStatus }, nil?: true - # @!method initialize(id:, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, request_options: {}) + # @!attribute title + # Human-readable ad group title. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!method initialize(id:, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, title: nil, request_options: {}) # @param id [String] # # @param budget [Float, nil] Budget amount in dollars. @@ -71,6 +77,8 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. # + # @param title [String, nil] Human-readable ad group title. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] class Config < WhopSDK::Internal::Type::BaseModel diff --git a/lib/whop_sdk/models/swap_retrieve_params.rb b/lib/whop_sdk/models/swap_retrieve_params.rb index 64ee4d3b..1642d38c 100644 --- a/lib/whop_sdk/models/swap_retrieve_params.rb +++ b/lib/whop_sdk/models/swap_retrieve_params.rb @@ -8,12 +8,14 @@ class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute account_id + # Business or user account ID (biz*\* / user*\*). # # @return [String] required :account_id, String # @!method initialize(account_id:, request_options: {}) - # @param account_id [String] + # @param account_id [String] Business or user account ID (biz*\* / user*\*). + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/wallet_balance_params.rb b/lib/whop_sdk/models/wallet_balance_params.rb index 4ae98c02..78d19466 100644 --- a/lib/whop_sdk/models/wallet_balance_params.rb +++ b/lib/whop_sdk/models/wallet_balance_params.rb @@ -8,12 +8,14 @@ class WalletBalanceParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute account_id + # The business or user account ID whose wallet balance should be returned. # # @return [String] required :account_id, String # @!method initialize(account_id:, request_options: {}) - # @param account_id [String] + # @param account_id [String] The business or user account ID whose wallet balance should be returned. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/wallet_send_params.rb b/lib/whop_sdk/models/wallet_send_params.rb index 20f16221..1a50c385 100644 --- a/lib/whop_sdk/models/wallet_send_params.rb +++ b/lib/whop_sdk/models/wallet_send_params.rb @@ -8,6 +8,7 @@ class WalletSendParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute account_id + # The sending account ID. # # @return [String] required :account_id, String @@ -25,7 +26,7 @@ class WalletSendParams < WhopSDK::Internal::Type::BaseModel required :to, String # @!method initialize(account_id:, amount:, to:, request_options: {}) - # @param account_id [String] + # @param account_id [String] The sending account ID. # # @param amount [String] USDT amount to send. # diff --git a/lib/whop_sdk/resources/ad_groups.rb b/lib/whop_sdk/resources/ad_groups.rb index a26eee65..510b1ab5 100644 --- a/lib/whop_sdk/resources/ad_groups.rb +++ b/lib/whop_sdk/resources/ad_groups.rb @@ -45,7 +45,7 @@ def retrieve(id, params = {}) # - `ad_campaign:update` # - `ad_campaign:basic:read` # - # @overload update(id, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, request_options: {}) + # @overload update(id, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, title: nil, request_options: {}) # # @param id [String] The unique identifier of the ad group to update. # @@ -63,6 +63,8 @@ def retrieve(id, params = {}) # # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. # + # @param title [String, nil] Human-readable ad group title. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::AdGroup] diff --git a/lib/whop_sdk/resources/swaps.rb b/lib/whop_sdk/resources/swaps.rb index bd6aef81..809dbc0e 100644 --- a/lib/whop_sdk/resources/swaps.rb +++ b/lib/whop_sdk/resources/swaps.rb @@ -4,7 +4,7 @@ module WhopSDK module Resources class Swaps # Executes a swap from the account's wallet. Runs asynchronously — poll GET - # /swaps/{account_id} for status. + # /swaps?account_id=... for status. # # @overload create(account_id:, amount:, from_token:, to_token:, from_chain: nil, slippage_bps: nil, to_chain: nil, request_options: {}) # @@ -40,7 +40,7 @@ def create(params) # Returns the status of the account's in-flight or most recent swap. # - # @overload retrieve(account_id, request_options: {}) + # @overload retrieve(account_id:, request_options: {}) # # @param account_id [String] Business or user account ID (biz*\* / user*\*). # @@ -49,12 +49,15 @@ def create(params) # @return [WhopSDK::Models::SwapRetrieveResponse] # # @see WhopSDK::Models::SwapRetrieveParams - def retrieve(account_id, params = {}) + def retrieve(params) + parsed, options = WhopSDK::SwapRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, - path: ["swaps/%1$s", account_id], + path: "swaps", + query: query, model: WhopSDK::Models::SwapRetrieveResponse, - options: params[:request_options] + options: options ) end diff --git a/lib/whop_sdk/resources/wallets.rb b/lib/whop_sdk/resources/wallets.rb index 13293f3c..4f3180b2 100644 --- a/lib/whop_sdk/resources/wallets.rb +++ b/lib/whop_sdk/resources/wallets.rb @@ -23,7 +23,7 @@ def list(params = {}) # Returns per-token balances held in an account's wallet. # - # @overload balance(account_id, request_options: {}) + # @overload balance(account_id:, request_options: {}) # # @param account_id [String] The business or user account ID whose wallet balance should be returned. # @@ -32,36 +32,45 @@ def list(params = {}) # @return [WhopSDK::Models::WalletBalanceResponse] # # @see WhopSDK::Models::WalletBalanceParams - def balance(account_id, params = {}) + def balance(params) + parsed, options = WhopSDK::WalletBalanceParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, - path: ["wallets/%1$s/balance", account_id], + path: "wallets/balance", + query: query, model: WhopSDK::Models::WalletBalanceResponse, - options: params[:request_options] + options: options ) end + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::WalletSendParams} for more details. + # # Sends USDT from an account's wallet to another Whop user or business. # - # @overload send_(account_id, amount:, to:, request_options: {}) + # @overload send_(account_id:, amount:, to:, request_options: {}) # - # @param account_id [String] The sending account ID. + # @param account_id [String] Query param: The sending account ID. # - # @param amount [String] USDT amount to send. + # @param amount [String] Body param: USDT amount to send. # - # @param to [String] Recipient user ID, business account ID, ledger account ID, or email. + # @param to [String] Body param: Recipient user ID, business account ID, ledger account ID, or email. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::WalletSendResponse] # # @see WhopSDK::Models::WalletSendParams - def send_(account_id, params) + def send_(params) + query_params = [:account_id] parsed, options = WhopSDK::WalletSendParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, - path: ["wallets/%1$s/sends", account_id], - body: parsed, + path: "wallets/send", + query: query, + body: parsed.except(*query_params), model: WhopSDK::Models::WalletSendResponse, options: options ) diff --git a/rbi/whop_sdk/models/ad_group_update_params.rbi b/rbi/whop_sdk/models/ad_group_update_params.rbi index e7a932e5..d7f8cf93 100644 --- a/rbi/whop_sdk/models/ad_group_update_params.rbi +++ b/rbi/whop_sdk/models/ad_group_update_params.rbi @@ -57,6 +57,10 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::AdGroupStatus::OrSymbol)) } attr_accessor :status + # Human-readable ad group title. + sig { returns(T.nilable(String)) } + attr_accessor :title + sig do params( id: String, @@ -68,6 +72,7 @@ module WhopSDK platform_config: T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::OrHash), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), + title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -87,6 +92,8 @@ module WhopSDK platform_config: nil, # The status of an external ad group. status: nil, + # Human-readable ad group title. + title: nil, request_options: {} ) end @@ -103,6 +110,7 @@ module WhopSDK platform_config: T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), + title: T.nilable(String), request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/swap_retrieve_params.rbi b/rbi/whop_sdk/models/swap_retrieve_params.rbi index 6cb64bec..12678a8a 100644 --- a/rbi/whop_sdk/models/swap_retrieve_params.rbi +++ b/rbi/whop_sdk/models/swap_retrieve_params.rbi @@ -11,6 +11,7 @@ module WhopSDK T.any(WhopSDK::SwapRetrieveParams, WhopSDK::Internal::AnyHash) end + # Business or user account ID (biz*\* / user*\*). sig { returns(String) } attr_accessor :account_id @@ -20,7 +21,11 @@ module WhopSDK request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(account_id:, request_options: {}) + def self.new( + # Business or user account ID (biz*\* / user*\*). + account_id:, + request_options: {} + ) end sig do diff --git a/rbi/whop_sdk/models/wallet_balance_params.rbi b/rbi/whop_sdk/models/wallet_balance_params.rbi index 567d1bcf..d373f7d9 100644 --- a/rbi/whop_sdk/models/wallet_balance_params.rbi +++ b/rbi/whop_sdk/models/wallet_balance_params.rbi @@ -11,6 +11,7 @@ module WhopSDK T.any(WhopSDK::WalletBalanceParams, WhopSDK::Internal::AnyHash) end + # The business or user account ID whose wallet balance should be returned. sig { returns(String) } attr_accessor :account_id @@ -20,7 +21,11 @@ module WhopSDK request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(account_id:, request_options: {}) + def self.new( + # The business or user account ID whose wallet balance should be returned. + account_id:, + request_options: {} + ) end sig do diff --git a/rbi/whop_sdk/models/wallet_send_params.rbi b/rbi/whop_sdk/models/wallet_send_params.rbi index 33e7008b..a7f21fc8 100644 --- a/rbi/whop_sdk/models/wallet_send_params.rbi +++ b/rbi/whop_sdk/models/wallet_send_params.rbi @@ -11,6 +11,7 @@ module WhopSDK T.any(WhopSDK::WalletSendParams, WhopSDK::Internal::AnyHash) end + # The sending account ID. sig { returns(String) } attr_accessor :account_id @@ -31,6 +32,7 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # The sending account ID. account_id:, # USDT amount to send. amount:, diff --git a/rbi/whop_sdk/resources/ad_groups.rbi b/rbi/whop_sdk/resources/ad_groups.rbi index 390ca26f..9147d0ba 100644 --- a/rbi/whop_sdk/resources/ad_groups.rbi +++ b/rbi/whop_sdk/resources/ad_groups.rbi @@ -47,6 +47,7 @@ module WhopSDK platform_config: T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::OrHash), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), + title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdGroup) end @@ -67,6 +68,8 @@ module WhopSDK platform_config: nil, # The status of an external ad group. status: nil, + # Human-readable ad group title. + title: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/swaps.rbi b/rbi/whop_sdk/resources/swaps.rbi index 20f92c67..005b9aff 100644 --- a/rbi/whop_sdk/resources/swaps.rbi +++ b/rbi/whop_sdk/resources/swaps.rbi @@ -4,7 +4,7 @@ module WhopSDK module Resources class Swaps # Executes a swap from the account's wallet. Runs asynchronously — poll GET - # /swaps/{account_id} for status. + # /swaps?account_id=... for status. sig do params( account_id: String, @@ -42,7 +42,7 @@ module WhopSDK end def retrieve( # Business or user account ID (biz*\* / user*\*). - account_id, + account_id:, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/wallets.rbi b/rbi/whop_sdk/resources/wallets.rbi index ee45be94..0a7d19d1 100644 --- a/rbi/whop_sdk/resources/wallets.rbi +++ b/rbi/whop_sdk/resources/wallets.rbi @@ -21,7 +21,7 @@ module WhopSDK end def balance( # The business or user account ID whose wallet balance should be returned. - account_id, + account_id:, request_options: {} ) end @@ -36,11 +36,11 @@ module WhopSDK ).returns(WhopSDK::Models::WalletSendResponse) end def send_( - # The sending account ID. - account_id, - # USDT amount to send. + # Query param: The sending account ID. + account_id:, + # Body param: USDT amount to send. amount:, - # Recipient user ID, business account ID, ledger account ID, or email. + # Body param: Recipient user ID, business account ID, ledger account ID, or email. to:, request_options: {} ) diff --git a/sig/whop_sdk/models/ad_group_update_params.rbs b/sig/whop_sdk/models/ad_group_update_params.rbs index 877d2ddb..dcc094ff 100644 --- a/sig/whop_sdk/models/ad_group_update_params.rbs +++ b/sig/whop_sdk/models/ad_group_update_params.rbs @@ -9,7 +9,8 @@ module WhopSDK daily_budget: Float?, name: String?, platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, - status: WhopSDK::Models::ad_group_status? + status: WhopSDK::Models::ad_group_status?, + title: String? } & WhopSDK::Internal::Type::request_parameters @@ -33,6 +34,8 @@ module WhopSDK attr_accessor status: WhopSDK::Models::ad_group_status? + attr_accessor title: String? + def initialize: ( id: String, ?budget: Float?, @@ -42,6 +45,7 @@ module WhopSDK ?name: String?, ?platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, ?status: WhopSDK::Models::ad_group_status?, + ?title: String?, ?request_options: WhopSDK::request_opts ) -> void @@ -54,6 +58,7 @@ module WhopSDK name: String?, platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, status: WhopSDK::Models::ad_group_status?, + title: String?, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/resources/ad_groups.rbs b/sig/whop_sdk/resources/ad_groups.rbs index 6e98edd3..b9d628f5 100644 --- a/sig/whop_sdk/resources/ad_groups.rbs +++ b/sig/whop_sdk/resources/ad_groups.rbs @@ -17,6 +17,7 @@ module WhopSDK ?name: String?, ?platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, ?status: WhopSDK::Models::ad_group_status?, + ?title: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdGroup diff --git a/sig/whop_sdk/resources/swaps.rbs b/sig/whop_sdk/resources/swaps.rbs index d66f3822..4afbb528 100644 --- a/sig/whop_sdk/resources/swaps.rbs +++ b/sig/whop_sdk/resources/swaps.rbs @@ -13,7 +13,7 @@ module WhopSDK ) -> WhopSDK::Models::SwapCreateResponse def retrieve: ( - String account_id, + account_id: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::SwapRetrieveResponse diff --git a/sig/whop_sdk/resources/wallets.rbs b/sig/whop_sdk/resources/wallets.rbs index 4cfd61d7..5543a065 100644 --- a/sig/whop_sdk/resources/wallets.rbs +++ b/sig/whop_sdk/resources/wallets.rbs @@ -6,12 +6,12 @@ module WhopSDK ) -> WhopSDK::Models::WalletListResponse def balance: ( - String account_id, + account_id: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::WalletBalanceResponse def send_: ( - String account_id, + account_id: String, amount: String, to: String, ?request_options: WhopSDK::request_opts diff --git a/test/whop_sdk/resources/swaps_test.rb b/test/whop_sdk/resources/swaps_test.rb index 441b6df0..9a7ee2fa 100644 --- a/test/whop_sdk/resources/swaps_test.rb +++ b/test/whop_sdk/resources/swaps_test.rb @@ -31,10 +31,10 @@ def test_create_required_params end end - def test_retrieve + def test_retrieve_required_params skip("Mock server tests are disabled") - response = @whop.swaps.retrieve("account_id") + response = @whop.swaps.retrieve(account_id: "account_id") assert_pattern do response => WhopSDK::Models::SwapRetrieveResponse diff --git a/test/whop_sdk/resources/wallets_test.rb b/test/whop_sdk/resources/wallets_test.rb index 7ad25796..885ff814 100644 --- a/test/whop_sdk/resources/wallets_test.rb +++ b/test/whop_sdk/resources/wallets_test.rb @@ -19,10 +19,10 @@ def test_list end end - def test_balance + def test_balance_required_params skip("Mock server tests are disabled") - response = @whop.wallets.balance("account_id") + response = @whop.wallets.balance(account_id: "account_id") assert_pattern do response => WhopSDK::Models::WalletBalanceResponse @@ -40,7 +40,7 @@ def test_balance def test_send__required_params skip("Mock server tests are disabled") - response = @whop.wallets.send_("account_id", amount: "amount", to: "to") + response = @whop.wallets.send_(account_id: "account_id", amount: "amount", to: "to") assert_pattern do response => WhopSDK::Models::WalletSendResponse From 0cdf737265afc90453b6780bc573a7e5135c0bae Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 8 Jun 2026 23:40:09 +0000 Subject: [PATCH 10/17] feat(ads): forward custom pixel events to Meta CAPI (ENG-23505) Stainless-Generated-From: 1181825ea8bdb6d5b24935fe9f8b78026250279a --- lib/whop_sdk/models/conversion_create_params.rb | 4 ++-- lib/whop_sdk/resources/conversions.rb | 2 +- rbi/whop_sdk/models/conversion_create_params.rbi | 4 ++-- rbi/whop_sdk/resources/conversions.rbi | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/whop_sdk/models/conversion_create_params.rb b/lib/whop_sdk/models/conversion_create_params.rb index ce351709..2e89ae5e 100644 --- a/lib/whop_sdk/models/conversion_create_params.rb +++ b/lib/whop_sdk/models/conversion_create_params.rb @@ -38,7 +38,7 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel optional :currency, enum: -> { WhopSDK::Currency }, nil?: true # @!attribute custom_name - # Custom event name when event_name is 'custom'. + # Custom event name when event_name is 'custom'. Maximum 35 chars for this value. # # @return [String, nil] optional :custom_name, String, nil?: true @@ -130,7 +130,7 @@ class ConversionCreateParams < WhopSDK::Internal::Type::BaseModel # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # - # @param custom_name [String, nil] Custom event name when event_name is 'custom'. + # @param custom_name [String, nil] Custom event name when event_name is 'custom'. Maximum 35 chars for this value. # # @param duration [Integer, nil] For 'leave' events: milliseconds the visitor spent on the page. # diff --git a/lib/whop_sdk/resources/conversions.rb b/lib/whop_sdk/resources/conversions.rb index c339040c..27d80a3e 100644 --- a/lib/whop_sdk/resources/conversions.rb +++ b/lib/whop_sdk/resources/conversions.rb @@ -25,7 +25,7 @@ class Conversions # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # - # @param custom_name [String, nil] Custom event name when event_name is 'custom'. + # @param custom_name [String, nil] Custom event name when event_name is 'custom'. Maximum 35 chars for this value. # # @param duration [Integer, nil] For 'leave' events: milliseconds the visitor spent on the page. # diff --git a/rbi/whop_sdk/models/conversion_create_params.rbi b/rbi/whop_sdk/models/conversion_create_params.rbi index 619f43aa..028779ab 100644 --- a/rbi/whop_sdk/models/conversion_create_params.rbi +++ b/rbi/whop_sdk/models/conversion_create_params.rbi @@ -42,7 +42,7 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } attr_accessor :currency - # Custom event name when event_name is 'custom'. + # Custom event name when event_name is 'custom'. Maximum 35 chars for this value. sig { returns(T.nilable(String)) } attr_accessor :custom_name @@ -137,7 +137,7 @@ module WhopSDK context: nil, # The available currencies on the platform currency: nil, - # Custom event name when event_name is 'custom'. + # Custom event name when event_name is 'custom'. Maximum 35 chars for this value. custom_name: nil, # For 'leave' events: milliseconds the visitor spent on the page. duration: nil, diff --git a/rbi/whop_sdk/resources/conversions.rbi b/rbi/whop_sdk/resources/conversions.rbi index 3b09d09b..bab59cca 100644 --- a/rbi/whop_sdk/resources/conversions.rbi +++ b/rbi/whop_sdk/resources/conversions.rbi @@ -44,7 +44,7 @@ module WhopSDK context: nil, # The available currencies on the platform currency: nil, - # Custom event name when event_name is 'custom'. + # Custom event name when event_name is 'custom'. Maximum 35 chars for this value. custom_name: nil, # For 'leave' events: milliseconds the visitor spent on the page. duration: nil, From 5eb3311cac5558e64914b98ac10e22b21c64ed6e Mon Sep 17 00:00:00 2001 From: danielschwartz4 <52050264+danielschwartz4@users.noreply.github.com> Date: Mon, 8 Jun 2026 17:55:09 -0700 Subject: [PATCH 11/17] Build SDK Stainless-Generated-From: 9533a395badec4a949e27ba116379d711182b2f6 --- .stats.yml | 2 +- README.md | 4 +- lib/whop_sdk.rb | 5 +- lib/whop_sdk/client.rb | 17 +- lib/whop_sdk/models.rb | 4 + lib/whop_sdk/models/ad_group_update_params.rb | 10 +- .../models/financial_activity_list_params.rb | 78 ++ .../financial_activity_list_response.rb | 581 +++++++++ lib/whop_sdk/models/swap_create_params.rb | 4 +- lib/whop_sdk/models/swap_retrieve_params.rb | 4 +- lib/whop_sdk/models/user.rb | 58 +- .../models/user_check_access_response.rb | 25 +- lib/whop_sdk/models/user_list_params.rb | 30 +- lib/whop_sdk/models/user_list_response.rb | 83 -- lib/whop_sdk/models/user_retrieve_params.rb | 12 +- lib/whop_sdk/models/user_update_me_params.rb | 54 + lib/whop_sdk/models/user_update_params.rb | 57 +- lib/whop_sdk/models/wallet_balance_params.rb | 4 +- lib/whop_sdk/models/wallet_send_params.rb | 3 +- lib/whop_sdk/resources/ad_groups.rb | 4 +- lib/whop_sdk/resources/financial_activity.rb | 54 + lib/whop_sdk/resources/swaps.rb | 21 +- lib/whop_sdk/resources/users.rb | 89 +- lib/whop_sdk/resources/wallets.rb | 31 +- rbi/whop_sdk/client.rbi | 13 +- rbi/whop_sdk/models.rbi | 4 + .../models/ad_group_update_params.rbi | 8 + .../models/financial_activity_list_params.rbi | 126 ++ .../financial_activity_list_response.rbi | 1160 +++++++++++++++++ rbi/whop_sdk/models/swap_create_params.rbi | 4 +- rbi/whop_sdk/models/swap_retrieve_params.rbi | 7 +- rbi/whop_sdk/models/user.rbi | 75 +- .../models/user_check_access_response.rbi | 58 +- rbi/whop_sdk/models/user_list_params.rbi | 65 +- rbi/whop_sdk/models/user_list_response.rbi | 124 -- rbi/whop_sdk/models/user_retrieve_params.rbi | 19 +- rbi/whop_sdk/models/user_update_me_params.rbi | 107 ++ rbi/whop_sdk/models/user_update_params.rbi | 91 +- rbi/whop_sdk/models/wallet_balance_params.rbi | 7 +- rbi/whop_sdk/models/wallet_send_params.rbi | 2 + rbi/whop_sdk/resources/ad_groups.rbi | 3 + rbi/whop_sdk/resources/financial_activity.rbi | 50 + rbi/whop_sdk/resources/swaps.rbi | 12 +- rbi/whop_sdk/resources/users.rbi | 105 +- rbi/whop_sdk/resources/wallets.rbi | 10 +- sig/whop_sdk/client.rbs | 5 + sig/whop_sdk/models.rbs | 4 + .../models/ad_group_update_params.rbs | 7 +- .../models/financial_activity_list_params.rbs | 77 ++ .../financial_activity_list_response.rbs | 569 ++++++++ sig/whop_sdk/models/user.rbs | 26 +- .../models/user_check_access_response.rbs | 23 +- sig/whop_sdk/models/user_list_params.rbs | 50 +- sig/whop_sdk/models/user_list_response.rbs | 55 - sig/whop_sdk/models/user_retrieve_params.rbs | 10 +- sig/whop_sdk/models/user_update_me_params.rbs | 67 + sig/whop_sdk/models/user_update_params.rbs | 47 +- sig/whop_sdk/resources/ad_groups.rbs | 1 + sig/whop_sdk/resources/financial_activity.rbs | 19 + sig/whop_sdk/resources/swaps.rbs | 2 +- sig/whop_sdk/resources/users.rbs | 30 +- sig/whop_sdk/resources/wallets.rbs | 4 +- .../resources/financial_activity_test.rb | 22 + test/whop_sdk/resources/swaps_test.rb | 4 +- test/whop_sdk/resources/users_test.rb | 43 +- test/whop_sdk/resources/wallets_test.rb | 6 +- 66 files changed, 3556 insertions(+), 799 deletions(-) create mode 100644 lib/whop_sdk/models/financial_activity_list_params.rb create mode 100644 lib/whop_sdk/models/financial_activity_list_response.rb delete mode 100644 lib/whop_sdk/models/user_list_response.rb create mode 100644 lib/whop_sdk/models/user_update_me_params.rb create mode 100644 lib/whop_sdk/resources/financial_activity.rb create mode 100644 rbi/whop_sdk/models/financial_activity_list_params.rbi create mode 100644 rbi/whop_sdk/models/financial_activity_list_response.rbi delete mode 100644 rbi/whop_sdk/models/user_list_response.rbi create mode 100644 rbi/whop_sdk/models/user_update_me_params.rbi create mode 100644 rbi/whop_sdk/resources/financial_activity.rbi create mode 100644 sig/whop_sdk/models/financial_activity_list_params.rbs create mode 100644 sig/whop_sdk/models/financial_activity_list_response.rbs delete mode 100644 sig/whop_sdk/models/user_list_response.rbs create mode 100644 sig/whop_sdk/models/user_update_me_params.rbs create mode 100644 sig/whop_sdk/resources/financial_activity.rbs create mode 100644 test/whop_sdk/resources/financial_activity_test.rb diff --git a/.stats.yml b/.stats.yml index a9737a87..cd5b9cf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 228 +configured_endpoints: 230 diff --git a/README.md b/README.md index a8bc85a4..1c1ddca5 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ It is generated with [Stainless](https://www.stainless.com/). Use the Whop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40whop%2Fmcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3aG9wL21jcCJdLCJlbnYiOnsiV0hPUF9BUElfS0VZIjoiTXkgQVBJIEtleSIsIldIT1BfV0VCSE9PS19TRUNSRVQiOiJNeSBXZWJob29rIEtleSIsIldIT1BfQVBQX0lEIjoiYXBwX3h4eHh4eHh4eHh4eHh4In19) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40whop%2Fmcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40whop%2Fmcp%22%5D%2C%22env%22%3A%7B%22WHOP_API_KEY%22%3A%22My%20API%20Key%22%2C%22WHOP_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Key%22%2C%22WHOP_APP_ID%22%3A%22app_xxxxxxxxxxxxxx%22%7D%7D) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40whop%2Fmcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3aG9wL21jcCJdLCJlbnYiOnsiV0hPUF9BUElfS0VZIjoiTXkgQVBJIEtleSIsIldIT1BfV0VCSE9PS19TRUNSRVQiOiJNeSBXZWJob29rIEtleSIsIldIT1BfQVBQX0lEIjoiYXBwX3h4eHh4eHh4eHh4eHh4IiwiV0hPUF9BUElfVkVSU0lPTiI6IjIwMjYtMDYtMDgifX0) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40whop%2Fmcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40whop%2Fmcp%22%5D%2C%22env%22%3A%7B%22WHOP_API_KEY%22%3A%22My%20API%20Key%22%2C%22WHOP_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Key%22%2C%22WHOP_APP_ID%22%3A%22app_xxxxxxxxxxxxxx%22%2C%22WHOP_API_VERSION%22%3A%222026-06-08%22%7D%7D) > Note: You may need to set environment variables in your MCP client. diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index c75c92cd..09f4c849 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -311,6 +311,8 @@ require_relative "whop_sdk/models/file_retrieve_params" require_relative "whop_sdk/models/file_retrieve_response" require_relative "whop_sdk/models/file_visibility" +require_relative "whop_sdk/models/financial_activity_list_params" +require_relative "whop_sdk/models/financial_activity_list_response" require_relative "whop_sdk/models/forum" require_relative "whop_sdk/models/forum_list_params" require_relative "whop_sdk/models/forum_list_response" @@ -532,8 +534,8 @@ require_relative "whop_sdk/models/user_check_access_params" require_relative "whop_sdk/models/user_check_access_response" require_relative "whop_sdk/models/user_list_params" -require_relative "whop_sdk/models/user_list_response" require_relative "whop_sdk/models/user_retrieve_params" +require_relative "whop_sdk/models/user_update_me_params" require_relative "whop_sdk/models/user_update_params" require_relative "whop_sdk/models/verification_error_code" require_relative "whop_sdk/models/verification_list_params" @@ -609,6 +611,7 @@ require_relative "whop_sdk/resources/experiences" require_relative "whop_sdk/resources/fee_markups" require_relative "whop_sdk/resources/files" +require_relative "whop_sdk/resources/financial_activity" require_relative "whop_sdk/resources/forum_posts" require_relative "whop_sdk/resources/forums" require_relative "whop_sdk/resources/invoices" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index cb51edf1..3b786bb3 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -29,6 +29,11 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [String, nil] attr_reader :app_id + # Pins the API version (an ISO date). Defaults to the latest version the SDK was + # generated against. + # @return [String, nil] + attr_reader :version + # Static public key (PEM or JWK JSON) used by {#verify_user_token} to # verify user tokens. When set, the SDK skips remote JWKS fetching. # Prefer {#user_token_jwks_url} (or the default) so key rotation is @@ -113,7 +118,6 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::ChatChannels] attr_reader :chat_channels - # Users # @return [WhopSDK::Resources::Users] attr_reader :users @@ -195,6 +199,9 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::Wallets] attr_reader :wallets + # @return [WhopSDK::Resources::FinancialActivity] + attr_reader :financial_activity + # @return [WhopSDK::Resources::Swaps] attr_reader :swaps @@ -309,6 +316,9 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @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"]` # + # @param version [String, nil] Pins the API version (an ISO date). Defaults to the latest version the SDK was + # generated against. Defaults to `ENV["WHOP_API_VERSION"]` + # # @param user_token_public_key [String, nil] Static public key (PEM or JWK JSON) used to verify # user tokens. When set, {#verify_user_token} skips remote JWKS fetching. # Defaults to `ENV["WHOP_USER_TOKEN_PUBLIC_KEY"]` @@ -330,6 +340,7 @@ def initialize( api_key: ENV["WHOP_API_KEY"], webhook_key: ENV["WHOP_WEBHOOK_SECRET"], app_id: ENV["WHOP_APP_ID"], + version: ENV.fetch("WHOP_API_VERSION", "2026-06-08"), user_token_public_key: ENV["WHOP_USER_TOKEN_PUBLIC_KEY"], user_token_jwks_url: ENV["WHOP_USER_TOKEN_JWKS_URL"], base_url: ENV["WHOP_BASE_URL"], @@ -345,7 +356,8 @@ def initialize( end headers = { - "x-whop-app-id" => (@app_id = app_id&.to_s) + "x-whop-app-id" => (@app_id = app_id&.to_s), + "api-version-date" => (@version = version.to_s) } custom_headers_env = ENV["WHOP_CUSTOM_HEADERS"] unless custom_headers_env.nil? @@ -412,6 +424,7 @@ def initialize( @account_links = WhopSDK::Resources::AccountLinks.new(client: self) @accounts = WhopSDK::Resources::Accounts.new(client: self) @wallets = WhopSDK::Resources::Wallets.new(client: self) + @financial_activity = WhopSDK::Resources::FinancialActivity.new(client: self) @swaps = WhopSDK::Resources::Swaps.new(client: self) @deposits = WhopSDK::Resources::Deposits.new(client: self) @setup_intents = WhopSDK::Resources::SetupIntents.new(client: self) diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index abb3ef53..3d6b7cce 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -418,6 +418,8 @@ module WhopSDK FileVisibility = WhopSDK::Models::FileVisibility + FinancialActivityListParams = WhopSDK::Models::FinancialActivityListParams + Forum = WhopSDK::Models::Forum ForumListParams = WhopSDK::Models::ForumListParams @@ -777,6 +779,8 @@ module WhopSDK UserRetrieveParams = WhopSDK::Models::UserRetrieveParams + UserUpdateMeParams = WhopSDK::Models::UserUpdateMeParams + UserUpdateParams = WhopSDK::Models::UserUpdateParams VerificationErrorCode = WhopSDK::Models::VerificationErrorCode diff --git a/lib/whop_sdk/models/ad_group_update_params.rb b/lib/whop_sdk/models/ad_group_update_params.rb index c97be738..729a9f53 100644 --- a/lib/whop_sdk/models/ad_group_update_params.rb +++ b/lib/whop_sdk/models/ad_group_update_params.rb @@ -54,7 +54,13 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::AdGroupStatus, nil] optional :status, enum: -> { WhopSDK::AdGroupStatus }, nil?: true - # @!method initialize(id:, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, request_options: {}) + # @!attribute title + # Human-readable ad group title. + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!method initialize(id:, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, title: nil, request_options: {}) # @param id [String] # # @param budget [Float, nil] Budget amount in dollars. @@ -71,6 +77,8 @@ class AdGroupUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. # + # @param title [String, nil] Human-readable ad group title. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] class Config < WhopSDK::Internal::Type::BaseModel diff --git a/lib/whop_sdk/models/financial_activity_list_params.rb b/lib/whop_sdk/models/financial_activity_list_params.rb new file mode 100644 index 00000000..54252781 --- /dev/null +++ b/lib/whop_sdk/models/financial_activity_list_params.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::FinancialActivity#list + class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute account_id + # The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @return [String, nil] + optional :account_id, String + + # @!attribute currency + # Optional currency code filter, for example usd. + # + # @return [String, nil] + optional :currency, String + + # @!attribute cursor + # Cursor returned by the previous page. + # + # @return [String, nil] + optional :cursor, String + + # @!attribute limit + # Maximum number of rows to return. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute line_types + # Optional ledger line categories to include. + # + # @return [Array, nil] + optional :line_types, WhopSDK::Internal::Type::ArrayOf[String] + + # @!attribute posted_after + # Only include rows posted after this ISO 8601 timestamp. + # + # @return [Time, nil] + optional :posted_after, Time + + # @!attribute posted_before + # Only include rows posted before this ISO 8601 timestamp. + # + # @return [Time, nil] + optional :posted_before, Time + + # @!attribute user_id + # The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @return [String, nil] + optional :user_id, String + + # @!method initialize(account_id: nil, currency: nil, cursor: nil, limit: nil, line_types: nil, posted_after: nil, posted_before: nil, user_id: nil, request_options: {}) + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param currency [String] Optional currency code filter, for example usd. + # + # @param cursor [String] Cursor returned by the previous page. + # + # @param limit [Integer] Maximum number of rows to return. + # + # @param line_types [Array] Optional ledger line categories to include. + # + # @param posted_after [Time] Only include rows posted after this ISO 8601 timestamp. + # + # @param posted_before [Time] Only include rows posted before this ISO 8601 timestamp. + # + # @param user_id [String] The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/financial_activity_list_response.rb b/lib/whop_sdk/models/financial_activity_list_response.rb new file mode 100644 index 00000000..77bfd25d --- /dev/null +++ b/lib/whop_sdk/models/financial_activity_list_response.rb @@ -0,0 +1,581 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::FinancialActivity#list + class FinancialActivityListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::FinancialActivityListResponse::Data] } + + # @!attribute page_info + # + # @return [WhopSDK::Models::FinancialActivityListResponse::PageInfo] + required :page_info, -> { WhopSDK::Models::FinancialActivityListResponse::PageInfo } + + # @!method initialize(data:, page_info:) + # @param data [Array] + # @param page_info [WhopSDK::Models::FinancialActivityListResponse::PageInfo] + + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute amount + # Signed amount in the currency's smallest precision units. + # + # @return [String] + required :amount, String + + # @!attribute currency + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] + required :currency, -> { WhopSDK::Models::FinancialActivityListResponse::Data::Currency } + + # @!attribute line_type + # + # @return [String] + required :line_type, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Object] + required :object, enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Object } + + # @!attribute posted_at + # + # @return [Time] + required :posted_at, Time + + # @!attribute resource + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, nil] + required :resource, + union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource }, + nil?: true + + # @!attribute source + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Source, nil] + required :source, -> { WhopSDK::Models::FinancialActivityListResponse::Data::Source }, nil?: true + + # @!method initialize(id:, amount:, currency:, line_type:, object:, posted_at:, resource:, source:) + # @param id [String] + # + # @param amount [String] Signed amount in the currency's smallest precision units. + # + # @param currency [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] + # + # @param line_type [String] + # + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Object] + # + # @param posted_at [Time] + # + # @param resource [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, nil] + # + # @param source [WhopSDK::Models::FinancialActivityListResponse::Data::Source, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#currency + class Currency < WhopSDK::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute precision + # Precision factor for the currency, for example 100000000 for USD. + # + # @return [String] + required :precision, String + + # @!method initialize(code:, precision:) + # @param code [String] + # + # @param precision [String] Precision factor for the currency, for example 100000000 for USD. + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#object + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACTIVITY = :ledger_activity + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#resource + module Resource + extend WhopSDK::Internal::Type::Union + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute logo_url + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object } + + # @!attribute route + # + # @return [String, nil] + required :route, String, nil?: true + + # @!attribute title + # + # @return [String, nil] + required :title, String, nil?: true + + # @!method initialize(id:, logo_url:, object:, route:, title:) + # @param id [String] + # @param logo_url [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object] + # @param route [String, nil] + # @param title [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0#object + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT = :account + + # @!method self.values + # @return [Array] + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object } + + # @!attribute profile_picture_url + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!method initialize(id:, name:, object:, profile_picture_url:, username:) + # @param id [String] + # @param name [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object] + # @param profile_picture_url [String, nil] + # @param username [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1#object + module Object + extend WhopSDK::Internal::Type::Enum + + USER = :user + + # @!method self.values + # @return [Array] + end + end + + class UnionMember2 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object } + + # @!attribute owner + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, nil] + required :owner, + union: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner }, + nil?: true + + # @!method initialize(id:, object:, owner:) + # @param id [String] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object] + # @param owner [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2#object + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACCOUNT = :ledger_account + + # @!method self.values + # @return [Array] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2#owner + module Owner + extend WhopSDK::Internal::Type::Union + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0 } + + variant -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute logo_url + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object } + + # @!attribute route + # + # @return [String, nil] + required :route, String, nil?: true + + # @!attribute title + # + # @return [String, nil] + required :title, String, nil?: true + + # @!method initialize(id:, logo_url:, object:, route:, title:) + # @param id [String] + # @param logo_url [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object] + # @param route [String, nil] + # @param title [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0#object + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT = :account + + # @!method self.values + # @return [Array] + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object } + + # @!attribute profile_picture_url + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!method initialize(id:, name:, object:, profile_picture_url:, username:) + # @param id [String] + # @param name [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object] + # @param profile_picture_url [String, nil] + # @param username [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1#object + module Object + extend WhopSDK::Internal::Type::Enum + + USER = :user + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1)] + end + end + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute bank + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, nil] + required :bank, + -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank }, + nil?: true + + # @!attribute card + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, nil] + required :card, + -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card }, + nil?: true + + # @!attribute email_identifier + # + # @return [String, nil] + required :email_identifier, String, nil?: true + + # @!attribute gateway_type + # + # @return [String, nil] + required :gateway_type, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object } + + # @!attribute payment_method_type + # + # @return [String, nil] + required :payment_method_type, String, nil?: true + + # @!method initialize(id:, bank:, card:, email_identifier:, gateway_type:, object:, payment_method_type:) + # @param id [String] + # @param bank [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, nil] + # @param card [WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, nil] + # @param email_identifier [String, nil] + # @param gateway_type [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object] + # @param payment_method_type [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#bank + class Bank < WhopSDK::Internal::Type::BaseModel + # @!attribute account_name + # + # @return [String, nil] + required :account_name, String, nil?: true + + # @!attribute account_type + # + # @return [String, nil] + required :account_type, String, nil?: true + + # @!attribute bank_name + # + # @return [String, nil] + required :bank_name, String, nil?: true + + # @!attribute last4 + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!method initialize(account_name:, account_type:, bank_name:, last4:) + # @param account_name [String, nil] + # @param account_type [String, nil] + # @param bank_name [String, nil] + # @param last4 [String, nil] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#card + class Card < WhopSDK::Internal::Type::BaseModel + # @!attribute brand + # + # @return [String, nil] + required :brand, String, nil?: true + + # @!attribute exp_month + # + # @return [Integer, nil] + required :exp_month, Integer, nil?: true + + # @!attribute exp_year + # + # @return [Integer, nil] + required :exp_year, Integer, nil?: true + + # @!attribute last4 + # + # @return [String, nil] + required :last4, String, nil?: true + + # @!method initialize(brand:, exp_month:, exp_year:, last4:) + # @param brand [String, nil] + # @param exp_month [Integer, nil] + # @param exp_year [Integer, nil] + # @param last4 [String, nil] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3#object + module Object + extend WhopSDK::Internal::Type::Enum + + PAYMENT_METHOD = :payment_method + + # @!method self.values + # @return [Array] + end + end + + class UnionMember4 < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute account_reference + # + # @return [String, nil] + required :account_reference, String, nil?: true + + # @!attribute destination_currency_code + # + # @return [String, nil] + required :destination_currency_code, String, nil?: true + + # @!attribute institution_name + # + # @return [String, nil] + required :institution_name, String, nil?: true + + # @!attribute nickname + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!attribute object + # + # @return [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object] + required :object, + enum: -> { WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object } + + # @!attribute provider + # + # @return [String, nil] + required :provider, String, nil?: true + + # @!method initialize(id:, account_reference:, destination_currency_code:, institution_name:, nickname:, object:, provider:) + # @param id [String] + # @param account_reference [String, nil] + # @param destination_currency_code [String, nil] + # @param institution_name [String, nil] + # @param nickname [String, nil] + # @param object [Symbol, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object] + # @param provider [String, nil] + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4#object + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT_METHOD = :payout_method + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4)] + end + + # @see WhopSDK::Models::FinancialActivityListResponse::Data#source + class Source < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute object + # + # @return [String] + required :object, String + + # @!method initialize(id:, object:) + # @param id [String] + # @param object [String] + end + end + + # @see WhopSDK::Models::FinancialActivityListResponse#page_info + class PageInfo < WhopSDK::Internal::Type::BaseModel + # @!attribute end_cursor + # + # @return [String, nil] + required :end_cursor, String, nil?: true + + # @!attribute has_next_page + # + # @return [Boolean] + required :has_next_page, WhopSDK::Internal::Type::Boolean + + # @!attribute has_previous_page + # + # @return [Boolean] + required :has_previous_page, WhopSDK::Internal::Type::Boolean + + # @!attribute start_cursor + # + # @return [String, nil] + required :start_cursor, String, nil?: true + + # @!method initialize(end_cursor:, has_next_page:, has_previous_page:, start_cursor:) + # @param end_cursor [String, nil] + # @param has_next_page [Boolean] + # @param has_previous_page [Boolean] + # @param start_cursor [String, nil] + end + end + end +end diff --git a/lib/whop_sdk/models/swap_create_params.rb b/lib/whop_sdk/models/swap_create_params.rb index 0d4ae643..df65c8bb 100644 --- a/lib/whop_sdk/models/swap_create_params.rb +++ b/lib/whop_sdk/models/swap_create_params.rb @@ -8,7 +8,7 @@ class SwapCreateParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute account_id - # The business or user account ID whose wallet should execute the swap. + # Business or user account ID (biz*\* / user*\*). # # @return [String] required :account_id, String @@ -47,7 +47,7 @@ class SwapCreateParams < WhopSDK::Internal::Type::BaseModel optional :to_chain, union: -> { WhopSDK::SwapCreateParams::ToChain }, nil?: true # @!method initialize(account_id:, amount:, from_token:, to_token:, from_chain: nil, slippage_bps: nil, to_chain: nil, request_options: {}) - # @param account_id [String] The business or user account ID whose wallet should execute the swap. + # @param account_id [String] Business or user account ID (biz*\* / user*\*). # # @param amount [String] Input token amount. # diff --git a/lib/whop_sdk/models/swap_retrieve_params.rb b/lib/whop_sdk/models/swap_retrieve_params.rb index 64ee4d3b..1642d38c 100644 --- a/lib/whop_sdk/models/swap_retrieve_params.rb +++ b/lib/whop_sdk/models/swap_retrieve_params.rb @@ -8,12 +8,14 @@ class SwapRetrieveParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute account_id + # Business or user account ID (biz*\* / user*\*). # # @return [String] required :account_id, String # @!method initialize(account_id:, request_options: {}) - # @param account_id [String] + # @param account_id [String] Business or user account ID (biz*\* / user*\*). + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/user.rb b/lib/whop_sdk/models/user.rb index ac61f84c..76bb8412 100644 --- a/lib/whop_sdk/models/user.rb +++ b/lib/whop_sdk/models/user.rb @@ -5,79 +5,53 @@ module Models # @see WhopSDK::Resources::Users#retrieve class User < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for the user. + # The ID of the user, which will look like user\_******\******* # # @return [String] required :id, String # @!attribute bio - # A short biography written by the user, displayed on their public profile. + # The user's biography # # @return [String, nil] required :bio, String, nil?: true # @!attribute created_at - # The datetime the user was created. + # When the user was created, as an ISO 8601 timestamp # - # @return [Time] - required :created_at, Time + # @return [String] + required :created_at, String # @!attribute name - # The user's display name shown on their public profile. + # The user's display name # # @return [String, nil] required :name, String, nil?: true # @!attribute profile_picture - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. + # The user's profile picture, an object with a url # - # @return [WhopSDK::Models::User::ProfilePicture, nil] - required :profile_picture, -> { WhopSDK::User::ProfilePicture }, nil?: true + # @return [Object, nil] + required :profile_picture, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute username - # The user's unique username shown on their public profile. + # The user's unique username # # @return [String] required :username, String # @!method initialize(id:, bio:, created_at:, name:, profile_picture:, username:) - # Some parameter documentations has been truncated, see {WhopSDK::Models::User} - # for more details. - # - # A user account on Whop. Contains profile information, identity details, and - # social connections. - # - # @param id [String] The unique identifier for the user. + # @param id [String] The ID of the user, which will look like user\_******\******* # - # @param bio [String, nil] A short biography written by the user, displayed on their public profile. + # @param bio [String, nil] The user's biography # - # @param created_at [Time] The datetime the user was created. + # @param created_at [String] When the user was created, as an ISO 8601 timestamp # - # @param name [String, nil] The user's display name shown on their public profile. + # @param name [String, nil] The user's display name # - # @param profile_picture [WhopSDK::Models::User::ProfilePicture, nil] The user's profile picture attachment with URL, content type, and file metadata. + # @param profile_picture [Object, nil] The user's profile picture, an object with a url # - # @param username [String] The user's unique username shown on their public profile. - - # @see WhopSDK::Models::User#profile_picture - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - # @!attribute url - # A pre-optimized URL for rendering this attachment on the client. This should be - # used for displaying attachments in apps. - # - # @return [String, nil] - required :url, String, nil?: true - - # @!method initialize(url:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::User::ProfilePicture} for more details. - # - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - # - # @param url [String, nil] A pre-optimized URL for rendering this attachment on the client. This should be - end + # @param username [String] The user's unique username end end end diff --git a/lib/whop_sdk/models/user_check_access_response.rb b/lib/whop_sdk/models/user_check_access_response.rb index b10b8924..09101375 100644 --- a/lib/whop_sdk/models/user_check_access_response.rb +++ b/lib/whop_sdk/models/user_check_access_response.rb @@ -5,23 +5,30 @@ module Models # @see WhopSDK::Resources::Users#check_access class UserCheckAccessResponse < WhopSDK::Internal::Type::BaseModel # @!attribute access_level - # The permission level of the user # - # @return [Symbol, WhopSDK::Models::AccessLevel] - required :access_level, enum: -> { WhopSDK::AccessLevel } + # @return [Symbol, WhopSDK::Models::UserCheckAccessResponse::AccessLevel] + required :access_level, enum: -> { WhopSDK::Models::UserCheckAccessResponse::AccessLevel } # @!attribute has_access - # Whether the user has access to the resource # # @return [Boolean] required :has_access, WhopSDK::Internal::Type::Boolean # @!method initialize(access_level:, has_access:) - # The result of a has access check for the developer API - # - # @param access_level [Symbol, WhopSDK::Models::AccessLevel] The permission level of the user - # - # @param has_access [Boolean] Whether the user has access to the resource + # @param access_level [Symbol, WhopSDK::Models::UserCheckAccessResponse::AccessLevel] + # @param has_access [Boolean] + + # @see WhopSDK::Models::UserCheckAccessResponse#access_level + module AccessLevel + extend WhopSDK::Internal::Type::Enum + + NO_ACCESS = :no_access + ADMIN = :admin + CUSTOMER = :customer + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/user_list_params.rb b/lib/whop_sdk/models/user_list_params.rb index 626420a0..031f5ba0 100644 --- a/lib/whop_sdk/models/user_list_params.rb +++ b/lib/whop_sdk/models/user_list_params.rb @@ -8,45 +8,45 @@ class UserListParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns users after this position. # # @return [String, nil] - optional :after, String, nil?: true + optional :after, String # @!attribute before - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns users before this position. # # @return [String, nil] - optional :before, String, nil?: true + optional :before, String # @!attribute first - # Returns the first _n_ elements from the list. + # The number of users to return (max 50). # # @return [Integer, nil] - optional :first, Integer, nil?: true + optional :first, Integer # @!attribute last - # Returns the last _n_ elements from the list. + # The number of users to return from the end of the range. # # @return [Integer, nil] - optional :last, Integer, nil?: true + optional :last, Integer # @!attribute query - # Search term to filter by name or username. + # A search term to filter users by name or username. # # @return [String, nil] - optional :query, String, nil?: true + optional :query, String # @!method initialize(after: nil, before: nil, first: nil, last: nil, query: nil, request_options: {}) - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] A cursor; returns users after this position. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] A cursor; returns users before this position. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param first [Integer] The number of users to return (max 50). # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param last [Integer] The number of users to return from the end of the range. # - # @param query [String, nil] Search term to filter by name or username. + # @param query [String] A search term to filter users by name or username. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/user_list_response.rb b/lib/whop_sdk/models/user_list_response.rb deleted file mode 100644 index 61a3ea65..00000000 --- a/lib/whop_sdk/models/user_list_response.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -module WhopSDK - module Models - # @see WhopSDK::Resources::Users#list - class UserListResponse < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the user. - # - # @return [String] - required :id, String - - # @!attribute bio - # A short biography written by the user, displayed on their public profile. - # - # @return [String, nil] - required :bio, String, nil?: true - - # @!attribute created_at - # The datetime the user was created. - # - # @return [Time] - required :created_at, Time - - # @!attribute name - # The user's display name shown on their public profile. - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute profile_picture - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - # - # @return [WhopSDK::Models::UserListResponse::ProfilePicture, nil] - required :profile_picture, -> { WhopSDK::Models::UserListResponse::ProfilePicture }, nil?: true - - # @!attribute username - # The user's unique username shown on their public profile. - # - # @return [String] - required :username, String - - # @!method initialize(id:, bio:, created_at:, name:, profile_picture:, username:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::UserListResponse} for more details. - # - # A user account on Whop. Contains profile information, identity details, and - # social connections. - # - # @param id [String] The unique identifier for the user. - # - # @param bio [String, nil] A short biography written by the user, displayed on their public profile. - # - # @param created_at [Time] The datetime the user was created. - # - # @param name [String, nil] The user's display name shown on their public profile. - # - # @param profile_picture [WhopSDK::Models::UserListResponse::ProfilePicture, nil] The user's profile picture attachment with URL, content type, and file metadata. - # - # @param username [String] The user's unique username shown on their public profile. - - # @see WhopSDK::Models::UserListResponse#profile_picture - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - # @!attribute url - # A pre-optimized URL for rendering this attachment on the client. This should be - # used for displaying attachments in apps. - # - # @return [String, nil] - required :url, String, nil?: true - - # @!method initialize(url:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::UserListResponse::ProfilePicture} for more details. - # - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - # - # @param url [String, nil] A pre-optimized URL for rendering this attachment on the client. This should be - end - end - end -end diff --git a/lib/whop_sdk/models/user_retrieve_params.rb b/lib/whop_sdk/models/user_retrieve_params.rb index 2de9f977..7e07865a 100644 --- a/lib/whop_sdk/models/user_retrieve_params.rb +++ b/lib/whop_sdk/models/user_retrieve_params.rb @@ -12,20 +12,20 @@ class UserRetrieveParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!attribute company_id - # When provided, returns the user's company-specific profile overrides (name, - # profile picture) instead of their global profile. + # @!attribute account_id + # When set, returns the user's account-specific profile overrides for this + # account. # # @return [String, nil] - optional :company_id, String, nil?: true + optional :account_id, String - # @!method initialize(id:, company_id: nil, request_options: {}) + # @!method initialize(id:, account_id: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::UserRetrieveParams} for more details. # # @param id [String] # - # @param company_id [String, nil] When provided, returns the user's company-specific profile overrides (name, prof + # @param account_id [String] When set, returns the user's account-specific profile overrides for this account # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/whop_sdk/models/user_update_me_params.rb b/lib/whop_sdk/models/user_update_me_params.rb new file mode 100644 index 00000000..fd2c1e8a --- /dev/null +++ b/lib/whop_sdk/models/user_update_me_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Users#update_me + class UserUpdateMeParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute bio + # + # @return [String, nil] + optional :bio, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute profile_picture + # + # @return [WhopSDK::Models::UserUpdateMeParams::ProfilePicture, nil] + optional :profile_picture, -> { WhopSDK::UserUpdateMeParams::ProfilePicture } + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) + # @param bio [String] + # @param name [String] + # @param profile_picture [WhopSDK::Models::UserUpdateMeParams::ProfilePicture] + # @param username [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute direct_upload_id + # + # @return [String, nil] + optional :direct_upload_id, String + + # @!method initialize(id: nil, direct_upload_id: nil) + # @param id [String] + # @param direct_upload_id [String] + end + end + end +end diff --git a/lib/whop_sdk/models/user_update_params.rb b/lib/whop_sdk/models/user_update_params.rb index 6d154d98..3fba7295 100644 --- a/lib/whop_sdk/models/user_update_params.rb +++ b/lib/whop_sdk/models/user_update_params.rb @@ -12,69 +12,32 @@ class UserUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String] required :id, String - # @!attribute bio - # A short biography displayed on the user's public profile. + # @!attribute account_id + # The account whose profile override to update. Required for API key callers. # # @return [String, nil] - optional :bio, String, nil?: true + optional :account_id, String - # @!attribute company_id - # When provided, updates the user's profile overrides for this company instead of - # the global profile. Pass name and profile_picture to set overrides, or null to - # clear them. + # @!attribute bio # # @return [String, nil] - optional :company_id, String, nil?: true + optional :bio, String # @!attribute name - # The user's display name shown on their public profile. Maximum 100 characters. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # The user's profile picture image attachment. - # - # @return [WhopSDK::Models::UserUpdateParams::ProfilePicture, nil] - optional :profile_picture, -> { WhopSDK::UserUpdateParams::ProfilePicture }, nil?: true - - # @!attribute username - # The user's unique username. Alphanumeric characters and hyphens only. Maximum 42 - # characters. # # @return [String, nil] - optional :username, String, nil?: true + optional :name, String - # @!method initialize(id:, bio: nil, company_id: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::UserUpdateParams} for more details. - # + # @!method initialize(id:, account_id: nil, bio: nil, name: nil, request_options: {}) # @param id [String] # - # @param bio [String, nil] A short biography displayed on the user's public profile. - # - # @param company_id [String, nil] When provided, updates the user's profile overrides for this company instead of + # @param account_id [String] The account whose profile override to update. Required for API key callers. # - # @param name [String, nil] The user's display name shown on their public profile. Maximum 100 characters. + # @param bio [String] # - # @param profile_picture [WhopSDK::Models::UserUpdateParams::ProfilePicture, nil] The user's profile picture image attachment. - # - # @param username [String, nil] The user's unique username. Alphanumeric characters and hyphens only. Maximum 42 + # @param name [String] # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The ID of an existing file object. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The user's profile picture image attachment. - # - # @param id [String] The ID of an existing file object. - end end end end diff --git a/lib/whop_sdk/models/wallet_balance_params.rb b/lib/whop_sdk/models/wallet_balance_params.rb index 4ae98c02..78d19466 100644 --- a/lib/whop_sdk/models/wallet_balance_params.rb +++ b/lib/whop_sdk/models/wallet_balance_params.rb @@ -8,12 +8,14 @@ class WalletBalanceParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute account_id + # The business or user account ID whose wallet balance should be returned. # # @return [String] required :account_id, String # @!method initialize(account_id:, request_options: {}) - # @param account_id [String] + # @param account_id [String] The business or user account ID whose wallet balance should be returned. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/whop_sdk/models/wallet_send_params.rb b/lib/whop_sdk/models/wallet_send_params.rb index 20f16221..1a50c385 100644 --- a/lib/whop_sdk/models/wallet_send_params.rb +++ b/lib/whop_sdk/models/wallet_send_params.rb @@ -8,6 +8,7 @@ class WalletSendParams < WhopSDK::Internal::Type::BaseModel include WhopSDK::Internal::Type::RequestParameters # @!attribute account_id + # The sending account ID. # # @return [String] required :account_id, String @@ -25,7 +26,7 @@ class WalletSendParams < WhopSDK::Internal::Type::BaseModel required :to, String # @!method initialize(account_id:, amount:, to:, request_options: {}) - # @param account_id [String] + # @param account_id [String] The sending account ID. # # @param amount [String] USDT amount to send. # diff --git a/lib/whop_sdk/resources/ad_groups.rb b/lib/whop_sdk/resources/ad_groups.rb index a26eee65..510b1ab5 100644 --- a/lib/whop_sdk/resources/ad_groups.rb +++ b/lib/whop_sdk/resources/ad_groups.rb @@ -45,7 +45,7 @@ def retrieve(id, params = {}) # - `ad_campaign:update` # - `ad_campaign:basic:read` # - # @overload update(id, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, request_options: {}) + # @overload update(id, budget: nil, budget_type: nil, config: nil, daily_budget: nil, name: nil, platform_config: nil, status: nil, title: nil, request_options: {}) # # @param id [String] The unique identifier of the ad group to update. # @@ -63,6 +63,8 @@ def retrieve(id, params = {}) # # @param status [Symbol, WhopSDK::Models::AdGroupStatus, nil] The status of an external ad group. # + # @param title [String, nil] Human-readable ad group title. + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::AdGroup] diff --git a/lib/whop_sdk/resources/financial_activity.rb b/lib/whop_sdk/resources/financial_activity.rb new file mode 100644 index 00000000..b43efc2d --- /dev/null +++ b/lib/whop_sdk/resources/financial_activity.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + class FinancialActivity + # Lists financial activity rows for a ledger account. Rows are derived from ledger + # lines and include typed resource and source objects that clients can use for + # presentation and navigation. The ledger's owner is passed as exactly one of + # account*id (a biz* identifier) or user*id (a user* identifier). + # + # @overload list(account_id: nil, currency: nil, cursor: nil, limit: nil, line_types: nil, posted_after: nil, posted_before: nil, user_id: nil, request_options: {}) + # + # @param account_id [String] The owning account ID (a biz\_ identifier). Provide this or user_id. + # + # @param currency [String] Optional currency code filter, for example usd. + # + # @param cursor [String] Cursor returned by the previous page. + # + # @param limit [Integer] Maximum number of rows to return. + # + # @param line_types [Array] Optional ledger line categories to include. + # + # @param posted_after [Time] Only include rows posted after this ISO 8601 timestamp. + # + # @param posted_before [Time] Only include rows posted before this ISO 8601 timestamp. + # + # @param user_id [String] The owning user ID (a user\_ identifier). Provide this or account_id. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::FinancialActivityListResponse] + # + # @see WhopSDK::Models::FinancialActivityListParams + def list(params = {}) + parsed, options = WhopSDK::FinancialActivityListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "financial-activity", + query: query, + model: WhopSDK::Models::FinancialActivityListResponse, + options: options + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/whop_sdk/resources/swaps.rb b/lib/whop_sdk/resources/swaps.rb index c6dba22f..809dbc0e 100644 --- a/lib/whop_sdk/resources/swaps.rb +++ b/lib/whop_sdk/resources/swaps.rb @@ -3,12 +3,12 @@ module WhopSDK module Resources class Swaps - # Executes a swap from an account's wallet. The swap runs asynchronously; poll GET - # /swaps/{account_id} for status. + # Executes a swap from the account's wallet. Runs asynchronously — poll GET + # /swaps?account_id=... for status. # # @overload create(account_id:, amount:, from_token:, to_token:, from_chain: nil, slippage_bps: nil, to_chain: nil, request_options: {}) # - # @param account_id [String] The business or user account ID whose wallet should execute the swap. + # @param account_id [String] Business or user account ID (biz*\* / user*\*). # # @param amount [String] Input token amount. # @@ -38,23 +38,26 @@ def create(params) ) end - # Returns the status of an account's in-flight or most recent swap. + # Returns the status of the account's in-flight or most recent swap. # - # @overload retrieve(account_id, request_options: {}) + # @overload retrieve(account_id:, request_options: {}) # - # @param account_id [String] The business or user account ID whose swap status should be returned. + # @param account_id [String] Business or user account ID (biz*\* / user*\*). # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::SwapRetrieveResponse] # # @see WhopSDK::Models::SwapRetrieveParams - def retrieve(account_id, params = {}) + def retrieve(params) + parsed, options = WhopSDK::SwapRetrieveParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, - path: ["swaps/%1$s", account_id], + path: "swaps", + query: query, model: WhopSDK::Models::SwapRetrieveResponse, - options: params[:request_options] + options: options ) end diff --git a/lib/whop_sdk/resources/users.rb b/lib/whop_sdk/resources/users.rb index 00ada7a2..f8caed19 100644 --- a/lib/whop_sdk/resources/users.rb +++ b/lib/whop_sdk/resources/users.rb @@ -2,18 +2,18 @@ module WhopSDK module Resources - # Users class Users # Some parameter documentations has been truncated, see # {WhopSDK::Models::UserRetrieveParams} for more details. # - # Retrieves the details of an existing user. + # Retrieves a user's public profile by user\_ tag, username, or 'me'. # - # @overload retrieve(id, company_id: nil, request_options: {}) + # @overload retrieve(id, account_id: nil, request_options: {}) # - # @param id [String] The unique identifier or username of the user. + # @param id [String] The ID of the user, which will look like user\_******\*******, a username, or + # 'me' # - # @param company_id [String, nil] When provided, returns the user's company-specific profile overrides (name, prof + # @param account_id [String] When set, returns the user's account-specific profile overrides for this account # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -35,25 +35,19 @@ def retrieve(id, params = {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::UserUpdateParams} for more details. # - # Update a user's profile by their ID. + # Updates a user. A user token updates their own global profile; an API key + # updates the user's account-specific profile override (account_id required). # - # Required permissions: + # @overload update(id, account_id: nil, bio: nil, name: nil, request_options: {}) # - # - `user:profile:update` + # @param id [String] Path param: The ID of the user, which will look like user\_******\*******, a + # usern # - # @overload update(id, bio: nil, company_id: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) + # @param account_id [String] Query param: The account whose profile override to update. Required for API key # - # @param id [String] The unique identifier of the user to update. Accepts 'me', a user tag, or a user + # @param bio [String] Body param # - # @param bio [String, nil] A short biography displayed on the user's public profile. - # - # @param company_id [String, nil] When provided, updates the user's profile overrides for this company instead of - # - # @param name [String, nil] The user's display name shown on their public profile. Maximum 100 characters. - # - # @param profile_picture [WhopSDK::Models::UserUpdateParams::ProfilePicture, nil] The user's profile picture image attachment. - # - # @param username [String, nil] The user's unique username. Alphanumeric characters and hyphens only. Maximum 42 + # @param name [String] Body param # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -61,34 +55,38 @@ def retrieve(id, params = {}) # # @see WhopSDK::Models::UserUpdateParams def update(id, params = {}) + query_params = [:account_id] parsed, options = WhopSDK::UserUpdateParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :patch, path: ["users/%1$s", id], - body: parsed, + query: query, + body: parsed.except(*query_params), model: WhopSDK::User, options: options ) end # Search for users by name or username, ranked by social proximity to the - # authenticated user. + # authenticated user. Returns the user's most recently followed users when no + # query is given. # # @overload list(after: nil, before: nil, first: nil, last: nil, query: nil, request_options: {}) # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] A cursor; returns users after this position. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] A cursor; returns users before this position. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param first [Integer] The number of users to return (max 50). # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param last [Integer] The number of users to return from the end of the range. # - # @param query [String, nil] Search term to filter by name or username. + # @param query [String] A search term to filter users by name or username. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [WhopSDK::Internal::CursorPage] + # @return [WhopSDK::Internal::CursorPage] # # @see WhopSDK::Models::UserListParams def list(params = {}) @@ -99,22 +97,19 @@ def list(params = {}) path: "users", query: query, page: WhopSDK::Internal::CursorPage, - model: WhopSDK::Models::UserListResponse, + model: WhopSDK::User, options: options ) end - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::UserCheckAccessParams} for more details. - # - # Check whether a user has access to a specific resource, and return their access - # level. + # Checks whether a user has access to a company, product, or experience the caller + # can reach. # # @overload check_access(resource_id, id:, request_options: {}) # - # @param resource_id [String] The unique identifier of the resource to check access for. Accepts a company, pr + # @param resource_id [String] A company (biz*), product (prod*), or experience (exp\_) ID. # - # @param id [String] The unique identifier or username of the user. + # @param id [String] The user\_ tag or username to check access for. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -135,6 +130,30 @@ def check_access(resource_id, params) ) end + # Updates the authenticated user's global profile. Not available to API keys. + # + # @overload update_me(bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) + # + # @param bio [String] + # @param name [String] + # @param profile_picture [WhopSDK::Models::UserUpdateMeParams::ProfilePicture] + # @param username [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::User] + # + # @see WhopSDK::Models::UserUpdateMeParams + def update_me(params = {}) + parsed, options = WhopSDK::UserUpdateMeParams.dump_request(params) + @client.request( + method: :patch, + path: "users/me", + body: parsed, + model: WhopSDK::User, + options: options + ) + end + # @api private # # @param client [WhopSDK::Client] diff --git a/lib/whop_sdk/resources/wallets.rb b/lib/whop_sdk/resources/wallets.rb index 13293f3c..4f3180b2 100644 --- a/lib/whop_sdk/resources/wallets.rb +++ b/lib/whop_sdk/resources/wallets.rb @@ -23,7 +23,7 @@ def list(params = {}) # Returns per-token balances held in an account's wallet. # - # @overload balance(account_id, request_options: {}) + # @overload balance(account_id:, request_options: {}) # # @param account_id [String] The business or user account ID whose wallet balance should be returned. # @@ -32,36 +32,45 @@ def list(params = {}) # @return [WhopSDK::Models::WalletBalanceResponse] # # @see WhopSDK::Models::WalletBalanceParams - def balance(account_id, params = {}) + def balance(params) + parsed, options = WhopSDK::WalletBalanceParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, - path: ["wallets/%1$s/balance", account_id], + path: "wallets/balance", + query: query, model: WhopSDK::Models::WalletBalanceResponse, - options: params[:request_options] + options: options ) end + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::WalletSendParams} for more details. + # # Sends USDT from an account's wallet to another Whop user or business. # - # @overload send_(account_id, amount:, to:, request_options: {}) + # @overload send_(account_id:, amount:, to:, request_options: {}) # - # @param account_id [String] The sending account ID. + # @param account_id [String] Query param: The sending account ID. # - # @param amount [String] USDT amount to send. + # @param amount [String] Body param: USDT amount to send. # - # @param to [String] Recipient user ID, business account ID, ledger account ID, or email. + # @param to [String] Body param: Recipient user ID, business account ID, ledger account ID, or email. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::WalletSendResponse] # # @see WhopSDK::Models::WalletSendParams - def send_(account_id, params) + def send_(params) + query_params = [:account_id] parsed, options = WhopSDK::WalletSendParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, - path: ["wallets/%1$s/sends", account_id], - body: parsed, + path: "wallets/send", + query: query, + body: parsed.except(*query_params), model: WhopSDK::Models::WalletSendResponse, options: options ) diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index c17c6e29..1670b8b6 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -24,6 +24,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_reader :app_id + # Pins the API version (an ISO date). Defaults to the latest version the SDK was + # generated against. + sig { returns(T.nilable(String)) } + attr_reader :version + # Apps sig { returns(WhopSDK::Resources::Apps) } attr_reader :apps @@ -96,7 +101,6 @@ module WhopSDK sig { returns(WhopSDK::Resources::ChatChannels) } attr_reader :chat_channels - # Users sig { returns(WhopSDK::Resources::Users) } attr_reader :users @@ -178,6 +182,9 @@ module WhopSDK sig { returns(WhopSDK::Resources::Wallets) } attr_reader :wallets + sig { returns(WhopSDK::Resources::FinancialActivity) } + attr_reader :financial_activity + sig { returns(WhopSDK::Resources::Swaps) } attr_reader :swaps @@ -283,6 +290,7 @@ module WhopSDK api_key: T.nilable(String), webhook_key: T.nilable(String), app_id: T.nilable(String), + version: T.nilable(String), base_url: T.nilable(String), max_retries: Integer, timeout: Float, @@ -300,6 +308,9 @@ module WhopSDK # 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"], + # Pins the API version (an ISO date). Defaults to the latest version the SDK was + # generated against. Defaults to `ENV["WHOP_API_VERSION"]` + version: ENV.fetch("WHOP_API_VERSION", "2026-06-08"), # Override the default base URL for the API, e.g., # `"https://api.example.com/v2/"`. Defaults to `ENV["WHOP_BASE_URL"]` base_url: ENV["WHOP_BASE_URL"], diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index 13b19aaa..440978c8 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -393,6 +393,8 @@ module WhopSDK FileVisibility = WhopSDK::Models::FileVisibility + FinancialActivityListParams = WhopSDK::Models::FinancialActivityListParams + Forum = WhopSDK::Models::Forum ForumListParams = WhopSDK::Models::ForumListParams @@ -774,6 +776,8 @@ module WhopSDK UserRetrieveParams = WhopSDK::Models::UserRetrieveParams + UserUpdateMeParams = WhopSDK::Models::UserUpdateMeParams + UserUpdateParams = WhopSDK::Models::UserUpdateParams VerificationErrorCode = WhopSDK::Models::VerificationErrorCode diff --git a/rbi/whop_sdk/models/ad_group_update_params.rbi b/rbi/whop_sdk/models/ad_group_update_params.rbi index e7a932e5..d7f8cf93 100644 --- a/rbi/whop_sdk/models/ad_group_update_params.rbi +++ b/rbi/whop_sdk/models/ad_group_update_params.rbi @@ -57,6 +57,10 @@ module WhopSDK sig { returns(T.nilable(WhopSDK::AdGroupStatus::OrSymbol)) } attr_accessor :status + # Human-readable ad group title. + sig { returns(T.nilable(String)) } + attr_accessor :title + sig do params( id: String, @@ -68,6 +72,7 @@ module WhopSDK platform_config: T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::OrHash), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), + title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -87,6 +92,8 @@ module WhopSDK platform_config: nil, # The status of an external ad group. status: nil, + # Human-readable ad group title. + title: nil, request_options: {} ) end @@ -103,6 +110,7 @@ module WhopSDK platform_config: T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), + title: T.nilable(String), request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/financial_activity_list_params.rbi b/rbi/whop_sdk/models/financial_activity_list_params.rbi new file mode 100644 index 00000000..de9de9f2 --- /dev/null +++ b/rbi/whop_sdk/models/financial_activity_list_params.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module WhopSDK + module Models + class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::FinancialActivityListParams, + WhopSDK::Internal::AnyHash + ) + end + + # The owning account ID (a biz\_ identifier). Provide this or user_id. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + + # Optional currency code filter, for example usd. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # Cursor returned by the previous page. + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + # Maximum number of rows to return. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Optional ledger line categories to include. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :line_types + + sig { params(line_types: T::Array[String]).void } + attr_writer :line_types + + # Only include rows posted after this ISO 8601 timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :posted_after + + sig { params(posted_after: Time).void } + attr_writer :posted_after + + # Only include rows posted before this ISO 8601 timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :posted_before + + sig { params(posted_before: Time).void } + attr_writer :posted_before + + # The owning user ID (a user\_ identifier). Provide this or account_id. + sig { returns(T.nilable(String)) } + attr_reader :user_id + + sig { params(user_id: String).void } + attr_writer :user_id + + sig do + params( + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: T::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # Optional currency code filter, for example usd. + currency: nil, + # Cursor returned by the previous page. + cursor: nil, + # Maximum number of rows to return. + limit: nil, + # Optional ledger line categories to include. + line_types: nil, + # Only include rows posted after this ISO 8601 timestamp. + posted_after: nil, + # Only include rows posted before this ISO 8601 timestamp. + posted_before: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: T::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/financial_activity_list_response.rbi b/rbi/whop_sdk/models/financial_activity_list_response.rbi new file mode 100644 index 00000000..e6db1b7d --- /dev/null +++ b/rbi/whop_sdk/models/financial_activity_list_response.rbi @@ -0,0 +1,1160 @@ +# typed: strong + +module WhopSDK + module Models + class FinancialActivityListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse, + WhopSDK::Internal::AnyHash + ) + end + + sig do + returns(T::Array[WhopSDK::Models::FinancialActivityListResponse::Data]) + end + attr_accessor :data + + sig { returns(WhopSDK::Models::FinancialActivityListResponse::PageInfo) } + attr_reader :page_info + + sig do + params( + page_info: + WhopSDK::Models::FinancialActivityListResponse::PageInfo::OrHash + ).void + end + attr_writer :page_info + + sig do + params( + data: + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::OrHash + ], + page_info: + WhopSDK::Models::FinancialActivityListResponse::PageInfo::OrHash + ).returns(T.attached_class) + end + def self.new(data:, page_info:) + end + + sig do + override.returns( + { + data: + T::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Signed amount in the currency's smallest precision units. + sig { returns(String) } + attr_accessor :amount + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Currency + ) + end + attr_reader :currency + + sig do + params( + currency: + WhopSDK::Models::FinancialActivityListResponse::Data::Currency::OrHash + ).void + end + attr_writer :currency + + sig { returns(String) } + attr_accessor :line_type + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(Time) } + attr_accessor :posted_at + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::Variants + ) + ) + end + attr_accessor :resource + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source + ) + ) + end + attr_reader :source + + sig do + params( + source: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::OrHash + ) + ).void + end + attr_writer :source + + sig do + params( + id: String, + amount: String, + currency: + WhopSDK::Models::FinancialActivityListResponse::Data::Currency::OrHash, + line_type: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Object::OrSymbol, + posted_at: Time, + resource: + T.nilable( + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::OrHash + ) + ), + source: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + id:, + # Signed amount in the currency's smallest precision units. + amount:, + currency:, + line_type:, + object:, + posted_at:, + resource:, + source: + ) + end + + sig do + override.returns( + { + id: String, + amount: String, + currency: + WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol, + posted_at: Time, + resource: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::Variants + ), + source: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source + ) + } + ) + end + def to_hash + end + + class Currency < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + # Precision factor for the currency, for example 100000000 for USD. + sig { returns(String) } + attr_accessor :precision + + sig do + params(code: String, precision: String).returns(T.attached_class) + end + def self.new( + code:, + # Precision factor for the currency, for example 100000000 for USD. + precision: + ) + end + + sig { override.returns({ code: String, precision: String }) } + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEDGER_ACTIVITY = + T.let( + :ledger_activity, + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Resource + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 + ) + end + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :route + + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::OrSymbol, + route: T.nilable(String), + title: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, logo_url:, object:, route:, title:) + end + + sig do + override.returns( + { + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT = + T.let( + :account, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig do + params( + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::OrSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, name:, object:, profile_picture_url:, username:) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember2 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + ) + ) + end + attr_accessor :owner + + sig do + params( + id: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::OrSymbol, + owner: + T.nilable( + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::OrHash, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::OrHash + ) + ) + ).returns(T.attached_class) + end + def self.new(id:, object:, owner:) + end + + sig do + override.returns( + { + id: String, + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol, + owner: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + ) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEDGER_ACCOUNT = + T.let( + :ledger_account, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Owner + extend WhopSDK::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 + ) + end + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :route + + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::OrSymbol, + route: T.nilable(String), + title: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(id:, logo_url:, object:, route:, title:) + end + + sig do + override.returns( + { + id: String, + logo_url: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol, + route: T.nilable(String), + title: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT = + T.let( + :account, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig do + params( + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::OrSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + name:, + object:, + profile_picture_url:, + username: + ) + end + + sig do + override.returns( + { + id: String, + name: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol, + profile_picture_url: T.nilable(String), + username: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::Variants + ] + ) + end + def self.variants + end + end + end + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank + ) + ) + end + attr_reader :bank + + sig do + params( + bank: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank::OrHash + ) + ).void + end + attr_writer :bank + + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card + ) + ) + end + attr_reader :card + + sig do + params( + card: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card::OrHash + ) + ).void + end + attr_writer :card + + sig { returns(T.nilable(String)) } + attr_accessor :email_identifier + + sig { returns(T.nilable(String)) } + attr_accessor :gateway_type + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :payment_method_type + + sig do + params( + id: String, + bank: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank::OrHash + ), + card: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card::OrHash + ), + email_identifier: T.nilable(String), + gateway_type: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::OrSymbol, + payment_method_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + bank:, + card:, + email_identifier:, + gateway_type:, + object:, + payment_method_type: + ) + end + + sig do + override.returns( + { + id: String, + bank: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank + ), + card: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card + ), + email_identifier: T.nilable(String), + gateway_type: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol, + payment_method_type: T.nilable(String) + } + ) + end + def to_hash + end + + class Bank < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :account_name + + sig { returns(T.nilable(String)) } + attr_accessor :account_type + + sig { returns(T.nilable(String)) } + attr_accessor :bank_name + + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + sig do + params( + account_name: T.nilable(String), + account_type: T.nilable(String), + bank_name: T.nilable(String), + last4: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(account_name:, account_type:, bank_name:, last4:) + end + + sig do + override.returns( + { + account_name: T.nilable(String), + account_type: T.nilable(String), + bank_name: T.nilable(String), + last4: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Card < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :brand + + sig { returns(T.nilable(Integer)) } + attr_accessor :exp_month + + sig { returns(T.nilable(Integer)) } + attr_accessor :exp_year + + sig { returns(T.nilable(String)) } + attr_accessor :last4 + + sig do + params( + brand: T.nilable(String), + exp_month: T.nilable(Integer), + exp_year: T.nilable(Integer), + last4: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(brand:, exp_month:, exp_year:, last4:) + end + + sig do + override.returns( + { + brand: T.nilable(String), + exp_month: T.nilable(Integer), + exp_year: T.nilable(Integer), + last4: T.nilable(String) + } + ) + end + def to_hash + end + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYMENT_METHOD = + T.let( + :payment_method, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class UnionMember4 < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :account_reference + + sig { returns(T.nilable(String)) } + attr_accessor :destination_currency_code + + sig { returns(T.nilable(String)) } + attr_accessor :institution_name + + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + sig do + returns( + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + ) + end + attr_accessor :object + + sig { returns(T.nilable(String)) } + attr_accessor :provider + + sig do + params( + id: String, + account_reference: T.nilable(String), + destination_currency_code: T.nilable(String), + institution_name: T.nilable(String), + nickname: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::OrSymbol, + provider: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + account_reference:, + destination_currency_code:, + institution_name:, + nickname:, + object:, + provider: + ) + end + + sig do + override.returns( + { + id: String, + account_reference: T.nilable(String), + destination_currency_code: T.nilable(String), + institution_name: T.nilable(String), + nickname: T.nilable(String), + object: + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol, + provider: T.nilable(String) + } + ) + end + def to_hash + end + + module Object + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAYOUT_METHOD = + T.let( + :payout_method, + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::Object::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::Variants + ] + ) + end + def self.variants + end + end + + class Source < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Source, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :object + + sig { params(id: String, object: String).returns(T.attached_class) } + def self.new(id:, object:) + end + + sig { override.returns({ id: String, object: String }) } + def to_hash + end + end + end + + class PageInfo < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::PageInfo, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :end_cursor + + sig { returns(T::Boolean) } + attr_accessor :has_next_page + + sig { returns(T::Boolean) } + attr_accessor :has_previous_page + + sig { returns(T.nilable(String)) } + attr_accessor :start_cursor + + sig do + params( + end_cursor: T.nilable(String), + has_next_page: T::Boolean, + has_previous_page: T::Boolean, + start_cursor: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + end_cursor:, + has_next_page:, + has_previous_page:, + start_cursor: + ) + end + + sig do + override.returns( + { + end_cursor: T.nilable(String), + has_next_page: T::Boolean, + has_previous_page: T::Boolean, + start_cursor: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/swap_create_params.rbi b/rbi/whop_sdk/models/swap_create_params.rbi index 0bda2d14..d1ed16e5 100644 --- a/rbi/whop_sdk/models/swap_create_params.rbi +++ b/rbi/whop_sdk/models/swap_create_params.rbi @@ -11,7 +11,7 @@ module WhopSDK T.any(WhopSDK::SwapCreateParams, WhopSDK::Internal::AnyHash) end - # The business or user account ID whose wallet should execute the swap. + # Business or user account ID (biz*\* / user*\*). sig { returns(String) } attr_accessor :account_id @@ -49,7 +49,7 @@ module WhopSDK ).returns(T.attached_class) end def self.new( - # The business or user account ID whose wallet should execute the swap. + # Business or user account ID (biz*\* / user*\*). account_id:, # Input token amount. amount:, diff --git a/rbi/whop_sdk/models/swap_retrieve_params.rbi b/rbi/whop_sdk/models/swap_retrieve_params.rbi index 6cb64bec..12678a8a 100644 --- a/rbi/whop_sdk/models/swap_retrieve_params.rbi +++ b/rbi/whop_sdk/models/swap_retrieve_params.rbi @@ -11,6 +11,7 @@ module WhopSDK T.any(WhopSDK::SwapRetrieveParams, WhopSDK::Internal::AnyHash) end + # Business or user account ID (biz*\* / user*\*). sig { returns(String) } attr_accessor :account_id @@ -20,7 +21,11 @@ module WhopSDK request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(account_id:, request_options: {}) + def self.new( + # Business or user account ID (biz*\* / user*\*). + account_id:, + request_options: {} + ) end sig do diff --git a/rbi/whop_sdk/models/user.rbi b/rbi/whop_sdk/models/user.rbi index fcadf43d..89daa221 100644 --- a/rbi/whop_sdk/models/user.rbi +++ b/rbi/whop_sdk/models/user.rbi @@ -5,63 +5,52 @@ module WhopSDK class User < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias { T.any(WhopSDK::User, WhopSDK::Internal::AnyHash) } - # The unique identifier for the user. + # The ID of the user, which will look like user\_******\******* sig { returns(String) } attr_accessor :id - # A short biography written by the user, displayed on their public profile. + # The user's biography sig { returns(T.nilable(String)) } attr_accessor :bio - # The datetime the user was created. - sig { returns(Time) } + # When the user was created, as an ISO 8601 timestamp + sig { returns(String) } attr_accessor :created_at - # The user's display name shown on their public profile. + # The user's display name sig { returns(T.nilable(String)) } attr_accessor :name - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - sig { returns(T.nilable(WhopSDK::User::ProfilePicture)) } - attr_reader :profile_picture - - sig do - params( - profile_picture: T.nilable(WhopSDK::User::ProfilePicture::OrHash) - ).void - end - attr_writer :profile_picture + # The user's profile picture, an object with a url + sig { returns(T.nilable(T.anything)) } + attr_accessor :profile_picture - # The user's unique username shown on their public profile. + # The user's unique username sig { returns(String) } attr_accessor :username - # A user account on Whop. Contains profile information, identity details, and - # social connections. sig do params( id: String, bio: T.nilable(String), - created_at: Time, + created_at: String, name: T.nilable(String), - profile_picture: T.nilable(WhopSDK::User::ProfilePicture::OrHash), + profile_picture: T.nilable(T.anything), username: String ).returns(T.attached_class) end def self.new( - # The unique identifier for the user. + # The ID of the user, which will look like user\_******\******* id:, - # A short biography written by the user, displayed on their public profile. + # The user's biography bio:, - # The datetime the user was created. + # When the user was created, as an ISO 8601 timestamp created_at:, - # The user's display name shown on their public profile. + # The user's display name name:, - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. + # The user's profile picture, an object with a url profile_picture:, - # The user's unique username shown on their public profile. + # The user's unique username username: ) end @@ -71,41 +60,15 @@ module WhopSDK { id: String, bio: T.nilable(String), - created_at: Time, + created_at: String, name: T.nilable(String), - profile_picture: T.nilable(WhopSDK::User::ProfilePicture), + profile_picture: T.nilable(T.anything), username: String } ) end def to_hash end - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::User::ProfilePicture, WhopSDK::Internal::AnyHash) - end - - # A pre-optimized URL for rendering this attachment on the client. This should be - # used for displaying attachments in apps. - sig { returns(T.nilable(String)) } - attr_accessor :url - - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - sig { params(url: T.nilable(String)).returns(T.attached_class) } - def self.new( - # A pre-optimized URL for rendering this attachment on the client. This should be - # used for displaying attachments in apps. - url: - ) - end - - sig { override.returns({ url: T.nilable(String) }) } - def to_hash - end - end end end end diff --git a/rbi/whop_sdk/models/user_check_access_response.rbi b/rbi/whop_sdk/models/user_check_access_response.rbi index 1ac2e81b..4c648231 100644 --- a/rbi/whop_sdk/models/user_check_access_response.rbi +++ b/rbi/whop_sdk/models/user_check_access_response.rbi @@ -11,39 +11,73 @@ module WhopSDK ) end - # The permission level of the user - sig { returns(WhopSDK::AccessLevel::TaggedSymbol) } + sig do + returns( + WhopSDK::Models::UserCheckAccessResponse::AccessLevel::TaggedSymbol + ) + end attr_accessor :access_level - # Whether the user has access to the resource sig { returns(T::Boolean) } attr_accessor :has_access - # The result of a has access check for the developer API sig do params( - access_level: WhopSDK::AccessLevel::OrSymbol, + access_level: + WhopSDK::Models::UserCheckAccessResponse::AccessLevel::OrSymbol, has_access: T::Boolean ).returns(T.attached_class) end - def self.new( - # The permission level of the user - access_level:, - # Whether the user has access to the resource - has_access: - ) + def self.new(access_level:, has_access:) end sig do override.returns( { - access_level: WhopSDK::AccessLevel::TaggedSymbol, + access_level: + WhopSDK::Models::UserCheckAccessResponse::AccessLevel::TaggedSymbol, has_access: T::Boolean } ) end def to_hash end + + module AccessLevel + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::UserCheckAccessResponse::AccessLevel) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NO_ACCESS = + T.let( + :no_access, + WhopSDK::Models::UserCheckAccessResponse::AccessLevel::TaggedSymbol + ) + ADMIN = + T.let( + :admin, + WhopSDK::Models::UserCheckAccessResponse::AccessLevel::TaggedSymbol + ) + CUSTOMER = + T.let( + :customer, + WhopSDK::Models::UserCheckAccessResponse::AccessLevel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::UserCheckAccessResponse::AccessLevel::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/user_list_params.rbi b/rbi/whop_sdk/models/user_list_params.rbi index e6ea9833..a3a96946 100644 --- a/rbi/whop_sdk/models/user_list_params.rbi +++ b/rbi/whop_sdk/models/user_list_params.rbi @@ -11,46 +11,61 @@ module WhopSDK T.any(WhopSDK::UserListParams, WhopSDK::Internal::AnyHash) end - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns users after this position. sig { returns(T.nilable(String)) } - attr_accessor :after + attr_reader :after - # Returns the elements in the list that come before the specified cursor. + sig { params(after: String).void } + attr_writer :after + + # A cursor; returns users before this position. sig { returns(T.nilable(String)) } - attr_accessor :before + attr_reader :before + + sig { params(before: String).void } + attr_writer :before - # Returns the first _n_ elements from the list. + # The number of users to return (max 50). sig { returns(T.nilable(Integer)) } - attr_accessor :first + attr_reader :first + + sig { params(first: Integer).void } + attr_writer :first - # Returns the last _n_ elements from the list. + # The number of users to return from the end of the range. sig { returns(T.nilable(Integer)) } - attr_accessor :last + attr_reader :last - # Search term to filter by name or username. + sig { params(last: Integer).void } + attr_writer :last + + # A search term to filter users by name or username. sig { returns(T.nilable(String)) } - attr_accessor :query + attr_reader :query + + sig { params(query: String).void } + attr_writer :query sig do params( - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), - query: T.nilable(String), + after: String, + before: String, + first: Integer, + last: Integer, + query: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns users after this position. after: nil, - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns users before this position. before: nil, - # Returns the first _n_ elements from the list. + # The number of users to return (max 50). first: nil, - # Returns the last _n_ elements from the list. + # The number of users to return from the end of the range. last: nil, - # Search term to filter by name or username. + # A search term to filter users by name or username. query: nil, request_options: {} ) @@ -59,11 +74,11 @@ module WhopSDK sig do override.returns( { - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), - query: T.nilable(String), + after: String, + before: String, + first: Integer, + last: Integer, + query: String, request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/user_list_response.rbi b/rbi/whop_sdk/models/user_list_response.rbi deleted file mode 100644 index 5b130ab2..00000000 --- a/rbi/whop_sdk/models/user_list_response.rbi +++ /dev/null @@ -1,124 +0,0 @@ -# typed: strong - -module WhopSDK - module Models - class UserListResponse < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Models::UserListResponse, WhopSDK::Internal::AnyHash) - end - - # The unique identifier for the user. - sig { returns(String) } - attr_accessor :id - - # A short biography written by the user, displayed on their public profile. - sig { returns(T.nilable(String)) } - attr_accessor :bio - - # The datetime the user was created. - sig { returns(Time) } - attr_accessor :created_at - - # The user's display name shown on their public profile. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - sig do - returns(T.nilable(WhopSDK::Models::UserListResponse::ProfilePicture)) - end - attr_reader :profile_picture - - sig do - params( - profile_picture: - T.nilable(WhopSDK::Models::UserListResponse::ProfilePicture::OrHash) - ).void - end - attr_writer :profile_picture - - # The user's unique username shown on their public profile. - sig { returns(String) } - attr_accessor :username - - # A user account on Whop. Contains profile information, identity details, and - # social connections. - sig do - params( - id: String, - bio: T.nilable(String), - created_at: Time, - name: T.nilable(String), - profile_picture: - T.nilable( - WhopSDK::Models::UserListResponse::ProfilePicture::OrHash - ), - username: String - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the user. - id:, - # A short biography written by the user, displayed on their public profile. - bio:, - # The datetime the user was created. - created_at:, - # The user's display name shown on their public profile. - name:, - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - profile_picture:, - # The user's unique username shown on their public profile. - username: - ) - end - - sig do - override.returns( - { - id: String, - bio: T.nilable(String), - created_at: Time, - name: T.nilable(String), - profile_picture: - T.nilable(WhopSDK::Models::UserListResponse::ProfilePicture), - username: String - } - ) - end - def to_hash - end - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::UserListResponse::ProfilePicture, - WhopSDK::Internal::AnyHash - ) - end - - # A pre-optimized URL for rendering this attachment on the client. This should be - # used for displaying attachments in apps. - sig { returns(T.nilable(String)) } - attr_accessor :url - - # The user's profile picture attachment with URL, content type, and file metadata. - # Null if using a legacy profile picture. - sig { params(url: T.nilable(String)).returns(T.attached_class) } - def self.new( - # A pre-optimized URL for rendering this attachment on the client. This should be - # used for displaying attachments in apps. - url: - ) - end - - sig { override.returns({ url: T.nilable(String) }) } - def to_hash - end - end - end - end -end diff --git a/rbi/whop_sdk/models/user_retrieve_params.rbi b/rbi/whop_sdk/models/user_retrieve_params.rbi index 9adc1d0b..87cd2305 100644 --- a/rbi/whop_sdk/models/user_retrieve_params.rbi +++ b/rbi/whop_sdk/models/user_retrieve_params.rbi @@ -14,23 +14,26 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # When provided, returns the user's company-specific profile overrides (name, - # profile picture) instead of their global profile. + # When set, returns the user's account-specific profile overrides for this + # account. sig { returns(T.nilable(String)) } - attr_accessor :company_id + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id sig do params( id: String, - company_id: T.nilable(String), + account_id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, - # When provided, returns the user's company-specific profile overrides (name, - # profile picture) instead of their global profile. - company_id: nil, + # When set, returns the user's account-specific profile overrides for this + # account. + account_id: nil, request_options: {} ) end @@ -39,7 +42,7 @@ module WhopSDK override.returns( { id: String, - company_id: T.nilable(String), + account_id: String, request_options: WhopSDK::RequestOptions } ) diff --git a/rbi/whop_sdk/models/user_update_me_params.rbi b/rbi/whop_sdk/models/user_update_me_params.rbi new file mode 100644 index 00000000..53a05e6e --- /dev/null +++ b/rbi/whop_sdk/models/user_update_me_params.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module WhopSDK + module Models + class UserUpdateMeParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::UserUpdateMeParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :bio + + sig { params(bio: String).void } + attr_writer :bio + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(WhopSDK::UserUpdateMeParams::ProfilePicture)) } + attr_reader :profile_picture + + sig do + params( + profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + sig do + params( + bio: String, + name: String, + profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture::OrHash, + username: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + bio: nil, + name: nil, + profile_picture: nil, + username: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + bio: String, + name: String, + profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, + username: String, + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::UserUpdateMeParams::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :direct_upload_id + + sig { params(direct_upload_id: String).void } + attr_writer :direct_upload_id + + sig do + params(id: String, direct_upload_id: String).returns(T.attached_class) + end + def self.new(id: nil, direct_upload_id: nil) + end + + sig { override.returns({ id: String, direct_upload_id: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/user_update_params.rbi b/rbi/whop_sdk/models/user_update_params.rbi index f8e44058..575c45a8 100644 --- a/rbi/whop_sdk/models/user_update_params.rbi +++ b/rbi/whop_sdk/models/user_update_params.rbi @@ -14,64 +14,40 @@ module WhopSDK sig { returns(String) } attr_accessor :id - # A short biography displayed on the user's public profile. + # The account whose profile override to update. Required for API key callers. sig { returns(T.nilable(String)) } - attr_accessor :bio + attr_reader :account_id - # When provided, updates the user's profile overrides for this company instead of - # the global profile. Pass name and profile_picture to set overrides, or null to - # clear them. - sig { returns(T.nilable(String)) } - attr_accessor :company_id + sig { params(account_id: String).void } + attr_writer :account_id - # The user's display name shown on their public profile. Maximum 100 characters. sig { returns(T.nilable(String)) } - attr_accessor :name + attr_reader :bio - # The user's profile picture image attachment. - sig { returns(T.nilable(WhopSDK::UserUpdateParams::ProfilePicture)) } - attr_reader :profile_picture + sig { params(bio: String).void } + attr_writer :bio - sig do - params( - profile_picture: - T.nilable(WhopSDK::UserUpdateParams::ProfilePicture::OrHash) - ).void - end - attr_writer :profile_picture - - # The user's unique username. Alphanumeric characters and hyphens only. Maximum 42 - # characters. sig { returns(T.nilable(String)) } - attr_accessor :username + attr_reader :name + + sig { params(name: String).void } + attr_writer :name sig do params( id: String, - bio: T.nilable(String), - company_id: T.nilable(String), - name: T.nilable(String), - profile_picture: - T.nilable(WhopSDK::UserUpdateParams::ProfilePicture::OrHash), - username: T.nilable(String), + account_id: String, + bio: String, + name: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, - # A short biography displayed on the user's public profile. + # The account whose profile override to update. Required for API key callers. + account_id: nil, bio: nil, - # When provided, updates the user's profile overrides for this company instead of - # the global profile. Pass name and profile_picture to set overrides, or null to - # clear them. - company_id: nil, - # The user's display name shown on their public profile. Maximum 100 characters. name: nil, - # The user's profile picture image attachment. - profile_picture: nil, - # The user's unique username. Alphanumeric characters and hyphens only. Maximum 42 - # characters. - username: nil, request_options: {} ) end @@ -80,44 +56,15 @@ module WhopSDK override.returns( { id: String, - bio: T.nilable(String), - company_id: T.nilable(String), - name: T.nilable(String), - profile_picture: - T.nilable(WhopSDK::UserUpdateParams::ProfilePicture), - username: T.nilable(String), + account_id: String, + bio: String, + name: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::UserUpdateParams::ProfilePicture, - WhopSDK::Internal::AnyHash - ) - end - - # The ID of an existing file object. - sig { returns(String) } - attr_accessor :id - - # The user's profile picture image attachment. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The ID of an existing file object. - id: - ) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end end end end diff --git a/rbi/whop_sdk/models/wallet_balance_params.rbi b/rbi/whop_sdk/models/wallet_balance_params.rbi index 567d1bcf..d373f7d9 100644 --- a/rbi/whop_sdk/models/wallet_balance_params.rbi +++ b/rbi/whop_sdk/models/wallet_balance_params.rbi @@ -11,6 +11,7 @@ module WhopSDK T.any(WhopSDK::WalletBalanceParams, WhopSDK::Internal::AnyHash) end + # The business or user account ID whose wallet balance should be returned. sig { returns(String) } attr_accessor :account_id @@ -20,7 +21,11 @@ module WhopSDK request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end - def self.new(account_id:, request_options: {}) + def self.new( + # The business or user account ID whose wallet balance should be returned. + account_id:, + request_options: {} + ) end sig do diff --git a/rbi/whop_sdk/models/wallet_send_params.rbi b/rbi/whop_sdk/models/wallet_send_params.rbi index 33e7008b..a7f21fc8 100644 --- a/rbi/whop_sdk/models/wallet_send_params.rbi +++ b/rbi/whop_sdk/models/wallet_send_params.rbi @@ -11,6 +11,7 @@ module WhopSDK T.any(WhopSDK::WalletSendParams, WhopSDK::Internal::AnyHash) end + # The sending account ID. sig { returns(String) } attr_accessor :account_id @@ -31,6 +32,7 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # The sending account ID. account_id:, # USDT amount to send. amount:, diff --git a/rbi/whop_sdk/resources/ad_groups.rbi b/rbi/whop_sdk/resources/ad_groups.rbi index 390ca26f..9147d0ba 100644 --- a/rbi/whop_sdk/resources/ad_groups.rbi +++ b/rbi/whop_sdk/resources/ad_groups.rbi @@ -47,6 +47,7 @@ module WhopSDK platform_config: T.nilable(WhopSDK::AdGroupUpdateParams::PlatformConfig::OrHash), status: T.nilable(WhopSDK::AdGroupStatus::OrSymbol), + title: T.nilable(String), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::AdGroup) end @@ -67,6 +68,8 @@ module WhopSDK platform_config: nil, # The status of an external ad group. status: nil, + # Human-readable ad group title. + title: nil, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/financial_activity.rbi b/rbi/whop_sdk/resources/financial_activity.rbi new file mode 100644 index 00000000..cdb67559 --- /dev/null +++ b/rbi/whop_sdk/resources/financial_activity.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module WhopSDK + module Resources + class FinancialActivity + # Lists financial activity rows for a ledger account. Rows are derived from ledger + # lines and include typed resource and source objects that clients can use for + # presentation and navigation. The ledger's owner is passed as exactly one of + # account*id (a biz* identifier) or user*id (a user* identifier). + sig do + params( + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: T::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::FinancialActivityListResponse) + end + def list( + # The owning account ID (a biz\_ identifier). Provide this or user_id. + account_id: nil, + # Optional currency code filter, for example usd. + currency: nil, + # Cursor returned by the previous page. + cursor: nil, + # Maximum number of rows to return. + limit: nil, + # Optional ledger line categories to include. + line_types: nil, + # Only include rows posted after this ISO 8601 timestamp. + posted_after: nil, + # Only include rows posted before this ISO 8601 timestamp. + posted_before: nil, + # The owning user ID (a user\_ identifier). Provide this or account_id. + user_id: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/whop_sdk/resources/swaps.rbi b/rbi/whop_sdk/resources/swaps.rbi index c787114c..005b9aff 100644 --- a/rbi/whop_sdk/resources/swaps.rbi +++ b/rbi/whop_sdk/resources/swaps.rbi @@ -3,8 +3,8 @@ module WhopSDK module Resources class Swaps - # Executes a swap from an account's wallet. The swap runs asynchronously; poll GET - # /swaps/{account_id} for status. + # Executes a swap from the account's wallet. Runs asynchronously — poll GET + # /swaps?account_id=... for status. sig do params( account_id: String, @@ -18,7 +18,7 @@ module WhopSDK ).returns(WhopSDK::Models::SwapCreateResponse) end def create( - # The business or user account ID whose wallet should execute the swap. + # Business or user account ID (biz*\* / user*\*). account_id:, # Input token amount. amount:, @@ -33,7 +33,7 @@ module WhopSDK ) end - # Returns the status of an account's in-flight or most recent swap. + # Returns the status of the account's in-flight or most recent swap. sig do params( account_id: String, @@ -41,8 +41,8 @@ module WhopSDK ).returns(WhopSDK::Models::SwapRetrieveResponse) end def retrieve( - # The business or user account ID whose swap status should be returned. - account_id, + # Business or user account ID (biz*\* / user*\*). + account_id:, request_options: {} ) end diff --git a/rbi/whop_sdk/resources/users.rbi b/rbi/whop_sdk/resources/users.rbi index a813246c..42d349c9 100644 --- a/rbi/whop_sdk/resources/users.rbi +++ b/rbi/whop_sdk/resources/users.rbi @@ -2,95 +2,82 @@ module WhopSDK module Resources - # Users class Users - # Retrieves the details of an existing user. + # Retrieves a user's public profile by user\_ tag, username, or 'me'. sig do params( id: String, - company_id: T.nilable(String), + account_id: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::User) end def retrieve( - # The unique identifier or username of the user. + # The ID of the user, which will look like user\_******\*******, a username, or + # 'me'. id, - # When provided, returns the user's company-specific profile overrides (name, - # profile picture) instead of their global profile. - company_id: nil, + # When set, returns the user's account-specific profile overrides for this + # account. + account_id: nil, request_options: {} ) end - # Update a user's profile by their ID. - # - # Required permissions: - # - # - `user:profile:update` + # Updates a user. A user token updates their own global profile; an API key + # updates the user's account-specific profile override (account_id required). sig do params( id: String, - bio: T.nilable(String), - company_id: T.nilable(String), - name: T.nilable(String), - profile_picture: - T.nilable(WhopSDK::UserUpdateParams::ProfilePicture::OrHash), - username: T.nilable(String), + account_id: String, + bio: String, + name: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::User) end def update( - # The unique identifier of the user to update. Accepts 'me', a user tag, or a - # username. + # Path param: The ID of the user, which will look like user\_******\*******, a + # username, or 'me'. id, - # A short biography displayed on the user's public profile. + # Query param: The account whose profile override to update. Required for API key + # callers. + account_id: nil, + # Body param bio: nil, - # When provided, updates the user's profile overrides for this company instead of - # the global profile. Pass name and profile_picture to set overrides, or null to - # clear them. - company_id: nil, - # The user's display name shown on their public profile. Maximum 100 characters. + # Body param name: nil, - # The user's profile picture image attachment. - profile_picture: nil, - # The user's unique username. Alphanumeric characters and hyphens only. Maximum 42 - # characters. - username: nil, request_options: {} ) end # Search for users by name or username, ranked by social proximity to the - # authenticated user. + # authenticated user. Returns the user's most recently followed users when no + # query is given. sig do params( - after: T.nilable(String), - before: T.nilable(String), - first: T.nilable(Integer), - last: T.nilable(Integer), - query: T.nilable(String), + after: String, + before: String, + first: Integer, + last: Integer, + query: String, request_options: WhopSDK::RequestOptions::OrHash - ).returns( - WhopSDK::Internal::CursorPage[WhopSDK::Models::UserListResponse] - ) + ).returns(WhopSDK::Internal::CursorPage[WhopSDK::User]) end def list( - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns users after this position. after: nil, - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns users before this position. before: nil, - # Returns the first _n_ elements from the list. + # The number of users to return (max 50). first: nil, - # Returns the last _n_ elements from the list. + # The number of users to return from the end of the range. last: nil, - # Search term to filter by name or username. + # A search term to filter users by name or username. query: nil, request_options: {} ) end - # Check whether a user has access to a specific resource, and return their access - # level. + # Checks whether a user has access to a company, product, or experience the caller + # can reach. sig do params( resource_id: String, @@ -99,15 +86,33 @@ module WhopSDK ).returns(WhopSDK::Models::UserCheckAccessResponse) end def check_access( - # The unique identifier of the resource to check access for. Accepts a company, - # product, or experience identifier. + # A company (biz*), product (prod*), or experience (exp\_) ID. resource_id, - # The unique identifier or username of the user. + # The user\_ tag or username to check access for. id:, request_options: {} ) end + # Updates the authenticated user's global profile. Not available to API keys. + sig do + params( + bio: String, + name: String, + profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture::OrHash, + username: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::User) + end + def update_me( + bio: nil, + name: nil, + profile_picture: nil, + username: nil, + request_options: {} + ) + end + # @api private sig { params(client: WhopSDK::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/whop_sdk/resources/wallets.rbi b/rbi/whop_sdk/resources/wallets.rbi index ee45be94..0a7d19d1 100644 --- a/rbi/whop_sdk/resources/wallets.rbi +++ b/rbi/whop_sdk/resources/wallets.rbi @@ -21,7 +21,7 @@ module WhopSDK end def balance( # The business or user account ID whose wallet balance should be returned. - account_id, + account_id:, request_options: {} ) end @@ -36,11 +36,11 @@ module WhopSDK ).returns(WhopSDK::Models::WalletSendResponse) end def send_( - # The sending account ID. - account_id, - # USDT amount to send. + # Query param: The sending account ID. + account_id:, + # Body param: USDT amount to send. amount:, - # Recipient user ID, business account ID, ledger account ID, or email. + # Body param: Recipient user ID, business account ID, ledger account ID, or email. to:, request_options: {} ) diff --git a/sig/whop_sdk/client.rbs b/sig/whop_sdk/client.rbs index 52916981..08f224a3 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -14,6 +14,8 @@ module WhopSDK attr_reader app_id: String? + attr_reader version: String? + attr_reader apps: WhopSDK::Resources::Apps attr_reader invoices: WhopSDK::Resources::Invoices @@ -92,6 +94,8 @@ module WhopSDK attr_reader wallets: WhopSDK::Resources::Wallets + attr_reader financial_activity: WhopSDK::Resources::FinancialActivity + attr_reader swaps: WhopSDK::Resources::Swaps attr_reader deposits: WhopSDK::Resources::Deposits @@ -146,6 +150,7 @@ module WhopSDK ?api_key: String?, ?webhook_key: String?, ?app_id: String?, + ?version: String?, ?base_url: String?, ?max_retries: Integer, ?timeout: Float, diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index c2d1641a..291c9b3e 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -377,6 +377,8 @@ module WhopSDK module FileVisibility = WhopSDK::Models::FileVisibility + class FinancialActivityListParams = WhopSDK::Models::FinancialActivityListParams + class Forum = WhopSDK::Models::Forum class ForumListParams = WhopSDK::Models::ForumListParams @@ -735,6 +737,8 @@ module WhopSDK class UserRetrieveParams = WhopSDK::Models::UserRetrieveParams + class UserUpdateMeParams = WhopSDK::Models::UserUpdateMeParams + class UserUpdateParams = WhopSDK::Models::UserUpdateParams module VerificationErrorCode = WhopSDK::Models::VerificationErrorCode diff --git a/sig/whop_sdk/models/ad_group_update_params.rbs b/sig/whop_sdk/models/ad_group_update_params.rbs index 877d2ddb..dcc094ff 100644 --- a/sig/whop_sdk/models/ad_group_update_params.rbs +++ b/sig/whop_sdk/models/ad_group_update_params.rbs @@ -9,7 +9,8 @@ module WhopSDK daily_budget: Float?, name: String?, platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, - status: WhopSDK::Models::ad_group_status? + status: WhopSDK::Models::ad_group_status?, + title: String? } & WhopSDK::Internal::Type::request_parameters @@ -33,6 +34,8 @@ module WhopSDK attr_accessor status: WhopSDK::Models::ad_group_status? + attr_accessor title: String? + def initialize: ( id: String, ?budget: Float?, @@ -42,6 +45,7 @@ module WhopSDK ?name: String?, ?platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, ?status: WhopSDK::Models::ad_group_status?, + ?title: String?, ?request_options: WhopSDK::request_opts ) -> void @@ -54,6 +58,7 @@ module WhopSDK name: String?, platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, status: WhopSDK::Models::ad_group_status?, + title: String?, request_options: WhopSDK::RequestOptions } diff --git a/sig/whop_sdk/models/financial_activity_list_params.rbs b/sig/whop_sdk/models/financial_activity_list_params.rbs new file mode 100644 index 00000000..6503585f --- /dev/null +++ b/sig/whop_sdk/models/financial_activity_list_params.rbs @@ -0,0 +1,77 @@ +module WhopSDK + module Models + type financial_activity_list_params = + { + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: ::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String + } + & WhopSDK::Internal::Type::request_parameters + + class FinancialActivityListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader account_id: String? + + def account_id=: (String) -> String + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader line_types: ::Array[String]? + + def line_types=: (::Array[String]) -> ::Array[String] + + attr_reader posted_after: Time? + + def posted_after=: (Time) -> Time + + attr_reader posted_before: Time? + + def posted_before=: (Time) -> Time + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?account_id: String, + ?currency: String, + ?cursor: String, + ?limit: Integer, + ?line_types: ::Array[String], + ?posted_after: Time, + ?posted_before: Time, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + currency: String, + cursor: String, + limit: Integer, + line_types: ::Array[String], + posted_after: Time, + posted_before: Time, + user_id: String, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/financial_activity_list_response.rbs b/sig/whop_sdk/models/financial_activity_list_response.rbs new file mode 100644 index 00000000..3a42b265 --- /dev/null +++ b/sig/whop_sdk/models/financial_activity_list_response.rbs @@ -0,0 +1,569 @@ +module WhopSDK + module Models + type financial_activity_list_response = + { + data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + + class FinancialActivityListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data] + + attr_accessor page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + + def initialize: ( + data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + ) -> void + + def to_hash: -> { + data: ::Array[WhopSDK::Models::FinancialActivityListResponse::Data], + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + + type data = + { + id: String, + amount: String, + currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::object, + posted_at: Time, + resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource?, + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor amount: String + + attr_accessor currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency + + attr_accessor line_type: String + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::object + + attr_accessor posted_at: Time + + attr_accessor resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource? + + attr_accessor source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + + def initialize: ( + id: String, + amount: String, + currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::object, + posted_at: Time, + resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource?, + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + ) -> void + + def to_hash: -> { + id: String, + amount: String, + currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, + line_type: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::object, + posted_at: Time, + resource: WhopSDK::Models::FinancialActivityListResponse::Data::resource?, + source: WhopSDK::Models::FinancialActivityListResponse::Data::Source? + } + + type currency = { code: String, precision: String } + + class Currency < WhopSDK::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor precision: String + + def initialize: (code: String, precision: String) -> void + + def to_hash: -> { code: String, precision: String } + end + + type object = :ledger_activity + + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACTIVITY: :ledger_activity + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::object] + end + + type resource = + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4 + + module Resource + extend WhopSDK::Internal::Type::Union + + type union_member0 = + { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object, + route: String?, + title: String? + } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor logo_url: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object + + attr_accessor route: String? + + attr_accessor title: String? + + def initialize: ( + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object, + route: String?, + title: String? + ) -> void + + def to_hash: -> { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object, + route: String?, + title: String? + } + + type object = :account + + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT: :account + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember0::object] + end + end + + type union_member1 = + { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object + + attr_accessor profile_picture_url: String? + + attr_accessor username: String? + + def initialize: ( + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object, + profile_picture_url: String?, + username: String? + ) -> void + + def to_hash: -> { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + type object = :user + + module Object + extend WhopSDK::Internal::Type::Enum + + USER: :user + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember1::object] + end + end + + type union_member2 = + { + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + } + + class UnionMember2 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object + + attr_accessor owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + + def initialize: ( + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + ) -> void + + def to_hash: -> { + id: String, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object, + owner: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner? + } + + type object = :ledger_account + + module Object + extend WhopSDK::Internal::Type::Enum + + LEDGER_ACCOUNT: :ledger_account + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::object] + end + + type owner = + WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0 + | WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1 + + module Owner + extend WhopSDK::Internal::Type::Union + + type union_member0 = + { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + route: String?, + title: String? + } + + class UnionMember0 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor logo_url: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object + + attr_accessor route: String? + + attr_accessor title: String? + + def initialize: ( + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + route: String?, + title: String? + ) -> void + + def to_hash: -> { + id: String, + logo_url: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object, + route: String?, + title: String? + } + + type object = :account + + module Object + extend WhopSDK::Internal::Type::Enum + + ACCOUNT: :account + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember0::object] + end + end + + type union_member1 = + { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + class UnionMember1 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor name: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object + + attr_accessor profile_picture_url: String? + + attr_accessor username: String? + + def initialize: ( + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + profile_picture_url: String?, + username: String? + ) -> void + + def to_hash: -> { + id: String, + name: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object, + profile_picture_url: String?, + username: String? + } + + type object = :user + + module Object + extend WhopSDK::Internal::Type::Enum + + USER: :user + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::Owner::UnionMember1::object] + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember2::owner] + end + end + + type union_member3 = + { + id: String, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card?, + email_identifier: String?, + gateway_type: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + payment_method_type: String? + } + + class UnionMember3 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank? + + attr_accessor card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card? + + attr_accessor email_identifier: String? + + attr_accessor gateway_type: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object + + attr_accessor payment_method_type: String? + + def initialize: ( + id: String, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card?, + email_identifier: String?, + gateway_type: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + payment_method_type: String? + ) -> void + + def to_hash: -> { + id: String, + bank: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Bank?, + card: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::Card?, + email_identifier: String?, + gateway_type: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object, + payment_method_type: String? + } + + type bank = + { + account_name: String?, + account_type: String?, + bank_name: String?, + :last4 => String? + } + + class Bank < WhopSDK::Internal::Type::BaseModel + attr_accessor account_name: String? + + attr_accessor account_type: String? + + attr_accessor bank_name: String? + + attr_accessor last4: String? + + def initialize: ( + account_name: String?, + account_type: String?, + bank_name: String?, + last4: String? + ) -> void + + def to_hash: -> { + account_name: String?, + account_type: String?, + bank_name: String?, + :last4 => String? + } + end + + type card = + { + brand: String?, + exp_month: Integer?, + exp_year: Integer?, + :last4 => String? + } + + class Card < WhopSDK::Internal::Type::BaseModel + attr_accessor brand: String? + + attr_accessor exp_month: Integer? + + attr_accessor exp_year: Integer? + + attr_accessor last4: String? + + def initialize: ( + brand: String?, + exp_month: Integer?, + exp_year: Integer?, + last4: String? + ) -> void + + def to_hash: -> { + brand: String?, + exp_month: Integer?, + exp_year: Integer?, + :last4 => String? + } + end + + type object = :payment_method + + module Object + extend WhopSDK::Internal::Type::Enum + + PAYMENT_METHOD: :payment_method + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember3::object] + end + end + + type union_member4 = + { + id: String, + account_reference: String?, + destination_currency_code: String?, + institution_name: String?, + nickname: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + provider: String? + } + + class UnionMember4 < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor account_reference: String? + + attr_accessor destination_currency_code: String? + + attr_accessor institution_name: String? + + attr_accessor nickname: String? + + attr_accessor object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object + + attr_accessor provider: String? + + def initialize: ( + id: String, + account_reference: String?, + destination_currency_code: String?, + institution_name: String?, + nickname: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + provider: String? + ) -> void + + def to_hash: -> { + id: String, + account_reference: String?, + destination_currency_code: String?, + institution_name: String?, + nickname: String?, + object: WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object, + provider: String? + } + + type object = :payout_method + + module Object + extend WhopSDK::Internal::Type::Enum + + PAYOUT_METHOD: :payout_method + + def self?.values: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::Resource::UnionMember4::object] + end + end + + def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::resource] + end + + type source = { id: String, object: String } + + class Source < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor object: String + + def initialize: (id: String, object: String) -> void + + def to_hash: -> { id: String, object: String } + end + end + + type page_info = + { + end_cursor: String?, + has_next_page: bool, + has_previous_page: bool, + start_cursor: String? + } + + class PageInfo < WhopSDK::Internal::Type::BaseModel + attr_accessor end_cursor: String? + + attr_accessor has_next_page: bool + + attr_accessor has_previous_page: bool + + attr_accessor start_cursor: String? + + def initialize: ( + end_cursor: String?, + has_next_page: bool, + has_previous_page: bool, + start_cursor: String? + ) -> void + + def to_hash: -> { + end_cursor: String?, + has_next_page: bool, + has_previous_page: bool, + start_cursor: String? + } + end + end + end +end diff --git a/sig/whop_sdk/models/user.rbs b/sig/whop_sdk/models/user.rbs index 68909ed7..e0b105a4 100644 --- a/sig/whop_sdk/models/user.rbs +++ b/sig/whop_sdk/models/user.rbs @@ -4,9 +4,9 @@ module WhopSDK { id: String, bio: String?, - created_at: Time, + created_at: String, name: String?, - profile_picture: WhopSDK::User::ProfilePicture?, + profile_picture: top?, username: String } @@ -15,41 +15,31 @@ module WhopSDK attr_accessor bio: String? - attr_accessor created_at: Time + attr_accessor created_at: String attr_accessor name: String? - attr_accessor profile_picture: WhopSDK::User::ProfilePicture? + attr_accessor profile_picture: top? attr_accessor username: String def initialize: ( id: String, bio: String?, - created_at: Time, + created_at: String, name: String?, - profile_picture: WhopSDK::User::ProfilePicture?, + profile_picture: top?, username: String ) -> void def to_hash: -> { id: String, bio: String?, - created_at: Time, + created_at: String, name: String?, - profile_picture: WhopSDK::User::ProfilePicture?, + profile_picture: top?, username: String } - - type profile_picture = { url: String? } - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - attr_accessor url: String? - - def initialize: (url: String?) -> void - - def to_hash: -> { url: String? } - end end end end diff --git a/sig/whop_sdk/models/user_check_access_response.rbs b/sig/whop_sdk/models/user_check_access_response.rbs index 0b8f5436..7bf94c33 100644 --- a/sig/whop_sdk/models/user_check_access_response.rbs +++ b/sig/whop_sdk/models/user_check_access_response.rbs @@ -1,22 +1,37 @@ module WhopSDK module Models type user_check_access_response = - { access_level: WhopSDK::Models::access_level, has_access: bool } + { + access_level: WhopSDK::Models::UserCheckAccessResponse::access_level, + has_access: bool + } class UserCheckAccessResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor access_level: WhopSDK::Models::access_level + attr_accessor access_level: WhopSDK::Models::UserCheckAccessResponse::access_level attr_accessor has_access: bool def initialize: ( - access_level: WhopSDK::Models::access_level, + access_level: WhopSDK::Models::UserCheckAccessResponse::access_level, has_access: bool ) -> void def to_hash: -> { - access_level: WhopSDK::Models::access_level, + access_level: WhopSDK::Models::UserCheckAccessResponse::access_level, has_access: bool } + + type access_level = :no_access | :admin | :customer + + module AccessLevel + extend WhopSDK::Internal::Type::Enum + + NO_ACCESS: :no_access + ADMIN: :admin + CUSTOMER: :customer + + def self?.values: -> ::Array[WhopSDK::Models::UserCheckAccessResponse::access_level] + end end end end diff --git a/sig/whop_sdk/models/user_list_params.rbs b/sig/whop_sdk/models/user_list_params.rbs index b5f7f5b3..36a6e3d1 100644 --- a/sig/whop_sdk/models/user_list_params.rbs +++ b/sig/whop_sdk/models/user_list_params.rbs @@ -2,11 +2,11 @@ module WhopSDK module Models type user_list_params = { - after: String?, - before: String?, - first: Integer?, - last: Integer?, - query: String? + after: String, + before: String, + first: Integer, + last: Integer, + query: String } & WhopSDK::Internal::Type::request_parameters @@ -14,31 +14,41 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor after: String? + attr_reader after: String? - attr_accessor before: String? + def after=: (String) -> String - attr_accessor first: Integer? + attr_reader before: String? - attr_accessor last: Integer? + def before=: (String) -> String - attr_accessor query: String? + attr_reader first: Integer? + + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader query: String? + + def query=: (String) -> String def initialize: ( - ?after: String?, - ?before: String?, - ?first: Integer?, - ?last: Integer?, - ?query: String?, + ?after: String, + ?before: String, + ?first: Integer, + ?last: Integer, + ?query: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - after: String?, - before: String?, - first: Integer?, - last: Integer?, - query: String?, + after: String, + before: String, + first: Integer, + last: Integer, + query: String, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/user_list_response.rbs b/sig/whop_sdk/models/user_list_response.rbs deleted file mode 100644 index 5f1fe47e..00000000 --- a/sig/whop_sdk/models/user_list_response.rbs +++ /dev/null @@ -1,55 +0,0 @@ -module WhopSDK - module Models - type user_list_response = - { - id: String, - bio: String?, - created_at: Time, - name: String?, - profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture?, - username: String - } - - class UserListResponse < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor bio: String? - - attr_accessor created_at: Time - - attr_accessor name: String? - - attr_accessor profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture? - - attr_accessor username: String - - def initialize: ( - id: String, - bio: String?, - created_at: Time, - name: String?, - profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture?, - username: String - ) -> void - - def to_hash: -> { - id: String, - bio: String?, - created_at: Time, - name: String?, - profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture?, - username: String - } - - type profile_picture = { url: String? } - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - attr_accessor url: String? - - def initialize: (url: String?) -> void - - def to_hash: -> { url: String? } - end - end - end -end diff --git a/sig/whop_sdk/models/user_retrieve_params.rbs b/sig/whop_sdk/models/user_retrieve_params.rbs index 5948d436..ba6aefd8 100644 --- a/sig/whop_sdk/models/user_retrieve_params.rbs +++ b/sig/whop_sdk/models/user_retrieve_params.rbs @@ -1,7 +1,7 @@ module WhopSDK module Models type user_retrieve_params = - { id: String, company_id: String? } + { id: String, account_id: String } & WhopSDK::Internal::Type::request_parameters class UserRetrieveParams < WhopSDK::Internal::Type::BaseModel @@ -10,17 +10,19 @@ module WhopSDK attr_accessor id: String - attr_accessor company_id: String? + attr_reader account_id: String? + + def account_id=: (String) -> String def initialize: ( id: String, - ?company_id: String?, + ?account_id: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, - company_id: String?, + account_id: String, request_options: WhopSDK::RequestOptions } end diff --git a/sig/whop_sdk/models/user_update_me_params.rbs b/sig/whop_sdk/models/user_update_me_params.rbs new file mode 100644 index 00000000..19c04ddf --- /dev/null +++ b/sig/whop_sdk/models/user_update_me_params.rbs @@ -0,0 +1,67 @@ +module WhopSDK + module Models + type user_update_me_params = + { + bio: String, + name: String, + profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, + username: String + } + & WhopSDK::Internal::Type::request_parameters + + class UserUpdateMeParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_reader bio: String? + + def bio=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture? + + def profile_picture=: ( + WhopSDK::UserUpdateMeParams::ProfilePicture + ) -> WhopSDK::UserUpdateMeParams::ProfilePicture + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + ?bio: String, + ?name: String, + ?profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, + ?username: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + bio: String, + name: String, + profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, + username: String, + request_options: WhopSDK::RequestOptions + } + + type profile_picture = { id: String, direct_upload_id: String } + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader direct_upload_id: String? + + def direct_upload_id=: (String) -> String + + def initialize: (?id: String, ?direct_upload_id: String) -> void + + def to_hash: -> { id: String, direct_upload_id: String } + end + end + end +end diff --git a/sig/whop_sdk/models/user_update_params.rbs b/sig/whop_sdk/models/user_update_params.rbs index 02299343..56ccf1c6 100644 --- a/sig/whop_sdk/models/user_update_params.rbs +++ b/sig/whop_sdk/models/user_update_params.rbs @@ -1,14 +1,7 @@ module WhopSDK module Models type user_update_params = - { - id: String, - bio: String?, - company_id: String?, - name: String?, - profile_picture: WhopSDK::UserUpdateParams::ProfilePicture?, - username: String? - } + { id: String, account_id: String, bio: String, name: String } & WhopSDK::Internal::Type::request_parameters class UserUpdateParams < WhopSDK::Internal::Type::BaseModel @@ -17,45 +10,33 @@ module WhopSDK attr_accessor id: String - attr_accessor bio: String? + attr_reader account_id: String? - attr_accessor company_id: String? + def account_id=: (String) -> String - attr_accessor name: String? + attr_reader bio: String? - attr_accessor profile_picture: WhopSDK::UserUpdateParams::ProfilePicture? + def bio=: (String) -> String - attr_accessor username: String? + attr_reader name: String? + + def name=: (String) -> String def initialize: ( id: String, - ?bio: String?, - ?company_id: String?, - ?name: String?, - ?profile_picture: WhopSDK::UserUpdateParams::ProfilePicture?, - ?username: String?, + ?account_id: String, + ?bio: String, + ?name: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { id: String, - bio: String?, - company_id: String?, - name: String?, - profile_picture: WhopSDK::UserUpdateParams::ProfilePicture?, - username: String?, + account_id: String, + bio: String, + name: String, request_options: WhopSDK::RequestOptions } - - type profile_picture = { id: String } - - class ProfilePicture < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end end end end diff --git a/sig/whop_sdk/resources/ad_groups.rbs b/sig/whop_sdk/resources/ad_groups.rbs index 6e98edd3..b9d628f5 100644 --- a/sig/whop_sdk/resources/ad_groups.rbs +++ b/sig/whop_sdk/resources/ad_groups.rbs @@ -17,6 +17,7 @@ module WhopSDK ?name: String?, ?platform_config: WhopSDK::AdGroupUpdateParams::PlatformConfig?, ?status: WhopSDK::Models::ad_group_status?, + ?title: String?, ?request_options: WhopSDK::request_opts ) -> WhopSDK::AdGroup diff --git a/sig/whop_sdk/resources/financial_activity.rbs b/sig/whop_sdk/resources/financial_activity.rbs new file mode 100644 index 00000000..448d522e --- /dev/null +++ b/sig/whop_sdk/resources/financial_activity.rbs @@ -0,0 +1,19 @@ +module WhopSDK + module Resources + class FinancialActivity + def list: ( + ?account_id: String, + ?currency: String, + ?cursor: String, + ?limit: Integer, + ?line_types: ::Array[String], + ?posted_after: Time, + ?posted_before: Time, + ?user_id: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::FinancialActivityListResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/swaps.rbs b/sig/whop_sdk/resources/swaps.rbs index d66f3822..4afbb528 100644 --- a/sig/whop_sdk/resources/swaps.rbs +++ b/sig/whop_sdk/resources/swaps.rbs @@ -13,7 +13,7 @@ module WhopSDK ) -> WhopSDK::Models::SwapCreateResponse def retrieve: ( - String account_id, + account_id: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::SwapRetrieveResponse diff --git a/sig/whop_sdk/resources/users.rbs b/sig/whop_sdk/resources/users.rbs index 40a79973..e4a72cd2 100644 --- a/sig/whop_sdk/resources/users.rbs +++ b/sig/whop_sdk/resources/users.rbs @@ -3,28 +3,26 @@ module WhopSDK class Users def retrieve: ( String id, - ?company_id: String?, + ?account_id: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::User def update: ( String id, - ?bio: String?, - ?company_id: String?, - ?name: String?, - ?profile_picture: WhopSDK::UserUpdateParams::ProfilePicture?, - ?username: String?, + ?account_id: String, + ?bio: String, + ?name: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::User def list: ( - ?after: String?, - ?before: String?, - ?first: Integer?, - ?last: Integer?, - ?query: String?, + ?after: String, + ?before: String, + ?first: Integer, + ?last: Integer, + ?query: String, ?request_options: WhopSDK::request_opts - ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::UserListResponse] + ) -> WhopSDK::Internal::CursorPage[WhopSDK::User] def check_access: ( String resource_id, @@ -32,6 +30,14 @@ module WhopSDK ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::UserCheckAccessResponse + def update_me: ( + ?bio: String, + ?name: String, + ?profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, + ?username: String, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::User + def initialize: (client: WhopSDK::Client) -> void end end diff --git a/sig/whop_sdk/resources/wallets.rbs b/sig/whop_sdk/resources/wallets.rbs index 4cfd61d7..5543a065 100644 --- a/sig/whop_sdk/resources/wallets.rbs +++ b/sig/whop_sdk/resources/wallets.rbs @@ -6,12 +6,12 @@ module WhopSDK ) -> WhopSDK::Models::WalletListResponse def balance: ( - String account_id, + account_id: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::WalletBalanceResponse def send_: ( - String account_id, + account_id: String, amount: String, to: String, ?request_options: WhopSDK::request_opts diff --git a/test/whop_sdk/resources/financial_activity_test.rb b/test/whop_sdk/resources/financial_activity_test.rb new file mode 100644 index 00000000..29220050 --- /dev/null +++ b/test/whop_sdk/resources/financial_activity_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::FinancialActivityTest < WhopSDK::Test::ResourceTest + def test_list + skip("Mock server tests are disabled") + + response = @whop.financial_activity.list + + assert_pattern do + response => WhopSDK::Models::FinancialActivityListResponse + end + + assert_pattern do + response => { + data: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::FinancialActivityListResponse::Data]), + page_info: WhopSDK::Models::FinancialActivityListResponse::PageInfo + } + end + end +end diff --git a/test/whop_sdk/resources/swaps_test.rb b/test/whop_sdk/resources/swaps_test.rb index 441b6df0..9a7ee2fa 100644 --- a/test/whop_sdk/resources/swaps_test.rb +++ b/test/whop_sdk/resources/swaps_test.rb @@ -31,10 +31,10 @@ def test_create_required_params end end - def test_retrieve + def test_retrieve_required_params skip("Mock server tests are disabled") - response = @whop.swaps.retrieve("account_id") + response = @whop.swaps.retrieve(account_id: "account_id") assert_pattern do response => WhopSDK::Models::SwapRetrieveResponse diff --git a/test/whop_sdk/resources/users_test.rb b/test/whop_sdk/resources/users_test.rb index e5a034d6..5c22ad5c 100644 --- a/test/whop_sdk/resources/users_test.rb +++ b/test/whop_sdk/resources/users_test.rb @@ -6,7 +6,7 @@ class WhopSDK::Test::Resources::UsersTest < WhopSDK::Test::ResourceTest def test_retrieve skip("Mock server tests are disabled") - response = @whop.users.retrieve("user_xxxxxxxxxxxxx") + response = @whop.users.retrieve("id") assert_pattern do response => WhopSDK::User @@ -16,9 +16,9 @@ def test_retrieve response => { id: String, bio: String | nil, - created_at: Time, + created_at: String, name: String | nil, - profile_picture: WhopSDK::User::ProfilePicture | nil, + profile_picture: WhopSDK::Internal::Type::Unknown | nil, username: String } end @@ -27,7 +27,7 @@ def test_retrieve def test_update skip("Mock server tests are disabled") - response = @whop.users.update("user_xxxxxxxxxxxxx") + response = @whop.users.update("id") assert_pattern do response => WhopSDK::User @@ -37,9 +37,9 @@ def test_update response => { id: String, bio: String | nil, - created_at: Time, + created_at: String, name: String | nil, - profile_picture: WhopSDK::User::ProfilePicture | nil, + profile_picture: WhopSDK::Internal::Type::Unknown | nil, username: String } end @@ -58,16 +58,16 @@ def test_list return if row.nil? assert_pattern do - row => WhopSDK::Models::UserListResponse + row => WhopSDK::User end assert_pattern do row => { id: String, bio: String | nil, - created_at: Time, + created_at: String, name: String | nil, - profile_picture: WhopSDK::Models::UserListResponse::ProfilePicture | nil, + profile_picture: WhopSDK::Internal::Type::Unknown | nil, username: String } end @@ -76,7 +76,7 @@ def test_list def test_check_access_required_params skip("Mock server tests are disabled") - response = @whop.users.check_access("resource_id", id: "user_xxxxxxxxxxxxx") + response = @whop.users.check_access("resource_id", id: "id") assert_pattern do response => WhopSDK::Models::UserCheckAccessResponse @@ -84,9 +84,30 @@ def test_check_access_required_params assert_pattern do response => { - access_level: WhopSDK::AccessLevel, + access_level: WhopSDK::Models::UserCheckAccessResponse::AccessLevel, has_access: WhopSDK::Internal::Type::Boolean } end end + + def test_update_me + skip("Mock server tests are disabled") + + response = @whop.users.update_me + + assert_pattern do + response => WhopSDK::User + end + + assert_pattern do + response => { + id: String, + bio: String | nil, + created_at: String, + name: String | nil, + profile_picture: WhopSDK::Internal::Type::Unknown | nil, + username: String + } + end + end end diff --git a/test/whop_sdk/resources/wallets_test.rb b/test/whop_sdk/resources/wallets_test.rb index 7ad25796..885ff814 100644 --- a/test/whop_sdk/resources/wallets_test.rb +++ b/test/whop_sdk/resources/wallets_test.rb @@ -19,10 +19,10 @@ def test_list end end - def test_balance + def test_balance_required_params skip("Mock server tests are disabled") - response = @whop.wallets.balance("account_id") + response = @whop.wallets.balance(account_id: "account_id") assert_pattern do response => WhopSDK::Models::WalletBalanceResponse @@ -40,7 +40,7 @@ def test_balance def test_send__required_params skip("Mock server tests are disabled") - response = @whop.wallets.send_("account_id", amount: "amount", to: "to") + response = @whop.wallets.send_(account_id: "account_id", amount: "amount", to: "to") assert_pattern do response => WhopSDK::Models::WalletSendResponse From 0edd207cbb4e8b58a5748ae032cc2b6556e9abf7 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 8 Jun 2026 20:08:35 -0700 Subject: [PATCH 12/17] fix: add weekly and monthly Granularities for ad reports --- lib/whop_sdk/models/ad_report_retrieve_response.rb | 12 ++++++------ lib/whop_sdk/models/granularities.rb | 4 +++- rbi/whop_sdk/models/granularities.rbi | 4 +++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/whop_sdk/models/ad_report_retrieve_response.rb b/lib/whop_sdk/models/ad_report_retrieve_response.rb index 4c789a31..221c9907 100644 --- a/lib/whop_sdk/models/ad_report_retrieve_response.rb +++ b/lib/whop_sdk/models/ad_report_retrieve_response.rb @@ -17,7 +17,7 @@ class AdReportRetrieveResponse < WhopSDK::Internal::Type::BaseModel # @!attribute granularity # Per-bucket time series over the date range, ordered ascending by `bucketStart`. # `null` when the `granularity` arg on `adReport` is omitted; otherwise contains - # rows at the requested grain (`daily` or `hourly`). + # rows at the requested grain (`hourly`, `daily`, `weekly`, or `monthly`). # # @return [Array, nil] required :granularity, @@ -54,7 +54,7 @@ class Breakdown < WhopSDK::Internal::Type::BaseModel # @!attribute granularity # Per-bucket time series for this entity over the date range, ordered ascending by # `bucketStart`. `null` when the `granularity` arg on `adReport` is omitted; - # otherwise contains rows at the requested grain (`daily` or `hourly`). + # otherwise contains rows at the requested grain (`hourly`, `daily`, `weekly`, or `monthly`). # # @return [Array, nil] required :granularity, @@ -112,7 +112,7 @@ class Granularity < WhopSDK::Internal::Type::BaseModel required :clicks, Integer # @!attribute granularity - # The bucket size of this row (`daily` or `hourly`). + # The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). # # @return [Symbol, WhopSDK::Models::Granularities] required :granularity, enum: -> { WhopSDK::Granularities } @@ -187,7 +187,7 @@ class Granularity < WhopSDK::Internal::Type::BaseModel # # @param clicks [Integer] Clicks in this bucket. # - # @param granularity [Symbol, WhopSDK::Models::Granularities] The bucket size of this row (`daily` or `hourly`). + # @param granularity [Symbol, WhopSDK::Models::Granularities] The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). # # @param impressions [Integer] Impressions in this bucket. # @@ -363,7 +363,7 @@ class Granularity < WhopSDK::Internal::Type::BaseModel required :clicks, Integer # @!attribute granularity - # The bucket size of this row (`daily` or `hourly`). + # The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). # # @return [Symbol, WhopSDK::Models::Granularities] required :granularity, enum: -> { WhopSDK::Granularities } @@ -437,7 +437,7 @@ class Granularity < WhopSDK::Internal::Type::BaseModel # # @param clicks [Integer] Clicks in this bucket. # - # @param granularity [Symbol, WhopSDK::Models::Granularities] The bucket size of this row (`daily` or `hourly`). + # @param granularity [Symbol, WhopSDK::Models::Granularities] The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). # # @param impressions [Integer] Impressions in this bucket. # diff --git a/lib/whop_sdk/models/granularities.rb b/lib/whop_sdk/models/granularities.rb index 69b84f10..4b6a36ec 100644 --- a/lib/whop_sdk/models/granularities.rb +++ b/lib/whop_sdk/models/granularities.rb @@ -6,8 +6,10 @@ module Models module Granularities extend WhopSDK::Internal::Type::Enum - DAILY = :daily HOURLY = :hourly + DAILY = :daily + WEEKLY = :weekly + MONTHLY = :monthly # @!method self.values # @return [Array] diff --git a/rbi/whop_sdk/models/granularities.rbi b/rbi/whop_sdk/models/granularities.rbi index baebf463..b8b8a902 100644 --- a/rbi/whop_sdk/models/granularities.rbi +++ b/rbi/whop_sdk/models/granularities.rbi @@ -9,8 +9,10 @@ module WhopSDK TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Granularities) } OrSymbol = T.type_alias { T.any(Symbol, String) } - DAILY = T.let(:daily, WhopSDK::Granularities::TaggedSymbol) HOURLY = T.let(:hourly, WhopSDK::Granularities::TaggedSymbol) + DAILY = T.let(:daily, WhopSDK::Granularities::TaggedSymbol) + WEEKLY = T.let(:weekly, WhopSDK::Granularities::TaggedSymbol) + MONTHLY = T.let(:monthly, WhopSDK::Granularities::TaggedSymbol) sig { override.returns(T::Array[WhopSDK::Granularities::TaggedSymbol]) } def self.values From 65fb473601e7728a94657a921cc1f88ffd2fdf48 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 9 Jun 2026 21:41:37 +0000 Subject: [PATCH 13/17] feat(api): native /users resource + date-based API versioning Stainless-Generated-From: e9c599fb6a899b2dbc9445a2874c66eb606187af --- lib/whop_sdk/models/ad.rb | 58 +++++----- lib/whop_sdk/models/ad_campaign.rb | 58 +++++----- .../models/ad_campaign_list_response.rb | 58 +++++----- lib/whop_sdk/models/ad_group.rb | 58 +++++----- lib/whop_sdk/models/ad_group_list_response.rb | 58 +++++----- lib/whop_sdk/models/ad_list_response.rb | 58 +++++----- lib/whop_sdk/models/user_update_me_params.rb | 18 ++- lib/whop_sdk/models/user_update_params.rb | 32 +++++- lib/whop_sdk/resources/users.rb | 33 ++++-- rbi/whop_sdk/models/ad.rbi | 77 ++++++++----- rbi/whop_sdk/models/ad_campaign.rbi | 89 ++++++++++----- .../models/ad_campaign_list_response.rbi | 105 +++++++++++++----- rbi/whop_sdk/models/ad_group.rbi | 89 ++++++++++----- .../models/ad_group_list_response.rbi | 105 +++++++++++++----- rbi/whop_sdk/models/ad_list_response.rbi | 102 ++++++++++++----- rbi/whop_sdk/models/user_update_me_params.rbi | 13 +++ rbi/whop_sdk/models/user_update_params.rbi | 54 +++++++++ rbi/whop_sdk/resources/users.rbi | 17 ++- sig/whop_sdk/models/ad.rbs | 48 +++++--- sig/whop_sdk/models/ad_campaign.rbs | 48 +++++--- .../models/ad_campaign_list_response.rbs | 48 +++++--- sig/whop_sdk/models/ad_group.rbs | 48 +++++--- .../models/ad_group_list_response.rbs | 48 +++++--- sig/whop_sdk/models/ad_list_response.rbs | 48 +++++--- sig/whop_sdk/models/user_update_me_params.rbs | 7 ++ sig/whop_sdk/models/user_update_params.rbs | 39 ++++++- sig/whop_sdk/resources/users.rbs | 3 + 27 files changed, 987 insertions(+), 432 deletions(-) diff --git a/lib/whop_sdk/models/ad.rb b/lib/whop_sdk/models/ad.rb index 5eff4a29..18806d93 100644 --- a/lib/whop_sdk/models/ad.rb +++ b/lib/whop_sdk/models/ad.rb @@ -266,30 +266,18 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel end class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @return [Symbol, WhopSDK::Models::Ad::Issue::Category, nil] + required :category, enum: -> { WhopSDK::Ad::Issue::Category }, nil?: true + # @!attribute created_at # When the issue was first reported. # # @return [Time] required :created_at, Time - # @!attribute error_code - # Platform-specific error code. - # - # @return [String, nil] - required :error_code, String, nil?: true - - # @!attribute error_message - # Full error detail from the platform. - # - # @return [String, nil] - required :error_message, String, nil?: true - - # @!attribute error_summary - # Short description of the issue. - # - # @return [String] - required :error_summary, String - # @!attribute resolution_status # Current resolution status. # @@ -310,25 +298,45 @@ class Issue < WhopSDK::Internal::Type::BaseModel # @return [String] required :resource_type, String - # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # @!attribute subtype + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + # + # @return [String, nil] + required :subtype, String, nil?: true + + # @!method initialize(category:, created_at:, resolution_status:, resource_id:, resource_type:, subtype:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::Ad::Issue} for more details. # # A platform-reported issue on an ad object (rejection, policy flag, etc.). # - # @param created_at [Time] When the issue was first reported. - # - # @param error_code [String, nil] Platform-specific error code. + # @param category [Symbol, WhopSDK::Models::Ad::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. # - # @param error_message [String, nil] Full error detail from the platform. - # - # @param error_summary [String] Short description of the issue. + # @param created_at [Time] When the issue was first reported. # # @param resolution_status [Symbol, WhopSDK::Models::Ad::Issue::ResolutionStatus] Current resolution status. # # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N # # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # + # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @see WhopSDK::Models::Ad::Issue#category + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION = :policy_rejection + CREATIVE_MEDIA = :creative_media + AUDIENCE_TARGETING = :audience_targeting + AD_VOLUME_LIMIT = :ad_volume_limit + + # @!method self.values + # @return [Array] + end # Current resolution status. # diff --git a/lib/whop_sdk/models/ad_campaign.rb b/lib/whop_sdk/models/ad_campaign.rb index d4b49a43..e8160765 100644 --- a/lib/whop_sdk/models/ad_campaign.rb +++ b/lib/whop_sdk/models/ad_campaign.rb @@ -238,30 +238,18 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel # @param updated_at [Time] When the ad campaign was last updated. class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @return [Symbol, WhopSDK::Models::AdCampaign::Issue::Category, nil] + required :category, enum: -> { WhopSDK::AdCampaign::Issue::Category }, nil?: true + # @!attribute created_at # When the issue was first reported. # # @return [Time] required :created_at, Time - # @!attribute error_code - # Platform-specific error code. - # - # @return [String, nil] - required :error_code, String, nil?: true - - # @!attribute error_message - # Full error detail from the platform. - # - # @return [String, nil] - required :error_message, String, nil?: true - - # @!attribute error_summary - # Short description of the issue. - # - # @return [String] - required :error_summary, String - # @!attribute resolution_status # Current resolution status. # @@ -282,25 +270,45 @@ class Issue < WhopSDK::Internal::Type::BaseModel # @return [String] required :resource_type, String - # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # @!attribute subtype + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + # + # @return [String, nil] + required :subtype, String, nil?: true + + # @!method initialize(category:, created_at:, resolution_status:, resource_id:, resource_type:, subtype:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdCampaign::Issue} for more details. # # A platform-reported issue on an ad object (rejection, policy flag, etc.). # - # @param created_at [Time] When the issue was first reported. - # - # @param error_code [String, nil] Platform-specific error code. + # @param category [Symbol, WhopSDK::Models::AdCampaign::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. # - # @param error_message [String, nil] Full error detail from the platform. - # - # @param error_summary [String] Short description of the issue. + # @param created_at [Time] When the issue was first reported. # # @param resolution_status [Symbol, WhopSDK::Models::AdCampaign::Issue::ResolutionStatus] Current resolution status. # # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N # # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # + # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @see WhopSDK::Models::AdCampaign::Issue#category + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION = :policy_rejection + CREATIVE_MEDIA = :creative_media + AUDIENCE_TARGETING = :audience_targeting + AD_VOLUME_LIMIT = :ad_volume_limit + + # @!method self.values + # @return [Array] + end # Current resolution status. # diff --git a/lib/whop_sdk/models/ad_campaign_list_response.rb b/lib/whop_sdk/models/ad_campaign_list_response.rb index be3e1f28..1d1924dc 100644 --- a/lib/whop_sdk/models/ad_campaign_list_response.rb +++ b/lib/whop_sdk/models/ad_campaign_list_response.rb @@ -238,30 +238,18 @@ class AdCampaignListResponse < WhopSDK::Internal::Type::BaseModel # @param updated_at [Time] When the ad campaign was last updated. class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @return [Symbol, WhopSDK::Models::AdCampaignListResponse::Issue::Category, nil] + required :category, enum: -> { WhopSDK::Models::AdCampaignListResponse::Issue::Category }, nil?: true + # @!attribute created_at # When the issue was first reported. # # @return [Time] required :created_at, Time - # @!attribute error_code - # Platform-specific error code. - # - # @return [String, nil] - required :error_code, String, nil?: true - - # @!attribute error_message - # Full error detail from the platform. - # - # @return [String, nil] - required :error_message, String, nil?: true - - # @!attribute error_summary - # Short description of the issue. - # - # @return [String] - required :error_summary, String - # @!attribute resolution_status # Current resolution status. # @@ -282,25 +270,45 @@ class Issue < WhopSDK::Internal::Type::BaseModel # @return [String] required :resource_type, String - # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # @!attribute subtype + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + # + # @return [String, nil] + required :subtype, String, nil?: true + + # @!method initialize(category:, created_at:, resolution_status:, resource_id:, resource_type:, subtype:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdCampaignListResponse::Issue} for more details. # # A platform-reported issue on an ad object (rejection, policy flag, etc.). # - # @param created_at [Time] When the issue was first reported. - # - # @param error_code [String, nil] Platform-specific error code. + # @param category [Symbol, WhopSDK::Models::AdCampaignListResponse::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. # - # @param error_message [String, nil] Full error detail from the platform. - # - # @param error_summary [String] Short description of the issue. + # @param created_at [Time] When the issue was first reported. # # @param resolution_status [Symbol, WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus] Current resolution status. # # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N # # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # + # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @see WhopSDK::Models::AdCampaignListResponse::Issue#category + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION = :policy_rejection + CREATIVE_MEDIA = :creative_media + AUDIENCE_TARGETING = :audience_targeting + AD_VOLUME_LIMIT = :ad_volume_limit + + # @!method self.values + # @return [Array] + end # Current resolution status. # diff --git a/lib/whop_sdk/models/ad_group.rb b/lib/whop_sdk/models/ad_group.rb index c4e8a0f5..3ce4c2af 100644 --- a/lib/whop_sdk/models/ad_group.rb +++ b/lib/whop_sdk/models/ad_group.rb @@ -260,30 +260,18 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel end class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @return [Symbol, WhopSDK::Models::AdGroup::Issue::Category, nil] + required :category, enum: -> { WhopSDK::AdGroup::Issue::Category }, nil?: true + # @!attribute created_at # When the issue was first reported. # # @return [Time] required :created_at, Time - # @!attribute error_code - # Platform-specific error code. - # - # @return [String, nil] - required :error_code, String, nil?: true - - # @!attribute error_message - # Full error detail from the platform. - # - # @return [String, nil] - required :error_message, String, nil?: true - - # @!attribute error_summary - # Short description of the issue. - # - # @return [String] - required :error_summary, String - # @!attribute resolution_status # Current resolution status. # @@ -304,25 +292,45 @@ class Issue < WhopSDK::Internal::Type::BaseModel # @return [String] required :resource_type, String - # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # @!attribute subtype + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + # + # @return [String, nil] + required :subtype, String, nil?: true + + # @!method initialize(category:, created_at:, resolution_status:, resource_id:, resource_type:, subtype:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdGroup::Issue} for more details. # # A platform-reported issue on an ad object (rejection, policy flag, etc.). # - # @param created_at [Time] When the issue was first reported. - # - # @param error_code [String, nil] Platform-specific error code. + # @param category [Symbol, WhopSDK::Models::AdGroup::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. # - # @param error_message [String, nil] Full error detail from the platform. - # - # @param error_summary [String] Short description of the issue. + # @param created_at [Time] When the issue was first reported. # # @param resolution_status [Symbol, WhopSDK::Models::AdGroup::Issue::ResolutionStatus] Current resolution status. # # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N # # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # + # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @see WhopSDK::Models::AdGroup::Issue#category + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION = :policy_rejection + CREATIVE_MEDIA = :creative_media + AUDIENCE_TARGETING = :audience_targeting + AD_VOLUME_LIMIT = :ad_volume_limit + + # @!method self.values + # @return [Array] + end # Current resolution status. # diff --git a/lib/whop_sdk/models/ad_group_list_response.rb b/lib/whop_sdk/models/ad_group_list_response.rb index 3d72f100..6d4b3011 100644 --- a/lib/whop_sdk/models/ad_group_list_response.rb +++ b/lib/whop_sdk/models/ad_group_list_response.rb @@ -260,30 +260,18 @@ class AdCampaign < WhopSDK::Internal::Type::BaseModel end class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @return [Symbol, WhopSDK::Models::AdGroupListResponse::Issue::Category, nil] + required :category, enum: -> { WhopSDK::Models::AdGroupListResponse::Issue::Category }, nil?: true + # @!attribute created_at # When the issue was first reported. # # @return [Time] required :created_at, Time - # @!attribute error_code - # Platform-specific error code. - # - # @return [String, nil] - required :error_code, String, nil?: true - - # @!attribute error_message - # Full error detail from the platform. - # - # @return [String, nil] - required :error_message, String, nil?: true - - # @!attribute error_summary - # Short description of the issue. - # - # @return [String] - required :error_summary, String - # @!attribute resolution_status # Current resolution status. # @@ -304,25 +292,45 @@ class Issue < WhopSDK::Internal::Type::BaseModel # @return [String] required :resource_type, String - # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # @!attribute subtype + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + # + # @return [String, nil] + required :subtype, String, nil?: true + + # @!method initialize(category:, created_at:, resolution_status:, resource_id:, resource_type:, subtype:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdGroupListResponse::Issue} for more details. # # A platform-reported issue on an ad object (rejection, policy flag, etc.). # - # @param created_at [Time] When the issue was first reported. - # - # @param error_code [String, nil] Platform-specific error code. + # @param category [Symbol, WhopSDK::Models::AdGroupListResponse::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. # - # @param error_message [String, nil] Full error detail from the platform. - # - # @param error_summary [String] Short description of the issue. + # @param created_at [Time] When the issue was first reported. # # @param resolution_status [Symbol, WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus] Current resolution status. # # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N # # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # + # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @see WhopSDK::Models::AdGroupListResponse::Issue#category + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION = :policy_rejection + CREATIVE_MEDIA = :creative_media + AUDIENCE_TARGETING = :audience_targeting + AD_VOLUME_LIMIT = :ad_volume_limit + + # @!method self.values + # @return [Array] + end # Current resolution status. # diff --git a/lib/whop_sdk/models/ad_list_response.rb b/lib/whop_sdk/models/ad_list_response.rb index 9b01f58b..cd2c173d 100644 --- a/lib/whop_sdk/models/ad_list_response.rb +++ b/lib/whop_sdk/models/ad_list_response.rb @@ -266,30 +266,18 @@ class AdGroup < WhopSDK::Internal::Type::BaseModel end class Issue < WhopSDK::Internal::Type::BaseModel + # @!attribute category + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @return [Symbol, WhopSDK::Models::AdListResponse::Issue::Category, nil] + required :category, enum: -> { WhopSDK::Models::AdListResponse::Issue::Category }, nil?: true + # @!attribute created_at # When the issue was first reported. # # @return [Time] required :created_at, Time - # @!attribute error_code - # Platform-specific error code. - # - # @return [String, nil] - required :error_code, String, nil?: true - - # @!attribute error_message - # Full error detail from the platform. - # - # @return [String, nil] - required :error_message, String, nil?: true - - # @!attribute error_summary - # Short description of the issue. - # - # @return [String] - required :error_summary, String - # @!attribute resolution_status # Current resolution status. # @@ -310,25 +298,45 @@ class Issue < WhopSDK::Internal::Type::BaseModel # @return [String] required :resource_type, String - # @!method initialize(created_at:, error_code:, error_message:, error_summary:, resolution_status:, resource_id:, resource_type:) + # @!attribute subtype + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + # + # @return [String, nil] + required :subtype, String, nil?: true + + # @!method initialize(category:, created_at:, resolution_status:, resource_id:, resource_type:, subtype:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::AdListResponse::Issue} for more details. # # A platform-reported issue on an ad object (rejection, policy flag, etc.). # - # @param created_at [Time] When the issue was first reported. - # - # @param error_code [String, nil] Platform-specific error code. + # @param category [Symbol, WhopSDK::Models::AdListResponse::Issue::Category, nil] Whop's canonical category that a raw platform issue is bucketed into. # - # @param error_message [String, nil] Full error detail from the platform. - # - # @param error_summary [String] Short description of the issue. + # @param created_at [Time] When the issue was first reported. # # @param resolution_status [Symbol, WhopSDK::Models::AdListResponse::Issue::ResolutionStatus] Current resolution status. # # @param resource_id [String, nil] The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). N # # @param resource_type [String] The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. Pair + # + # @param subtype [String, nil] Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + + # Whop's canonical category that a raw platform issue is bucketed into. + # + # @see WhopSDK::Models::AdListResponse::Issue#category + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION = :policy_rejection + CREATIVE_MEDIA = :creative_media + AUDIENCE_TARGETING = :audience_targeting + AD_VOLUME_LIMIT = :ad_volume_limit + + # @!method self.values + # @return [Array] + end # Current resolution status. # diff --git a/lib/whop_sdk/models/user_update_me_params.rb b/lib/whop_sdk/models/user_update_me_params.rb index fd2c1e8a..54de5637 100644 --- a/lib/whop_sdk/models/user_update_me_params.rb +++ b/lib/whop_sdk/models/user_update_me_params.rb @@ -7,6 +7,13 @@ class UserUpdateMeParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + # @!attribute account_id + # When set, updates the authenticated user's profile override for this account + # instead of their global profile. + # + # @return [String, nil] + optional :account_id, String + # @!attribute bio # # @return [String, nil] @@ -27,11 +34,20 @@ class UserUpdateMeParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :username, String - # @!method initialize(bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) + # @!method initialize(account_id: nil, bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::UserUpdateMeParams} for more details. + # + # @param account_id [String] When set, updates the authenticated user's profile override for this account ins + # # @param bio [String] + # # @param name [String] + # # @param profile_picture [WhopSDK::Models::UserUpdateMeParams::ProfilePicture] + # # @param username [String] + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] class ProfilePicture < WhopSDK::Internal::Type::BaseModel diff --git a/lib/whop_sdk/models/user_update_params.rb b/lib/whop_sdk/models/user_update_params.rb index 3fba7295..6fd217f1 100644 --- a/lib/whop_sdk/models/user_update_params.rb +++ b/lib/whop_sdk/models/user_update_params.rb @@ -28,7 +28,17 @@ class UserUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :name, String - # @!method initialize(id:, account_id: nil, bio: nil, name: nil, request_options: {}) + # @!attribute profile_picture + # + # @return [WhopSDK::Models::UserUpdateParams::ProfilePicture, nil] + optional :profile_picture, -> { WhopSDK::UserUpdateParams::ProfilePicture } + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(id:, account_id: nil, bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) # @param id [String] # # @param account_id [String] The account whose profile override to update. Required for API key callers. @@ -37,7 +47,27 @@ class UserUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param name [String] # + # @param profile_picture [WhopSDK::Models::UserUpdateParams::ProfilePicture] + # + # @param username [String] + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute direct_upload_id + # + # @return [String, nil] + optional :direct_upload_id, String + + # @!method initialize(id: nil, direct_upload_id: nil) + # @param id [String] + # @param direct_upload_id [String] + end end end end diff --git a/lib/whop_sdk/resources/users.rb b/lib/whop_sdk/resources/users.rb index f8caed19..924bc65d 100644 --- a/lib/whop_sdk/resources/users.rb +++ b/lib/whop_sdk/resources/users.rb @@ -38,7 +38,7 @@ def retrieve(id, params = {}) # Updates a user. A user token updates their own global profile; an API key # updates the user's account-specific profile override (account_id required). # - # @overload update(id, account_id: nil, bio: nil, name: nil, request_options: {}) + # @overload update(id, account_id: nil, bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) # # @param id [String] Path param: The ID of the user, which will look like user\_******\*******, a # usern @@ -49,6 +49,10 @@ def retrieve(id, params = {}) # # @param name [String] Body param # + # @param profile_picture [WhopSDK::Models::UserUpdateParams::ProfilePicture] Body param + # + # @param username [String] Body param + # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::User] @@ -130,25 +134,38 @@ def check_access(resource_id, params) ) end - # Updates the authenticated user's global profile. Not available to API keys. + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::UserUpdateMeParams} for more details. + # + # Updates the authenticated user's global profile, or their profile override for + # an account when account_id is given. Not available to API keys. # - # @overload update_me(bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) + # @overload update_me(account_id: nil, bio: nil, name: nil, profile_picture: nil, username: nil, request_options: {}) + # + # @param account_id [String] Query param: When set, updates the authenticated user's profile override for thi + # + # @param bio [String] Body param + # + # @param name [String] Body param + # + # @param profile_picture [WhopSDK::Models::UserUpdateMeParams::ProfilePicture] Body param + # + # @param username [String] Body param # - # @param bio [String] - # @param name [String] - # @param profile_picture [WhopSDK::Models::UserUpdateMeParams::ProfilePicture] - # @param username [String] # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [WhopSDK::Models::User] # # @see WhopSDK::Models::UserUpdateMeParams def update_me(params = {}) + query_params = [:account_id] parsed, options = WhopSDK::UserUpdateMeParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :patch, path: "users/me", - body: parsed, + query: query, + body: parsed.except(*query_params), model: WhopSDK::User, options: options ) diff --git a/rbi/whop_sdk/models/ad.rbi b/rbi/whop_sdk/models/ad.rbi index 44defebb..bd5c210f 100644 --- a/rbi/whop_sdk/models/ad.rbi +++ b/rbi/whop_sdk/models/ad.rbi @@ -317,22 +317,14 @@ module WhopSDK OrHash = T.type_alias { T.any(WhopSDK::Ad::Issue, WhopSDK::Internal::AnyHash) } + # Whop's canonical category that a raw platform issue is bucketed into. + sig { returns(T.nilable(WhopSDK::Ad::Issue::Category::TaggedSymbol)) } + attr_accessor :category + # When the issue was first reported. sig { returns(Time) } attr_accessor :created_at - # Platform-specific error code. - sig { returns(T.nilable(String)) } - attr_accessor :error_code - - # Full error detail from the platform. - sig { returns(T.nilable(String)) } - attr_accessor :error_message - - # Short description of the issue. - sig { returns(String) } - attr_accessor :error_summary - # Current resolution status. sig { returns(WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol) } attr_accessor :resolution_status @@ -347,27 +339,27 @@ module WhopSDK sig { returns(String) } attr_accessor :resource_type + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + sig { returns(T.nilable(String)) } + attr_accessor :subtype + # A platform-reported issue on an ad object (rejection, policy flag, etc.). sig do params( + category: T.nilable(WhopSDK::Ad::Issue::Category::OrSymbol), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Ad::Issue::ResolutionStatus::OrSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Whop's canonical category that a raw platform issue is bucketed into. + category:, # When the issue was first reported. created_at:, - # Platform-specific error code. - error_code:, - # Full error detail from the platform. - error_message:, - # Short description of the issue. - error_summary:, # Current resolution status. resolution_status:, # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). @@ -375,27 +367,58 @@ module WhopSDK resource_id:, # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. # Pairs with `resourceId`. - resource_type: + resource_type:, + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + subtype: ) end sig do override.returns( { + category: T.nilable(WhopSDK::Ad::Issue::Category::TaggedSymbol), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Ad::Issue::ResolutionStatus::TaggedSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) } ) end def to_hash end + # Whop's canonical category that a raw platform issue is bucketed into. + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::Ad::Issue::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLICY_REJECTION = + T.let(:policy_rejection, WhopSDK::Ad::Issue::Category::TaggedSymbol) + CREATIVE_MEDIA = + T.let(:creative_media, WhopSDK::Ad::Issue::Category::TaggedSymbol) + AUDIENCE_TARGETING = + T.let( + :audience_targeting, + WhopSDK::Ad::Issue::Category::TaggedSymbol + ) + AD_VOLUME_LIMIT = + T.let(:ad_volume_limit, WhopSDK::Ad::Issue::Category::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::Ad::Issue::Category::TaggedSymbol] + ) + end + def self.values + end + end + # Current resolution status. module ResolutionStatus extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/ad_campaign.rbi b/rbi/whop_sdk/models/ad_campaign.rbi index 18f8aff3..5e6c36be 100644 --- a/rbi/whop_sdk/models/ad_campaign.rbi +++ b/rbi/whop_sdk/models/ad_campaign.rbi @@ -268,22 +268,16 @@ module WhopSDK T.any(WhopSDK::AdCampaign::Issue, WhopSDK::Internal::AnyHash) end + # Whop's canonical category that a raw platform issue is bucketed into. + sig do + returns(T.nilable(WhopSDK::AdCampaign::Issue::Category::TaggedSymbol)) + end + attr_accessor :category + # When the issue was first reported. sig { returns(Time) } attr_accessor :created_at - # Platform-specific error code. - sig { returns(T.nilable(String)) } - attr_accessor :error_code - - # Full error detail from the platform. - sig { returns(T.nilable(String)) } - attr_accessor :error_message - - # Short description of the issue. - sig { returns(String) } - attr_accessor :error_summary - # Current resolution status. sig do returns(WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol) @@ -300,28 +294,28 @@ module WhopSDK sig { returns(String) } attr_accessor :resource_type + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + sig { returns(T.nilable(String)) } + attr_accessor :subtype + # A platform-reported issue on an ad object (rejection, policy flag, etc.). sig do params( + category: T.nilable(WhopSDK::AdCampaign::Issue::Category::OrSymbol), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::AdCampaign::Issue::ResolutionStatus::OrSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Whop's canonical category that a raw platform issue is bucketed into. + category:, # When the issue was first reported. created_at:, - # Platform-specific error code. - error_code:, - # Full error detail from the platform. - error_message:, - # Short description of the issue. - error_summary:, # Current resolution status. resolution_status:, # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). @@ -329,27 +323,68 @@ module WhopSDK resource_id:, # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. # Pairs with `resourceId`. - resource_type: + resource_type:, + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + subtype: ) end sig do override.returns( { + category: + T.nilable(WhopSDK::AdCampaign::Issue::Category::TaggedSymbol), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::AdCampaign::Issue::ResolutionStatus::TaggedSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) } ) end def to_hash end + # Whop's canonical category that a raw platform issue is bucketed into. + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdCampaign::Issue::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLICY_REJECTION = + T.let( + :policy_rejection, + WhopSDK::AdCampaign::Issue::Category::TaggedSymbol + ) + CREATIVE_MEDIA = + T.let( + :creative_media, + WhopSDK::AdCampaign::Issue::Category::TaggedSymbol + ) + AUDIENCE_TARGETING = + T.let( + :audience_targeting, + WhopSDK::AdCampaign::Issue::Category::TaggedSymbol + ) + AD_VOLUME_LIMIT = + T.let( + :ad_volume_limit, + WhopSDK::AdCampaign::Issue::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdCampaign::Issue::Category::TaggedSymbol] + ) + end + def self.values + end + end + # Current resolution status. module ResolutionStatus extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/ad_campaign_list_response.rbi b/rbi/whop_sdk/models/ad_campaign_list_response.rbi index b97d5ac3..fc79dcd9 100644 --- a/rbi/whop_sdk/models/ad_campaign_list_response.rbi +++ b/rbi/whop_sdk/models/ad_campaign_list_response.rbi @@ -277,22 +277,20 @@ module WhopSDK ) end + # Whop's canonical category that a raw platform issue is bucketed into. + sig do + returns( + T.nilable( + WhopSDK::Models::AdCampaignListResponse::Issue::Category::TaggedSymbol + ) + ) + end + attr_accessor :category + # When the issue was first reported. sig { returns(Time) } attr_accessor :created_at - # Platform-specific error code. - sig { returns(T.nilable(String)) } - attr_accessor :error_code - - # Full error detail from the platform. - sig { returns(T.nilable(String)) } - attr_accessor :error_message - - # Short description of the issue. - sig { returns(String) } - attr_accessor :error_summary - # Current resolution status. sig do returns( @@ -311,28 +309,31 @@ module WhopSDK sig { returns(String) } attr_accessor :resource_type + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + sig { returns(T.nilable(String)) } + attr_accessor :subtype + # A platform-reported issue on an ad object (rejection, policy flag, etc.). sig do params( + category: + T.nilable( + WhopSDK::Models::AdCampaignListResponse::Issue::Category::OrSymbol + ), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::OrSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Whop's canonical category that a raw platform issue is bucketed into. + category:, # When the issue was first reported. created_at:, - # Platform-specific error code. - error_code:, - # Full error detail from the platform. - error_message:, - # Short description of the issue. - error_summary:, # Current resolution status. resolution_status:, # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). @@ -340,27 +341,77 @@ module WhopSDK resource_id:, # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. # Pairs with `resourceId`. - resource_type: + resource_type:, + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + subtype: ) end sig do override.returns( { + category: + T.nilable( + WhopSDK::Models::AdCampaignListResponse::Issue::Category::TaggedSymbol + ), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::ResolutionStatus::TaggedSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) } ) end def to_hash end + # Whop's canonical category that a raw platform issue is bucketed into. + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::AdCampaignListResponse::Issue::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLICY_REJECTION = + T.let( + :policy_rejection, + WhopSDK::Models::AdCampaignListResponse::Issue::Category::TaggedSymbol + ) + CREATIVE_MEDIA = + T.let( + :creative_media, + WhopSDK::Models::AdCampaignListResponse::Issue::Category::TaggedSymbol + ) + AUDIENCE_TARGETING = + T.let( + :audience_targeting, + WhopSDK::Models::AdCampaignListResponse::Issue::Category::TaggedSymbol + ) + AD_VOLUME_LIMIT = + T.let( + :ad_volume_limit, + WhopSDK::Models::AdCampaignListResponse::Issue::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AdCampaignListResponse::Issue::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + # Current resolution status. module ResolutionStatus extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/ad_group.rbi b/rbi/whop_sdk/models/ad_group.rbi index 4e91a03c..16b1c1f2 100644 --- a/rbi/whop_sdk/models/ad_group.rbi +++ b/rbi/whop_sdk/models/ad_group.rbi @@ -302,22 +302,16 @@ module WhopSDK T.any(WhopSDK::AdGroup::Issue, WhopSDK::Internal::AnyHash) end + # Whop's canonical category that a raw platform issue is bucketed into. + sig do + returns(T.nilable(WhopSDK::AdGroup::Issue::Category::TaggedSymbol)) + end + attr_accessor :category + # When the issue was first reported. sig { returns(Time) } attr_accessor :created_at - # Platform-specific error code. - sig { returns(T.nilable(String)) } - attr_accessor :error_code - - # Full error detail from the platform. - sig { returns(T.nilable(String)) } - attr_accessor :error_message - - # Short description of the issue. - sig { returns(String) } - attr_accessor :error_summary - # Current resolution status. sig { returns(WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol) } attr_accessor :resolution_status @@ -332,28 +326,28 @@ module WhopSDK sig { returns(String) } attr_accessor :resource_type + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + sig { returns(T.nilable(String)) } + attr_accessor :subtype + # A platform-reported issue on an ad object (rejection, policy flag, etc.). sig do params( + category: T.nilable(WhopSDK::AdGroup::Issue::Category::OrSymbol), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::AdGroup::Issue::ResolutionStatus::OrSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Whop's canonical category that a raw platform issue is bucketed into. + category:, # When the issue was first reported. created_at:, - # Platform-specific error code. - error_code:, - # Full error detail from the platform. - error_message:, - # Short description of the issue. - error_summary:, # Current resolution status. resolution_status:, # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). @@ -361,27 +355,68 @@ module WhopSDK resource_id:, # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. # Pairs with `resourceId`. - resource_type: + resource_type:, + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + subtype: ) end sig do override.returns( { + category: + T.nilable(WhopSDK::AdGroup::Issue::Category::TaggedSymbol), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::AdGroup::Issue::ResolutionStatus::TaggedSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) } ) end def to_hash end + # Whop's canonical category that a raw platform issue is bucketed into. + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::AdGroup::Issue::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLICY_REJECTION = + T.let( + :policy_rejection, + WhopSDK::AdGroup::Issue::Category::TaggedSymbol + ) + CREATIVE_MEDIA = + T.let( + :creative_media, + WhopSDK::AdGroup::Issue::Category::TaggedSymbol + ) + AUDIENCE_TARGETING = + T.let( + :audience_targeting, + WhopSDK::AdGroup::Issue::Category::TaggedSymbol + ) + AD_VOLUME_LIMIT = + T.let( + :ad_volume_limit, + WhopSDK::AdGroup::Issue::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::AdGroup::Issue::Category::TaggedSymbol] + ) + end + def self.values + end + end + # Current resolution status. module ResolutionStatus extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/ad_group_list_response.rbi b/rbi/whop_sdk/models/ad_group_list_response.rbi index 4ef68045..3d01cbd8 100644 --- a/rbi/whop_sdk/models/ad_group_list_response.rbi +++ b/rbi/whop_sdk/models/ad_group_list_response.rbi @@ -317,22 +317,20 @@ module WhopSDK ) end + # Whop's canonical category that a raw platform issue is bucketed into. + sig do + returns( + T.nilable( + WhopSDK::Models::AdGroupListResponse::Issue::Category::TaggedSymbol + ) + ) + end + attr_accessor :category + # When the issue was first reported. sig { returns(Time) } attr_accessor :created_at - # Platform-specific error code. - sig { returns(T.nilable(String)) } - attr_accessor :error_code - - # Full error detail from the platform. - sig { returns(T.nilable(String)) } - attr_accessor :error_message - - # Short description of the issue. - sig { returns(String) } - attr_accessor :error_summary - # Current resolution status. sig do returns( @@ -351,28 +349,31 @@ module WhopSDK sig { returns(String) } attr_accessor :resource_type + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + sig { returns(T.nilable(String)) } + attr_accessor :subtype + # A platform-reported issue on an ad object (rejection, policy flag, etc.). sig do params( + category: + T.nilable( + WhopSDK::Models::AdGroupListResponse::Issue::Category::OrSymbol + ), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::OrSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Whop's canonical category that a raw platform issue is bucketed into. + category:, # When the issue was first reported. created_at:, - # Platform-specific error code. - error_code:, - # Full error detail from the platform. - error_message:, - # Short description of the issue. - error_summary:, # Current resolution status. resolution_status:, # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). @@ -380,27 +381,77 @@ module WhopSDK resource_id:, # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. # Pairs with `resourceId`. - resource_type: + resource_type:, + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + subtype: ) end sig do override.returns( { + category: + T.nilable( + WhopSDK::Models::AdGroupListResponse::Issue::Category::TaggedSymbol + ), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::ResolutionStatus::TaggedSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) } ) end def to_hash end + # Whop's canonical category that a raw platform issue is bucketed into. + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::AdGroupListResponse::Issue::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLICY_REJECTION = + T.let( + :policy_rejection, + WhopSDK::Models::AdGroupListResponse::Issue::Category::TaggedSymbol + ) + CREATIVE_MEDIA = + T.let( + :creative_media, + WhopSDK::Models::AdGroupListResponse::Issue::Category::TaggedSymbol + ) + AUDIENCE_TARGETING = + T.let( + :audience_targeting, + WhopSDK::Models::AdGroupListResponse::Issue::Category::TaggedSymbol + ) + AD_VOLUME_LIMIT = + T.let( + :ad_volume_limit, + WhopSDK::Models::AdGroupListResponse::Issue::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AdGroupListResponse::Issue::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + # Current resolution status. module ResolutionStatus extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/ad_list_response.rbi b/rbi/whop_sdk/models/ad_list_response.rbi index 4b372780..638577f6 100644 --- a/rbi/whop_sdk/models/ad_list_response.rbi +++ b/rbi/whop_sdk/models/ad_list_response.rbi @@ -337,22 +337,20 @@ module WhopSDK ) end + # Whop's canonical category that a raw platform issue is bucketed into. + sig do + returns( + T.nilable( + WhopSDK::Models::AdListResponse::Issue::Category::TaggedSymbol + ) + ) + end + attr_accessor :category + # When the issue was first reported. sig { returns(Time) } attr_accessor :created_at - # Platform-specific error code. - sig { returns(T.nilable(String)) } - attr_accessor :error_code - - # Full error detail from the platform. - sig { returns(T.nilable(String)) } - attr_accessor :error_message - - # Short description of the issue. - sig { returns(String) } - attr_accessor :error_summary - # Current resolution status. sig do returns( @@ -371,28 +369,31 @@ module WhopSDK sig { returns(String) } attr_accessor :resource_type + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + sig { returns(T.nilable(String)) } + attr_accessor :subtype + # A platform-reported issue on an ad object (rejection, policy flag, etc.). sig do params( + category: + T.nilable( + WhopSDK::Models::AdListResponse::Issue::Category::OrSymbol + ), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::OrSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) ).returns(T.attached_class) end def self.new( + # Whop's canonical category that a raw platform issue is bucketed into. + category:, # When the issue was first reported. created_at:, - # Platform-specific error code. - error_code:, - # Full error detail from the platform. - error_message:, - # Short description of the issue. - error_summary:, # Current resolution status. resolution_status:, # The Whop ID of the ad object this issue is on (the ad, ad group, or campaign). @@ -400,27 +401,74 @@ module WhopSDK resource_id:, # The kind of ad object this issue is on: `ad`, `ad_group`, or `ad_campaign`. # Pairs with `resourceId`. - resource_type: + resource_type:, + # Finer-grained sub-bucket within the category (e.g. the specific Meta policy for + # a rejection). + subtype: ) end sig do override.returns( { + category: + T.nilable( + WhopSDK::Models::AdListResponse::Issue::Category::TaggedSymbol + ), created_at: Time, - error_code: T.nilable(String), - error_message: T.nilable(String), - error_summary: String, resolution_status: WhopSDK::Models::AdListResponse::Issue::ResolutionStatus::TaggedSymbol, resource_id: T.nilable(String), - resource_type: String + resource_type: String, + subtype: T.nilable(String) } ) end def to_hash end + # Whop's canonical category that a raw platform issue is bucketed into. + module Category + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::Models::AdListResponse::Issue::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLICY_REJECTION = + T.let( + :policy_rejection, + WhopSDK::Models::AdListResponse::Issue::Category::TaggedSymbol + ) + CREATIVE_MEDIA = + T.let( + :creative_media, + WhopSDK::Models::AdListResponse::Issue::Category::TaggedSymbol + ) + AUDIENCE_TARGETING = + T.let( + :audience_targeting, + WhopSDK::Models::AdListResponse::Issue::Category::TaggedSymbol + ) + AD_VOLUME_LIMIT = + T.let( + :ad_volume_limit, + WhopSDK::Models::AdListResponse::Issue::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::AdListResponse::Issue::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + # Current resolution status. module ResolutionStatus extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/user_update_me_params.rbi b/rbi/whop_sdk/models/user_update_me_params.rbi index 53a05e6e..32f669b2 100644 --- a/rbi/whop_sdk/models/user_update_me_params.rbi +++ b/rbi/whop_sdk/models/user_update_me_params.rbi @@ -11,6 +11,14 @@ module WhopSDK T.any(WhopSDK::UserUpdateMeParams, WhopSDK::Internal::AnyHash) end + # When set, updates the authenticated user's profile override for this account + # instead of their global profile. + sig { returns(T.nilable(String)) } + attr_reader :account_id + + sig { params(account_id: String).void } + attr_writer :account_id + sig { returns(T.nilable(String)) } attr_reader :bio @@ -41,6 +49,7 @@ module WhopSDK sig do params( + account_id: String, bio: String, name: String, profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture::OrHash, @@ -49,6 +58,9 @@ module WhopSDK ).returns(T.attached_class) end def self.new( + # When set, updates the authenticated user's profile override for this account + # instead of their global profile. + account_id: nil, bio: nil, name: nil, profile_picture: nil, @@ -60,6 +72,7 @@ module WhopSDK sig do override.returns( { + account_id: String, bio: String, name: String, profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, diff --git a/rbi/whop_sdk/models/user_update_params.rbi b/rbi/whop_sdk/models/user_update_params.rbi index 575c45a8..1f366eb7 100644 --- a/rbi/whop_sdk/models/user_update_params.rbi +++ b/rbi/whop_sdk/models/user_update_params.rbi @@ -33,12 +33,30 @@ module WhopSDK sig { params(name: String).void } attr_writer :name + sig { returns(T.nilable(WhopSDK::UserUpdateParams::ProfilePicture)) } + attr_reader :profile_picture + + sig do + params( + profile_picture: WhopSDK::UserUpdateParams::ProfilePicture::OrHash + ).void + end + attr_writer :profile_picture + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + sig do params( id: String, account_id: String, bio: String, name: String, + profile_picture: WhopSDK::UserUpdateParams::ProfilePicture::OrHash, + username: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -48,6 +66,8 @@ module WhopSDK account_id: nil, bio: nil, name: nil, + profile_picture: nil, + username: nil, request_options: {} ) end @@ -59,12 +79,46 @@ module WhopSDK account_id: String, bio: String, name: String, + profile_picture: WhopSDK::UserUpdateParams::ProfilePicture, + username: String, request_options: WhopSDK::RequestOptions } ) end def to_hash end + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::UserUpdateParams::ProfilePicture, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :direct_upload_id + + sig { params(direct_upload_id: String).void } + attr_writer :direct_upload_id + + sig do + params(id: String, direct_upload_id: String).returns(T.attached_class) + end + def self.new(id: nil, direct_upload_id: nil) + end + + sig { override.returns({ id: String, direct_upload_id: String }) } + def to_hash + end + end end end end diff --git a/rbi/whop_sdk/resources/users.rbi b/rbi/whop_sdk/resources/users.rbi index 42d349c9..f26d2040 100644 --- a/rbi/whop_sdk/resources/users.rbi +++ b/rbi/whop_sdk/resources/users.rbi @@ -30,6 +30,8 @@ module WhopSDK account_id: String, bio: String, name: String, + profile_picture: WhopSDK::UserUpdateParams::ProfilePicture::OrHash, + username: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::User) end @@ -44,6 +46,10 @@ module WhopSDK bio: nil, # Body param name: nil, + # Body param + profile_picture: nil, + # Body param + username: nil, request_options: {} ) end @@ -94,9 +100,11 @@ module WhopSDK ) end - # Updates the authenticated user's global profile. Not available to API keys. + # Updates the authenticated user's global profile, or their profile override for + # an account when account_id is given. Not available to API keys. sig do params( + account_id: String, bio: String, name: String, profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture::OrHash, @@ -105,9 +113,16 @@ module WhopSDK ).returns(WhopSDK::User) end def update_me( + # Query param: When set, updates the authenticated user's profile override for + # this account instead of their global profile. + account_id: nil, + # Body param bio: nil, + # Body param name: nil, + # Body param profile_picture: nil, + # Body param username: nil, request_options: {} ) diff --git a/sig/whop_sdk/models/ad.rbs b/sig/whop_sdk/models/ad.rbs index ff05d11b..f11e9d44 100644 --- a/sig/whop_sdk/models/ad.rbs +++ b/sig/whop_sdk/models/ad.rbs @@ -168,23 +168,18 @@ module WhopSDK type issue = { + category: WhopSDK::Models::Ad::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor created_at: Time - - attr_accessor error_code: String? - - attr_accessor error_message: String? + attr_accessor category: WhopSDK::Models::Ad::Issue::category? - attr_accessor error_summary: String + attr_accessor created_at: Time attr_accessor resolution_status: WhopSDK::Models::Ad::Issue::resolution_status @@ -192,26 +187,43 @@ module WhopSDK attr_accessor resource_type: String + attr_accessor subtype: String? + def initialize: ( + category: WhopSDK::Models::Ad::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? ) -> void def to_hash: -> { + category: WhopSDK::Models::Ad::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::Ad::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } + type category = + :policy_rejection + | :creative_media + | :audience_targeting + | :ad_volume_limit + + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION: :policy_rejection + CREATIVE_MEDIA: :creative_media + AUDIENCE_TARGETING: :audience_targeting + AD_VOLUME_LIMIT: :ad_volume_limit + + def self?.values: -> ::Array[WhopSDK::Models::Ad::Issue::category] + end + type resolution_status = :open | :resolved | :acknowledged module ResolutionStatus diff --git a/sig/whop_sdk/models/ad_campaign.rbs b/sig/whop_sdk/models/ad_campaign.rbs index 01c7acfc..aaacd317 100644 --- a/sig/whop_sdk/models/ad_campaign.rbs +++ b/sig/whop_sdk/models/ad_campaign.rbs @@ -148,23 +148,18 @@ module WhopSDK type issue = { + category: WhopSDK::Models::AdCampaign::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor created_at: Time - - attr_accessor error_code: String? - - attr_accessor error_message: String? + attr_accessor category: WhopSDK::Models::AdCampaign::Issue::category? - attr_accessor error_summary: String + attr_accessor created_at: Time attr_accessor resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status @@ -172,26 +167,43 @@ module WhopSDK attr_accessor resource_type: String + attr_accessor subtype: String? + def initialize: ( + category: WhopSDK::Models::AdCampaign::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? ) -> void def to_hash: -> { + category: WhopSDK::Models::AdCampaign::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdCampaign::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } + type category = + :policy_rejection + | :creative_media + | :audience_targeting + | :ad_volume_limit + + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION: :policy_rejection + CREATIVE_MEDIA: :creative_media + AUDIENCE_TARGETING: :audience_targeting + AD_VOLUME_LIMIT: :ad_volume_limit + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaign::Issue::category] + end + type resolution_status = :open | :resolved | :acknowledged module ResolutionStatus diff --git a/sig/whop_sdk/models/ad_campaign_list_response.rbs b/sig/whop_sdk/models/ad_campaign_list_response.rbs index c434f748..d8e0f073 100644 --- a/sig/whop_sdk/models/ad_campaign_list_response.rbs +++ b/sig/whop_sdk/models/ad_campaign_list_response.rbs @@ -148,23 +148,18 @@ module WhopSDK type issue = { + category: WhopSDK::Models::AdCampaignListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor created_at: Time - - attr_accessor error_code: String? - - attr_accessor error_message: String? + attr_accessor category: WhopSDK::Models::AdCampaignListResponse::Issue::category? - attr_accessor error_summary: String + attr_accessor created_at: Time attr_accessor resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status @@ -172,26 +167,43 @@ module WhopSDK attr_accessor resource_type: String + attr_accessor subtype: String? + def initialize: ( + category: WhopSDK::Models::AdCampaignListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? ) -> void def to_hash: -> { + category: WhopSDK::Models::AdCampaignListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdCampaignListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } + type category = + :policy_rejection + | :creative_media + | :audience_targeting + | :ad_volume_limit + + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION: :policy_rejection + CREATIVE_MEDIA: :creative_media + AUDIENCE_TARGETING: :audience_targeting + AD_VOLUME_LIMIT: :ad_volume_limit + + def self?.values: -> ::Array[WhopSDK::Models::AdCampaignListResponse::Issue::category] + end + type resolution_status = :open | :resolved | :acknowledged module ResolutionStatus diff --git a/sig/whop_sdk/models/ad_group.rbs b/sig/whop_sdk/models/ad_group.rbs index d92fa899..6c3366b2 100644 --- a/sig/whop_sdk/models/ad_group.rbs +++ b/sig/whop_sdk/models/ad_group.rbs @@ -163,23 +163,18 @@ module WhopSDK type issue = { + category: WhopSDK::Models::AdGroup::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor created_at: Time - - attr_accessor error_code: String? - - attr_accessor error_message: String? + attr_accessor category: WhopSDK::Models::AdGroup::Issue::category? - attr_accessor error_summary: String + attr_accessor created_at: Time attr_accessor resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status @@ -187,26 +182,43 @@ module WhopSDK attr_accessor resource_type: String + attr_accessor subtype: String? + def initialize: ( + category: WhopSDK::Models::AdGroup::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? ) -> void def to_hash: -> { + category: WhopSDK::Models::AdGroup::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdGroup::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } + type category = + :policy_rejection + | :creative_media + | :audience_targeting + | :ad_volume_limit + + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION: :policy_rejection + CREATIVE_MEDIA: :creative_media + AUDIENCE_TARGETING: :audience_targeting + AD_VOLUME_LIMIT: :ad_volume_limit + + def self?.values: -> ::Array[WhopSDK::Models::AdGroup::Issue::category] + end + type resolution_status = :open | :resolved | :acknowledged module ResolutionStatus diff --git a/sig/whop_sdk/models/ad_group_list_response.rbs b/sig/whop_sdk/models/ad_group_list_response.rbs index f41996b8..107142a3 100644 --- a/sig/whop_sdk/models/ad_group_list_response.rbs +++ b/sig/whop_sdk/models/ad_group_list_response.rbs @@ -163,23 +163,18 @@ module WhopSDK type issue = { + category: WhopSDK::Models::AdGroupListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor created_at: Time - - attr_accessor error_code: String? - - attr_accessor error_message: String? + attr_accessor category: WhopSDK::Models::AdGroupListResponse::Issue::category? - attr_accessor error_summary: String + attr_accessor created_at: Time attr_accessor resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status @@ -187,26 +182,43 @@ module WhopSDK attr_accessor resource_type: String + attr_accessor subtype: String? + def initialize: ( + category: WhopSDK::Models::AdGroupListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? ) -> void def to_hash: -> { + category: WhopSDK::Models::AdGroupListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdGroupListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } + type category = + :policy_rejection + | :creative_media + | :audience_targeting + | :ad_volume_limit + + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION: :policy_rejection + CREATIVE_MEDIA: :creative_media + AUDIENCE_TARGETING: :audience_targeting + AD_VOLUME_LIMIT: :ad_volume_limit + + def self?.values: -> ::Array[WhopSDK::Models::AdGroupListResponse::Issue::category] + end + type resolution_status = :open | :resolved | :acknowledged module ResolutionStatus diff --git a/sig/whop_sdk/models/ad_list_response.rbs b/sig/whop_sdk/models/ad_list_response.rbs index 101ec02d..f2d2706a 100644 --- a/sig/whop_sdk/models/ad_list_response.rbs +++ b/sig/whop_sdk/models/ad_list_response.rbs @@ -168,23 +168,18 @@ module WhopSDK type issue = { + category: WhopSDK::Models::AdListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } class Issue < WhopSDK::Internal::Type::BaseModel - attr_accessor created_at: Time - - attr_accessor error_code: String? - - attr_accessor error_message: String? + attr_accessor category: WhopSDK::Models::AdListResponse::Issue::category? - attr_accessor error_summary: String + attr_accessor created_at: Time attr_accessor resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status @@ -192,26 +187,43 @@ module WhopSDK attr_accessor resource_type: String + attr_accessor subtype: String? + def initialize: ( + category: WhopSDK::Models::AdListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? ) -> void def to_hash: -> { + category: WhopSDK::Models::AdListResponse::Issue::category?, created_at: Time, - error_code: String?, - error_message: String?, - error_summary: String, resolution_status: WhopSDK::Models::AdListResponse::Issue::resolution_status, resource_id: String?, - resource_type: String + resource_type: String, + subtype: String? } + type category = + :policy_rejection + | :creative_media + | :audience_targeting + | :ad_volume_limit + + module Category + extend WhopSDK::Internal::Type::Enum + + POLICY_REJECTION: :policy_rejection + CREATIVE_MEDIA: :creative_media + AUDIENCE_TARGETING: :audience_targeting + AD_VOLUME_LIMIT: :ad_volume_limit + + def self?.values: -> ::Array[WhopSDK::Models::AdListResponse::Issue::category] + end + type resolution_status = :open | :resolved | :acknowledged module ResolutionStatus diff --git a/sig/whop_sdk/models/user_update_me_params.rbs b/sig/whop_sdk/models/user_update_me_params.rbs index 19c04ddf..cde7d57c 100644 --- a/sig/whop_sdk/models/user_update_me_params.rbs +++ b/sig/whop_sdk/models/user_update_me_params.rbs @@ -2,6 +2,7 @@ module WhopSDK module Models type user_update_me_params = { + account_id: String, bio: String, name: String, profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, @@ -13,6 +14,10 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters + attr_reader account_id: String? + + def account_id=: (String) -> String + attr_reader bio: String? def bio=: (String) -> String @@ -32,6 +37,7 @@ module WhopSDK def username=: (String) -> String def initialize: ( + ?account_id: String, ?bio: String, ?name: String, ?profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, @@ -40,6 +46,7 @@ module WhopSDK ) -> void def to_hash: -> { + account_id: String, bio: String, name: String, profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, diff --git a/sig/whop_sdk/models/user_update_params.rbs b/sig/whop_sdk/models/user_update_params.rbs index 56ccf1c6..3a2e9df6 100644 --- a/sig/whop_sdk/models/user_update_params.rbs +++ b/sig/whop_sdk/models/user_update_params.rbs @@ -1,7 +1,14 @@ module WhopSDK module Models type user_update_params = - { id: String, account_id: String, bio: String, name: String } + { + id: String, + account_id: String, + bio: String, + name: String, + profile_picture: WhopSDK::UserUpdateParams::ProfilePicture, + username: String + } & WhopSDK::Internal::Type::request_parameters class UserUpdateParams < WhopSDK::Internal::Type::BaseModel @@ -22,11 +29,23 @@ module WhopSDK def name=: (String) -> String + attr_reader profile_picture: WhopSDK::UserUpdateParams::ProfilePicture? + + def profile_picture=: ( + WhopSDK::UserUpdateParams::ProfilePicture + ) -> WhopSDK::UserUpdateParams::ProfilePicture + + attr_reader username: String? + + def username=: (String) -> String + def initialize: ( id: String, ?account_id: String, ?bio: String, ?name: String, + ?profile_picture: WhopSDK::UserUpdateParams::ProfilePicture, + ?username: String, ?request_options: WhopSDK::request_opts ) -> void @@ -35,8 +54,26 @@ module WhopSDK account_id: String, bio: String, name: String, + profile_picture: WhopSDK::UserUpdateParams::ProfilePicture, + username: String, request_options: WhopSDK::RequestOptions } + + type profile_picture = { id: String, direct_upload_id: String } + + class ProfilePicture < WhopSDK::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader direct_upload_id: String? + + def direct_upload_id=: (String) -> String + + def initialize: (?id: String, ?direct_upload_id: String) -> void + + def to_hash: -> { id: String, direct_upload_id: String } + end end end end diff --git a/sig/whop_sdk/resources/users.rbs b/sig/whop_sdk/resources/users.rbs index e4a72cd2..bc12c11e 100644 --- a/sig/whop_sdk/resources/users.rbs +++ b/sig/whop_sdk/resources/users.rbs @@ -12,6 +12,8 @@ module WhopSDK ?account_id: String, ?bio: String, ?name: String, + ?profile_picture: WhopSDK::UserUpdateParams::ProfilePicture, + ?username: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::User @@ -31,6 +33,7 @@ module WhopSDK ) -> WhopSDK::Models::UserCheckAccessResponse def update_me: ( + ?account_id: String, ?bio: String, ?name: String, ?profile_picture: WhopSDK::UserUpdateMeParams::ProfilePicture, From d6cae1365f16f43a5fedf19ad593cda92f4e372a Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 10 Jun 2026 04:21:52 +0000 Subject: [PATCH 14/17] feat(pixel): add new conversion events and update dev panel Stainless-Generated-From: 19ba38b7f51d9d29e567ada6889399238c736556 --- lib/whop_sdk/models/conversion_create_params.rb | 4 ++-- rbi/whop_sdk/models/conversion_create_params.rbi | 16 ++++++++-------- sig/whop_sdk/models/conversion_create_params.rbs | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/whop_sdk/models/conversion_create_params.rb b/lib/whop_sdk/models/conversion_create_params.rb index 2e89ae5e..16458d4e 100644 --- a/lib/whop_sdk/models/conversion_create_params.rb +++ b/lib/whop_sdk/models/conversion_create_params.rb @@ -167,10 +167,10 @@ module EventName CONTACT = :contact COMPLETE_REGISTRATION = :complete_registration SCHEDULE = :schedule + VIEW_CONTENT = :view_content + ADD_TO_CART = :add_to_cart CUSTOM = :custom PAGE = :page - LEAVE = :leave - IDENTIFY = :identify # @!method self.values # @return [Array] diff --git a/rbi/whop_sdk/models/conversion_create_params.rbi b/rbi/whop_sdk/models/conversion_create_params.rbi index 028779ab..8d50c14b 100644 --- a/rbi/whop_sdk/models/conversion_create_params.rbi +++ b/rbi/whop_sdk/models/conversion_create_params.rbi @@ -231,23 +231,23 @@ module WhopSDK :schedule, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol ) - CUSTOM = + VIEW_CONTENT = T.let( - :custom, + :view_content, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol ) - PAGE = - T.let(:page, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol) - LEAVE = + ADD_TO_CART = T.let( - :leave, + :add_to_cart, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol ) - IDENTIFY = + CUSTOM = T.let( - :identify, + :custom, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol ) + PAGE = + T.let(:page, WhopSDK::ConversionCreateParams::EventName::TaggedSymbol) sig do override.returns( diff --git a/sig/whop_sdk/models/conversion_create_params.rbs b/sig/whop_sdk/models/conversion_create_params.rbs index d4cda78c..0d0b0fab 100644 --- a/sig/whop_sdk/models/conversion_create_params.rbs +++ b/sig/whop_sdk/models/conversion_create_params.rbs @@ -113,10 +113,10 @@ module WhopSDK | :contact | :complete_registration | :schedule + | :view_content + | :add_to_cart | :custom | :page - | :leave - | :identify module EventName extend WhopSDK::Internal::Type::Enum @@ -126,10 +126,10 @@ module WhopSDK CONTACT: :contact COMPLETE_REGISTRATION: :complete_registration SCHEDULE: :schedule + VIEW_CONTENT: :view_content + ADD_TO_CART: :add_to_cart CUSTOM: :custom PAGE: :page - LEAVE: :leave - IDENTIFY: :identify def self?.values: -> ::Array[WhopSDK::Models::ConversionCreateParams::event_name] end From 8204b78210f800ec987a31055f6492ce0a4824ce Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 10 Jun 2026 04:30:04 +0000 Subject: [PATCH 15/17] Make /plans a native V1 API resource, unblocking new plan endpoints Stainless-Generated-From: c34eb54f7b0cedbcd6e73b5407a9f1c55d3a3083 --- lib/whop_sdk/client.rb | 1 - lib/whop_sdk/models/plan.rb | 517 ++++++++-------- lib/whop_sdk/models/plan_create_params.rb | 246 +++----- lib/whop_sdk/models/plan_list_params.rb | 89 +-- lib/whop_sdk/models/plan_list_response.rb | 334 +++------- lib/whop_sdk/models/plan_update_params.rb | 223 +++---- lib/whop_sdk/resources/plans.rb | 113 ++-- rbi/whop_sdk/client.rbi | 1 - rbi/whop_sdk/models/plan.rbi | 677 +++++++++------------ rbi/whop_sdk/models/plan_create_params.rbi | 421 +++++++------ rbi/whop_sdk/models/plan_list_params.rbi | 172 ++++-- rbi/whop_sdk/models/plan_list_response.rbi | 535 ++++------------ rbi/whop_sdk/models/plan_update_params.rbi | 382 ++++++------ rbi/whop_sdk/resources/plans.rbi | 174 ++---- sig/whop_sdk/models/plan.rbs | 453 +++++++++----- sig/whop_sdk/models/plan_create_params.rbs | 224 +++---- sig/whop_sdk/models/plan_list_params.rbs | 135 ++-- sig/whop_sdk/models/plan_list_response.rbs | 216 +++---- sig/whop_sdk/models/plan_update_params.rbs | 192 +++--- sig/whop_sdk/resources/plans.rbs | 54 +- test/whop_sdk/resources/plans_test.rb | 160 ++--- 21 files changed, 2366 insertions(+), 2953 deletions(-) diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index 3b786bb3..d3045ac7 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -70,7 +70,6 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::Webhooks] attr_reader :webhooks - # Plans # @return [WhopSDK::Resources::Plans] attr_reader :plans diff --git a/lib/whop_sdk/models/plan.rb b/lib/whop_sdk/models/plan.rb index 31d7f09e..6202da3e 100644 --- a/lib/whop_sdk/models/plan.rb +++ b/lib/whop_sdk/models/plan.rb @@ -4,440 +4,388 @@ module WhopSDK module Models class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for the plan. + # The ID of the plan, which will look like plan\_******\******* # # @return [String] required :id, String # @!attribute adaptive_pricing_enabled - # Whether the creator has turned on adaptive pricing for this plan. Raw setting — - # does not check processor compatibility or feature flags. + # Whether this plan accepts local currency payments via adaptive pricing # # @return [Boolean] required :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean # @!attribute billing_period - # The number of days between each recurring charge. Null for one-time plans. For - # example, 30 for monthly or 365 for annual billing. + # The number of days between recurring charges. Null for one-time plans # - # @return [Integer, nil] - required :billing_period, Integer, nil?: true + # @return [Float, nil] + required :billing_period, Float, nil?: true # @!attribute collect_tax - # Whether tax is collected on purchases of this plan, based on the company's tax - # configuration. + # Whether tax is collected on purchases of this plan # # @return [Boolean] required :collect_tax, WhopSDK::Internal::Type::Boolean # @!attribute company - # The company that sells this plan. Null for standalone invoice plans not linked - # to a company. + # The company that sells this plan, an object with an id and title. Null for + # standalone invoice plans # - # @return [WhopSDK::Models::Plan::Company, nil] - required :company, -> { WhopSDK::Plan::Company }, nil?: true + # @return [Object, nil] + required :company, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute created_at - # The datetime the plan was created. + # When the plan was created, as an ISO 8601 timestamp # - # @return [Time] - required :created_at, Time + # @return [String] + required :created_at, String # @!attribute currency - # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary - # amounts on the plan are denominated in this currency. + # The three-letter ISO currency code all prices on this plan are denominated in # - # @return [Symbol, WhopSDK::Models::Currency] - required :currency, enum: -> { WhopSDK::Currency } + # @return [Symbol, WhopSDK::Models::Plan::Currency] + required :currency, enum: -> { WhopSDK::Plan::Currency } # @!attribute custom_fields - # Custom input fields displayed on the checkout form that collect additional - # information from the buyer. + # Custom input fields displayed on the checkout form, objects with id, field_type, + # name, order, placeholder and required # - # @return [Array] - required :custom_fields, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField] } + # @return [Array] + required :custom_fields, WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown] # @!attribute description - # A text description of the plan visible to customers. Maximum 1000 characters. - # Null if no description is set. + # A text description of the plan visible to customers # # @return [String, nil] required :description, String, nil?: true # @!attribute expiration_days - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # The number of days until the membership expires, for expiration-based plans # - # @return [Integer, nil] - required :expiration_days, Integer, nil?: true + # @return [Float, nil] + required :expiration_days, Float, nil?: true # @!attribute initial_price - # The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). - # For one-time plans, this is the full price. For renewal plans, this is charged - # on top of the first renewal_price. + # The initial purchase price in the plan's currency # # @return [Float] required :initial_price, Float # @!attribute internal_notes - # Private notes visible only to the company owner and team members. Not shown to - # customers. Null if no notes have been added. + # Private notes visible only to authorized team members # # @return [String, nil] required :internal_notes, String, nil?: true # @!attribute invoice - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. + # The invoice this plan was generated for, an object with an id. Null unless the + # plan was created for an invoice # - # @return [WhopSDK::Models::Plan::Invoice, nil] - required :invoice, -> { WhopSDK::Plan::Invoice }, nil?: true + # @return [Object, nil] + required :invoice, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute member_count - # The number of users who currently hold an active membership through this plan. - # Only visible to authorized team members. + # The number of active memberships on this plan. Only visible to authorized team + # members # - # @return [Integer, nil] - required :member_count, Integer, nil?: true + # @return [Float, nil] + required :member_count, Float, nil?: true # @!attribute metadata - # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the plan # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @return [Object, nil] + required :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute payment_method_configuration - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. + # The explicit payment method configuration for the plan, an object with enabled, + # disabled and include_platform_defaults. Null if the plan uses default settings # - # @return [WhopSDK::Models::Plan::PaymentMethodConfiguration, nil] - required :payment_method_configuration, -> { WhopSDK::Plan::PaymentMethodConfiguration }, nil?: true + # @return [Object, nil] + required :payment_method_configuration, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute plan_type # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. + # 'one_time' for single payments # - # @return [Symbol, WhopSDK::Models::PlanType] - required :plan_type, enum: -> { WhopSDK::PlanType } + # @return [Symbol, WhopSDK::Models::Plan::PlanType] + required :plan_type, enum: -> { WhopSDK::Plan::PlanType } # @!attribute product - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. + # The product this plan belongs to, an object with an id and title. Null for + # standalone plans # - # @return [WhopSDK::Models::Plan::Product, nil] - required :product, -> { WhopSDK::Plan::Product }, nil?: true + # @return [Object, nil] + required :product, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute purchase_url - # The full URL where customers can purchase this plan directly, bypassing the - # product page. + # The full URL where customers can purchase this plan directly # # @return [String] required :purchase_url, String # @!attribute release_method - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' # - # @return [Symbol, WhopSDK::Models::ReleaseMethod] - required :release_method, enum: -> { WhopSDK::ReleaseMethod } + # @return [Symbol, WhopSDK::Models::Plan::ReleaseMethod] + required :release_method, enum: -> { WhopSDK::Plan::ReleaseMethod } # @!attribute renewal_price - # The recurring price charged every billing_period in the plan's base_currency - # (e.g., 9.99 for $9.99/period). Zero for one-time plans. + # The recurring price charged every billing period in the plan's currency # # @return [Float] required :renewal_price, Float # @!attribute split_pay_required_payments - # The total number of installment payments required before the subscription - # pauses. Null if split pay is not configured. Must be greater than 1. + # The number of installment payments required before the subscription pauses # - # @return [Integer, nil] - required :split_pay_required_payments, Integer, nil?: true + # @return [Float, nil] + required :split_pay_required_payments, Float, nil?: true # @!attribute stock # The number of units available for purchase. Only visible to authorized team - # members. Null if the requester lacks permission. + # members # - # @return [Integer, nil] - required :stock, Integer, nil?: true + # @return [Float, nil] + required :stock, Float, nil?: true # @!attribute tax_type - # How tax is handled for this plan: 'inclusive' (tax included in price), - # 'exclusive' (tax added at checkout), or 'unspecified' (tax not configured). + # How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' # - # @return [Symbol, WhopSDK::Models::TaxType] - required :tax_type, enum: -> { WhopSDK::TaxType } + # @return [String] + required :tax_type, String # @!attribute three_ds_level - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default # # @return [Symbol, WhopSDK::Models::Plan::ThreeDSLevel, nil] required :three_ds_level, enum: -> { WhopSDK::Plan::ThreeDSLevel }, nil?: true # @!attribute title - # The display name of the plan shown to customers on the product page and at - # checkout. Maximum 30 characters. Null if no title has been set. + # The display name of the plan shown to customers # # @return [String, nil] required :title, String, nil?: true # @!attribute trial_period_days - # The number of free trial days before the first charge on a renewal plan. Null if - # no trial is configured or the current user has already used a trial for this - # plan. + # The number of free trial days before the first charge on a recurring plan # - # @return [Integer, nil] - required :trial_period_days, Integer, nil?: true + # @return [Float, nil] + required :trial_period_days, Float, nil?: true # @!attribute unlimited_stock - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. + # Whether the plan has unlimited stock # # @return [Boolean] required :unlimited_stock, WhopSDK::Internal::Type::Boolean # @!attribute updated_at - # The datetime the plan was last updated. + # When the plan was last updated, as an ISO 8601 timestamp # - # @return [Time] - required :updated_at, Time + # @return [String] + required :updated_at, String # @!attribute visibility - # Controls whether the plan is visible to customers. When set to 'hidden', the - # plan is only accessible via direct link. + # Whether the plan is visible to customers or hidden from public view # - # @return [Symbol, WhopSDK::Models::Visibility] - required :visibility, enum: -> { WhopSDK::Visibility } + # @return [Symbol, WhopSDK::Models::Plan::Visibility] + required :visibility, enum: -> { WhopSDK::Plan::Visibility } # @!method initialize(id:, adaptive_pricing_enabled:, billing_period:, collect_tax:, company:, created_at:, currency:, custom_fields:, description:, expiration_days:, initial_price:, internal_notes:, invoice:, member_count:, metadata:, payment_method_configuration:, plan_type:, product:, purchase_url:, release_method:, renewal_price:, split_pay_required_payments:, stock:, tax_type:, three_ds_level:, title:, trial_period_days:, unlimited_stock:, updated_at:, visibility:) # Some parameter documentations has been truncated, see {WhopSDK::Models::Plan} # for more details. # - # A plan defines pricing and billing terms for a checkout. Plans can optionally - # belong to a product, where they represent different pricing options such as - # one-time payments, recurring subscriptions, or free trials. - # - # @param id [String] The unique identifier for the plan. + # @param id [String] The ID of the plan, which will look like plan\_******\******* # - # @param adaptive_pricing_enabled [Boolean] Whether the creator has turned on adaptive pricing for this plan. Raw setting — + # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing # - # @param billing_period [Integer, nil] The number of days between each recurring charge. Null for one-time plans. For e + # @param billing_period [Float, nil] The number of days between recurring charges. Null for one-time plans # - # @param collect_tax [Boolean] Whether tax is collected on purchases of this plan, based on the company's tax c + # @param collect_tax [Boolean] Whether tax is collected on purchases of this plan # - # @param company [WhopSDK::Models::Plan::Company, nil] The company that sells this plan. Null for standalone invoice plans not linked t + # @param company [Object, nil] The company that sells this plan, an object with an id and title. Null for stand # - # @param created_at [Time] The datetime the plan was created. + # @param created_at [String] When the plan was created, as an ISO 8601 timestamp # - # @param currency [Symbol, WhopSDK::Models::Currency] The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary + # @param currency [Symbol, WhopSDK::Models::Plan::Currency] The three-letter ISO currency code all prices on this plan are denominated in # - # @param custom_fields [Array] Custom input fields displayed on the checkout form that collect additional infor + # @param custom_fields [Array] Custom input fields displayed on the checkout form, objects with id, field_type, # - # @param description [String, nil] A text description of the plan visible to customers. Maximum 1000 characters. Nu + # @param description [String, nil] A text description of the plan visible to customers # - # @param expiration_days [Integer, nil] The number of days until the membership expires (for expiration-based plans). Fo + # @param expiration_days [Float, nil] The number of days until the membership expires, for expiration-based plans # - # @param initial_price [Float] The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). + # @param initial_price [Float] The initial purchase price in the plan's currency # - # @param internal_notes [String, nil] Private notes visible only to the company owner and team members. Not shown to c + # @param internal_notes [String, nil] Private notes visible only to authorized team members # - # @param invoice [WhopSDK::Models::Plan::Invoice, nil] The invoice this plan was generated for. Null if the plan was not created for a + # @param invoice [Object, nil] The invoice this plan was generated for, an object with an id. Null unless the p # - # @param member_count [Integer, nil] The number of users who currently hold an active membership through this plan. O + # @param member_count [Float, nil] The number of active memberships on this plan. Only visible to authorized team m # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the plan. Included in webhook payloads for paym + # @param metadata [Object, nil] Custom key-value pairs stored on the plan # - # @param payment_method_configuration [WhopSDK::Models::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration specifying which payment methods are e + # @param payment_method_configuration [Object, nil] The explicit payment method configuration for the plan, an object with enabled, # - # @param plan_type [Symbol, WhopSDK::Models::PlanType] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t + # @param plan_type [Symbol, WhopSDK::Models::Plan::PlanType] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t # - # @param product [WhopSDK::Models::Plan::Product, nil] The product that this plan belongs to. Null for standalone one-off purchases not + # @param product [Object, nil] The product this plan belongs to, an object with an id and title. Null for stand # - # @param purchase_url [String] The full URL where customers can purchase this plan directly, bypassing the prod + # @param purchase_url [String] The full URL where customers can purchase this plan directly # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod] The method used to sell this plan: 'buy_now' for immediate purchase or 'waitlist + # @param release_method [Symbol, WhopSDK::Models::Plan::ReleaseMethod] The method used to sell this plan, e.g. 'buy_now' or 'waitlist' # - # @param renewal_price [Float] The recurring price charged every billing_period in the plan's base_currency (e. + # @param renewal_price [Float] The recurring price charged every billing period in the plan's currency # - # @param split_pay_required_payments [Integer, nil] The total number of installment payments required before the subscription pauses + # @param split_pay_required_payments [Float, nil] The number of installment payments required before the subscription pauses # - # @param stock [Integer, nil] The number of units available for purchase. Only visible to authorized team memb + # @param stock [Float, nil] The number of units available for purchase. Only visible to authorized team memb # - # @param tax_type [Symbol, WhopSDK::Models::TaxType] How tax is handled for this plan: 'inclusive' (tax included in price), 'exclusiv + # @param tax_type [String] How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' # - # @param three_ds_level [Symbol, WhopSDK::Models::Plan::ThreeDSLevel, nil] The 3D Secure behavior for a plan. + # @param three_ds_level [Symbol, WhopSDK::Models::Plan::ThreeDSLevel, nil] The 3D Secure behavior for this plan. Null means the plan inherits the account d # - # @param title [String, nil] The display name of the plan shown to customers on the product page and at check + # @param title [String, nil] The display name of the plan shown to customers # - # @param trial_period_days [Integer, nil] The number of free trial days before the first charge on a renewal plan. Null if + # @param trial_period_days [Float, nil] The number of free trial days before the first charge on a recurring plan # - # @param unlimited_stock [Boolean] When true, the plan has unlimited stock (stock field is ignored). When false, pu + # @param unlimited_stock [Boolean] Whether the plan has unlimited stock # - # @param updated_at [Time] The datetime the plan was last updated. + # @param updated_at [String] When the plan was last updated, as an ISO 8601 timestamp # - # @param visibility [Symbol, WhopSDK::Models::Visibility] Controls whether the plan is visible to customers. When set to 'hidden', the pla + # @param visibility [Symbol, WhopSDK::Models::Plan::Visibility] Whether the plan is visible to customers or hidden from public view - # @see WhopSDK::Models::Plan#company - class Company < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the company. - # - # @return [String] - required :id, String + # The three-letter ISO currency code all prices on this plan are denominated in + # + # @see WhopSDK::Models::Plan#currency + module Currency + extend WhopSDK::Internal::Type::Enum - # @!attribute title - # The display name of the company shown to customers. - # - # @return [String] - required :title, String + USD = :usd + SGD = :sgd + INR = :inr + AUD = :aud + BRL = :brl + CAD = :cad + DKK = :dkk + EUR = :eur + NOK = :nok + GBP = :gbp + SEK = :sek + CHF = :chf + HKD = :hkd + HUF = :huf + JPY = :jpy + MXN = :mxn + MYR = :myr + PLN = :pln + CZK = :czk + NZD = :nzd + AED = :aed + ETH = :eth + APE = :ape + COP = :cop + RON = :ron + THB = :thb + BGN = :bgn + IDR = :idr + DOP = :dop + PHP = :php + TRY = :try + KRW = :krw + TWD = :twd + VND = :vnd + PKR = :pkr + CLP = :clp + UYU = :uyu + ARS = :ars + ZAR = :zar + DZD = :dzd + TND = :tnd + MAD = :mad + KES = :kes + KWD = :kwd + JOD = :jod + ALL = :all + XCD = :xcd + AMD = :amd + BSD = :bsd + BHD = :bhd + BOB = :bob + BAM = :bam + KHR = :khr + CRC = :crc + XOF = :xof + EGP = :egp + ETB = :etb + GMD = :gmd + GHS = :ghs + GTQ = :gtq + GYD = :gyd + ILS = :ils + JMD = :jmd + MOP = :mop + MGA = :mga + MUR = :mur + MDL = :mdl + MNT = :mnt + NAD = :nad + NGN = :ngn + MKD = :mkd + OMR = :omr + PYG = :pyg + PEN = :pen + QAR = :qar + RWF = :rwf + SAR = :sar + RSD = :rsd + LKR = :lkr + TZS = :tzs + TTD = :ttd + UZS = :uzs + RUB = :rub + BTC = :btc + CNY = :cny + USDT = :usdt + KZT = :kzt + AWG = :awg + WHOP_USD = :whop_usd + XAU = :xau - # @!method initialize(id:, title:) - # The company that sells this plan. Null for standalone invoice plans not linked - # to a company. - # - # @param id [String] The unique identifier for the company. - # - # @param title [String] The display name of the company shown to customers. + # @!method self.values + # @return [Array] end - class CustomField < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the custom field. - # - # @return [String] - required :id, String - - # @!attribute field_type - # What type of input field to use. - # - # @return [Symbol, :text] - required :field_type, const: :text - - # @!attribute name - # The title/header of the custom field. - # - # @return [String] - required :name, String - - # @!attribute order - # How the custom field should be ordered when rendered on the checkout page. - # - # @return [Integer, nil] - required :order, Integer, nil?: true - - # @!attribute placeholder - # An example response displayed in the input field. - # - # @return [String, nil] - required :placeholder, String, nil?: true - - # @!attribute required - # Whether or not the custom field is required. - # - # @return [Boolean] - required :required, WhopSDK::Internal::Type::Boolean - - # @!method initialize(id:, name:, order:, placeholder:, required:, field_type: :text) - # An object representing a custom field for a plan. - # - # @param id [String] The unique identifier for the custom field. - # - # @param name [String] The title/header of the custom field. - # - # @param order [Integer, nil] How the custom field should be ordered when rendered on the checkout page. - # - # @param placeholder [String, nil] An example response displayed in the input field. - # - # @param required [Boolean] Whether or not the custom field is required. - # - # @param field_type [Symbol, :text] What type of input field to use. - end + # The billing model for this plan: 'renewal' for recurring subscriptions or + # 'one_time' for single payments + # + # @see WhopSDK::Models::Plan#plan_type + module PlanType + extend WhopSDK::Internal::Type::Enum - # @see WhopSDK::Models::Plan#invoice - class Invoice < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the invoice. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. - # - # @param id [String] The unique identifier for the invoice. - end + RENEWAL = :renewal + ONE_TIME = :one_time - # @see WhopSDK::Models::Plan#payment_method_configuration - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - # @!attribute disabled - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - # - # @return [Array] - required :disabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute enabled - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - # - # @return [Array] - required :enabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute include_platform_defaults - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - # - # @return [Boolean] - required :include_platform_defaults, WhopSDK::Internal::Type::Boolean - - # @!method initialize(disabled:, enabled:, include_platform_defaults:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Plan::PaymentMethodConfiguration} for more details. - # - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. - # - # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie - # - # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t - # - # @param include_platform_defaults [Boolean] Whether Whop's platform default payment method enablement settings are included + # @!method self.values + # @return [Array] end - # @see WhopSDK::Models::Plan#product - class Product < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the product. - # - # @return [String] - required :id, String - - # @!attribute title - # The display name of the product shown to customers on the product page and in - # search results. - # - # @return [String] - required :title, String - - # @!method initialize(id:, title:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::Plan::Product} for more details. - # - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. - # - # @param id [String] The unique identifier for the product. - # - # @param title [String] The display name of the product shown to customers on the product page and in se + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + # + # @see WhopSDK::Models::Plan#release_method + module ReleaseMethod + extend WhopSDK::Internal::Type::Enum + + BUY_NOW = :buy_now + WAITLIST = :waitlist + + # @!method self.values + # @return [Array] end - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default # # @see WhopSDK::Models::Plan#three_ds_level module ThreeDSLevel @@ -449,6 +397,21 @@ module ThreeDSLevel # @!method self.values # @return [Array] end + + # Whether the plan is visible to customers or hidden from public view + # + # @see WhopSDK::Models::Plan#visibility + module Visibility + extend WhopSDK::Internal::Type::Enum + + VISIBLE = :visible + HIDDEN = :hidden + ARCHIVED = :archived + QUICK_LINK = :quick_link + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/plan_create_params.rb b/lib/whop_sdk/models/plan_create_params.rb index 49e42163..159e58ff 100644 --- a/lib/whop_sdk/models/plan_create_params.rb +++ b/lib/whop_sdk/models/plan_create_params.rb @@ -7,12 +7,6 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - # @!attribute company_id - # The unique identifier of the company to create this plan for. - # - # @return [String] - required :company_id, String - # @!attribute product_id # The unique identifier of the product to attach this plan to. # @@ -33,20 +27,27 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :billing_period, Integer, nil?: true # @!attribute checkout_styling - # Checkout styling overrides for this plan. Pass null to inherit from the company - # default. + # Checkout styling overrides for this plan. + # + # @return [Object, nil] + optional :checkout_styling, WhopSDK::Internal::Type::Unknown, nil?: true + + # @!attribute company_id + # The unique identifier of the company to create this plan for. Defaults to the + # caller's company. # - # @return [WhopSDK::Models::PlanCreateParams::CheckoutStyling, nil] - optional :checkout_styling, -> { WhopSDK::PlanCreateParams::CheckoutStyling }, nil?: true + # @return [String, nil] + optional :company_id, String # @!attribute currency - # The available currencies on the platform + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. # - # @return [Symbol, WhopSDK::Models::Currency, nil] - optional :currency, enum: -> { WhopSDK::Currency }, nil?: true + # @return [String, nil] + optional :currency, String # @!attribute custom_fields # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. # # @return [Array, nil] optional :custom_fields, @@ -60,8 +61,7 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :description, String, nil?: true # @!attribute expiration_days - # The number of days until the membership expires and access is revoked. Used for - # expiration-based plans. + # The number of days until the membership expires and access is revoked. # # @return [Integer, nil] optional :expiration_days, Integer, nil?: true @@ -73,9 +73,8 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :image, -> { WhopSDK::PlanCreateParams::Image }, nil?: true # @!attribute initial_price - # The amount charged on the first purchase. For one-time plans, this is the full - # price. For recurring plans, this is an additional charge on top of the renewal - # price. Provided in the plan's currency (e.g., 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). # # @return [Float, nil] optional :initial_price, Float, nil?: true @@ -94,18 +93,16 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # payment and membership events. # - # @return [Hash{Symbol=>Object}, nil] - optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute override_tax_type - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) + # Override the default tax classification for this specific plan. # - # @return [Symbol, WhopSDK::Models::TaxType, nil] - optional :override_tax_type, enum: -> { WhopSDK::TaxType }, nil?: true + # @return [String, nil] + optional :override_tax_type, String # @!attribute payment_method_configuration # Explicit payment method configuration for the plan. When not provided, the @@ -117,20 +114,20 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel nil?: true # @!attribute plan_type - # The type of plan that can be attached to a product + # The billing type of the plan, such as one_time or renewal. # - # @return [Symbol, WhopSDK::Models::PlanType, nil] - optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true + # @return [String, nil] + optional :plan_type, String # @!attribute release_method - # The methods of how a plan can be released. + # The method used to sell this plan (e.g., buy_now, waitlist). # - # @return [Symbol, WhopSDK::Models::ReleaseMethod, nil] - optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true + # @return [String, nil] + optional :release_method, String # @!attribute renewal_price - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. # # @return [Float, nil] optional :renewal_price, Float, nil?: true @@ -149,10 +146,10 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel optional :stock, Integer, nil?: true # @!attribute three_ds_level - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. # # @return [Symbol, WhopSDK::Models::PlanCreateParams::ThreeDSLevel, nil] - optional :three_ds_level, enum: -> { WhopSDK::PlanCreateParams::ThreeDSLevel }, nil?: true + optional :three_ds_level, enum: -> { WhopSDK::PlanCreateParams::ThreeDSLevel } # @!attribute title # The display name of the plan shown to customers on the product page. @@ -168,144 +165,101 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute unlimited_stock # Whether the plan has unlimited stock. When true, the stock field is ignored. - # Defaults to true. # # @return [Boolean, nil] optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true # @!attribute visibility - # Visibility of a resource + # Whether the plan is visible to customers or hidden from public view. # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true + # @return [String, nil] + optional :visibility, String - # @!method initialize(company_id:, product_id:, adaptive_pricing_enabled: nil, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, metadata: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, three_ds_level: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) + # @!method initialize(product_id:, adaptive_pricing_enabled: nil, billing_period: nil, checkout_styling: nil, company_id: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, metadata: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, three_ds_level: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PlanCreateParams} for more details. # - # @param company_id [String] The unique identifier of the company to create this plan for. - # # @param product_id [String] The unique identifier of the product to attach this plan to. # # @param adaptive_pricing_enabled [Boolean, nil] Whether this plan accepts local currency payments via adaptive pricing. # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # - # @param checkout_styling [WhopSDK::Models::PlanCreateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to inherit from the company + # @param checkout_styling [Object, nil] Checkout styling overrides for this plan. + # + # @param company_id [String] The unique identifier of the company to create this plan for. Defaults to the ca # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param currency [String] The three-letter ISO currency code for the plan's pricing. Defaults to USD. # - # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. + # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. Omit # # @param description [String, nil] A text description of the plan displayed to customers on the product page. # - # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. Used for + # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. # # @param image [WhopSDK::Models::PlanCreateParams::Image, nil] An image displayed on the product page to represent this plan. # - # @param initial_price [Float, nil] The amount charged on the first purchase. For one-time plans, this is the full p + # @param initial_price [Float, nil] The amount charged on the first purchase, in the plan's currency (e.g., 10.43 fo # # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa + # @param metadata [Object, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa # - # @param override_tax_type [Symbol, WhopSDK::Models::TaxType, nil] Whether or not the tax is included in a plan's price (or if it hasn't been set u + # @param override_tax_type [String] Override the default tax classification for this specific plan. # # @param payment_method_configuration [WhopSDK::Models::PlanCreateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the compa # - # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product + # @param plan_type [String] The billing type of the plan, such as one_time or renewal. # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released. + # @param release_method [String] The method used to sell this plan (e.g., buy_now, waitlist). # - # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans. Provided in the plan + # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans, in the plan's curren # # @param split_pay_required_payments [Integer, nil] The number of installment payments required before the subscription pauses. # # @param stock [Integer, nil] The maximum number of units available for purchase. Ignored when unlimited_stock # - # @param three_ds_level [Symbol, WhopSDK::Models::PlanCreateParams::ThreeDSLevel, nil] The 3D Secure behavior for a plan. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanCreateParams::ThreeDSLevel] The 3D Secure behavior for this plan. Send null to inherit the account default. # # @param title [String, nil] The display name of the plan shown to customers on the product page. # # @param trial_period_days [Integer, nil] The number of free trial days before the first charge on a recurring plan. # - # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. Def + # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the plan is visible to customers or hidden from public view. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel - # @!attribute background_color - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). - # - # @return [String, nil] - optional :background_color, String, nil?: true - - # @!attribute border_style - # The different border-radius styles available for checkout pages. - # - # @return [Symbol, WhopSDK::Models::CheckoutShape, nil] - optional :border_style, enum: -> { WhopSDK::CheckoutShape }, nil?: true - - # @!attribute button_color - # A hex color code for the button color (e.g. #FF5733). + class CustomField < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the custom field (if being updated). # # @return [String, nil] - optional :button_color, String, nil?: true - - # @!attribute font_family - # The different font families available for checkout pages. - # - # @return [Symbol, WhopSDK::Models::CheckoutFont, nil] - optional :font_family, enum: -> { WhopSDK::CheckoutFont }, nil?: true + optional :id, String - # @!method initialize(background_color: nil, border_style: nil, button_color: nil, font_family: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PlanCreateParams::CheckoutStyling} for more details. - # - # Checkout styling overrides for this plan. Pass null to inherit from the company - # default. - # - # @param background_color [String, nil] A hex color code for the checkout page background, applied to the order summary - # - # @param border_style [Symbol, WhopSDK::Models::CheckoutShape, nil] The different border-radius styles available for checkout pages. - # - # @param button_color [String, nil] A hex color code for the button color (e.g. #FF5733). - # - # @param font_family [Symbol, WhopSDK::Models::CheckoutFont, nil] The different font families available for checkout pages. - end - - class CustomField < WhopSDK::Internal::Type::BaseModel # @!attribute field_type # The type of the custom field. # - # @return [Symbol, :text] - required :field_type, const: :text + # @return [Symbol, WhopSDK::Models::PlanCreateParams::CustomField::FieldType, nil] + optional :field_type, enum: -> { WhopSDK::PlanCreateParams::CustomField::FieldType } # @!attribute name # The name of the custom field. # - # @return [String] - required :name, String - - # @!attribute id - # The ID of the custom field (if being updated) - # # @return [String, nil] - optional :id, String, nil?: true + optional :name, String # @!attribute order # The order of the field. # # @return [Integer, nil] - optional :order, Integer, nil?: true + optional :order, Integer # @!attribute placeholder - # The placeholder value of the field. + # An example response displayed in the input field. # # @return [String, nil] optional :placeholder, String, nil?: true @@ -314,76 +268,78 @@ class CustomField < WhopSDK::Internal::Type::BaseModel # Whether or not the field is required. # # @return [Boolean, nil] - optional :required, WhopSDK::Internal::Type::Boolean, nil?: true + optional :required, WhopSDK::Internal::Type::Boolean - # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text) - # @param name [String] The name of the custom field. + # @!method initialize(id: nil, field_type: nil, name: nil, order: nil, placeholder: nil, required: nil) + # @param id [String] The ID of the custom field (if being updated). # - # @param id [String, nil] The ID of the custom field (if being updated) + # @param field_type [Symbol, WhopSDK::Models::PlanCreateParams::CustomField::FieldType] The type of the custom field. # - # @param order [Integer, nil] The order of the field. + # @param name [String] The name of the custom field. + # + # @param order [Integer] The order of the field. # - # @param placeholder [String, nil] The placeholder value of the field. + # @param placeholder [String, nil] An example response displayed in the input field. # - # @param required [Boolean, nil] Whether or not the field is required. + # @param required [Boolean] Whether or not the field is required. + + # The type of the custom field. # - # @param field_type [Symbol, :text] The type of the custom field. + # @see WhopSDK::Models::PlanCreateParams::CustomField#field_type + module FieldType + extend WhopSDK::Internal::Type::Enum + + TEXT = :text + + # @!method self.values + # @return [Array] + end end class Image < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The ID of an existing file object. # - # @return [String] - required :id, String + # @return [String, nil] + optional :id, String + + # @!attribute direct_upload_id + # + # @return [String, nil] + optional :direct_upload_id, String - # @!method initialize(id:) + # @!method initialize(id: nil, direct_upload_id: nil) # An image displayed on the product page to represent this plan. # - # @param id [String] The ID of an existing file object. + # @param id [String] + # @param direct_upload_id [String] end class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!attribute disabled - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. # - # @return [Array] - required :disabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } + # @return [Array, nil] + optional :disabled, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute enabled - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. # - # @return [Array] - required :enabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } + # @return [Array, nil] + optional :enabled, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute include_platform_defaults - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. # # @return [Boolean, nil] - optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean, nil?: true + optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean - # @!method initialize(disabled:, enabled:, include_platform_defaults: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PlanCreateParams::PaymentMethodConfiguration} for more - # details. - # + # @!method initialize(disabled: nil, enabled: nil, include_platform_defaults: nil) # Explicit payment method configuration for the plan. When not provided, the # company's defaults apply. # - # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie - # - # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t - # - # @param include_platform_defaults [Boolean, nil] Whether Whop's platform default payment method enablement settings are included + # @param disabled [Array] + # @param enabled [Array] + # @param include_platform_defaults [Boolean] end - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. module ThreeDSLevel extend WhopSDK::Internal::Type::Enum diff --git a/lib/whop_sdk/models/plan_list_params.rb b/lib/whop_sdk/models/plan_list_params.rb index 61ea8929..6e900c1c 100644 --- a/lib/whop_sdk/models/plan_list_params.rb +++ b/lib/whop_sdk/models/plan_list_params.rb @@ -14,111 +14,118 @@ class PlanListParams < WhopSDK::Internal::Type::BaseModel required :company_id, String # @!attribute after - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns plans after this position. # # @return [String, nil] - optional :after, String, nil?: true + optional :after, String # @!attribute before - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns plans before this position. # # @return [String, nil] - optional :before, String, nil?: true + optional :before, String # @!attribute created_after # Only return plans created after this timestamp. # - # @return [Time, nil] - optional :created_after, Time, nil?: true + # @return [String, nil] + optional :created_after, String # @!attribute created_before # Only return plans created before this timestamp. # - # @return [Time, nil] - optional :created_before, Time, nil?: true + # @return [String, nil] + optional :created_before, String # @!attribute direction - # The direction of the sort. + # The sort direction for results. Defaults to descending. # - # @return [Symbol, WhopSDK::Models::Direction, nil] - optional :direction, enum: -> { WhopSDK::Direction }, nil?: true + # @return [Symbol, WhopSDK::Models::PlanListParams::Direction, nil] + optional :direction, enum: -> { WhopSDK::PlanListParams::Direction } # @!attribute first - # Returns the first _n_ elements from the list. + # The number of plans to return (default and max 100). # # @return [Integer, nil] - optional :first, Integer, nil?: true + optional :first, Integer # @!attribute last - # Returns the last _n_ elements from the list. + # The number of plans to return from the end of the range. # # @return [Integer, nil] - optional :last, Integer, nil?: true + optional :last, Integer # @!attribute order - # The ways a relation of Plans can be ordered + # The field to sort results by. Defaults to created_at. # # @return [Symbol, WhopSDK::Models::PlanListParams::Order, nil] - optional :order, enum: -> { WhopSDK::PlanListParams::Order }, nil?: true + optional :order, enum: -> { WhopSDK::PlanListParams::Order } # @!attribute plan_types # Filter to only plans matching these billing types. # - # @return [Array, nil] - optional :plan_types, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PlanType] }, nil?: true + # @return [Array, nil] + optional :plan_types, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute product_ids # Filter to only plans belonging to these product identifiers. # # @return [Array, nil] - optional :product_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true + optional :product_ids, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute release_methods # Filter to only plans matching these release methods. # - # @return [Array, nil] - optional :release_methods, - -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::ReleaseMethod] }, - nil?: true + # @return [Array, nil] + optional :release_methods, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute visibilities # Filter to only plans matching these visibility states. # - # @return [Array, nil] - optional :visibilities, - -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::VisibilityFilter] }, - nil?: true + # @return [Array, nil] + optional :visibilities, WhopSDK::Internal::Type::ArrayOf[String] # @!method initialize(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, plan_types: nil, product_ids: nil, release_methods: nil, visibilities: nil, request_options: {}) # @param company_id [String] The unique identifier of the company to list plans for. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] A cursor; returns plans after this position. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] A cursor; returns plans before this position. # - # @param created_after [Time, nil] Only return plans created after this timestamp. + # @param created_after [String] Only return plans created after this timestamp. # - # @param created_before [Time, nil] Only return plans created before this timestamp. + # @param created_before [String] Only return plans created before this timestamp. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param direction [Symbol, WhopSDK::Models::PlanListParams::Direction] The sort direction for results. Defaults to descending. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param first [Integer] The number of plans to return (default and max 100). # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param last [Integer] The number of plans to return from the end of the range. # - # @param order [Symbol, WhopSDK::Models::PlanListParams::Order, nil] The ways a relation of Plans can be ordered + # @param order [Symbol, WhopSDK::Models::PlanListParams::Order] The field to sort results by. Defaults to created_at. # - # @param plan_types [Array, nil] Filter to only plans matching these billing types. + # @param plan_types [Array] Filter to only plans matching these billing types. # - # @param product_ids [Array, nil] Filter to only plans belonging to these product identifiers. + # @param product_ids [Array] Filter to only plans belonging to these product identifiers. # - # @param release_methods [Array, nil] Filter to only plans matching these release methods. + # @param release_methods [Array] Filter to only plans matching these release methods. # - # @param visibilities [Array, nil] Filter to only plans matching these visibility states. + # @param visibilities [Array] Filter to only plans matching these visibility states. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - # The ways a relation of Plans can be ordered + # The sort direction for results. Defaults to descending. + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + + # The field to sort results by. Defaults to created_at. module Order extend WhopSDK::Internal::Type::Enum diff --git a/lib/whop_sdk/models/plan_list_response.rb b/lib/whop_sdk/models/plan_list_response.rb index 9f6d7c57..c1428ff3 100644 --- a/lib/whop_sdk/models/plan_list_response.rb +++ b/lib/whop_sdk/models/plan_list_response.rb @@ -5,374 +5,232 @@ module Models # @see WhopSDK::Resources::Plans#list class PlanListResponse < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The unique identifier for the plan. + # The ID of the plan, which will look like plan\_******\******* # # @return [String] required :id, String # @!attribute adaptive_pricing_enabled - # Whether the creator has turned on adaptive pricing for this plan. Raw setting — - # does not check processor compatibility or feature flags. + # Whether this plan accepts local currency payments via adaptive pricing # # @return [Boolean] required :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean # @!attribute billing_period - # The number of days between each recurring charge. Null for one-time plans. For - # example, 30 for monthly or 365 for annual billing. + # The number of days between recurring charges. Null for one-time plans # - # @return [Integer, nil] - required :billing_period, Integer, nil?: true + # @return [Float, nil] + required :billing_period, Float, nil?: true # @!attribute company - # The company that sells this plan. Null for standalone invoice plans not linked - # to a company. + # The company that sells this plan, an object with an id and title. Null for + # standalone invoice plans # - # @return [WhopSDK::Models::PlanListResponse::Company, nil] - required :company, -> { WhopSDK::Models::PlanListResponse::Company }, nil?: true + # @return [Object, nil] + required :company, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute created_at - # The datetime the plan was created. + # When the plan was created, as an ISO 8601 timestamp # - # @return [Time] - required :created_at, Time + # @return [String] + required :created_at, String # @!attribute currency - # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary - # amounts on the plan are denominated in this currency. + # The three-letter ISO currency code all prices on this plan are denominated in # - # @return [Symbol, WhopSDK::Models::Currency] - required :currency, enum: -> { WhopSDK::Currency } + # @return [String] + required :currency, String # @!attribute description - # A text description of the plan visible to customers. Maximum 1000 characters. - # Null if no description is set. + # A text description of the plan visible to customers # # @return [String, nil] required :description, String, nil?: true # @!attribute expiration_days - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # The number of days until the membership expires, for expiration-based plans # - # @return [Integer, nil] - required :expiration_days, Integer, nil?: true + # @return [Float, nil] + required :expiration_days, Float, nil?: true # @!attribute initial_price - # The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). - # For one-time plans, this is the full price. For renewal plans, this is charged - # on top of the first renewal_price. + # The initial purchase price in the plan's currency # # @return [Float] required :initial_price, Float # @!attribute internal_notes - # Private notes visible only to the company owner and team members. Not shown to - # customers. Null if no notes have been added. + # Private notes visible only to authorized team members # # @return [String, nil] required :internal_notes, String, nil?: true # @!attribute invoice - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. + # The invoice this plan was generated for, an object with an id. Null unless the + # plan was created for an invoice # - # @return [WhopSDK::Models::PlanListResponse::Invoice, nil] - required :invoice, -> { WhopSDK::Models::PlanListResponse::Invoice }, nil?: true + # @return [Object, nil] + required :invoice, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute member_count - # The number of users who currently hold an active membership through this plan. - # Only visible to authorized team members. + # The number of active memberships on this plan. Only visible to authorized team + # members # - # @return [Integer, nil] - required :member_count, Integer, nil?: true + # @return [Float, nil] + required :member_count, Float, nil?: true # @!attribute metadata - # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the plan # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @return [Object, nil] + required :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute payment_method_configuration - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. + # The explicit payment method configuration for the plan, an object with enabled, + # disabled and include_platform_defaults. Null if the plan uses default settings # - # @return [WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration, nil] - required :payment_method_configuration, - -> { WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration }, - nil?: true + # @return [Object, nil] + required :payment_method_configuration, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute plan_type # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. + # 'one_time' for single payments # - # @return [Symbol, WhopSDK::Models::PlanType] - required :plan_type, enum: -> { WhopSDK::PlanType } + # @return [String] + required :plan_type, String # @!attribute product - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. + # The product this plan belongs to, an object with an id and title. Null for + # standalone plans # - # @return [WhopSDK::Models::PlanListResponse::Product, nil] - required :product, -> { WhopSDK::Models::PlanListResponse::Product }, nil?: true + # @return [Object, nil] + required :product, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute purchase_url - # The full URL where customers can purchase this plan directly, bypassing the - # product page. + # The full URL where customers can purchase this plan directly # # @return [String] required :purchase_url, String # @!attribute release_method - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' # - # @return [Symbol, WhopSDK::Models::ReleaseMethod] - required :release_method, enum: -> { WhopSDK::ReleaseMethod } + # @return [String] + required :release_method, String # @!attribute renewal_price - # The recurring price charged every billing_period in the plan's base_currency - # (e.g., 9.99 for $9.99/period). Zero for one-time plans. + # The recurring price charged every billing period in the plan's currency # # @return [Float] required :renewal_price, Float # @!attribute split_pay_required_payments - # The total number of installment payments required before the subscription - # pauses. Null if split pay is not configured. Must be greater than 1. + # The number of installment payments required before the subscription pauses # - # @return [Integer, nil] - required :split_pay_required_payments, Integer, nil?: true + # @return [Float, nil] + required :split_pay_required_payments, Float, nil?: true # @!attribute stock # The number of units available for purchase. Only visible to authorized team - # members. Null if the requester lacks permission. + # members # - # @return [Integer, nil] - required :stock, Integer, nil?: true + # @return [Float, nil] + required :stock, Float, nil?: true # @!attribute three_ds_level - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default # - # @return [Symbol, WhopSDK::Models::PlanListResponse::ThreeDSLevel, nil] - required :three_ds_level, enum: -> { WhopSDK::Models::PlanListResponse::ThreeDSLevel }, nil?: true + # @return [String, nil] + required :three_ds_level, String, nil?: true # @!attribute title - # The display name of the plan shown to customers on the product page and at - # checkout. Maximum 30 characters. Null if no title has been set. + # The display name of the plan shown to customers # # @return [String, nil] required :title, String, nil?: true # @!attribute trial_period_days - # The number of free trial days before the first charge on a renewal plan. Null if - # no trial is configured or the current user has already used a trial for this - # plan. + # The number of free trial days before the first charge on a recurring plan # - # @return [Integer, nil] - required :trial_period_days, Integer, nil?: true + # @return [Float, nil] + required :trial_period_days, Float, nil?: true # @!attribute unlimited_stock - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. + # Whether the plan has unlimited stock # # @return [Boolean] required :unlimited_stock, WhopSDK::Internal::Type::Boolean # @!attribute updated_at - # The datetime the plan was last updated. + # When the plan was last updated, as an ISO 8601 timestamp # - # @return [Time] - required :updated_at, Time + # @return [String] + required :updated_at, String # @!attribute visibility - # Controls whether the plan is visible to customers. When set to 'hidden', the - # plan is only accessible via direct link. + # Whether the plan is visible to customers or hidden from public view # - # @return [Symbol, WhopSDK::Models::Visibility] - required :visibility, enum: -> { WhopSDK::Visibility } + # @return [String] + required :visibility, String # @!method initialize(id:, adaptive_pricing_enabled:, billing_period:, company:, created_at:, currency:, description:, expiration_days:, initial_price:, internal_notes:, invoice:, member_count:, metadata:, payment_method_configuration:, plan_type:, product:, purchase_url:, release_method:, renewal_price:, split_pay_required_payments:, stock:, three_ds_level:, title:, trial_period_days:, unlimited_stock:, updated_at:, visibility:) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PlanListResponse} for more details. # - # A plan defines pricing and billing terms for a checkout. Plans can optionally - # belong to a product, where they represent different pricing options such as - # one-time payments, recurring subscriptions, or free trials. - # - # @param id [String] The unique identifier for the plan. - # - # @param adaptive_pricing_enabled [Boolean] Whether the creator has turned on adaptive pricing for this plan. Raw setting — + # @param id [String] The ID of the plan, which will look like plan\_******\******* # - # @param billing_period [Integer, nil] The number of days between each recurring charge. Null for one-time plans. For e + # @param adaptive_pricing_enabled [Boolean] Whether this plan accepts local currency payments via adaptive pricing # - # @param company [WhopSDK::Models::PlanListResponse::Company, nil] The company that sells this plan. Null for standalone invoice plans not linked t + # @param billing_period [Float, nil] The number of days between recurring charges. Null for one-time plans # - # @param created_at [Time] The datetime the plan was created. + # @param company [Object, nil] The company that sells this plan, an object with an id and title. Null for stand # - # @param currency [Symbol, WhopSDK::Models::Currency] The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary + # @param created_at [String] When the plan was created, as an ISO 8601 timestamp # - # @param description [String, nil] A text description of the plan visible to customers. Maximum 1000 characters. Nu + # @param currency [String] The three-letter ISO currency code all prices on this plan are denominated in # - # @param expiration_days [Integer, nil] The number of days until the membership expires (for expiration-based plans). Fo + # @param description [String, nil] A text description of the plan visible to customers # - # @param initial_price [Float] The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). + # @param expiration_days [Float, nil] The number of days until the membership expires, for expiration-based plans # - # @param internal_notes [String, nil] Private notes visible only to the company owner and team members. Not shown to c + # @param initial_price [Float] The initial purchase price in the plan's currency # - # @param invoice [WhopSDK::Models::PlanListResponse::Invoice, nil] The invoice this plan was generated for. Null if the plan was not created for a + # @param internal_notes [String, nil] Private notes visible only to authorized team members # - # @param member_count [Integer, nil] The number of users who currently hold an active membership through this plan. O + # @param invoice [Object, nil] The invoice this plan was generated for, an object with an id. Null unless the p # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs stored on the plan. Included in webhook payloads for paym + # @param member_count [Float, nil] The number of active memberships on this plan. Only visible to authorized team m # - # @param payment_method_configuration [WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration, nil] The explicit payment method configuration specifying which payment methods are e + # @param metadata [Object, nil] Custom key-value pairs stored on the plan # - # @param plan_type [Symbol, WhopSDK::Models::PlanType] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t + # @param payment_method_configuration [Object, nil] The explicit payment method configuration for the plan, an object with enabled, # - # @param product [WhopSDK::Models::PlanListResponse::Product, nil] The product that this plan belongs to. Null for standalone one-off purchases not + # @param plan_type [String] The billing model for this plan: 'renewal' for recurring subscriptions or 'one_t # - # @param purchase_url [String] The full URL where customers can purchase this plan directly, bypassing the prod + # @param product [Object, nil] The product this plan belongs to, an object with an id and title. Null for stand # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod] The method used to sell this plan: 'buy_now' for immediate purchase or 'waitlist + # @param purchase_url [String] The full URL where customers can purchase this plan directly # - # @param renewal_price [Float] The recurring price charged every billing_period in the plan's base_currency (e. + # @param release_method [String] The method used to sell this plan, e.g. 'buy_now' or 'waitlist' # - # @param split_pay_required_payments [Integer, nil] The total number of installment payments required before the subscription pauses + # @param renewal_price [Float] The recurring price charged every billing period in the plan's currency # - # @param stock [Integer, nil] The number of units available for purchase. Only visible to authorized team memb + # @param split_pay_required_payments [Float, nil] The number of installment payments required before the subscription pauses # - # @param three_ds_level [Symbol, WhopSDK::Models::PlanListResponse::ThreeDSLevel, nil] The 3D Secure behavior for a plan. + # @param stock [Float, nil] The number of units available for purchase. Only visible to authorized team memb # - # @param title [String, nil] The display name of the plan shown to customers on the product page and at check + # @param three_ds_level [String, nil] The 3D Secure behavior for this plan. Null means the plan inherits the account d # - # @param trial_period_days [Integer, nil] The number of free trial days before the first charge on a renewal plan. Null if + # @param title [String, nil] The display name of the plan shown to customers # - # @param unlimited_stock [Boolean] When true, the plan has unlimited stock (stock field is ignored). When false, pu + # @param trial_period_days [Float, nil] The number of free trial days before the first charge on a recurring plan # - # @param updated_at [Time] The datetime the plan was last updated. + # @param unlimited_stock [Boolean] Whether the plan has unlimited stock # - # @param visibility [Symbol, WhopSDK::Models::Visibility] Controls whether the plan is visible to customers. When set to 'hidden', the pla - - # @see WhopSDK::Models::PlanListResponse#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 that sells this plan. Null for standalone invoice plans not linked - # to a company. - # - # @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::PlanListResponse#invoice - class Invoice < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the invoice. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. - # - # @param id [String] The unique identifier for the invoice. - end - - # @see WhopSDK::Models::PlanListResponse#payment_method_configuration - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - # @!attribute disabled - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - # - # @return [Array] - required :disabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute enabled - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - # - # @return [Array] - required :enabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute include_platform_defaults - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - # - # @return [Boolean] - required :include_platform_defaults, WhopSDK::Internal::Type::Boolean - - # @!method initialize(disabled:, enabled:, include_platform_defaults:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration} for more - # details. - # - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. - # - # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie - # - # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t - # - # @param include_platform_defaults [Boolean] Whether Whop's platform default payment method enablement settings are included - end - - # @see WhopSDK::Models::PlanListResponse#product - class Product < WhopSDK::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the product. - # - # @return [String] - required :id, String - - # @!attribute title - # The display name of the product shown to customers on the product page and in - # search results. - # - # @return [String] - required :title, String - - # @!method initialize(id:, title:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PlanListResponse::Product} for more details. - # - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. - # - # @param id [String] The unique identifier for the product. - # - # @param title [String] The display name of the product shown to customers on the product page and in se - end - - # The 3D Secure behavior for a plan. + # @param updated_at [String] When the plan was last updated, as an ISO 8601 timestamp # - # @see WhopSDK::Models::PlanListResponse#three_ds_level - module ThreeDSLevel - extend WhopSDK::Internal::Type::Enum - - MANDATE_CHALLENGE = :mandate_challenge - FRICTIONLESS = :frictionless - - # @!method self.values - # @return [Array] - end + # @param visibility [String] Whether the plan is visible to customers or hidden from public view end end end diff --git a/lib/whop_sdk/models/plan_update_params.rb b/lib/whop_sdk/models/plan_update_params.rb index bc21ece3..fd2af61c 100644 --- a/lib/whop_sdk/models/plan_update_params.rb +++ b/lib/whop_sdk/models/plan_update_params.rb @@ -26,20 +26,20 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :billing_period, Integer, nil?: true # @!attribute checkout_styling - # Checkout styling overrides for this plan. Pass null to remove all overrides and - # inherit from the company default. + # Checkout styling overrides for this plan. # - # @return [WhopSDK::Models::PlanUpdateParams::CheckoutStyling, nil] - optional :checkout_styling, -> { WhopSDK::PlanUpdateParams::CheckoutStyling }, nil?: true + # @return [Object, nil] + optional :checkout_styling, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute currency - # The available currencies on the platform + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. # - # @return [Symbol, WhopSDK::Models::Currency, nil] - optional :currency, enum: -> { WhopSDK::Currency }, nil?: true + # @return [String, nil] + optional :currency, String # @!attribute custom_fields # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. # # @return [Array, nil] optional :custom_fields, @@ -53,8 +53,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :description, String, nil?: true # @!attribute expiration_days - # The number of days until the membership expires and access is revoked. For - # example, 365 for one-year access. + # The number of days until the membership expires and access is revoked. # # @return [Integer, nil] optional :expiration_days, Integer, nil?: true @@ -66,8 +65,8 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :image, -> { WhopSDK::PlanUpdateParams::Image }, nil?: true # @!attribute initial_price - # The amount charged on the first purchase. Provided in the plan's currency (e.g., - # 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). # # @return [Float, nil] optional :initial_price, Float, nil?: true @@ -86,11 +85,10 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # @!attribute metadata # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # payment and membership events. # - # @return [Hash{Symbol=>Object}, nil] - optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true + # @return [Object, nil] + optional :metadata, WhopSDK::Internal::Type::Unknown, nil?: true # @!attribute offer_cancel_discount # Whether to offer a retention discount when a customer attempts to cancel. @@ -99,15 +97,14 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :offer_cancel_discount, WhopSDK::Internal::Type::Boolean, nil?: true # @!attribute override_tax_type - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) + # Override the default tax classification for this specific plan. # - # @return [Symbol, WhopSDK::Models::TaxType, nil] - optional :override_tax_type, enum: -> { WhopSDK::TaxType }, nil?: true + # @return [String, nil] + optional :override_tax_type, String # @!attribute payment_method_configuration - # Explicit payment method configuration for the plan. Sending null removes any - # custom configuration. + # Explicit payment method configuration for the plan. When not provided, the + # company's defaults apply. # # @return [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] optional :payment_method_configuration, @@ -115,8 +112,8 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel nil?: true # @!attribute renewal_price - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. # # @return [Float, nil] optional :renewal_price, Float, nil?: true @@ -130,23 +127,21 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # @!attribute strike_through_initial_price # A comparison price displayed with a strikethrough for the initial price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). # # @return [Float, nil] optional :strike_through_initial_price, Float, nil?: true # @!attribute strike_through_renewal_price # A comparison price displayed with a strikethrough for the renewal price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). # # @return [Float, nil] optional :strike_through_renewal_price, Float, nil?: true # @!attribute three_ds_level - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. # # @return [Symbol, WhopSDK::Models::PlanUpdateParams::ThreeDSLevel, nil] - optional :three_ds_level, enum: -> { WhopSDK::PlanUpdateParams::ThreeDSLevel }, nil?: true + optional :three_ds_level, enum: -> { WhopSDK::PlanUpdateParams::ThreeDSLevel } # @!attribute title # The display name of the plan shown to customers on the product page. @@ -167,10 +162,10 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true # @!attribute visibility - # Visibility of a resource + # Whether the plan is visible to customers or hidden from public view. # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true + # @return [String, nil] + optional :visibility, String # @!method initialize(id:, adaptive_pricing_enabled: nil, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, metadata: nil, offer_cancel_discount: nil, override_tax_type: nil, payment_method_configuration: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, three_ds_level: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -182,41 +177,41 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # - # @param checkout_styling [WhopSDK::Models::PlanUpdateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to remove all overrides and + # @param checkout_styling [Object, nil] Checkout styling overrides for this plan. # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param currency [String] The three-letter ISO currency code for the plan's pricing. Defaults to USD. # - # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. + # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. Omit # # @param description [String, nil] A text description of the plan displayed to customers on the product page. # - # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. For examp + # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. # # @param image [WhopSDK::Models::PlanUpdateParams::Image, nil] An image displayed on the product page to represent this plan. # - # @param initial_price [Float, nil] The amount charged on the first purchase. Provided in the plan's currency (e.g., + # @param initial_price [Float, nil] The amount charged on the first purchase, in the plan's currency (e.g., 10.43 fo # # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa + # @param metadata [Object, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa # # @param offer_cancel_discount [Boolean, nil] Whether to offer a retention discount when a customer attempts to cancel. # - # @param override_tax_type [Symbol, WhopSDK::Models::TaxType, nil] Whether or not the tax is included in a plan's price (or if it hasn't been set u + # @param override_tax_type [String] Override the default tax classification for this specific plan. # - # @param payment_method_configuration [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. Sending null removes any cus + # @param payment_method_configuration [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the compa # - # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans. Provided in the plan + # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans, in the plan's curren # # @param stock [Integer, nil] The maximum number of units available for purchase. Ignored when unlimited_stock # - # @param strike_through_initial_price [Float, nil] A comparison price displayed with a strikethrough for the initial price. Provide + # @param strike_through_initial_price [Float, nil] A comparison price displayed with a strikethrough for the initial price. # - # @param strike_through_renewal_price [Float, nil] A comparison price displayed with a strikethrough for the renewal price. Provide + # @param strike_through_renewal_price [Float, nil] A comparison price displayed with a strikethrough for the renewal price. # - # @param three_ds_level [Symbol, WhopSDK::Models::PlanUpdateParams::ThreeDSLevel, nil] The 3D Secure behavior for a plan. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanUpdateParams::ThreeDSLevel] The 3D Secure behavior for this plan. Send null to inherit the account default. # # @param title [String, nil] The display name of the plan shown to customers on the product page. # @@ -224,79 +219,37 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the plan is visible to customers or hidden from public view. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel - # @!attribute background_color - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). - # - # @return [String, nil] - optional :background_color, String, nil?: true - - # @!attribute border_style - # The different border-radius styles available for checkout pages. - # - # @return [Symbol, WhopSDK::Models::CheckoutShape, nil] - optional :border_style, enum: -> { WhopSDK::CheckoutShape }, nil?: true - - # @!attribute button_color - # A hex color code for the button color (e.g. #FF5733). + class CustomField < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The ID of the custom field (if being updated). # # @return [String, nil] - optional :button_color, String, nil?: true - - # @!attribute font_family - # The different font families available for checkout pages. - # - # @return [Symbol, WhopSDK::Models::CheckoutFont, nil] - optional :font_family, enum: -> { WhopSDK::CheckoutFont }, nil?: true - - # @!method initialize(background_color: nil, border_style: nil, button_color: nil, font_family: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PlanUpdateParams::CheckoutStyling} for more details. - # - # Checkout styling overrides for this plan. Pass null to remove all overrides and - # inherit from the company default. - # - # @param background_color [String, nil] A hex color code for the checkout page background, applied to the order summary - # - # @param border_style [Symbol, WhopSDK::Models::CheckoutShape, nil] The different border-radius styles available for checkout pages. - # - # @param button_color [String, nil] A hex color code for the button color (e.g. #FF5733). - # - # @param font_family [Symbol, WhopSDK::Models::CheckoutFont, nil] The different font families available for checkout pages. - end + optional :id, String - class CustomField < WhopSDK::Internal::Type::BaseModel # @!attribute field_type # The type of the custom field. # - # @return [Symbol, :text] - required :field_type, const: :text + # @return [Symbol, WhopSDK::Models::PlanUpdateParams::CustomField::FieldType, nil] + optional :field_type, enum: -> { WhopSDK::PlanUpdateParams::CustomField::FieldType } # @!attribute name # The name of the custom field. # - # @return [String] - required :name, String - - # @!attribute id - # The ID of the custom field (if being updated) - # # @return [String, nil] - optional :id, String, nil?: true + optional :name, String # @!attribute order # The order of the field. # # @return [Integer, nil] - optional :order, Integer, nil?: true + optional :order, Integer # @!attribute placeholder - # The placeholder value of the field. + # An example response displayed in the input field. # # @return [String, nil] optional :placeholder, String, nil?: true @@ -305,76 +258,78 @@ class CustomField < WhopSDK::Internal::Type::BaseModel # Whether or not the field is required. # # @return [Boolean, nil] - optional :required, WhopSDK::Internal::Type::Boolean, nil?: true + optional :required, WhopSDK::Internal::Type::Boolean - # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text) - # @param name [String] The name of the custom field. + # @!method initialize(id: nil, field_type: nil, name: nil, order: nil, placeholder: nil, required: nil) + # @param id [String] The ID of the custom field (if being updated). + # + # @param field_type [Symbol, WhopSDK::Models::PlanUpdateParams::CustomField::FieldType] The type of the custom field. # - # @param id [String, nil] The ID of the custom field (if being updated) + # @param name [String] The name of the custom field. # - # @param order [Integer, nil] The order of the field. + # @param order [Integer] The order of the field. # - # @param placeholder [String, nil] The placeholder value of the field. + # @param placeholder [String, nil] An example response displayed in the input field. # - # @param required [Boolean, nil] Whether or not the field is required. + # @param required [Boolean] Whether or not the field is required. + + # The type of the custom field. # - # @param field_type [Symbol, :text] The type of the custom field. + # @see WhopSDK::Models::PlanUpdateParams::CustomField#field_type + module FieldType + extend WhopSDK::Internal::Type::Enum + + TEXT = :text + + # @!method self.values + # @return [Array] + end end class Image < WhopSDK::Internal::Type::BaseModel # @!attribute id - # The ID of an existing file object. # - # @return [String] - required :id, String + # @return [String, nil] + optional :id, String - # @!method initialize(id:) + # @!attribute direct_upload_id + # + # @return [String, nil] + optional :direct_upload_id, String + + # @!method initialize(id: nil, direct_upload_id: nil) # An image displayed on the product page to represent this plan. # - # @param id [String] The ID of an existing file object. + # @param id [String] + # @param direct_upload_id [String] end class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!attribute disabled - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. # - # @return [Array] - required :disabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } + # @return [Array, nil] + optional :disabled, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute enabled - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. # - # @return [Array] - required :enabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } + # @return [Array, nil] + optional :enabled, WhopSDK::Internal::Type::ArrayOf[String] # @!attribute include_platform_defaults - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. # # @return [Boolean, nil] - optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean, nil?: true + optional :include_platform_defaults, WhopSDK::Internal::Type::Boolean - # @!method initialize(disabled:, enabled:, include_platform_defaults: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration} for more - # details. - # - # Explicit payment method configuration for the plan. Sending null removes any - # custom configuration. - # - # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie - # - # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t + # @!method initialize(disabled: nil, enabled: nil, include_platform_defaults: nil) + # Explicit payment method configuration for the plan. When not provided, the + # company's defaults apply. # - # @param include_platform_defaults [Boolean, nil] Whether Whop's platform default payment method enablement settings are included + # @param disabled [Array] + # @param enabled [Array] + # @param include_platform_defaults [Boolean] end - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. module ThreeDSLevel extend WhopSDK::Internal::Type::Enum diff --git a/lib/whop_sdk/resources/plans.rb b/lib/whop_sdk/resources/plans.rb index b22fff0a..c7034386 100644 --- a/lib/whop_sdk/resources/plans.rb +++ b/lib/whop_sdk/resources/plans.rb @@ -2,7 +2,6 @@ module WhopSDK module Resources - # Plans class Plans # Some parameter documentations has been truncated, see # {WhopSDK::Models::PlanCreateParams} for more details. @@ -10,15 +9,7 @@ class Plans # Create a new pricing plan for a product. The plan defines the billing interval, # price, and availability for customers. # - # Required permissions: - # - # - `plan:create` - # - `access_pass:basic:read` - # - `plan:basic:read` - # - # @overload create(company_id:, product_id:, adaptive_pricing_enabled: nil, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, metadata: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, three_ds_level: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) - # - # @param company_id [String] The unique identifier of the company to create this plan for. + # @overload create(product_id:, adaptive_pricing_enabled: nil, billing_period: nil, checkout_styling: nil, company_id: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, metadata: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, three_ds_level: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # # @param product_id [String] The unique identifier of the product to attach this plan to. # @@ -26,49 +17,51 @@ class Plans # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # - # @param checkout_styling [WhopSDK::Models::PlanCreateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to inherit from the company + # @param checkout_styling [Object, nil] Checkout styling overrides for this plan. + # + # @param company_id [String] The unique identifier of the company to create this plan for. Defaults to the ca # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param currency [String] The three-letter ISO currency code for the plan's pricing. Defaults to USD. # - # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. + # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. Omit # # @param description [String, nil] A text description of the plan displayed to customers on the product page. # - # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. Used for + # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. # # @param image [WhopSDK::Models::PlanCreateParams::Image, nil] An image displayed on the product page to represent this plan. # - # @param initial_price [Float, nil] The amount charged on the first purchase. For one-time plans, this is the full p + # @param initial_price [Float, nil] The amount charged on the first purchase, in the plan's currency (e.g., 10.43 fo # # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa + # @param metadata [Object, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa # - # @param override_tax_type [Symbol, WhopSDK::Models::TaxType, nil] Whether or not the tax is included in a plan's price (or if it hasn't been set u + # @param override_tax_type [String] Override the default tax classification for this specific plan. # # @param payment_method_configuration [WhopSDK::Models::PlanCreateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the compa # - # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product + # @param plan_type [String] The billing type of the plan, such as one_time or renewal. # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released. + # @param release_method [String] The method used to sell this plan (e.g., buy_now, waitlist). # - # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans. Provided in the plan + # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans, in the plan's curren # # @param split_pay_required_payments [Integer, nil] The number of installment payments required before the subscription pauses. # # @param stock [Integer, nil] The maximum number of units available for purchase. Ignored when unlimited_stock # - # @param three_ds_level [Symbol, WhopSDK::Models::PlanCreateParams::ThreeDSLevel, nil] The 3D Secure behavior for a plan. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanCreateParams::ThreeDSLevel] The 3D Secure behavior for this plan. Send null to inherit the account default. # # @param title [String, nil] The display name of the plan shown to customers on the product page. # # @param trial_period_days [Integer, nil] The number of free trial days before the first charge on a recurring plan. # - # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. Def + # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the plan is visible to customers or hidden from public view. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -82,13 +75,9 @@ def create(params) # Retrieves the details of an existing plan. # - # Required permissions: - # - # - `plan:basic:read` - # # @overload retrieve(id, request_options: {}) # - # @param id [String] The unique identifier of the plan. + # @param id [String] The unique identifier of the plan, which will look like plan\_******\*******. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -110,55 +99,49 @@ def retrieve(id, params = {}) # Update a plan's pricing, billing interval, visibility, stock, and other # settings. # - # Required permissions: - # - # - `plan:update` - # - `access_pass:basic:read` - # - `plan:basic:read` - # # @overload update(id, adaptive_pricing_enabled: nil, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, metadata: nil, offer_cancel_discount: nil, override_tax_type: nil, payment_method_configuration: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, three_ds_level: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # - # @param id [String] The unique identifier of the plan to update. + # @param id [String] The unique identifier of the plan, which will look like plan\_******\*******. # # @param adaptive_pricing_enabled [Boolean, nil] Whether this plan accepts local currency payments via adaptive pricing. # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # - # @param checkout_styling [WhopSDK::Models::PlanUpdateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to remove all overrides and + # @param checkout_styling [Object, nil] Checkout styling overrides for this plan. # - # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform + # @param currency [String] The three-letter ISO currency code for the plan's pricing. Defaults to USD. # - # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. + # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. Omit # # @param description [String, nil] A text description of the plan displayed to customers on the product page. # - # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. For examp + # @param expiration_days [Integer, nil] The number of days until the membership expires and access is revoked. # # @param image [WhopSDK::Models::PlanUpdateParams::Image, nil] An image displayed on the product page to represent this plan. # - # @param initial_price [Float, nil] The amount charged on the first purchase. Provided in the plan's currency (e.g., + # @param initial_price [Float, nil] The amount charged on the first purchase, in the plan's currency (e.g., 10.43 fo # # @param internal_notes [String, nil] Private notes visible only to the business owner. Not shown to customers. # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls. # - # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa + # @param metadata [Object, nil] Custom key-value pairs to store on the plan. Included in webhook payloads for pa # # @param offer_cancel_discount [Boolean, nil] Whether to offer a retention discount when a customer attempts to cancel. # - # @param override_tax_type [Symbol, WhopSDK::Models::TaxType, nil] Whether or not the tax is included in a plan's price (or if it hasn't been set u + # @param override_tax_type [String] Override the default tax classification for this specific plan. # - # @param payment_method_configuration [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. Sending null removes any cus + # @param payment_method_configuration [WhopSDK::Models::PlanUpdateParams::PaymentMethodConfiguration, nil] Explicit payment method configuration for the plan. When not provided, the compa # - # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans. Provided in the plan + # @param renewal_price [Float, nil] The amount charged each billing period for recurring plans, in the plan's curren # # @param stock [Integer, nil] The maximum number of units available for purchase. Ignored when unlimited_stock # - # @param strike_through_initial_price [Float, nil] A comparison price displayed with a strikethrough for the initial price. Provide + # @param strike_through_initial_price [Float, nil] A comparison price displayed with a strikethrough for the initial price. # - # @param strike_through_renewal_price [Float, nil] A comparison price displayed with a strikethrough for the renewal price. Provide + # @param strike_through_renewal_price [Float, nil] A comparison price displayed with a strikethrough for the renewal price. # - # @param three_ds_level [Symbol, WhopSDK::Models::PlanUpdateParams::ThreeDSLevel, nil] The 3D Secure behavior for a plan. + # @param three_ds_level [Symbol, WhopSDK::Models::PlanUpdateParams::ThreeDSLevel] The 3D Secure behavior for this plan. Send null to inherit the account default. # # @param title [String, nil] The display name of the plan shown to customers on the product page. # @@ -166,7 +149,7 @@ def retrieve(id, params = {}) # # @param unlimited_stock [Boolean, nil] Whether the plan has unlimited stock. When true, the stock field is ignored. # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + # @param visibility [String] Whether the plan is visible to customers or hidden from public view. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -187,37 +170,33 @@ def update(id, params = {}) # Returns a paginated list of plans belonging to a company, with optional # filtering by visibility, type, release method, and product. # - # Required permissions: - # - # - `plan:basic:read` - # # @overload list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, plan_types: nil, product_ids: nil, release_methods: nil, visibilities: nil, request_options: {}) # # @param company_id [String] The unique identifier of the company to list plans for. # - # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # @param after [String] A cursor; returns plans after this position. # - # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # @param before [String] A cursor; returns plans before this position. # - # @param created_after [Time, nil] Only return plans created after this timestamp. + # @param created_after [String] Only return plans created after this timestamp. # - # @param created_before [Time, nil] Only return plans created before this timestamp. + # @param created_before [String] Only return plans created before this timestamp. # - # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort. + # @param direction [Symbol, WhopSDK::Models::PlanListParams::Direction] The sort direction for results. Defaults to descending. # - # @param first [Integer, nil] Returns the first _n_ elements from the list. + # @param first [Integer] The number of plans to return (default and max 100). # - # @param last [Integer, nil] Returns the last _n_ elements from the list. + # @param last [Integer] The number of plans to return from the end of the range. # - # @param order [Symbol, WhopSDK::Models::PlanListParams::Order, nil] The ways a relation of Plans can be ordered + # @param order [Symbol, WhopSDK::Models::PlanListParams::Order] The field to sort results by. Defaults to created_at. # - # @param plan_types [Array, nil] Filter to only plans matching these billing types. + # @param plan_types [Array] Filter to only plans matching these billing types. # - # @param product_ids [Array, nil] Filter to only plans belonging to these product identifiers. + # @param product_ids [Array] Filter to only plans belonging to these product identifiers. # - # @param release_methods [Array, nil] Filter to only plans matching these release methods. + # @param release_methods [Array] Filter to only plans matching these release methods. # - # @param visibilities [Array, nil] Filter to only plans matching these visibility states. + # @param visibilities [Array] Filter to only plans matching these visibility states. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -240,13 +219,9 @@ def list(params) # Permanently delete a plan from a product. Existing memberships on this plan will # not be affected. # - # Required permissions: - # - # - `plan:delete` - # # @overload delete(id, request_options: {}) # - # @param id [String] The unique identifier of the plan to delete. + # @param id [String] The unique identifier of the plan, which will look like plan\_******\*******. # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index 1670b8b6..b7b9407e 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -53,7 +53,6 @@ module WhopSDK sig { returns(WhopSDK::Resources::Webhooks) } attr_reader :webhooks - # Plans sig { returns(WhopSDK::Resources::Plans) } attr_reader :plans diff --git a/rbi/whop_sdk/models/plan.rbi b/rbi/whop_sdk/models/plan.rbi index c55728b6..7dd01cdc 100644 --- a/rbi/whop_sdk/models/plan.rbi +++ b/rbi/whop_sdk/models/plan.rbi @@ -5,297 +5,238 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias { T.any(WhopSDK::Plan, WhopSDK::Internal::AnyHash) } - # The unique identifier for the plan. + # The ID of the plan, which will look like plan\_******\******* sig { returns(String) } attr_accessor :id - # Whether the creator has turned on adaptive pricing for this plan. Raw setting — - # does not check processor compatibility or feature flags. + # Whether this plan accepts local currency payments via adaptive pricing sig { returns(T::Boolean) } attr_accessor :adaptive_pricing_enabled - # The number of days between each recurring charge. Null for one-time plans. For - # example, 30 for monthly or 365 for annual billing. - sig { returns(T.nilable(Integer)) } + # The number of days between recurring charges. Null for one-time plans + sig { returns(T.nilable(Float)) } attr_accessor :billing_period - # Whether tax is collected on purchases of this plan, based on the company's tax - # configuration. + # Whether tax is collected on purchases of this plan sig { returns(T::Boolean) } attr_accessor :collect_tax - # The company that sells this plan. Null for standalone invoice plans not linked - # to a company. - sig { returns(T.nilable(WhopSDK::Plan::Company)) } - attr_reader :company + # The company that sells this plan, an object with an id and title. Null for + # standalone invoice plans + sig { returns(T.nilable(T.anything)) } + attr_accessor :company - sig { params(company: T.nilable(WhopSDK::Plan::Company::OrHash)).void } - attr_writer :company - - # The datetime the plan was created. - sig { returns(Time) } + # When the plan was created, as an ISO 8601 timestamp + sig { returns(String) } attr_accessor :created_at - # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary - # amounts on the plan are denominated in this currency. - sig { returns(WhopSDK::Currency::TaggedSymbol) } + # The three-letter ISO currency code all prices on this plan are denominated in + sig { returns(WhopSDK::Plan::Currency::TaggedSymbol) } attr_accessor :currency - # Custom input fields displayed on the checkout form that collect additional - # information from the buyer. - sig { returns(T::Array[WhopSDK::Plan::CustomField]) } + # Custom input fields displayed on the checkout form, objects with id, field_type, + # name, order, placeholder and required + sig { returns(T::Array[T.anything]) } attr_accessor :custom_fields - # A text description of the plan visible to customers. Maximum 1000 characters. - # Null if no description is set. + # A text description of the plan visible to customers sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. - sig { returns(T.nilable(Integer)) } + # The number of days until the membership expires, for expiration-based plans + sig { returns(T.nilable(Float)) } attr_accessor :expiration_days - # The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). - # For one-time plans, this is the full price. For renewal plans, this is charged - # on top of the first renewal_price. + # The initial purchase price in the plan's currency sig { returns(Float) } attr_accessor :initial_price - # Private notes visible only to the company owner and team members. Not shown to - # customers. Null if no notes have been added. + # Private notes visible only to authorized team members sig { returns(T.nilable(String)) } attr_accessor :internal_notes - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. - sig { returns(T.nilable(WhopSDK::Plan::Invoice)) } - attr_reader :invoice + # The invoice this plan was generated for, an object with an id. Null unless the + # plan was created for an invoice + sig { returns(T.nilable(T.anything)) } + attr_accessor :invoice - sig { params(invoice: T.nilable(WhopSDK::Plan::Invoice::OrHash)).void } - attr_writer :invoice - - # The number of users who currently hold an active membership through this plan. - # Only visible to authorized team members. - sig { returns(T.nilable(Integer)) } + # The number of active memberships on this plan. Only visible to authorized team + # members + sig { returns(T.nilable(Float)) } attr_accessor :member_count - # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + # Custom key-value pairs stored on the plan + sig { returns(T.nilable(T.anything)) } attr_accessor :metadata - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. - sig { returns(T.nilable(WhopSDK::Plan::PaymentMethodConfiguration)) } - attr_reader :payment_method_configuration - - sig do - params( - payment_method_configuration: - T.nilable(WhopSDK::Plan::PaymentMethodConfiguration::OrHash) - ).void - end - attr_writer :payment_method_configuration + # The explicit payment method configuration for the plan, an object with enabled, + # disabled and include_platform_defaults. Null if the plan uses default settings + sig { returns(T.nilable(T.anything)) } + attr_accessor :payment_method_configuration # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. - sig { returns(WhopSDK::PlanType::TaggedSymbol) } + # 'one_time' for single payments + sig { returns(WhopSDK::Plan::PlanType::TaggedSymbol) } attr_accessor :plan_type - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. - sig { returns(T.nilable(WhopSDK::Plan::Product)) } - attr_reader :product - - sig { params(product: T.nilable(WhopSDK::Plan::Product::OrHash)).void } - attr_writer :product + # The product this plan belongs to, an object with an id and title. Null for + # standalone plans + sig { returns(T.nilable(T.anything)) } + attr_accessor :product - # The full URL where customers can purchase this plan directly, bypassing the - # product page. + # The full URL where customers can purchase this plan directly sig { returns(String) } attr_accessor :purchase_url - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. - sig { returns(WhopSDK::ReleaseMethod::TaggedSymbol) } + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + sig { returns(WhopSDK::Plan::ReleaseMethod::TaggedSymbol) } attr_accessor :release_method - # The recurring price charged every billing_period in the plan's base_currency - # (e.g., 9.99 for $9.99/period). Zero for one-time plans. + # The recurring price charged every billing period in the plan's currency sig { returns(Float) } attr_accessor :renewal_price - # The total number of installment payments required before the subscription - # pauses. Null if split pay is not configured. Must be greater than 1. - sig { returns(T.nilable(Integer)) } + # The number of installment payments required before the subscription pauses + sig { returns(T.nilable(Float)) } attr_accessor :split_pay_required_payments # The number of units available for purchase. Only visible to authorized team - # members. Null if the requester lacks permission. - sig { returns(T.nilable(Integer)) } + # members + sig { returns(T.nilable(Float)) } attr_accessor :stock - # How tax is handled for this plan: 'inclusive' (tax included in price), - # 'exclusive' (tax added at checkout), or 'unspecified' (tax not configured). - sig { returns(WhopSDK::TaxType::TaggedSymbol) } + # How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' + sig { returns(String) } attr_accessor :tax_type - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default sig { returns(T.nilable(WhopSDK::Plan::ThreeDSLevel::TaggedSymbol)) } attr_accessor :three_ds_level - # The display name of the plan shown to customers on the product page and at - # checkout. Maximum 30 characters. Null if no title has been set. + # The display name of the plan shown to customers sig { returns(T.nilable(String)) } attr_accessor :title - # The number of free trial days before the first charge on a renewal plan. Null if - # no trial is configured or the current user has already used a trial for this - # plan. - sig { returns(T.nilable(Integer)) } + # The number of free trial days before the first charge on a recurring plan + sig { returns(T.nilable(Float)) } attr_accessor :trial_period_days - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. + # Whether the plan has unlimited stock sig { returns(T::Boolean) } attr_accessor :unlimited_stock - # The datetime the plan was last updated. - sig { returns(Time) } + # When the plan was last updated, as an ISO 8601 timestamp + sig { returns(String) } attr_accessor :updated_at - # Controls whether the plan is visible to customers. When set to 'hidden', the - # plan is only accessible via direct link. - sig { returns(WhopSDK::Visibility::TaggedSymbol) } + # Whether the plan is visible to customers or hidden from public view + sig { returns(WhopSDK::Plan::Visibility::TaggedSymbol) } attr_accessor :visibility - # A plan defines pricing and billing terms for a checkout. Plans can optionally - # belong to a product, where they represent different pricing options such as - # one-time payments, recurring subscriptions, or free trials. sig do params( id: String, adaptive_pricing_enabled: T::Boolean, - billing_period: T.nilable(Integer), + billing_period: T.nilable(Float), collect_tax: T::Boolean, - company: T.nilable(WhopSDK::Plan::Company::OrHash), - created_at: Time, - currency: WhopSDK::Currency::OrSymbol, - custom_fields: T::Array[WhopSDK::Plan::CustomField::OrHash], + company: T.nilable(T.anything), + created_at: String, + currency: WhopSDK::Plan::Currency::OrSymbol, + custom_fields: T::Array[T.anything], description: T.nilable(String), - expiration_days: T.nilable(Integer), + expiration_days: T.nilable(Float), initial_price: Float, internal_notes: T.nilable(String), - invoice: T.nilable(WhopSDK::Plan::Invoice::OrHash), - member_count: T.nilable(Integer), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - payment_method_configuration: - T.nilable(WhopSDK::Plan::PaymentMethodConfiguration::OrHash), - plan_type: WhopSDK::PlanType::OrSymbol, - product: T.nilable(WhopSDK::Plan::Product::OrHash), + invoice: T.nilable(T.anything), + member_count: T.nilable(Float), + metadata: T.nilable(T.anything), + payment_method_configuration: T.nilable(T.anything), + plan_type: WhopSDK::Plan::PlanType::OrSymbol, + product: T.nilable(T.anything), purchase_url: String, - release_method: WhopSDK::ReleaseMethod::OrSymbol, + release_method: WhopSDK::Plan::ReleaseMethod::OrSymbol, renewal_price: Float, - split_pay_required_payments: T.nilable(Integer), - stock: T.nilable(Integer), - tax_type: WhopSDK::TaxType::OrSymbol, + split_pay_required_payments: T.nilable(Float), + stock: T.nilable(Float), + tax_type: String, three_ds_level: T.nilable(WhopSDK::Plan::ThreeDSLevel::OrSymbol), title: T.nilable(String), - trial_period_days: T.nilable(Integer), + trial_period_days: T.nilable(Float), unlimited_stock: T::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility::OrSymbol + updated_at: String, + visibility: WhopSDK::Plan::Visibility::OrSymbol ).returns(T.attached_class) end def self.new( - # The unique identifier for the plan. + # The ID of the plan, which will look like plan\_******\******* id:, - # Whether the creator has turned on adaptive pricing for this plan. Raw setting — - # does not check processor compatibility or feature flags. + # Whether this plan accepts local currency payments via adaptive pricing adaptive_pricing_enabled:, - # The number of days between each recurring charge. Null for one-time plans. For - # example, 30 for monthly or 365 for annual billing. + # The number of days between recurring charges. Null for one-time plans billing_period:, - # Whether tax is collected on purchases of this plan, based on the company's tax - # configuration. + # Whether tax is collected on purchases of this plan collect_tax:, - # The company that sells this plan. Null for standalone invoice plans not linked - # to a company. + # The company that sells this plan, an object with an id and title. Null for + # standalone invoice plans company:, - # The datetime the plan was created. + # When the plan was created, as an ISO 8601 timestamp created_at:, - # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary - # amounts on the plan are denominated in this currency. + # The three-letter ISO currency code all prices on this plan are denominated in currency:, - # Custom input fields displayed on the checkout form that collect additional - # information from the buyer. + # Custom input fields displayed on the checkout form, objects with id, field_type, + # name, order, placeholder and required custom_fields:, - # A text description of the plan visible to customers. Maximum 1000 characters. - # Null if no description is set. + # A text description of the plan visible to customers description:, - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # The number of days until the membership expires, for expiration-based plans expiration_days:, - # The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). - # For one-time plans, this is the full price. For renewal plans, this is charged - # on top of the first renewal_price. + # The initial purchase price in the plan's currency initial_price:, - # Private notes visible only to the company owner and team members. Not shown to - # customers. Null if no notes have been added. + # Private notes visible only to authorized team members internal_notes:, - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. + # The invoice this plan was generated for, an object with an id. Null unless the + # plan was created for an invoice invoice:, - # The number of users who currently hold an active membership through this plan. - # Only visible to authorized team members. + # The number of active memberships on this plan. Only visible to authorized team + # members member_count:, - # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the plan metadata:, - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. + # The explicit payment method configuration for the plan, an object with enabled, + # disabled and include_platform_defaults. Null if the plan uses default settings payment_method_configuration:, # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. + # 'one_time' for single payments plan_type:, - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. + # The product this plan belongs to, an object with an id and title. Null for + # standalone plans product:, - # The full URL where customers can purchase this plan directly, bypassing the - # product page. + # The full URL where customers can purchase this plan directly purchase_url:, - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' release_method:, - # The recurring price charged every billing_period in the plan's base_currency - # (e.g., 9.99 for $9.99/period). Zero for one-time plans. + # The recurring price charged every billing period in the plan's currency renewal_price:, - # The total number of installment payments required before the subscription - # pauses. Null if split pay is not configured. Must be greater than 1. + # The number of installment payments required before the subscription pauses split_pay_required_payments:, # The number of units available for purchase. Only visible to authorized team - # members. Null if the requester lacks permission. + # members stock:, - # How tax is handled for this plan: 'inclusive' (tax included in price), - # 'exclusive' (tax added at checkout), or 'unspecified' (tax not configured). + # How tax is handled for this plan: 'inclusive', 'exclusive', or 'unspecified' tax_type:, - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default three_ds_level:, - # The display name of the plan shown to customers on the product page and at - # checkout. Maximum 30 characters. Null if no title has been set. + # The display name of the plan shown to customers title:, - # The number of free trial days before the first charge on a renewal plan. Null if - # no trial is configured or the current user has already used a trial for this - # plan. + # The number of free trial days before the first charge on a recurring plan trial_period_days:, - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. + # Whether the plan has unlimited stock unlimited_stock:, - # The datetime the plan was last updated. + # When the plan was last updated, as an ISO 8601 timestamp updated_at:, - # Controls whether the plan is visible to customers. When set to 'hidden', the - # plan is only accessible via direct link. + # Whether the plan is visible to customers or hidden from public view visibility: ) end @@ -305,267 +246,184 @@ module WhopSDK { id: String, adaptive_pricing_enabled: T::Boolean, - billing_period: T.nilable(Integer), + billing_period: T.nilable(Float), collect_tax: T::Boolean, - company: T.nilable(WhopSDK::Plan::Company), - created_at: Time, - currency: WhopSDK::Currency::TaggedSymbol, - custom_fields: T::Array[WhopSDK::Plan::CustomField], + company: T.nilable(T.anything), + created_at: String, + currency: WhopSDK::Plan::Currency::TaggedSymbol, + custom_fields: T::Array[T.anything], description: T.nilable(String), - expiration_days: T.nilable(Integer), + expiration_days: T.nilable(Float), initial_price: Float, internal_notes: T.nilable(String), - invoice: T.nilable(WhopSDK::Plan::Invoice), - member_count: T.nilable(Integer), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - payment_method_configuration: - T.nilable(WhopSDK::Plan::PaymentMethodConfiguration), - plan_type: WhopSDK::PlanType::TaggedSymbol, - product: T.nilable(WhopSDK::Plan::Product), + invoice: T.nilable(T.anything), + member_count: T.nilable(Float), + metadata: T.nilable(T.anything), + payment_method_configuration: T.nilable(T.anything), + plan_type: WhopSDK::Plan::PlanType::TaggedSymbol, + product: T.nilable(T.anything), purchase_url: String, - release_method: WhopSDK::ReleaseMethod::TaggedSymbol, + release_method: WhopSDK::Plan::ReleaseMethod::TaggedSymbol, renewal_price: Float, - split_pay_required_payments: T.nilable(Integer), - stock: T.nilable(Integer), - tax_type: WhopSDK::TaxType::TaggedSymbol, + split_pay_required_payments: T.nilable(Float), + stock: T.nilable(Float), + tax_type: String, three_ds_level: T.nilable(WhopSDK::Plan::ThreeDSLevel::TaggedSymbol), title: T.nilable(String), - trial_period_days: T.nilable(Integer), + trial_period_days: T.nilable(Float), unlimited_stock: T::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility::TaggedSymbol + updated_at: String, + visibility: WhopSDK::Plan::Visibility::TaggedSymbol } ) end def to_hash end - class Company < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Plan::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 that sells this plan. Null for standalone invoice plans not linked - # to a company. - 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 CustomField < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Plan::CustomField, WhopSDK::Internal::AnyHash) - end - - # The unique identifier for the custom field. - sig { returns(String) } - attr_accessor :id - - # What type of input field to use. - sig { returns(Symbol) } - attr_accessor :field_type - - # The title/header of the custom field. - sig { returns(String) } - attr_accessor :name - - # How the custom field should be ordered when rendered on the checkout page. - sig { returns(T.nilable(Integer)) } - attr_accessor :order + # The three-letter ISO currency code all prices on this plan are denominated in + module Currency + extend WhopSDK::Internal::Type::Enum - # An example response displayed in the input field. - sig { returns(T.nilable(String)) } - attr_accessor :placeholder + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Plan::Currency) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - # Whether or not the custom field is required. - sig { returns(T::Boolean) } - attr_accessor :required + USD = T.let(:usd, WhopSDK::Plan::Currency::TaggedSymbol) + SGD = T.let(:sgd, WhopSDK::Plan::Currency::TaggedSymbol) + INR = T.let(:inr, WhopSDK::Plan::Currency::TaggedSymbol) + AUD = T.let(:aud, WhopSDK::Plan::Currency::TaggedSymbol) + BRL = T.let(:brl, WhopSDK::Plan::Currency::TaggedSymbol) + CAD = T.let(:cad, WhopSDK::Plan::Currency::TaggedSymbol) + DKK = T.let(:dkk, WhopSDK::Plan::Currency::TaggedSymbol) + EUR = T.let(:eur, WhopSDK::Plan::Currency::TaggedSymbol) + NOK = T.let(:nok, WhopSDK::Plan::Currency::TaggedSymbol) + GBP = T.let(:gbp, WhopSDK::Plan::Currency::TaggedSymbol) + SEK = T.let(:sek, WhopSDK::Plan::Currency::TaggedSymbol) + CHF = T.let(:chf, WhopSDK::Plan::Currency::TaggedSymbol) + HKD = T.let(:hkd, WhopSDK::Plan::Currency::TaggedSymbol) + HUF = T.let(:huf, WhopSDK::Plan::Currency::TaggedSymbol) + JPY = T.let(:jpy, WhopSDK::Plan::Currency::TaggedSymbol) + MXN = T.let(:mxn, WhopSDK::Plan::Currency::TaggedSymbol) + MYR = T.let(:myr, WhopSDK::Plan::Currency::TaggedSymbol) + PLN = T.let(:pln, WhopSDK::Plan::Currency::TaggedSymbol) + CZK = T.let(:czk, WhopSDK::Plan::Currency::TaggedSymbol) + NZD = T.let(:nzd, WhopSDK::Plan::Currency::TaggedSymbol) + AED = T.let(:aed, WhopSDK::Plan::Currency::TaggedSymbol) + ETH = T.let(:eth, WhopSDK::Plan::Currency::TaggedSymbol) + APE = T.let(:ape, WhopSDK::Plan::Currency::TaggedSymbol) + COP = T.let(:cop, WhopSDK::Plan::Currency::TaggedSymbol) + RON = T.let(:ron, WhopSDK::Plan::Currency::TaggedSymbol) + THB = T.let(:thb, WhopSDK::Plan::Currency::TaggedSymbol) + BGN = T.let(:bgn, WhopSDK::Plan::Currency::TaggedSymbol) + IDR = T.let(:idr, WhopSDK::Plan::Currency::TaggedSymbol) + DOP = T.let(:dop, WhopSDK::Plan::Currency::TaggedSymbol) + PHP = T.let(:php, WhopSDK::Plan::Currency::TaggedSymbol) + TRY = T.let(:try, WhopSDK::Plan::Currency::TaggedSymbol) + KRW = T.let(:krw, WhopSDK::Plan::Currency::TaggedSymbol) + TWD = T.let(:twd, WhopSDK::Plan::Currency::TaggedSymbol) + VND = T.let(:vnd, WhopSDK::Plan::Currency::TaggedSymbol) + PKR = T.let(:pkr, WhopSDK::Plan::Currency::TaggedSymbol) + CLP = T.let(:clp, WhopSDK::Plan::Currency::TaggedSymbol) + UYU = T.let(:uyu, WhopSDK::Plan::Currency::TaggedSymbol) + ARS = T.let(:ars, WhopSDK::Plan::Currency::TaggedSymbol) + ZAR = T.let(:zar, WhopSDK::Plan::Currency::TaggedSymbol) + DZD = T.let(:dzd, WhopSDK::Plan::Currency::TaggedSymbol) + TND = T.let(:tnd, WhopSDK::Plan::Currency::TaggedSymbol) + MAD = T.let(:mad, WhopSDK::Plan::Currency::TaggedSymbol) + KES = T.let(:kes, WhopSDK::Plan::Currency::TaggedSymbol) + KWD = T.let(:kwd, WhopSDK::Plan::Currency::TaggedSymbol) + JOD = T.let(:jod, WhopSDK::Plan::Currency::TaggedSymbol) + ALL = T.let(:all, WhopSDK::Plan::Currency::TaggedSymbol) + XCD = T.let(:xcd, WhopSDK::Plan::Currency::TaggedSymbol) + AMD = T.let(:amd, WhopSDK::Plan::Currency::TaggedSymbol) + BSD = T.let(:bsd, WhopSDK::Plan::Currency::TaggedSymbol) + BHD = T.let(:bhd, WhopSDK::Plan::Currency::TaggedSymbol) + BOB = T.let(:bob, WhopSDK::Plan::Currency::TaggedSymbol) + BAM = T.let(:bam, WhopSDK::Plan::Currency::TaggedSymbol) + KHR = T.let(:khr, WhopSDK::Plan::Currency::TaggedSymbol) + CRC = T.let(:crc, WhopSDK::Plan::Currency::TaggedSymbol) + XOF = T.let(:xof, WhopSDK::Plan::Currency::TaggedSymbol) + EGP = T.let(:egp, WhopSDK::Plan::Currency::TaggedSymbol) + ETB = T.let(:etb, WhopSDK::Plan::Currency::TaggedSymbol) + GMD = T.let(:gmd, WhopSDK::Plan::Currency::TaggedSymbol) + GHS = T.let(:ghs, WhopSDK::Plan::Currency::TaggedSymbol) + GTQ = T.let(:gtq, WhopSDK::Plan::Currency::TaggedSymbol) + GYD = T.let(:gyd, WhopSDK::Plan::Currency::TaggedSymbol) + ILS = T.let(:ils, WhopSDK::Plan::Currency::TaggedSymbol) + JMD = T.let(:jmd, WhopSDK::Plan::Currency::TaggedSymbol) + MOP = T.let(:mop, WhopSDK::Plan::Currency::TaggedSymbol) + MGA = T.let(:mga, WhopSDK::Plan::Currency::TaggedSymbol) + MUR = T.let(:mur, WhopSDK::Plan::Currency::TaggedSymbol) + MDL = T.let(:mdl, WhopSDK::Plan::Currency::TaggedSymbol) + MNT = T.let(:mnt, WhopSDK::Plan::Currency::TaggedSymbol) + NAD = T.let(:nad, WhopSDK::Plan::Currency::TaggedSymbol) + NGN = T.let(:ngn, WhopSDK::Plan::Currency::TaggedSymbol) + MKD = T.let(:mkd, WhopSDK::Plan::Currency::TaggedSymbol) + OMR = T.let(:omr, WhopSDK::Plan::Currency::TaggedSymbol) + PYG = T.let(:pyg, WhopSDK::Plan::Currency::TaggedSymbol) + PEN = T.let(:pen, WhopSDK::Plan::Currency::TaggedSymbol) + QAR = T.let(:qar, WhopSDK::Plan::Currency::TaggedSymbol) + RWF = T.let(:rwf, WhopSDK::Plan::Currency::TaggedSymbol) + SAR = T.let(:sar, WhopSDK::Plan::Currency::TaggedSymbol) + RSD = T.let(:rsd, WhopSDK::Plan::Currency::TaggedSymbol) + LKR = T.let(:lkr, WhopSDK::Plan::Currency::TaggedSymbol) + TZS = T.let(:tzs, WhopSDK::Plan::Currency::TaggedSymbol) + TTD = T.let(:ttd, WhopSDK::Plan::Currency::TaggedSymbol) + UZS = T.let(:uzs, WhopSDK::Plan::Currency::TaggedSymbol) + RUB = T.let(:rub, WhopSDK::Plan::Currency::TaggedSymbol) + BTC = T.let(:btc, WhopSDK::Plan::Currency::TaggedSymbol) + CNY = T.let(:cny, WhopSDK::Plan::Currency::TaggedSymbol) + USDT = T.let(:usdt, WhopSDK::Plan::Currency::TaggedSymbol) + KZT = T.let(:kzt, WhopSDK::Plan::Currency::TaggedSymbol) + AWG = T.let(:awg, WhopSDK::Plan::Currency::TaggedSymbol) + WHOP_USD = T.let(:whop_usd, WhopSDK::Plan::Currency::TaggedSymbol) + XAU = T.let(:xau, WhopSDK::Plan::Currency::TaggedSymbol) - # An object representing a custom field for a plan. sig do - params( - id: String, - name: String, - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T::Boolean, - field_type: Symbol - ).returns(T.attached_class) + override.returns(T::Array[WhopSDK::Plan::Currency::TaggedSymbol]) end - def self.new( - # The unique identifier for the custom field. - id:, - # The title/header of the custom field. - name:, - # How the custom field should be ordered when rendered on the checkout page. - order:, - # An example response displayed in the input field. - placeholder:, - # Whether or not the custom field is required. - required:, - # What type of input field to use. - field_type: :text - ) - end - - sig do - override.returns( - { - id: String, - field_type: Symbol, - name: String, - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T::Boolean - } - ) - end - def to_hash + def self.values end end - class Invoice < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Plan::Invoice, WhopSDK::Internal::AnyHash) - end - - # The unique identifier for the invoice. - sig { returns(String) } - attr_accessor :id - - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the invoice. - id: - ) - end + # The billing model for this plan: 'renewal' for recurring subscriptions or + # 'one_time' for single payments + module PlanType + extend WhopSDK::Internal::Type::Enum - sig { override.returns({ id: String }) } - def to_hash - end - end + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Plan::PlanType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Plan::PaymentMethodConfiguration, - WhopSDK::Internal::AnyHash - ) - end - - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) } - attr_accessor :disabled - - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) } - attr_accessor :enabled - - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - sig { returns(T::Boolean) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - disabled:, - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - enabled:, - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - include_platform_defaults: - ) - end + RENEWAL = T.let(:renewal, WhopSDK::Plan::PlanType::TaggedSymbol) + ONE_TIME = T.let(:one_time, WhopSDK::Plan::PlanType::TaggedSymbol) sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], - include_platform_defaults: T::Boolean - } - ) + override.returns(T::Array[WhopSDK::Plan::PlanType::TaggedSymbol]) end - def to_hash + def self.values end end - class Product < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(WhopSDK::Plan::Product, WhopSDK::Internal::AnyHash) - end - - # The unique identifier for the product. - sig { returns(String) } - attr_accessor :id - - # The display name of the product shown to customers on the product page and in - # search results. - sig { returns(String) } - attr_accessor :title - - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. - sig { params(id: String, title: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the product. - id:, - # The display name of the product shown to customers on the product page and in - # search results. - title: - ) - end + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + module ReleaseMethod + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::Plan::ReleaseMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - sig { override.returns({ id: String, title: String }) } - def to_hash + BUY_NOW = T.let(:buy_now, WhopSDK::Plan::ReleaseMethod::TaggedSymbol) + WAITLIST = T.let(:waitlist, WhopSDK::Plan::ReleaseMethod::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::Plan::ReleaseMethod::TaggedSymbol]) + end + def self.values end end - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default module ThreeDSLevel extend WhopSDK::Internal::Type::Enum @@ -584,6 +442,25 @@ module WhopSDK def self.values end end + + # Whether the plan is visible to customers or hidden from public view + module Visibility + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::Plan::Visibility) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VISIBLE = T.let(:visible, WhopSDK::Plan::Visibility::TaggedSymbol) + HIDDEN = T.let(:hidden, WhopSDK::Plan::Visibility::TaggedSymbol) + ARCHIVED = T.let(:archived, WhopSDK::Plan::Visibility::TaggedSymbol) + QUICK_LINK = T.let(:quick_link, WhopSDK::Plan::Visibility::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::Plan::Visibility::TaggedSymbol]) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/plan_create_params.rbi b/rbi/whop_sdk/models/plan_create_params.rbi index 073551e3..759896b6 100644 --- a/rbi/whop_sdk/models/plan_create_params.rbi +++ b/rbi/whop_sdk/models/plan_create_params.rbi @@ -11,10 +11,6 @@ module WhopSDK T.any(WhopSDK::PlanCreateParams, WhopSDK::Internal::AnyHash) end - # The unique identifier of the company to create this plan for. - sig { returns(String) } - attr_accessor :company_id - # The unique identifier of the product to attach this plan to. sig { returns(String) } attr_accessor :product_id @@ -28,24 +24,27 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :billing_period - # Checkout styling overrides for this plan. Pass null to inherit from the company - # default. - sig { returns(T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling)) } - attr_reader :checkout_styling + # Checkout styling overrides for this plan. + sig { returns(T.nilable(T.anything)) } + attr_accessor :checkout_styling - sig do - params( - checkout_styling: - T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling::OrHash) - ).void - end - attr_writer :checkout_styling + # The unique identifier of the company to create this plan for. Defaults to the + # caller's company. + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. + sig { returns(T.nilable(String)) } + attr_reader :currency - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } - attr_accessor :currency + sig { params(currency: String).void } + attr_writer :currency # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. sig do returns(T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField])) end @@ -55,8 +54,7 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires and access is revoked. Used for - # expiration-based plans. + # The number of days until the membership expires and access is revoked. sig { returns(T.nilable(Integer)) } attr_accessor :expiration_days @@ -69,9 +67,8 @@ module WhopSDK end attr_writer :image - # The amount charged on the first purchase. For one-time plans, this is the full - # price. For recurring plans, this is an additional charge on top of the renewal - # price. Provided in the plan's currency (e.g., 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). sig { returns(T.nilable(Float)) } attr_accessor :initial_price @@ -84,15 +81,16 @@ module WhopSDK attr_accessor :legacy_payment_method_controls # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + # payment and membership events. + sig { returns(T.nilable(T.anything)) } attr_accessor :metadata - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) - sig { returns(T.nilable(WhopSDK::TaxType::OrSymbol)) } - attr_accessor :override_tax_type + # Override the default tax classification for this specific plan. + sig { returns(T.nilable(String)) } + attr_reader :override_tax_type + + sig { params(override_tax_type: String).void } + attr_writer :override_tax_type # Explicit payment method configuration for the plan. When not provided, the # company's defaults apply. @@ -113,16 +111,22 @@ module WhopSDK end attr_writer :payment_method_configuration - # The type of plan that can be attached to a product - sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) } - attr_accessor :plan_type + # The billing type of the plan, such as one_time or renewal. + sig { returns(T.nilable(String)) } + attr_reader :plan_type + + sig { params(plan_type: String).void } + attr_writer :plan_type + + # The method used to sell this plan (e.g., buy_now, waitlist). + sig { returns(T.nilable(String)) } + attr_reader :release_method - # The methods of how a plan can be released. - sig { returns(T.nilable(WhopSDK::ReleaseMethod::OrSymbol)) } - attr_accessor :release_method + sig { params(release_method: String).void } + attr_writer :release_method - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. sig { returns(T.nilable(Float)) } attr_accessor :renewal_price @@ -135,11 +139,18 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :stock - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. sig do returns(T.nilable(WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol)) end - attr_accessor :three_ds_level + attr_reader :three_ds_level + + sig do + params( + three_ds_level: WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol + ).void + end + attr_writer :three_ds_level # The display name of the plan shown to customers on the product page. sig { returns(T.nilable(String)) } @@ -150,23 +161,24 @@ module WhopSDK attr_accessor :trial_period_days # Whether the plan has unlimited stock. When true, the stock field is ignored. - # Defaults to true. sig { returns(T.nilable(T::Boolean)) } attr_accessor :unlimited_stock - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility + # Whether the plan is visible to customers or hidden from public view. + sig { returns(T.nilable(String)) } + attr_reader :visibility + + sig { params(visibility: String).void } + attr_writer :visibility sig do params( - company_id: String, product_id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), - checkout_styling: - T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling::OrHash), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + checkout_styling: T.nilable(T.anything), + company_id: String, + currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField::OrHash]), description: T.nilable(String), @@ -175,29 +187,26 @@ module WhopSDK initial_price: T.nilable(Float), internal_notes: T.nilable(String), legacy_payment_method_controls: T.nilable(T::Boolean), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), + metadata: T.nilable(T.anything), + override_tax_type: String, payment_method_configuration: T.nilable( WhopSDK::PlanCreateParams::PaymentMethodConfiguration::OrHash ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), + plan_type: String, + release_method: String, renewal_price: T.nilable(Float), split_pay_required_payments: T.nilable(Integer), stock: T.nilable(Integer), - three_ds_level: - T.nilable(WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol), + three_ds_level: WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol, title: T.nilable(String), trial_period_days: T.nilable(Integer), unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The unique identifier of the company to create this plan for. - company_id:, # The unique identifier of the product to attach this plan to. product_id:, # Whether this plan accepts local currency payments via adaptive pricing. @@ -205,60 +214,58 @@ module WhopSDK # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, - # Checkout styling overrides for this plan. Pass null to inherit from the company - # default. + # Checkout styling overrides for this plan. checkout_styling: nil, - # The available currencies on the platform + # The unique identifier of the company to create this plan for. Defaults to the + # caller's company. + company_id: nil, + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. currency: nil, # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. custom_fields: nil, # A text description of the plan displayed to customers on the product page. description: nil, - # The number of days until the membership expires and access is revoked. Used for - # expiration-based plans. + # The number of days until the membership expires and access is revoked. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase. For one-time plans, this is the full - # price. For recurring plans, this is an additional charge on top of the renewal - # price. Provided in the plan's currency (e.g., 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). initial_price: nil, # Private notes visible only to the business owner. Not shown to customers. internal_notes: nil, # Whether this plan uses legacy payment method controls. legacy_payment_method_controls: nil, # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # payment and membership events. metadata: nil, - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) + # Override the default tax classification for this specific plan. override_tax_type: nil, # Explicit payment method configuration for the plan. When not provided, the # company's defaults apply. payment_method_configuration: nil, - # The type of plan that can be attached to a product + # The billing type of the plan, such as one_time or renewal. plan_type: nil, - # The methods of how a plan can be released. + # The method used to sell this plan (e.g., buy_now, waitlist). release_method: nil, - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. renewal_price: nil, # The number of installment payments required before the subscription pauses. split_pay_required_payments: nil, # The maximum number of units available for purchase. Ignored when unlimited_stock # is true. stock: nil, - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. three_ds_level: nil, # The display name of the plan shown to customers on the product page. title: nil, # The number of free trial days before the first charge on a recurring plan. trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. - # Defaults to true. unlimited_stock: nil, - # Visibility of a resource + # Whether the plan is visible to customers or hidden from public view. visibility: nil, request_options: {} ) @@ -267,13 +274,12 @@ module WhopSDK sig do override.returns( { - company_id: String, product_id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), - checkout_styling: - T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + checkout_styling: T.nilable(T.anything), + company_id: String, + currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField]), description: T.nilable(String), @@ -282,21 +288,20 @@ module WhopSDK initial_price: T.nilable(Float), internal_notes: T.nilable(String), legacy_payment_method_controls: T.nilable(T::Boolean), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), + metadata: T.nilable(T.anything), + override_tax_type: String, payment_method_configuration: T.nilable(WhopSDK::PlanCreateParams::PaymentMethodConfiguration), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), + plan_type: String, + release_method: String, renewal_price: T.nilable(Float), split_pay_required_payments: T.nilable(Integer), stock: T.nilable(Integer), - three_ds_level: - T.nilable(WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol), + three_ds_level: WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol, title: T.nilable(String), trial_period_days: T.nilable(Integer), unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions } ) @@ -304,142 +309,134 @@ module WhopSDK def to_hash end - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + class CustomField < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::PlanCreateParams::CheckoutStyling, + WhopSDK::PlanCreateParams::CustomField, WhopSDK::Internal::AnyHash ) end - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). + # The ID of the custom field (if being updated). sig { returns(T.nilable(String)) } - attr_accessor :background_color + attr_reader :id - # The different border-radius styles available for checkout pages. - sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } - attr_accessor :border_style + sig { params(id: String).void } + attr_writer :id - # A hex color code for the button color (e.g. #FF5733). - sig { returns(T.nilable(String)) } - attr_accessor :button_color - - # The different font families available for checkout pages. - sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } - attr_accessor :font_family - - # Checkout styling overrides for this plan. Pass null to inherit from the company - # default. + # The type of the custom field. sig do - params( - background_color: T.nilable(String), - border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), - button_color: T.nilable(String), - font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) - ).returns(T.attached_class) - end - def self.new( - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). - background_color: nil, - # The different border-radius styles available for checkout pages. - border_style: nil, - # A hex color code for the button color (e.g. #FF5733). - button_color: nil, - # The different font families available for checkout pages. - font_family: nil - ) + returns( + T.nilable( + WhopSDK::PlanCreateParams::CustomField::FieldType::OrSymbol + ) + ) end + attr_reader :field_type sig do - override.returns( - { - background_color: T.nilable(String), - border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), - button_color: T.nilable(String), - font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) - } - ) - end - def to_hash + params( + field_type: + WhopSDK::PlanCreateParams::CustomField::FieldType::OrSymbol + ).void end - end - - class CustomField < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::PlanCreateParams::CustomField, - WhopSDK::Internal::AnyHash - ) - end - - # The type of the custom field. - sig { returns(Symbol) } - attr_accessor :field_type + attr_writer :field_type # The name of the custom field. - sig { returns(String) } - attr_accessor :name - - # The ID of the custom field (if being updated) sig { returns(T.nilable(String)) } - attr_accessor :id + attr_reader :name + + sig { params(name: String).void } + attr_writer :name # The order of the field. sig { returns(T.nilable(Integer)) } - attr_accessor :order + attr_reader :order + + sig { params(order: Integer).void } + attr_writer :order - # The placeholder value of the field. + # An example response displayed in the input field. sig { returns(T.nilable(String)) } attr_accessor :placeholder # Whether or not the field is required. sig { returns(T.nilable(T::Boolean)) } - attr_accessor :required + attr_reader :required + + sig { params(required: T::Boolean).void } + attr_writer :required sig do params( + id: String, + field_type: + WhopSDK::PlanCreateParams::CustomField::FieldType::OrSymbol, name: String, - id: T.nilable(String), - order: T.nilable(Integer), + order: Integer, placeholder: T.nilable(String), - required: T.nilable(T::Boolean), - field_type: Symbol + required: T::Boolean ).returns(T.attached_class) end def self.new( - # The name of the custom field. - name:, - # The ID of the custom field (if being updated) + # The ID of the custom field (if being updated). id: nil, + # The type of the custom field. + field_type: nil, + # The name of the custom field. + name: nil, # The order of the field. order: nil, - # The placeholder value of the field. + # An example response displayed in the input field. placeholder: nil, # Whether or not the field is required. - required: nil, - # The type of the custom field. - field_type: :text + required: nil ) end sig do override.returns( { - field_type: Symbol, + id: String, + field_type: + WhopSDK::PlanCreateParams::CustomField::FieldType::OrSymbol, name: String, - id: T.nilable(String), - order: T.nilable(Integer), + order: Integer, placeholder: T.nilable(String), - required: T.nilable(T::Boolean) + required: T::Boolean } ) end def to_hash end + + # The type of the custom field. + module FieldType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::PlanCreateParams::CustomField::FieldType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TEXT = + T.let( + :text, + WhopSDK::PlanCreateParams::CustomField::FieldType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::PlanCreateParams::CustomField::FieldType::TaggedSymbol + ] + ) + end + def self.values + end + end end class Image < WhopSDK::Internal::Type::BaseModel @@ -448,19 +445,26 @@ module WhopSDK T.any(WhopSDK::PlanCreateParams::Image, WhopSDK::Internal::AnyHash) end - # The ID of an existing file object. - sig { returns(String) } - attr_accessor :id + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :direct_upload_id + + sig { params(direct_upload_id: String).void } + attr_writer :direct_upload_id # An image displayed on the product page to represent this plan. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The ID of an existing file object. - id: - ) + sig do + params(id: String, direct_upload_id: String).returns(T.attached_class) + end + def self.new(id: nil, direct_upload_id: nil) end - sig { override.returns({ id: String }) } + sig { override.returns({ id: String, direct_upload_id: String }) } def to_hash end end @@ -474,45 +478,36 @@ module WhopSDK ) end - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :disabled - - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :enabled - - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :disabled + + sig { params(disabled: T::Array[String]).void } + attr_writer :disabled + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :enabled + + sig { params(enabled: T::Array[String]).void } + attr_writer :enabled + sig { returns(T.nilable(T::Boolean)) } - attr_accessor :include_platform_defaults + attr_reader :include_platform_defaults + + sig { params(include_platform_defaults: T::Boolean).void } + attr_writer :include_platform_defaults # Explicit payment method configuration for the plan. When not provided, the # company's defaults apply. sig do params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean ).returns(T.attached_class) end def self.new( - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - disabled:, - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - enabled:, - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. + disabled: nil, + enabled: nil, include_platform_defaults: nil ) end @@ -520,9 +515,9 @@ module WhopSDK sig do override.returns( { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean } ) end @@ -530,7 +525,7 @@ module WhopSDK end end - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. module ThreeDSLevel extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/plan_list_params.rbi b/rbi/whop_sdk/models/plan_list_params.rbi index ab4d5bea..b95ef213 100644 --- a/rbi/whop_sdk/models/plan_list_params.rbi +++ b/rbi/whop_sdk/models/plan_list_params.rbi @@ -15,92 +15,128 @@ module WhopSDK sig { returns(String) } attr_accessor :company_id - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns plans after this position. sig { returns(T.nilable(String)) } - attr_accessor :after + attr_reader :after - # Returns the elements in the list that come before the specified cursor. + sig { params(after: String).void } + attr_writer :after + + # A cursor; returns plans before this position. sig { returns(T.nilable(String)) } - attr_accessor :before + attr_reader :before + + sig { params(before: String).void } + attr_writer :before # Only return plans created after this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_after + sig { returns(T.nilable(String)) } + attr_reader :created_after + + sig { params(created_after: String).void } + attr_writer :created_after # Only return plans created before this timestamp. - sig { returns(T.nilable(Time)) } - attr_accessor :created_before + sig { returns(T.nilable(String)) } + attr_reader :created_before - # The direction of the sort. - sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) } - attr_accessor :direction + sig { params(created_before: String).void } + attr_writer :created_before + + # The sort direction for results. Defaults to descending. + sig { returns(T.nilable(WhopSDK::PlanListParams::Direction::OrSymbol)) } + attr_reader :direction + + sig do + params(direction: WhopSDK::PlanListParams::Direction::OrSymbol).void + end + attr_writer :direction - # Returns the first _n_ elements from the list. + # The number of plans to return (default and max 100). sig { returns(T.nilable(Integer)) } - attr_accessor :first + attr_reader :first - # Returns the last _n_ elements from the list. + sig { params(first: Integer).void } + attr_writer :first + + # The number of plans to return from the end of the range. sig { returns(T.nilable(Integer)) } - attr_accessor :last + attr_reader :last + + sig { params(last: Integer).void } + attr_writer :last - # The ways a relation of Plans can be ordered + # The field to sort results by. Defaults to created_at. sig { returns(T.nilable(WhopSDK::PlanListParams::Order::OrSymbol)) } - attr_accessor :order + attr_reader :order + + sig { params(order: WhopSDK::PlanListParams::Order::OrSymbol).void } + attr_writer :order # Filter to only plans matching these billing types. - sig { returns(T.nilable(T::Array[WhopSDK::PlanType::OrSymbol])) } - attr_accessor :plan_types + sig { returns(T.nilable(T::Array[String])) } + attr_reader :plan_types + + sig { params(plan_types: T::Array[String]).void } + attr_writer :plan_types # Filter to only plans belonging to these product identifiers. sig { returns(T.nilable(T::Array[String])) } - attr_accessor :product_ids + attr_reader :product_ids + + sig { params(product_ids: T::Array[String]).void } + attr_writer :product_ids # Filter to only plans matching these release methods. - sig { returns(T.nilable(T::Array[WhopSDK::ReleaseMethod::OrSymbol])) } - attr_accessor :release_methods + sig { returns(T.nilable(T::Array[String])) } + attr_reader :release_methods + + sig { params(release_methods: T::Array[String]).void } + attr_writer :release_methods # Filter to only plans matching these visibility states. - sig { returns(T.nilable(T::Array[WhopSDK::VisibilityFilter::OrSymbol])) } - attr_accessor :visibilities + sig { returns(T.nilable(T::Array[String])) } + attr_reader :visibilities + + sig { params(visibilities: T::Array[String]).void } + attr_writer :visibilities sig do params( company_id: String, - after: T.nilable(String), - before: 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), - order: T.nilable(WhopSDK::PlanListParams::Order::OrSymbol), - plan_types: T.nilable(T::Array[WhopSDK::PlanType::OrSymbol]), - product_ids: T.nilable(T::Array[String]), - release_methods: - T.nilable(T::Array[WhopSDK::ReleaseMethod::OrSymbol]), - visibilities: - T.nilable(T::Array[WhopSDK::VisibilityFilter::OrSymbol]), + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::PlanListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::PlanListParams::Order::OrSymbol, + plan_types: T::Array[String], + product_ids: T::Array[String], + release_methods: T::Array[String], + visibilities: T::Array[String], request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( # The unique identifier of the company to list plans for. company_id:, - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns plans after this position. after: nil, - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns plans before this position. before: nil, # Only return plans created after this timestamp. created_after: nil, # Only return plans created before this timestamp. created_before: nil, - # The direction of the sort. + # The sort direction for results. Defaults to descending. direction: nil, - # Returns the first _n_ elements from the list. + # The number of plans to return (default and max 100). first: nil, - # Returns the last _n_ elements from the list. + # The number of plans to return from the end of the range. last: nil, - # The ways a relation of Plans can be ordered + # The field to sort results by. Defaults to created_at. order: nil, # Filter to only plans matching these billing types. plan_types: nil, @@ -118,20 +154,18 @@ module WhopSDK override.returns( { company_id: String, - after: T.nilable(String), - before: 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), - order: T.nilable(WhopSDK::PlanListParams::Order::OrSymbol), - plan_types: T.nilable(T::Array[WhopSDK::PlanType::OrSymbol]), - product_ids: T.nilable(T::Array[String]), - release_methods: - T.nilable(T::Array[WhopSDK::ReleaseMethod::OrSymbol]), - visibilities: - T.nilable(T::Array[WhopSDK::VisibilityFilter::OrSymbol]), + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::PlanListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::PlanListParams::Order::OrSymbol, + plan_types: T::Array[String], + product_ids: T::Array[String], + release_methods: T::Array[String], + visibilities: T::Array[String], request_options: WhopSDK::RequestOptions } ) @@ -139,7 +173,27 @@ module WhopSDK def to_hash end - # The ways a relation of Plans can be ordered + # The sort direction for results. Defaults to descending. + module Direction + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::PlanListParams::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = T.let(:asc, WhopSDK::PlanListParams::Direction::TaggedSymbol) + DESC = T.let(:desc, WhopSDK::PlanListParams::Direction::TaggedSymbol) + + sig do + override.returns( + T::Array[WhopSDK::PlanListParams::Direction::TaggedSymbol] + ) + end + def self.values + end + end + + # The field to sort results by. Defaults to created_at. module Order extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/models/plan_list_response.rbi b/rbi/whop_sdk/models/plan_list_response.rbi index 0e9fad96..31f2ae03 100644 --- a/rbi/whop_sdk/models/plan_list_response.rbi +++ b/rbi/whop_sdk/models/plan_list_response.rbi @@ -8,304 +8,215 @@ module WhopSDK T.any(WhopSDK::Models::PlanListResponse, WhopSDK::Internal::AnyHash) end - # The unique identifier for the plan. + # The ID of the plan, which will look like plan\_******\******* sig { returns(String) } attr_accessor :id - # Whether the creator has turned on adaptive pricing for this plan. Raw setting — - # does not check processor compatibility or feature flags. + # Whether this plan accepts local currency payments via adaptive pricing sig { returns(T::Boolean) } attr_accessor :adaptive_pricing_enabled - # The number of days between each recurring charge. Null for one-time plans. For - # example, 30 for monthly or 365 for annual billing. - sig { returns(T.nilable(Integer)) } + # The number of days between recurring charges. Null for one-time plans + sig { returns(T.nilable(Float)) } attr_accessor :billing_period - # The company that sells this plan. Null for standalone invoice plans not linked - # to a company. - sig { returns(T.nilable(WhopSDK::Models::PlanListResponse::Company)) } - attr_reader :company + # The company that sells this plan, an object with an id and title. Null for + # standalone invoice plans + sig { returns(T.nilable(T.anything)) } + attr_accessor :company - sig do - params( - company: T.nilable(WhopSDK::Models::PlanListResponse::Company::OrHash) - ).void - end - attr_writer :company - - # The datetime the plan was created. - sig { returns(Time) } + # When the plan was created, as an ISO 8601 timestamp + sig { returns(String) } attr_accessor :created_at - # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary - # amounts on the plan are denominated in this currency. - sig { returns(WhopSDK::Currency::TaggedSymbol) } + # The three-letter ISO currency code all prices on this plan are denominated in + sig { returns(String) } attr_accessor :currency - # A text description of the plan visible to customers. Maximum 1000 characters. - # Null if no description is set. + # A text description of the plan visible to customers sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. - sig { returns(T.nilable(Integer)) } + # The number of days until the membership expires, for expiration-based plans + sig { returns(T.nilable(Float)) } attr_accessor :expiration_days - # The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). - # For one-time plans, this is the full price. For renewal plans, this is charged - # on top of the first renewal_price. + # The initial purchase price in the plan's currency sig { returns(Float) } attr_accessor :initial_price - # Private notes visible only to the company owner and team members. Not shown to - # customers. Null if no notes have been added. + # Private notes visible only to authorized team members sig { returns(T.nilable(String)) } attr_accessor :internal_notes - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. - sig { returns(T.nilable(WhopSDK::Models::PlanListResponse::Invoice)) } - attr_reader :invoice - - sig do - params( - invoice: T.nilable(WhopSDK::Models::PlanListResponse::Invoice::OrHash) - ).void - end - attr_writer :invoice + # The invoice this plan was generated for, an object with an id. Null unless the + # plan was created for an invoice + sig { returns(T.nilable(T.anything)) } + attr_accessor :invoice - # The number of users who currently hold an active membership through this plan. - # Only visible to authorized team members. - sig { returns(T.nilable(Integer)) } + # The number of active memberships on this plan. Only visible to authorized team + # members + sig { returns(T.nilable(Float)) } attr_accessor :member_count - # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + # Custom key-value pairs stored on the plan + sig { returns(T.nilable(T.anything)) } attr_accessor :metadata - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. - sig do - returns( - T.nilable( - WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration - ) - ) - end - attr_reader :payment_method_configuration - - sig do - params( - payment_method_configuration: - T.nilable( - WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration::OrHash - ) - ).void - end - attr_writer :payment_method_configuration + # The explicit payment method configuration for the plan, an object with enabled, + # disabled and include_platform_defaults. Null if the plan uses default settings + sig { returns(T.nilable(T.anything)) } + attr_accessor :payment_method_configuration # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. - sig { returns(WhopSDK::PlanType::TaggedSymbol) } + # 'one_time' for single payments + sig { returns(String) } attr_accessor :plan_type - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. - sig { returns(T.nilable(WhopSDK::Models::PlanListResponse::Product)) } - attr_reader :product + # The product this plan belongs to, an object with an id and title. Null for + # standalone plans + sig { returns(T.nilable(T.anything)) } + attr_accessor :product - sig do - params( - product: T.nilable(WhopSDK::Models::PlanListResponse::Product::OrHash) - ).void - end - attr_writer :product - - # The full URL where customers can purchase this plan directly, bypassing the - # product page. + # The full URL where customers can purchase this plan directly sig { returns(String) } attr_accessor :purchase_url - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. - sig { returns(WhopSDK::ReleaseMethod::TaggedSymbol) } + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' + sig { returns(String) } attr_accessor :release_method - # The recurring price charged every billing_period in the plan's base_currency - # (e.g., 9.99 for $9.99/period). Zero for one-time plans. + # The recurring price charged every billing period in the plan's currency sig { returns(Float) } attr_accessor :renewal_price - # The total number of installment payments required before the subscription - # pauses. Null if split pay is not configured. Must be greater than 1. - sig { returns(T.nilable(Integer)) } + # The number of installment payments required before the subscription pauses + sig { returns(T.nilable(Float)) } attr_accessor :split_pay_required_payments # The number of units available for purchase. Only visible to authorized team - # members. Null if the requester lacks permission. - sig { returns(T.nilable(Integer)) } + # members + sig { returns(T.nilable(Float)) } attr_accessor :stock - # The 3D Secure behavior for a plan. - sig do - returns( - T.nilable( - WhopSDK::Models::PlanListResponse::ThreeDSLevel::TaggedSymbol - ) - ) - end + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default + sig { returns(T.nilable(String)) } attr_accessor :three_ds_level - # The display name of the plan shown to customers on the product page and at - # checkout. Maximum 30 characters. Null if no title has been set. + # The display name of the plan shown to customers sig { returns(T.nilable(String)) } attr_accessor :title - # The number of free trial days before the first charge on a renewal plan. Null if - # no trial is configured or the current user has already used a trial for this - # plan. - sig { returns(T.nilable(Integer)) } + # The number of free trial days before the first charge on a recurring plan + sig { returns(T.nilable(Float)) } attr_accessor :trial_period_days - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. + # Whether the plan has unlimited stock sig { returns(T::Boolean) } attr_accessor :unlimited_stock - # The datetime the plan was last updated. - sig { returns(Time) } + # When the plan was last updated, as an ISO 8601 timestamp + sig { returns(String) } attr_accessor :updated_at - # Controls whether the plan is visible to customers. When set to 'hidden', the - # plan is only accessible via direct link. - sig { returns(WhopSDK::Visibility::TaggedSymbol) } + # Whether the plan is visible to customers or hidden from public view + sig { returns(String) } attr_accessor :visibility - # A plan defines pricing and billing terms for a checkout. Plans can optionally - # belong to a product, where they represent different pricing options such as - # one-time payments, recurring subscriptions, or free trials. sig do params( id: String, adaptive_pricing_enabled: T::Boolean, - billing_period: T.nilable(Integer), - company: - T.nilable(WhopSDK::Models::PlanListResponse::Company::OrHash), - created_at: Time, - currency: WhopSDK::Currency::OrSymbol, + billing_period: T.nilable(Float), + company: T.nilable(T.anything), + created_at: String, + currency: String, description: T.nilable(String), - expiration_days: T.nilable(Integer), + expiration_days: T.nilable(Float), initial_price: Float, internal_notes: T.nilable(String), - invoice: - T.nilable(WhopSDK::Models::PlanListResponse::Invoice::OrHash), - member_count: T.nilable(Integer), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - payment_method_configuration: - T.nilable( - WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration::OrHash - ), - plan_type: WhopSDK::PlanType::OrSymbol, - product: - T.nilable(WhopSDK::Models::PlanListResponse::Product::OrHash), + invoice: T.nilable(T.anything), + member_count: T.nilable(Float), + metadata: T.nilable(T.anything), + payment_method_configuration: T.nilable(T.anything), + plan_type: String, + product: T.nilable(T.anything), purchase_url: String, - release_method: WhopSDK::ReleaseMethod::OrSymbol, + release_method: String, renewal_price: Float, - split_pay_required_payments: T.nilable(Integer), - stock: T.nilable(Integer), - three_ds_level: - T.nilable( - WhopSDK::Models::PlanListResponse::ThreeDSLevel::OrSymbol - ), + split_pay_required_payments: T.nilable(Float), + stock: T.nilable(Float), + three_ds_level: T.nilable(String), title: T.nilable(String), - trial_period_days: T.nilable(Integer), + trial_period_days: T.nilable(Float), unlimited_stock: T::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility::OrSymbol + updated_at: String, + visibility: String ).returns(T.attached_class) end def self.new( - # The unique identifier for the plan. + # The ID of the plan, which will look like plan\_******\******* id:, - # Whether the creator has turned on adaptive pricing for this plan. Raw setting — - # does not check processor compatibility or feature flags. + # Whether this plan accepts local currency payments via adaptive pricing adaptive_pricing_enabled:, - # The number of days between each recurring charge. Null for one-time plans. For - # example, 30 for monthly or 365 for annual billing. + # The number of days between recurring charges. Null for one-time plans billing_period:, - # The company that sells this plan. Null for standalone invoice plans not linked - # to a company. + # The company that sells this plan, an object with an id and title. Null for + # standalone invoice plans company:, - # The datetime the plan was created. + # When the plan was created, as an ISO 8601 timestamp created_at:, - # The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary - # amounts on the plan are denominated in this currency. + # The three-letter ISO currency code all prices on this plan are denominated in currency:, - # A text description of the plan visible to customers. Maximum 1000 characters. - # Null if no description is set. + # A text description of the plan visible to customers description:, - # The number of days until the membership expires (for expiration-based plans). - # For example, 365 for a one-year access pass. + # The number of days until the membership expires, for expiration-based plans expiration_days:, - # The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). - # For one-time plans, this is the full price. For renewal plans, this is charged - # on top of the first renewal_price. + # The initial purchase price in the plan's currency initial_price:, - # Private notes visible only to the company owner and team members. Not shown to - # customers. Null if no notes have been added. + # Private notes visible only to authorized team members internal_notes:, - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. + # The invoice this plan was generated for, an object with an id. Null unless the + # plan was created for an invoice invoice:, - # The number of users who currently hold an active membership through this plan. - # Only visible to authorized team members. + # The number of active memberships on this plan. Only visible to authorized team + # members member_count:, - # Custom key-value pairs stored on the plan. Included in webhook payloads for - # payment and membership events. + # Custom key-value pairs stored on the plan metadata:, - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. + # The explicit payment method configuration for the plan, an object with enabled, + # disabled and include_platform_defaults. Null if the plan uses default settings payment_method_configuration:, # The billing model for this plan: 'renewal' for recurring subscriptions or - # 'one_time' for single payments. + # 'one_time' for single payments plan_type:, - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. + # The product this plan belongs to, an object with an id and title. Null for + # standalone plans product:, - # The full URL where customers can purchase this plan directly, bypassing the - # product page. + # The full URL where customers can purchase this plan directly purchase_url:, - # The method used to sell this plan: 'buy_now' for immediate purchase or - # 'waitlist' for waitlist-based access. + # The method used to sell this plan, e.g. 'buy_now' or 'waitlist' release_method:, - # The recurring price charged every billing_period in the plan's base_currency - # (e.g., 9.99 for $9.99/period). Zero for one-time plans. + # The recurring price charged every billing period in the plan's currency renewal_price:, - # The total number of installment payments required before the subscription - # pauses. Null if split pay is not configured. Must be greater than 1. + # The number of installment payments required before the subscription pauses split_pay_required_payments:, # The number of units available for purchase. Only visible to authorized team - # members. Null if the requester lacks permission. + # members stock:, - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Null means the plan inherits the account + # default three_ds_level:, - # The display name of the plan shown to customers on the product page and at - # checkout. Maximum 30 characters. Null if no title has been set. + # The display name of the plan shown to customers title:, - # The number of free trial days before the first charge on a renewal plan. Null if - # no trial is configured or the current user has already used a trial for this - # plan. + # The number of free trial days before the first charge on a recurring plan trial_period_days:, - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. + # Whether the plan has unlimited stock unlimited_stock:, - # The datetime the plan was last updated. + # When the plan was last updated, as an ISO 8601 timestamp updated_at:, - # Controls whether the plan is visible to customers. When set to 'hidden', the - # plan is only accessible via direct link. + # Whether the plan is visible to customers or hidden from public view visibility: ) end @@ -315,234 +226,36 @@ module WhopSDK { id: String, adaptive_pricing_enabled: T::Boolean, - billing_period: T.nilable(Integer), - company: T.nilable(WhopSDK::Models::PlanListResponse::Company), - created_at: Time, - currency: WhopSDK::Currency::TaggedSymbol, + billing_period: T.nilable(Float), + company: T.nilable(T.anything), + created_at: String, + currency: String, description: T.nilable(String), - expiration_days: T.nilable(Integer), + expiration_days: T.nilable(Float), initial_price: Float, internal_notes: T.nilable(String), - invoice: T.nilable(WhopSDK::Models::PlanListResponse::Invoice), - member_count: T.nilable(Integer), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - payment_method_configuration: - T.nilable( - WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration - ), - plan_type: WhopSDK::PlanType::TaggedSymbol, - product: T.nilable(WhopSDK::Models::PlanListResponse::Product), + invoice: T.nilable(T.anything), + member_count: T.nilable(Float), + metadata: T.nilable(T.anything), + payment_method_configuration: T.nilable(T.anything), + plan_type: String, + product: T.nilable(T.anything), purchase_url: String, - release_method: WhopSDK::ReleaseMethod::TaggedSymbol, + release_method: String, renewal_price: Float, - split_pay_required_payments: T.nilable(Integer), - stock: T.nilable(Integer), - three_ds_level: - T.nilable( - WhopSDK::Models::PlanListResponse::ThreeDSLevel::TaggedSymbol - ), + split_pay_required_payments: T.nilable(Float), + stock: T.nilable(Float), + three_ds_level: T.nilable(String), title: T.nilable(String), - trial_period_days: T.nilable(Integer), + trial_period_days: T.nilable(Float), unlimited_stock: T::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility::TaggedSymbol + updated_at: String, + visibility: String } ) end def to_hash end - - class Company < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PlanListResponse::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 that sells this plan. Null for standalone invoice plans not linked - # to a company. - 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 Invoice < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PlanListResponse::Invoice, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the invoice. - sig { returns(String) } - attr_accessor :id - - # The invoice this plan was generated for. Null if the plan was not created for a - # specific invoice. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the invoice. - id: - ) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration, - WhopSDK::Internal::AnyHash - ) - end - - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) } - attr_accessor :disabled - - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) } - attr_accessor :enabled - - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - sig { returns(T::Boolean) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration specifying which payment methods are - # enabled or disabled for this plan. Null if the plan uses default settings. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - disabled:, - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - enabled:, - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - include_platform_defaults: - ) - end - - sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol], - include_platform_defaults: T::Boolean - } - ) - end - def to_hash - end - end - - class Product < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::Models::PlanListResponse::Product, - WhopSDK::Internal::AnyHash - ) - end - - # The unique identifier for the product. - sig { returns(String) } - attr_accessor :id - - # The display name of the product shown to customers on the product page and in - # search results. - sig { returns(String) } - attr_accessor :title - - # The product that this plan belongs to. Null for standalone one-off purchases not - # linked to a product. - sig { params(id: String, title: String).returns(T.attached_class) } - def self.new( - # The unique identifier for the product. - id:, - # The display name of the product shown to customers on the product page and in - # search results. - title: - ) - end - - sig { override.returns({ id: String, title: String }) } - def to_hash - end - end - - # The 3D Secure behavior for a plan. - module ThreeDSLevel - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, WhopSDK::Models::PlanListResponse::ThreeDSLevel) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MANDATE_CHALLENGE = - T.let( - :mandate_challenge, - WhopSDK::Models::PlanListResponse::ThreeDSLevel::TaggedSymbol - ) - FRICTIONLESS = - T.let( - :frictionless, - WhopSDK::Models::PlanListResponse::ThreeDSLevel::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Models::PlanListResponse::ThreeDSLevel::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/whop_sdk/models/plan_update_params.rbi b/rbi/whop_sdk/models/plan_update_params.rbi index 35f9d63b..12d9c8d7 100644 --- a/rbi/whop_sdk/models/plan_update_params.rbi +++ b/rbi/whop_sdk/models/plan_update_params.rbi @@ -23,24 +23,19 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :billing_period - # Checkout styling overrides for this plan. Pass null to remove all overrides and - # inherit from the company default. - sig { returns(T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling)) } - attr_reader :checkout_styling + # Checkout styling overrides for this plan. + sig { returns(T.nilable(T.anything)) } + attr_accessor :checkout_styling - sig do - params( - checkout_styling: - T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling::OrHash) - ).void - end - attr_writer :checkout_styling + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. + sig { returns(T.nilable(String)) } + attr_reader :currency - # The available currencies on the platform - sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } - attr_accessor :currency + sig { params(currency: String).void } + attr_writer :currency # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. sig do returns(T.nilable(T::Array[WhopSDK::PlanUpdateParams::CustomField])) end @@ -50,8 +45,7 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :description - # The number of days until the membership expires and access is revoked. For - # example, 365 for one-year access. + # The number of days until the membership expires and access is revoked. sig { returns(T.nilable(Integer)) } attr_accessor :expiration_days @@ -64,8 +58,8 @@ module WhopSDK end attr_writer :image - # The amount charged on the first purchase. Provided in the plan's currency (e.g., - # 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). sig { returns(T.nilable(Float)) } attr_accessor :initial_price @@ -78,22 +72,23 @@ module WhopSDK attr_accessor :legacy_payment_method_controls # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + # payment and membership events. + sig { returns(T.nilable(T.anything)) } attr_accessor :metadata # Whether to offer a retention discount when a customer attempts to cancel. sig { returns(T.nilable(T::Boolean)) } attr_accessor :offer_cancel_discount - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) - sig { returns(T.nilable(WhopSDK::TaxType::OrSymbol)) } - attr_accessor :override_tax_type + # Override the default tax classification for this specific plan. + sig { returns(T.nilable(String)) } + attr_reader :override_tax_type + + sig { params(override_tax_type: String).void } + attr_writer :override_tax_type - # Explicit payment method configuration for the plan. Sending null removes any - # custom configuration. + # Explicit payment method configuration for the plan. When not provided, the + # company's defaults apply. sig do returns( T.nilable(WhopSDK::PlanUpdateParams::PaymentMethodConfiguration) @@ -111,8 +106,8 @@ module WhopSDK end attr_writer :payment_method_configuration - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. sig { returns(T.nilable(Float)) } attr_accessor :renewal_price @@ -122,20 +117,25 @@ module WhopSDK attr_accessor :stock # A comparison price displayed with a strikethrough for the initial price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). sig { returns(T.nilable(Float)) } attr_accessor :strike_through_initial_price # A comparison price displayed with a strikethrough for the renewal price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). sig { returns(T.nilable(Float)) } attr_accessor :strike_through_renewal_price - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. sig do returns(T.nilable(WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol)) end - attr_accessor :three_ds_level + attr_reader :three_ds_level + + sig do + params( + three_ds_level: WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol + ).void + end + attr_writer :three_ds_level # The display name of the plan shown to customers on the product page. sig { returns(T.nilable(String)) } @@ -149,18 +149,20 @@ module WhopSDK sig { returns(T.nilable(T::Boolean)) } attr_accessor :unlimited_stock - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility + # Whether the plan is visible to customers or hidden from public view. + sig { returns(T.nilable(String)) } + attr_reader :visibility + + sig { params(visibility: String).void } + attr_writer :visibility sig do params( id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), - checkout_styling: - T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling::OrHash), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + checkout_styling: T.nilable(T.anything), + currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanUpdateParams::CustomField::OrHash]), description: T.nilable(String), @@ -169,9 +171,9 @@ module WhopSDK initial_price: T.nilable(Float), internal_notes: T.nilable(String), legacy_payment_method_controls: T.nilable(T::Boolean), - metadata: T.nilable(T::Hash[Symbol, T.anything]), + metadata: T.nilable(T.anything), offer_cancel_discount: T.nilable(T::Boolean), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), + override_tax_type: String, payment_method_configuration: T.nilable( WhopSDK::PlanUpdateParams::PaymentMethodConfiguration::OrHash @@ -180,12 +182,11 @@ module WhopSDK stock: T.nilable(Integer), strike_through_initial_price: T.nilable(Float), strike_through_renewal_price: T.nilable(Float), - three_ds_level: - T.nilable(WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol), + three_ds_level: WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol, title: T.nilable(String), trial_period_days: T.nilable(Integer), unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) end @@ -196,52 +197,47 @@ module WhopSDK # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, - # Checkout styling overrides for this plan. Pass null to remove all overrides and - # inherit from the company default. + # Checkout styling overrides for this plan. checkout_styling: nil, - # The available currencies on the platform + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. currency: nil, # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. custom_fields: nil, # A text description of the plan displayed to customers on the product page. description: nil, - # The number of days until the membership expires and access is revoked. For - # example, 365 for one-year access. + # The number of days until the membership expires and access is revoked. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase. Provided in the plan's currency (e.g., - # 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). initial_price: nil, # Private notes visible only to the business owner. Not shown to customers. internal_notes: nil, # Whether this plan uses legacy payment method controls. legacy_payment_method_controls: nil, # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # payment and membership events. metadata: nil, # Whether to offer a retention discount when a customer attempts to cancel. offer_cancel_discount: nil, - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) + # Override the default tax classification for this specific plan. override_tax_type: nil, - # Explicit payment method configuration for the plan. Sending null removes any - # custom configuration. + # Explicit payment method configuration for the plan. When not provided, the + # company's defaults apply. payment_method_configuration: nil, - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. renewal_price: nil, # The maximum number of units available for purchase. Ignored when unlimited_stock # is true. stock: nil, # A comparison price displayed with a strikethrough for the initial price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). strike_through_initial_price: nil, # A comparison price displayed with a strikethrough for the renewal price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). strike_through_renewal_price: nil, - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. three_ds_level: nil, # The display name of the plan shown to customers on the product page. title: nil, @@ -249,7 +245,7 @@ module WhopSDK trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. unlimited_stock: nil, - # Visibility of a resource + # Whether the plan is visible to customers or hidden from public view. visibility: nil, request_options: {} ) @@ -261,9 +257,8 @@ module WhopSDK id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), - checkout_styling: - T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + checkout_styling: T.nilable(T.anything), + currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanUpdateParams::CustomField]), description: T.nilable(String), @@ -272,21 +267,20 @@ module WhopSDK initial_price: T.nilable(Float), internal_notes: T.nilable(String), legacy_payment_method_controls: T.nilable(T::Boolean), - metadata: T.nilable(T::Hash[Symbol, T.anything]), + metadata: T.nilable(T.anything), offer_cancel_discount: T.nilable(T::Boolean), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), + override_tax_type: String, payment_method_configuration: T.nilable(WhopSDK::PlanUpdateParams::PaymentMethodConfiguration), renewal_price: T.nilable(Float), stock: T.nilable(Integer), strike_through_initial_price: T.nilable(Float), strike_through_renewal_price: T.nilable(Float), - three_ds_level: - T.nilable(WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol), + three_ds_level: WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol, title: T.nilable(String), trial_period_days: T.nilable(Integer), unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions } ) @@ -294,142 +288,134 @@ module WhopSDK def to_hash end - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + class CustomField < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::PlanUpdateParams::CheckoutStyling, + WhopSDK::PlanUpdateParams::CustomField, WhopSDK::Internal::AnyHash ) end - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). + # The ID of the custom field (if being updated). sig { returns(T.nilable(String)) } - attr_accessor :background_color - - # The different border-radius styles available for checkout pages. - sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } - attr_accessor :border_style + attr_reader :id - # A hex color code for the button color (e.g. #FF5733). - sig { returns(T.nilable(String)) } - attr_accessor :button_color + sig { params(id: String).void } + attr_writer :id - # The different font families available for checkout pages. - sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } - attr_accessor :font_family - - # Checkout styling overrides for this plan. Pass null to remove all overrides and - # inherit from the company default. + # The type of the custom field. sig do - params( - background_color: T.nilable(String), - border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), - button_color: T.nilable(String), - font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) - ).returns(T.attached_class) - end - def self.new( - # A hex color code for the checkout page background, applied to the order summary - # panel (e.g. #F4F4F5). - background_color: nil, - # The different border-radius styles available for checkout pages. - border_style: nil, - # A hex color code for the button color (e.g. #FF5733). - button_color: nil, - # The different font families available for checkout pages. - font_family: nil - ) + returns( + T.nilable( + WhopSDK::PlanUpdateParams::CustomField::FieldType::OrSymbol + ) + ) end + attr_reader :field_type sig do - override.returns( - { - background_color: T.nilable(String), - border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), - button_color: T.nilable(String), - font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) - } - ) - end - def to_hash + params( + field_type: + WhopSDK::PlanUpdateParams::CustomField::FieldType::OrSymbol + ).void end - end - - class CustomField < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::PlanUpdateParams::CustomField, - WhopSDK::Internal::AnyHash - ) - end - - # The type of the custom field. - sig { returns(Symbol) } - attr_accessor :field_type + attr_writer :field_type # The name of the custom field. - sig { returns(String) } - attr_accessor :name - - # The ID of the custom field (if being updated) sig { returns(T.nilable(String)) } - attr_accessor :id + attr_reader :name + + sig { params(name: String).void } + attr_writer :name # The order of the field. sig { returns(T.nilable(Integer)) } - attr_accessor :order + attr_reader :order - # The placeholder value of the field. + sig { params(order: Integer).void } + attr_writer :order + + # An example response displayed in the input field. sig { returns(T.nilable(String)) } attr_accessor :placeholder # Whether or not the field is required. sig { returns(T.nilable(T::Boolean)) } - attr_accessor :required + attr_reader :required + + sig { params(required: T::Boolean).void } + attr_writer :required sig do params( + id: String, + field_type: + WhopSDK::PlanUpdateParams::CustomField::FieldType::OrSymbol, name: String, - id: T.nilable(String), - order: T.nilable(Integer), + order: Integer, placeholder: T.nilable(String), - required: T.nilable(T::Boolean), - field_type: Symbol + required: T::Boolean ).returns(T.attached_class) end def self.new( - # The name of the custom field. - name:, - # The ID of the custom field (if being updated) + # The ID of the custom field (if being updated). id: nil, + # The type of the custom field. + field_type: nil, + # The name of the custom field. + name: nil, # The order of the field. order: nil, - # The placeholder value of the field. + # An example response displayed in the input field. placeholder: nil, # Whether or not the field is required. - required: nil, - # The type of the custom field. - field_type: :text + required: nil ) end sig do override.returns( { - field_type: Symbol, + id: String, + field_type: + WhopSDK::PlanUpdateParams::CustomField::FieldType::OrSymbol, name: String, - id: T.nilable(String), - order: T.nilable(Integer), + order: Integer, placeholder: T.nilable(String), - required: T.nilable(T::Boolean) + required: T::Boolean } ) end def to_hash end + + # The type of the custom field. + module FieldType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, WhopSDK::PlanUpdateParams::CustomField::FieldType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TEXT = + T.let( + :text, + WhopSDK::PlanUpdateParams::CustomField::FieldType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::PlanUpdateParams::CustomField::FieldType::TaggedSymbol + ] + ) + end + def self.values + end + end end class Image < WhopSDK::Internal::Type::BaseModel @@ -438,19 +424,26 @@ module WhopSDK T.any(WhopSDK::PlanUpdateParams::Image, WhopSDK::Internal::AnyHash) end - # The ID of an existing file object. - sig { returns(String) } - attr_accessor :id + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :direct_upload_id + + sig { params(direct_upload_id: String).void } + attr_writer :direct_upload_id # An image displayed on the product page to represent this plan. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The ID of an existing file object. - id: - ) + sig do + params(id: String, direct_upload_id: String).returns(T.attached_class) + end + def self.new(id: nil, direct_upload_id: nil) end - sig { override.returns({ id: String }) } + sig { override.returns({ id: String, direct_upload_id: String }) } def to_hash end end @@ -464,45 +457,36 @@ module WhopSDK ) end - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :disabled - - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :enabled - - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :disabled + + sig { params(disabled: T::Array[String]).void } + attr_writer :disabled + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :enabled + + sig { params(enabled: T::Array[String]).void } + attr_writer :enabled + sig { returns(T.nilable(T::Boolean)) } - attr_accessor :include_platform_defaults + attr_reader :include_platform_defaults + + sig { params(include_platform_defaults: T::Boolean).void } + attr_writer :include_platform_defaults - # Explicit payment method configuration for the plan. Sending null removes any - # custom configuration. + # Explicit payment method configuration for the plan. When not provided, the + # company's defaults apply. sig do params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean ).returns(T.attached_class) end def self.new( - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - disabled:, - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - enabled:, - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. + disabled: nil, + enabled: nil, include_platform_defaults: nil ) end @@ -510,9 +494,9 @@ module WhopSDK sig do override.returns( { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T.nilable(T::Boolean) + disabled: T::Array[String], + enabled: T::Array[String], + include_platform_defaults: T::Boolean } ) end @@ -520,7 +504,7 @@ module WhopSDK end end - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. module ThreeDSLevel extend WhopSDK::Internal::Type::Enum diff --git a/rbi/whop_sdk/resources/plans.rbi b/rbi/whop_sdk/resources/plans.rbi index aae08508..66eadf1c 100644 --- a/rbi/whop_sdk/resources/plans.rbi +++ b/rbi/whop_sdk/resources/plans.rbi @@ -2,25 +2,17 @@ module WhopSDK module Resources - # Plans class Plans # Create a new pricing plan for a product. The plan defines the billing interval, # price, and availability for customers. - # - # Required permissions: - # - # - `plan:create` - # - `access_pass:basic:read` - # - `plan:basic:read` sig do params( - company_id: String, product_id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), - checkout_styling: - T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling::OrHash), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + checkout_styling: T.nilable(T.anything), + company_id: String, + currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField::OrHash]), description: T.nilable(String), @@ -29,29 +21,26 @@ module WhopSDK initial_price: T.nilable(Float), internal_notes: T.nilable(String), legacy_payment_method_controls: T.nilable(T::Boolean), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), + metadata: T.nilable(T.anything), + override_tax_type: String, payment_method_configuration: T.nilable( WhopSDK::PlanCreateParams::PaymentMethodConfiguration::OrHash ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), + plan_type: String, + release_method: String, renewal_price: T.nilable(Float), split_pay_required_payments: T.nilable(Integer), stock: T.nilable(Integer), - three_ds_level: - T.nilable(WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol), + three_ds_level: WhopSDK::PlanCreateParams::ThreeDSLevel::OrSymbol, title: T.nilable(String), trial_period_days: T.nilable(Integer), unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Plan) end def create( - # The unique identifier of the company to create this plan for. - company_id:, # The unique identifier of the product to attach this plan to. product_id:, # Whether this plan accepts local currency payments via adaptive pricing. @@ -59,70 +48,64 @@ module WhopSDK # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, - # Checkout styling overrides for this plan. Pass null to inherit from the company - # default. + # Checkout styling overrides for this plan. checkout_styling: nil, - # The available currencies on the platform + # The unique identifier of the company to create this plan for. Defaults to the + # caller's company. + company_id: nil, + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. currency: nil, # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. custom_fields: nil, # A text description of the plan displayed to customers on the product page. description: nil, - # The number of days until the membership expires and access is revoked. Used for - # expiration-based plans. + # The number of days until the membership expires and access is revoked. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase. For one-time plans, this is the full - # price. For recurring plans, this is an additional charge on top of the renewal - # price. Provided in the plan's currency (e.g., 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). initial_price: nil, # Private notes visible only to the business owner. Not shown to customers. internal_notes: nil, # Whether this plan uses legacy payment method controls. legacy_payment_method_controls: nil, # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # payment and membership events. metadata: nil, - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) + # Override the default tax classification for this specific plan. override_tax_type: nil, # Explicit payment method configuration for the plan. When not provided, the # company's defaults apply. payment_method_configuration: nil, - # The type of plan that can be attached to a product + # The billing type of the plan, such as one_time or renewal. plan_type: nil, - # The methods of how a plan can be released. + # The method used to sell this plan (e.g., buy_now, waitlist). release_method: nil, - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. renewal_price: nil, # The number of installment payments required before the subscription pauses. split_pay_required_payments: nil, # The maximum number of units available for purchase. Ignored when unlimited_stock # is true. stock: nil, - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. three_ds_level: nil, # The display name of the plan shown to customers on the product page. title: nil, # The number of free trial days before the first charge on a recurring plan. trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. - # Defaults to true. unlimited_stock: nil, - # Visibility of a resource + # Whether the plan is visible to customers or hidden from public view. visibility: nil, request_options: {} ) end # Retrieves the details of an existing plan. - # - # Required permissions: - # - # - `plan:basic:read` sig do params( id: String, @@ -130,7 +113,7 @@ module WhopSDK ).returns(WhopSDK::Plan) end def retrieve( - # The unique identifier of the plan. + # The unique identifier of the plan, which will look like plan\_******\*******. id, request_options: {} ) @@ -138,20 +121,13 @@ module WhopSDK # Update a plan's pricing, billing interval, visibility, stock, and other # settings. - # - # Required permissions: - # - # - `plan:update` - # - `access_pass:basic:read` - # - `plan:basic:read` sig do params( id: String, adaptive_pricing_enabled: T.nilable(T::Boolean), billing_period: T.nilable(Integer), - checkout_styling: - T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling::OrHash), - currency: T.nilable(WhopSDK::Currency::OrSymbol), + checkout_styling: T.nilable(T.anything), + currency: String, custom_fields: T.nilable(T::Array[WhopSDK::PlanUpdateParams::CustomField::OrHash]), description: T.nilable(String), @@ -160,9 +136,9 @@ module WhopSDK initial_price: T.nilable(Float), internal_notes: T.nilable(String), legacy_payment_method_controls: T.nilable(T::Boolean), - metadata: T.nilable(T::Hash[Symbol, T.anything]), + metadata: T.nilable(T.anything), offer_cancel_discount: T.nilable(T::Boolean), - override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol), + override_tax_type: String, payment_method_configuration: T.nilable( WhopSDK::PlanUpdateParams::PaymentMethodConfiguration::OrHash @@ -171,69 +147,63 @@ module WhopSDK stock: T.nilable(Integer), strike_through_initial_price: T.nilable(Float), strike_through_renewal_price: T.nilable(Float), - three_ds_level: - T.nilable(WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol), + three_ds_level: WhopSDK::PlanUpdateParams::ThreeDSLevel::OrSymbol, title: T.nilable(String), trial_period_days: T.nilable(Integer), unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol), + visibility: String, request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Plan) end def update( - # The unique identifier of the plan to update. + # The unique identifier of the plan, which will look like plan\_******\*******. id, # Whether this plan accepts local currency payments via adaptive pricing. adaptive_pricing_enabled: nil, # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, - # Checkout styling overrides for this plan. Pass null to remove all overrides and - # inherit from the company default. + # Checkout styling overrides for this plan. checkout_styling: nil, - # The available currencies on the platform + # The three-letter ISO currency code for the plan's pricing. Defaults to USD. currency: nil, # An array of custom field definitions to collect from customers at checkout. + # Omitting this field clears existing custom fields. custom_fields: nil, # A text description of the plan displayed to customers on the product page. description: nil, - # The number of days until the membership expires and access is revoked. For - # example, 365 for one-year access. + # The number of days until the membership expires and access is revoked. expiration_days: nil, # An image displayed on the product page to represent this plan. image: nil, - # The amount charged on the first purchase. Provided in the plan's currency (e.g., - # 10.43 for $10.43). + # The amount charged on the first purchase, in the plan's currency (e.g., 10.43 + # for $10.43). initial_price: nil, # Private notes visible only to the business owner. Not shown to customers. internal_notes: nil, # Whether this plan uses legacy payment method controls. legacy_payment_method_controls: nil, # Custom key-value pairs to store on the plan. Included in webhook payloads for - # payment and membership events. Max 50 keys, 500 chars per key, 5000 chars per - # value. + # payment and membership events. metadata: nil, # Whether to offer a retention discount when a customer attempts to cancel. offer_cancel_discount: nil, - # Whether or not the tax is included in a plan's price (or if it hasn't been set - # up) + # Override the default tax classification for this specific plan. override_tax_type: nil, - # Explicit payment method configuration for the plan. Sending null removes any - # custom configuration. + # Explicit payment method configuration for the plan. When not provided, the + # company's defaults apply. payment_method_configuration: nil, - # The amount charged each billing period for recurring plans. Provided in the - # plan's currency (e.g., 10.43 for $10.43). + # The amount charged each billing period for recurring plans, in the plan's + # currency. renewal_price: nil, # The maximum number of units available for purchase. Ignored when unlimited_stock # is true. stock: nil, # A comparison price displayed with a strikethrough for the initial price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). strike_through_initial_price: nil, # A comparison price displayed with a strikethrough for the renewal price. - # Provided in the plan's currency (e.g., 19.99 for $19.99). strike_through_renewal_price: nil, - # The 3D Secure behavior for a plan. + # The 3D Secure behavior for this plan. Send null to inherit the account default. three_ds_level: nil, # The display name of the plan shown to customers on the product page. title: nil, @@ -241,7 +211,7 @@ module WhopSDK trial_period_days: nil, # Whether the plan has unlimited stock. When true, the stock field is ignored. unlimited_stock: nil, - # Visibility of a resource + # Whether the plan is visible to customers or hidden from public view. visibility: nil, request_options: {} ) @@ -249,27 +219,21 @@ module WhopSDK # Returns a paginated list of plans belonging to a company, with optional # filtering by visibility, type, release method, and product. - # - # Required permissions: - # - # - `plan:basic:read` sig do params( company_id: String, - after: T.nilable(String), - before: T.nilable(String), - created_after: T.nilable(Time), - created_before: T.nilable(Time), - direction: T.nilable(WhopSDK::Direction::OrSymbol), - first: T.nilable(Integer), - last: T.nilable(Integer), - order: T.nilable(WhopSDK::PlanListParams::Order::OrSymbol), - plan_types: T.nilable(T::Array[WhopSDK::PlanType::OrSymbol]), - product_ids: T.nilable(T::Array[String]), - release_methods: - T.nilable(T::Array[WhopSDK::ReleaseMethod::OrSymbol]), - visibilities: - T.nilable(T::Array[WhopSDK::VisibilityFilter::OrSymbol]), + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::PlanListParams::Direction::OrSymbol, + first: Integer, + last: Integer, + order: WhopSDK::PlanListParams::Order::OrSymbol, + plan_types: T::Array[String], + product_ids: T::Array[String], + release_methods: T::Array[String], + visibilities: T::Array[String], request_options: WhopSDK::RequestOptions::OrHash ).returns( WhopSDK::Internal::CursorPage[WhopSDK::Models::PlanListResponse] @@ -278,21 +242,21 @@ module WhopSDK def list( # The unique identifier of the company to list plans for. company_id:, - # Returns the elements in the list that come after the specified cursor. + # A cursor; returns plans after this position. after: nil, - # Returns the elements in the list that come before the specified cursor. + # A cursor; returns plans before this position. before: nil, # Only return plans created after this timestamp. created_after: nil, # Only return plans created before this timestamp. created_before: nil, - # The direction of the sort. + # The sort direction for results. Defaults to descending. direction: nil, - # Returns the first _n_ elements from the list. + # The number of plans to return (default and max 100). first: nil, - # Returns the last _n_ elements from the list. + # The number of plans to return from the end of the range. last: nil, - # The ways a relation of Plans can be ordered + # The field to sort results by. Defaults to created_at. order: nil, # Filter to only plans matching these billing types. plan_types: nil, @@ -308,10 +272,6 @@ module WhopSDK # Permanently delete a plan from a product. Existing memberships on this plan will # not be affected. - # - # Required permissions: - # - # - `plan:delete` sig do params( id: String, @@ -319,7 +279,7 @@ module WhopSDK ).returns(T::Boolean) end def delete( - # The unique identifier of the plan to delete. + # The unique identifier of the plan, which will look like plan\_******\*******. id, request_options: {} ) diff --git a/sig/whop_sdk/models/plan.rbs b/sig/whop_sdk/models/plan.rbs index 6bcb92b6..ef3e961f 100644 --- a/sig/whop_sdk/models/plan.rbs +++ b/sig/whop_sdk/models/plan.rbs @@ -4,34 +4,34 @@ module WhopSDK { id: String, adaptive_pricing_enabled: bool, - billing_period: Integer?, + billing_period: Float?, collect_tax: bool, - company: WhopSDK::Plan::Company?, - created_at: Time, - currency: WhopSDK::Models::currency, - custom_fields: ::Array[WhopSDK::Plan::CustomField], + company: top?, + created_at: String, + currency: WhopSDK::Models::Plan::currency, + custom_fields: ::Array[top], description: String?, - expiration_days: Integer?, + expiration_days: Float?, initial_price: Float, internal_notes: String?, - invoice: WhopSDK::Plan::Invoice?, - member_count: Integer?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type, - product: WhopSDK::Plan::Product?, + invoice: top?, + member_count: Float?, + metadata: top?, + payment_method_configuration: top?, + plan_type: WhopSDK::Models::Plan::plan_type, + product: top?, purchase_url: String, - release_method: WhopSDK::Models::release_method, + release_method: WhopSDK::Models::Plan::release_method, renewal_price: Float, - split_pay_required_payments: Integer?, - stock: Integer?, - tax_type: WhopSDK::Models::tax_type, + split_pay_required_payments: Float?, + stock: Float?, + tax_type: String, three_ds_level: WhopSDK::Models::Plan::three_ds_level?, title: String?, - trial_period_days: Integer?, + trial_period_days: Float?, unlimited_stock: bool, - updated_at: Time, - visibility: WhopSDK::Models::visibility + updated_at: String, + visibility: WhopSDK::Models::Plan::visibility } class Plan < WhopSDK::Internal::Type::BaseModel @@ -39,229 +39,337 @@ module WhopSDK attr_accessor adaptive_pricing_enabled: bool - attr_accessor billing_period: Integer? + attr_accessor billing_period: Float? attr_accessor collect_tax: bool - attr_accessor company: WhopSDK::Plan::Company? + attr_accessor company: top? - attr_accessor created_at: Time + attr_accessor created_at: String - attr_accessor currency: WhopSDK::Models::currency + attr_accessor currency: WhopSDK::Models::Plan::currency - attr_accessor custom_fields: ::Array[WhopSDK::Plan::CustomField] + attr_accessor custom_fields: ::Array[top] attr_accessor description: String? - attr_accessor expiration_days: Integer? + attr_accessor expiration_days: Float? attr_accessor initial_price: Float attr_accessor internal_notes: String? - attr_accessor invoice: WhopSDK::Plan::Invoice? + attr_accessor invoice: top? - attr_accessor member_count: Integer? + attr_accessor member_count: Float? - attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor metadata: top? - attr_accessor payment_method_configuration: WhopSDK::Plan::PaymentMethodConfiguration? + attr_accessor payment_method_configuration: top? - attr_accessor plan_type: WhopSDK::Models::plan_type + attr_accessor plan_type: WhopSDK::Models::Plan::plan_type - attr_accessor product: WhopSDK::Plan::Product? + attr_accessor product: top? attr_accessor purchase_url: String - attr_accessor release_method: WhopSDK::Models::release_method + attr_accessor release_method: WhopSDK::Models::Plan::release_method attr_accessor renewal_price: Float - attr_accessor split_pay_required_payments: Integer? + attr_accessor split_pay_required_payments: Float? - attr_accessor stock: Integer? + attr_accessor stock: Float? - attr_accessor tax_type: WhopSDK::Models::tax_type + attr_accessor tax_type: String attr_accessor three_ds_level: WhopSDK::Models::Plan::three_ds_level? attr_accessor title: String? - attr_accessor trial_period_days: Integer? + attr_accessor trial_period_days: Float? attr_accessor unlimited_stock: bool - attr_accessor updated_at: Time + attr_accessor updated_at: String - attr_accessor visibility: WhopSDK::Models::visibility + attr_accessor visibility: WhopSDK::Models::Plan::visibility def initialize: ( id: String, adaptive_pricing_enabled: bool, - billing_period: Integer?, + billing_period: Float?, collect_tax: bool, - company: WhopSDK::Plan::Company?, - created_at: Time, - currency: WhopSDK::Models::currency, - custom_fields: ::Array[WhopSDK::Plan::CustomField], + company: top?, + created_at: String, + currency: WhopSDK::Models::Plan::currency, + custom_fields: ::Array[top], description: String?, - expiration_days: Integer?, + expiration_days: Float?, initial_price: Float, internal_notes: String?, - invoice: WhopSDK::Plan::Invoice?, - member_count: Integer?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type, - product: WhopSDK::Plan::Product?, + invoice: top?, + member_count: Float?, + metadata: top?, + payment_method_configuration: top?, + plan_type: WhopSDK::Models::Plan::plan_type, + product: top?, purchase_url: String, - release_method: WhopSDK::Models::release_method, + release_method: WhopSDK::Models::Plan::release_method, renewal_price: Float, - split_pay_required_payments: Integer?, - stock: Integer?, - tax_type: WhopSDK::Models::tax_type, + split_pay_required_payments: Float?, + stock: Float?, + tax_type: String, three_ds_level: WhopSDK::Models::Plan::three_ds_level?, title: String?, - trial_period_days: Integer?, + trial_period_days: Float?, unlimited_stock: bool, - updated_at: Time, - visibility: WhopSDK::Models::visibility + updated_at: String, + visibility: WhopSDK::Models::Plan::visibility ) -> void def to_hash: -> { id: String, adaptive_pricing_enabled: bool, - billing_period: Integer?, + billing_period: Float?, collect_tax: bool, - company: WhopSDK::Plan::Company?, - created_at: Time, - currency: WhopSDK::Models::currency, - custom_fields: ::Array[WhopSDK::Plan::CustomField], + company: top?, + created_at: String, + currency: WhopSDK::Models::Plan::currency, + custom_fields: ::Array[top], description: String?, - expiration_days: Integer?, + expiration_days: Float?, initial_price: Float, internal_notes: String?, - invoice: WhopSDK::Plan::Invoice?, - member_count: Integer?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type, - product: WhopSDK::Plan::Product?, + invoice: top?, + member_count: Float?, + metadata: top?, + payment_method_configuration: top?, + plan_type: WhopSDK::Models::Plan::plan_type, + product: top?, purchase_url: String, - release_method: WhopSDK::Models::release_method, + release_method: WhopSDK::Models::Plan::release_method, renewal_price: Float, - split_pay_required_payments: Integer?, - stock: Integer?, - tax_type: WhopSDK::Models::tax_type, + split_pay_required_payments: Float?, + stock: Float?, + tax_type: String, three_ds_level: WhopSDK::Models::Plan::three_ds_level?, title: String?, - trial_period_days: Integer?, + trial_period_days: Float?, unlimited_stock: bool, - updated_at: Time, - visibility: WhopSDK::Models::visibility + updated_at: String, + visibility: WhopSDK::Models::Plan::visibility } - 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 custom_field = - { - id: String, - field_type: :text, - name: String, - order: Integer?, - placeholder: String?, - required: bool - } - - class CustomField < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor field_type: :text - - attr_accessor name: String - - attr_accessor order: Integer? - - attr_accessor placeholder: String? - - attr_accessor required: bool - - def initialize: ( - id: String, - name: String, - order: Integer?, - placeholder: String?, - required: bool, - ?field_type: :text - ) -> void - - def to_hash: -> { - id: String, - field_type: :text, - name: String, - order: Integer?, - placeholder: String?, - required: bool - } - end - - type invoice = { id: String } - - class Invoice < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void + type currency = + :usd + | :sgd + | :inr + | :aud + | :brl + | :cad + | :dkk + | :eur + | :nok + | :gbp + | :sek + | :chf + | :hkd + | :huf + | :jpy + | :mxn + | :myr + | :pln + | :czk + | :nzd + | :aed + | :eth + | :ape + | :cop + | :ron + | :thb + | :bgn + | :idr + | :dop + | :php + | :try + | :krw + | :twd + | :vnd + | :pkr + | :clp + | :uyu + | :ars + | :zar + | :dzd + | :tnd + | :mad + | :kes + | :kwd + | :jod + | :all + | :xcd + | :amd + | :bsd + | :bhd + | :bob + | :bam + | :khr + | :crc + | :xof + | :egp + | :etb + | :gmd + | :ghs + | :gtq + | :gyd + | :ils + | :jmd + | :mop + | :mga + | :mur + | :mdl + | :mnt + | :nad + | :ngn + | :mkd + | :omr + | :pyg + | :pen + | :qar + | :rwf + | :sar + | :rsd + | :lkr + | :tzs + | :ttd + | :uzs + | :rub + | :btc + | :cny + | :usdt + | :kzt + | :awg + | :whop_usd + | :xau + + module Currency + extend WhopSDK::Internal::Type::Enum - def to_hash: -> { id: String } + USD: :usd + SGD: :sgd + INR: :inr + AUD: :aud + BRL: :brl + CAD: :cad + DKK: :dkk + EUR: :eur + NOK: :nok + GBP: :gbp + SEK: :sek + CHF: :chf + HKD: :hkd + HUF: :huf + JPY: :jpy + MXN: :mxn + MYR: :myr + PLN: :pln + CZK: :czk + NZD: :nzd + AED: :aed + ETH: :eth + APE: :ape + COP: :cop + RON: :ron + THB: :thb + BGN: :bgn + IDR: :idr + DOP: :dop + PHP: :php + TRY: :try + KRW: :krw + TWD: :twd + VND: :vnd + PKR: :pkr + CLP: :clp + UYU: :uyu + ARS: :ars + ZAR: :zar + DZD: :dzd + TND: :tnd + MAD: :mad + KES: :kes + KWD: :kwd + JOD: :jod + ALL: :all + XCD: :xcd + AMD: :amd + BSD: :bsd + BHD: :bhd + BOB: :bob + BAM: :bam + KHR: :khr + CRC: :crc + XOF: :xof + EGP: :egp + ETB: :etb + GMD: :gmd + GHS: :ghs + GTQ: :gtq + GYD: :gyd + ILS: :ils + JMD: :jmd + MOP: :mop + MGA: :mga + MUR: :mur + MDL: :mdl + MNT: :mnt + NAD: :nad + NGN: :ngn + MKD: :mkd + OMR: :omr + PYG: :pyg + PEN: :pen + QAR: :qar + RWF: :rwf + SAR: :sar + RSD: :rsd + LKR: :lkr + TZS: :tzs + TTD: :ttd + UZS: :uzs + RUB: :rub + BTC: :btc + CNY: :cny + USDT: :usdt + KZT: :kzt + AWG: :awg + WHOP_USD: :whop_usd + XAU: :xau + + def self?.values: -> ::Array[WhopSDK::Models::Plan::currency] end - type payment_method_configuration = - { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } + type plan_type = :renewal | :one_time - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor include_platform_defaults: bool + module PlanType + extend WhopSDK::Internal::Type::Enum - def initialize: ( - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - ) -> void + RENEWAL: :renewal + ONE_TIME: :one_time - def to_hash: -> { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } + def self?.values: -> ::Array[WhopSDK::Models::Plan::plan_type] end - type product = { id: String, title: String } + type release_method = :buy_now | :waitlist - class Product < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor title: String + module ReleaseMethod + extend WhopSDK::Internal::Type::Enum - def initialize: (id: String, title: String) -> void + BUY_NOW: :buy_now + WAITLIST: :waitlist - def to_hash: -> { id: String, title: String } + def self?.values: -> ::Array[WhopSDK::Models::Plan::release_method] end type three_ds_level = :mandate_challenge | :frictionless @@ -274,6 +382,19 @@ module WhopSDK def self?.values: -> ::Array[WhopSDK::Models::Plan::three_ds_level] end + + type visibility = :visible | :hidden | :archived | :quick_link + + module Visibility + extend WhopSDK::Internal::Type::Enum + + VISIBLE: :visible + HIDDEN: :hidden + ARCHIVED: :archived + QUICK_LINK: :quick_link + + def self?.values: -> ::Array[WhopSDK::Models::Plan::visibility] + end end end end diff --git a/sig/whop_sdk/models/plan_create_params.rbs b/sig/whop_sdk/models/plan_create_params.rbs index 9fe2c5f7..be6a9f53 100644 --- a/sig/whop_sdk/models/plan_create_params.rbs +++ b/sig/whop_sdk/models/plan_create_params.rbs @@ -2,12 +2,12 @@ module WhopSDK module Models type plan_create_params = { - company_id: String, product_id: String, adaptive_pricing_enabled: bool?, billing_period: Integer?, - checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, - currency: WhopSDK::Models::currency?, + checkout_styling: top?, + company_id: String, + currency: String, custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, description: String?, expiration_days: Integer?, @@ -15,19 +15,19 @@ module WhopSDK initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - metadata: ::Hash[Symbol, top]?, - override_tax_type: WhopSDK::Models::tax_type?, + metadata: top?, + override_tax_type: String, payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, + plan_type: String, + release_method: String, renewal_price: Float?, split_pay_required_payments: Integer?, stock: Integer?, - three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level?, + three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level, title: String?, trial_period_days: Integer?, unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility? + visibility: String } & WhopSDK::Internal::Type::request_parameters @@ -35,17 +35,21 @@ module WhopSDK extend WhopSDK::Internal::Type::RequestParameters::Converter include WhopSDK::Internal::Type::RequestParameters - attr_accessor company_id: String - attr_accessor product_id: String attr_accessor adaptive_pricing_enabled: bool? attr_accessor billing_period: Integer? - attr_accessor checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling? + attr_accessor checkout_styling: top? + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader currency: String? - attr_accessor currency: WhopSDK::Models::currency? + def currency=: (String) -> String attr_accessor custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]? @@ -61,15 +65,21 @@ module WhopSDK attr_accessor legacy_payment_method_controls: bool? - attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor metadata: top? - attr_accessor override_tax_type: WhopSDK::Models::tax_type? + attr_reader override_tax_type: String? + + def override_tax_type=: (String) -> String attr_accessor payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration? - attr_accessor plan_type: WhopSDK::Models::plan_type? + attr_reader plan_type: String? + + def plan_type=: (String) -> String + + attr_reader release_method: String? - attr_accessor release_method: WhopSDK::Models::release_method? + def release_method=: (String) -> String attr_accessor renewal_price: Float? @@ -77,7 +87,11 @@ module WhopSDK attr_accessor stock: Integer? - attr_accessor three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level? + attr_reader three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level? + + def three_ds_level=: ( + WhopSDK::Models::PlanCreateParams::three_ds_level + ) -> WhopSDK::Models::PlanCreateParams::three_ds_level attr_accessor title: String? @@ -85,15 +99,17 @@ module WhopSDK attr_accessor unlimited_stock: bool? - attr_accessor visibility: WhopSDK::Models::visibility? + attr_reader visibility: String? + + def visibility=: (String) -> String def initialize: ( - company_id: String, product_id: String, ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, - ?checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, - ?currency: WhopSDK::Models::currency?, + ?checkout_styling: top?, + ?company_id: String, + ?currency: String, ?custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, ?description: String?, ?expiration_days: Integer?, @@ -101,29 +117,29 @@ module WhopSDK ?initial_price: Float?, ?internal_notes: String?, ?legacy_payment_method_controls: bool?, - ?metadata: ::Hash[Symbol, top]?, - ?override_tax_type: WhopSDK::Models::tax_type?, + ?metadata: top?, + ?override_tax_type: String, ?payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, - ?plan_type: WhopSDK::Models::plan_type?, - ?release_method: WhopSDK::Models::release_method?, + ?plan_type: String, + ?release_method: String, ?renewal_price: Float?, ?split_pay_required_payments: Integer?, ?stock: Integer?, - ?three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level?, + ?three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level, ?title: String?, ?trial_period_days: Integer?, ?unlimited_stock: bool?, - ?visibility: WhopSDK::Models::visibility?, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { - company_id: String, product_id: String, adaptive_pricing_enabled: bool?, billing_period: Integer?, - checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, - currency: WhopSDK::Models::currency?, + checkout_styling: top?, + company_id: String, + currency: String, custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, description: String?, expiration_days: Integer?, @@ -131,130 +147,132 @@ module WhopSDK initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - metadata: ::Hash[Symbol, top]?, - override_tax_type: WhopSDK::Models::tax_type?, + metadata: top?, + override_tax_type: String, payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, + plan_type: String, + release_method: String, renewal_price: Float?, split_pay_required_payments: Integer?, stock: Integer?, - three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level?, + three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level, title: String?, trial_period_days: Integer?, unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility?, + visibility: String, request_options: WhopSDK::RequestOptions } - type checkout_styling = - { - background_color: String?, - border_style: WhopSDK::Models::checkout_shape?, - button_color: String?, - font_family: WhopSDK::Models::checkout_font? - } - - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel - attr_accessor background_color: String? - - attr_accessor border_style: WhopSDK::Models::checkout_shape? - - attr_accessor button_color: String? - - attr_accessor font_family: WhopSDK::Models::checkout_font? - - def initialize: ( - ?background_color: String?, - ?border_style: WhopSDK::Models::checkout_shape?, - ?button_color: String?, - ?font_family: WhopSDK::Models::checkout_font? - ) -> void - - def to_hash: -> { - background_color: String?, - border_style: WhopSDK::Models::checkout_shape?, - button_color: String?, - font_family: WhopSDK::Models::checkout_font? - } - end - type custom_field = { - field_type: :text, + id: String, + field_type: WhopSDK::Models::PlanCreateParams::CustomField::field_type, name: String, - id: String?, - order: Integer?, + order: Integer, placeholder: String?, - required: bool? + required: bool } class CustomField < WhopSDK::Internal::Type::BaseModel - attr_accessor field_type: :text + attr_reader id: String? - attr_accessor name: String + def id=: (String) -> String - attr_accessor id: String? + attr_reader field_type: WhopSDK::Models::PlanCreateParams::CustomField::field_type? - attr_accessor order: Integer? + def field_type=: ( + WhopSDK::Models::PlanCreateParams::CustomField::field_type + ) -> WhopSDK::Models::PlanCreateParams::CustomField::field_type + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader order: Integer? + + def order=: (Integer) -> Integer attr_accessor placeholder: String? - attr_accessor required: bool? + attr_reader required: bool? + + def required=: (bool) -> bool def initialize: ( - name: String, - ?id: String?, - ?order: Integer?, + ?id: String, + ?field_type: WhopSDK::Models::PlanCreateParams::CustomField::field_type, + ?name: String, + ?order: Integer, ?placeholder: String?, - ?required: bool?, - ?field_type: :text + ?required: bool ) -> void def to_hash: -> { - field_type: :text, + id: String, + field_type: WhopSDK::Models::PlanCreateParams::CustomField::field_type, name: String, - id: String?, - order: Integer?, + order: Integer, placeholder: String?, - required: bool? + required: bool } + + type field_type = :text + + module FieldType + extend WhopSDK::Internal::Type::Enum + + TEXT: :text + + def self?.values: -> ::Array[WhopSDK::Models::PlanCreateParams::CustomField::field_type] + end end - type image = { id: String } + type image = { id: String, direct_upload_id: String } class Image < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String + attr_reader id: String? + + def id=: (String) -> String - def initialize: (id: String) -> void + attr_reader direct_upload_id: String? - def to_hash: -> { id: String } + def direct_upload_id=: (String) -> String + + def initialize: (?id: String, ?direct_upload_id: String) -> void + + def to_hash: -> { id: String, direct_upload_id: String } end type payment_method_configuration = { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool? + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool } class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] + attr_reader disabled: ::Array[String]? + + def disabled=: (::Array[String]) -> ::Array[String] + + attr_reader enabled: ::Array[String]? + + def enabled=: (::Array[String]) -> ::Array[String] - attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] + attr_reader include_platform_defaults: bool? - attr_accessor include_platform_defaults: bool? + def include_platform_defaults=: (bool) -> bool def initialize: ( - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - ?include_platform_defaults: bool? + ?disabled: ::Array[String], + ?enabled: ::Array[String], + ?include_platform_defaults: bool ) -> void def to_hash: -> { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool? + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool } end diff --git a/sig/whop_sdk/models/plan_list_params.rbs b/sig/whop_sdk/models/plan_list_params.rbs index 6d585055..0cdabf16 100644 --- a/sig/whop_sdk/models/plan_list_params.rbs +++ b/sig/whop_sdk/models/plan_list_params.rbs @@ -3,18 +3,18 @@ module WhopSDK type plan_list_params = { company_id: String, - after: String?, - before: String?, - created_after: Time?, - created_before: Time?, - direction: WhopSDK::Models::direction?, - first: Integer?, - last: Integer?, - order: WhopSDK::Models::PlanListParams::order?, - plan_types: ::Array[WhopSDK::Models::plan_type]?, - product_ids: ::Array[String]?, - release_methods: ::Array[WhopSDK::Models::release_method]?, - visibilities: ::Array[WhopSDK::Models::visibility_filter]? + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::PlanListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::PlanListParams::order, + plan_types: ::Array[String], + product_ids: ::Array[String], + release_methods: ::Array[String], + visibilities: ::Array[String] } & WhopSDK::Internal::Type::request_parameters @@ -24,64 +24,103 @@ module WhopSDK attr_accessor company_id: String - attr_accessor after: String? + attr_reader after: String? - attr_accessor before: String? + def after=: (String) -> String - attr_accessor created_after: Time? + attr_reader before: String? - attr_accessor created_before: Time? + def before=: (String) -> String - attr_accessor direction: WhopSDK::Models::direction? + attr_reader created_after: String? - attr_accessor first: Integer? + def created_after=: (String) -> String - attr_accessor last: Integer? + attr_reader created_before: String? - attr_accessor order: WhopSDK::Models::PlanListParams::order? + def created_before=: (String) -> String - attr_accessor plan_types: ::Array[WhopSDK::Models::plan_type]? + attr_reader direction: WhopSDK::Models::PlanListParams::direction? - attr_accessor product_ids: ::Array[String]? + def direction=: ( + WhopSDK::Models::PlanListParams::direction + ) -> WhopSDK::Models::PlanListParams::direction - attr_accessor release_methods: ::Array[WhopSDK::Models::release_method]? + attr_reader first: Integer? - attr_accessor visibilities: ::Array[WhopSDK::Models::visibility_filter]? + def first=: (Integer) -> Integer + + attr_reader last: Integer? + + def last=: (Integer) -> Integer + + attr_reader order: WhopSDK::Models::PlanListParams::order? + + def order=: ( + WhopSDK::Models::PlanListParams::order + ) -> WhopSDK::Models::PlanListParams::order + + attr_reader plan_types: ::Array[String]? + + def plan_types=: (::Array[String]) -> ::Array[String] + + attr_reader product_ids: ::Array[String]? + + def product_ids=: (::Array[String]) -> ::Array[String] + + attr_reader release_methods: ::Array[String]? + + def release_methods=: (::Array[String]) -> ::Array[String] + + attr_reader visibilities: ::Array[String]? + + def visibilities=: (::Array[String]) -> ::Array[String] def initialize: ( company_id: String, - ?after: String?, - ?before: String?, - ?created_after: Time?, - ?created_before: Time?, - ?direction: WhopSDK::Models::direction?, - ?first: Integer?, - ?last: Integer?, - ?order: WhopSDK::Models::PlanListParams::order?, - ?plan_types: ::Array[WhopSDK::Models::plan_type]?, - ?product_ids: ::Array[String]?, - ?release_methods: ::Array[WhopSDK::Models::release_method]?, - ?visibilities: ::Array[WhopSDK::Models::visibility_filter]?, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::PlanListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::PlanListParams::order, + ?plan_types: ::Array[String], + ?product_ids: ::Array[String], + ?release_methods: ::Array[String], + ?visibilities: ::Array[String], ?request_options: WhopSDK::request_opts ) -> void def to_hash: -> { company_id: String, - after: String?, - before: String?, - created_after: Time?, - created_before: Time?, - direction: WhopSDK::Models::direction?, - first: Integer?, - last: Integer?, - order: WhopSDK::Models::PlanListParams::order?, - plan_types: ::Array[WhopSDK::Models::plan_type]?, - product_ids: ::Array[String]?, - release_methods: ::Array[WhopSDK::Models::release_method]?, - visibilities: ::Array[WhopSDK::Models::visibility_filter]?, + after: String, + before: String, + created_after: String, + created_before: String, + direction: WhopSDK::Models::PlanListParams::direction, + first: Integer, + last: Integer, + order: WhopSDK::Models::PlanListParams::order, + plan_types: ::Array[String], + product_ids: ::Array[String], + release_methods: ::Array[String], + visibilities: ::Array[String], request_options: WhopSDK::RequestOptions } + type direction = :asc | :desc + + module Direction + extend WhopSDK::Internal::Type::Enum + + ASC: :asc + DESC: :desc + + def self?.values: -> ::Array[WhopSDK::Models::PlanListParams::direction] + end + type order = :id | :active_members_count diff --git a/sig/whop_sdk/models/plan_list_response.rbs b/sig/whop_sdk/models/plan_list_response.rbs index 5cd430d7..01324cd6 100644 --- a/sig/whop_sdk/models/plan_list_response.rbs +++ b/sig/whop_sdk/models/plan_list_response.rbs @@ -4,31 +4,31 @@ module WhopSDK { id: String, adaptive_pricing_enabled: bool, - billing_period: Integer?, - company: WhopSDK::Models::PlanListResponse::Company?, - created_at: Time, - currency: WhopSDK::Models::currency, + billing_period: Float?, + company: top?, + created_at: String, + currency: String, description: String?, - expiration_days: Integer?, + expiration_days: Float?, initial_price: Float, internal_notes: String?, - invoice: WhopSDK::Models::PlanListResponse::Invoice?, - member_count: Integer?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type, - product: WhopSDK::Models::PlanListResponse::Product?, + invoice: top?, + member_count: Float?, + metadata: top?, + payment_method_configuration: top?, + plan_type: String, + product: top?, purchase_url: String, - release_method: WhopSDK::Models::release_method, + release_method: String, renewal_price: Float, - split_pay_required_payments: Integer?, - stock: Integer?, - three_ds_level: WhopSDK::Models::PlanListResponse::three_ds_level?, + split_pay_required_payments: Float?, + stock: Float?, + three_ds_level: String?, title: String?, - trial_period_days: Integer?, + trial_period_days: Float?, unlimited_stock: bool, - updated_at: Time, - visibility: WhopSDK::Models::visibility + updated_at: String, + visibility: String } class PlanListResponse < WhopSDK::Internal::Type::BaseModel @@ -36,187 +36,115 @@ module WhopSDK attr_accessor adaptive_pricing_enabled: bool - attr_accessor billing_period: Integer? + attr_accessor billing_period: Float? - attr_accessor company: WhopSDK::Models::PlanListResponse::Company? + attr_accessor company: top? - attr_accessor created_at: Time + attr_accessor created_at: String - attr_accessor currency: WhopSDK::Models::currency + attr_accessor currency: String attr_accessor description: String? - attr_accessor expiration_days: Integer? + attr_accessor expiration_days: Float? attr_accessor initial_price: Float attr_accessor internal_notes: String? - attr_accessor invoice: WhopSDK::Models::PlanListResponse::Invoice? + attr_accessor invoice: top? - attr_accessor member_count: Integer? + attr_accessor member_count: Float? - attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor metadata: top? - attr_accessor payment_method_configuration: WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration? + attr_accessor payment_method_configuration: top? - attr_accessor plan_type: WhopSDK::Models::plan_type + attr_accessor plan_type: String - attr_accessor product: WhopSDK::Models::PlanListResponse::Product? + attr_accessor product: top? attr_accessor purchase_url: String - attr_accessor release_method: WhopSDK::Models::release_method + attr_accessor release_method: String attr_accessor renewal_price: Float - attr_accessor split_pay_required_payments: Integer? + attr_accessor split_pay_required_payments: Float? - attr_accessor stock: Integer? + attr_accessor stock: Float? - attr_accessor three_ds_level: WhopSDK::Models::PlanListResponse::three_ds_level? + attr_accessor three_ds_level: String? attr_accessor title: String? - attr_accessor trial_period_days: Integer? + attr_accessor trial_period_days: Float? attr_accessor unlimited_stock: bool - attr_accessor updated_at: Time + attr_accessor updated_at: String - attr_accessor visibility: WhopSDK::Models::visibility + attr_accessor visibility: String def initialize: ( id: String, adaptive_pricing_enabled: bool, - billing_period: Integer?, - company: WhopSDK::Models::PlanListResponse::Company?, - created_at: Time, - currency: WhopSDK::Models::currency, + billing_period: Float?, + company: top?, + created_at: String, + currency: String, description: String?, - expiration_days: Integer?, + expiration_days: Float?, initial_price: Float, internal_notes: String?, - invoice: WhopSDK::Models::PlanListResponse::Invoice?, - member_count: Integer?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type, - product: WhopSDK::Models::PlanListResponse::Product?, + invoice: top?, + member_count: Float?, + metadata: top?, + payment_method_configuration: top?, + plan_type: String, + product: top?, purchase_url: String, - release_method: WhopSDK::Models::release_method, + release_method: String, renewal_price: Float, - split_pay_required_payments: Integer?, - stock: Integer?, - three_ds_level: WhopSDK::Models::PlanListResponse::three_ds_level?, + split_pay_required_payments: Float?, + stock: Float?, + three_ds_level: String?, title: String?, - trial_period_days: Integer?, + trial_period_days: Float?, unlimited_stock: bool, - updated_at: Time, - visibility: WhopSDK::Models::visibility + updated_at: String, + visibility: String ) -> void def to_hash: -> { id: String, adaptive_pricing_enabled: bool, - billing_period: Integer?, - company: WhopSDK::Models::PlanListResponse::Company?, - created_at: Time, - currency: WhopSDK::Models::currency, + billing_period: Float?, + company: top?, + created_at: String, + currency: String, description: String?, - expiration_days: Integer?, + expiration_days: Float?, initial_price: Float, internal_notes: String?, - invoice: WhopSDK::Models::PlanListResponse::Invoice?, - member_count: Integer?, - metadata: ::Hash[Symbol, top]?, - payment_method_configuration: WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type, - product: WhopSDK::Models::PlanListResponse::Product?, + invoice: top?, + member_count: Float?, + metadata: top?, + payment_method_configuration: top?, + plan_type: String, + product: top?, purchase_url: String, - release_method: WhopSDK::Models::release_method, + release_method: String, renewal_price: Float, - split_pay_required_payments: Integer?, - stock: Integer?, - three_ds_level: WhopSDK::Models::PlanListResponse::three_ds_level?, + split_pay_required_payments: Float?, + stock: Float?, + three_ds_level: String?, title: String?, - trial_period_days: Integer?, + trial_period_days: Float?, unlimited_stock: bool, - updated_at: Time, - visibility: WhopSDK::Models::visibility + updated_at: String, + visibility: String } - - 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 invoice = { id: String } - - class Invoice < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - - type payment_method_configuration = - { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor include_platform_defaults: bool - - def initialize: ( - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - ) -> void - - def to_hash: -> { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } - end - - type product = { id: String, title: String } - - class Product < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor title: String - - def initialize: (id: String, title: String) -> void - - def to_hash: -> { id: String, title: String } - end - - type three_ds_level = :mandate_challenge | :frictionless - - module ThreeDSLevel - extend WhopSDK::Internal::Type::Enum - - MANDATE_CHALLENGE: :mandate_challenge - FRICTIONLESS: :frictionless - - def self?.values: -> ::Array[WhopSDK::Models::PlanListResponse::three_ds_level] - end end end end diff --git a/sig/whop_sdk/models/plan_update_params.rbs b/sig/whop_sdk/models/plan_update_params.rbs index 05667f87..fcc641bf 100644 --- a/sig/whop_sdk/models/plan_update_params.rbs +++ b/sig/whop_sdk/models/plan_update_params.rbs @@ -5,8 +5,8 @@ module WhopSDK id: String, adaptive_pricing_enabled: bool?, billing_period: Integer?, - checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, - currency: WhopSDK::Models::currency?, + checkout_styling: top?, + currency: String, custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, description: String?, expiration_days: Integer?, @@ -14,19 +14,19 @@ module WhopSDK initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - metadata: ::Hash[Symbol, top]?, + metadata: top?, offer_cancel_discount: bool?, - override_tax_type: WhopSDK::Models::tax_type?, + override_tax_type: String, payment_method_configuration: WhopSDK::PlanUpdateParams::PaymentMethodConfiguration?, renewal_price: Float?, stock: Integer?, strike_through_initial_price: Float?, strike_through_renewal_price: Float?, - three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level?, + three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level, title: String?, trial_period_days: Integer?, unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility? + visibility: String } & WhopSDK::Internal::Type::request_parameters @@ -40,9 +40,11 @@ module WhopSDK attr_accessor billing_period: Integer? - attr_accessor checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling? + attr_accessor checkout_styling: top? - attr_accessor currency: WhopSDK::Models::currency? + attr_reader currency: String? + + def currency=: (String) -> String attr_accessor custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]? @@ -58,11 +60,13 @@ module WhopSDK attr_accessor legacy_payment_method_controls: bool? - attr_accessor metadata: ::Hash[Symbol, top]? + attr_accessor metadata: top? attr_accessor offer_cancel_discount: bool? - attr_accessor override_tax_type: WhopSDK::Models::tax_type? + attr_reader override_tax_type: String? + + def override_tax_type=: (String) -> String attr_accessor payment_method_configuration: WhopSDK::PlanUpdateParams::PaymentMethodConfiguration? @@ -74,7 +78,11 @@ module WhopSDK attr_accessor strike_through_renewal_price: Float? - attr_accessor three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level? + attr_reader three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level? + + def three_ds_level=: ( + WhopSDK::Models::PlanUpdateParams::three_ds_level + ) -> WhopSDK::Models::PlanUpdateParams::three_ds_level attr_accessor title: String? @@ -82,14 +90,16 @@ module WhopSDK attr_accessor unlimited_stock: bool? - attr_accessor visibility: WhopSDK::Models::visibility? + attr_reader visibility: String? + + def visibility=: (String) -> String def initialize: ( id: String, ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, - ?checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, - ?currency: WhopSDK::Models::currency?, + ?checkout_styling: top?, + ?currency: String, ?custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, ?description: String?, ?expiration_days: Integer?, @@ -97,19 +107,19 @@ module WhopSDK ?initial_price: Float?, ?internal_notes: String?, ?legacy_payment_method_controls: bool?, - ?metadata: ::Hash[Symbol, top]?, + ?metadata: top?, ?offer_cancel_discount: bool?, - ?override_tax_type: WhopSDK::Models::tax_type?, + ?override_tax_type: String, ?payment_method_configuration: WhopSDK::PlanUpdateParams::PaymentMethodConfiguration?, ?renewal_price: Float?, ?stock: Integer?, ?strike_through_initial_price: Float?, ?strike_through_renewal_price: Float?, - ?three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level?, + ?three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level, ?title: String?, ?trial_period_days: Integer?, ?unlimited_stock: bool?, - ?visibility: WhopSDK::Models::visibility?, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> void @@ -117,8 +127,8 @@ module WhopSDK id: String, adaptive_pricing_enabled: bool?, billing_period: Integer?, - checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, - currency: WhopSDK::Models::currency?, + checkout_styling: top?, + currency: String, custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, description: String?, expiration_days: Integer?, @@ -126,130 +136,132 @@ module WhopSDK initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - metadata: ::Hash[Symbol, top]?, + metadata: top?, offer_cancel_discount: bool?, - override_tax_type: WhopSDK::Models::tax_type?, + override_tax_type: String, payment_method_configuration: WhopSDK::PlanUpdateParams::PaymentMethodConfiguration?, renewal_price: Float?, stock: Integer?, strike_through_initial_price: Float?, strike_through_renewal_price: Float?, - three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level?, + three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level, title: String?, trial_period_days: Integer?, unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility?, + visibility: String, request_options: WhopSDK::RequestOptions } - type checkout_styling = - { - background_color: String?, - border_style: WhopSDK::Models::checkout_shape?, - button_color: String?, - font_family: WhopSDK::Models::checkout_font? - } - - class CheckoutStyling < WhopSDK::Internal::Type::BaseModel - attr_accessor background_color: String? - - attr_accessor border_style: WhopSDK::Models::checkout_shape? - - attr_accessor button_color: String? - - attr_accessor font_family: WhopSDK::Models::checkout_font? - - def initialize: ( - ?background_color: String?, - ?border_style: WhopSDK::Models::checkout_shape?, - ?button_color: String?, - ?font_family: WhopSDK::Models::checkout_font? - ) -> void - - def to_hash: -> { - background_color: String?, - border_style: WhopSDK::Models::checkout_shape?, - button_color: String?, - font_family: WhopSDK::Models::checkout_font? - } - end - type custom_field = { - field_type: :text, + id: String, + field_type: WhopSDK::Models::PlanUpdateParams::CustomField::field_type, name: String, - id: String?, - order: Integer?, + order: Integer, placeholder: String?, - required: bool? + required: bool } class CustomField < WhopSDK::Internal::Type::BaseModel - attr_accessor field_type: :text + attr_reader id: String? + + def id=: (String) -> String + + attr_reader field_type: WhopSDK::Models::PlanUpdateParams::CustomField::field_type? + + def field_type=: ( + WhopSDK::Models::PlanUpdateParams::CustomField::field_type + ) -> WhopSDK::Models::PlanUpdateParams::CustomField::field_type + + attr_reader name: String? - attr_accessor name: String + def name=: (String) -> String - attr_accessor id: String? + attr_reader order: Integer? - attr_accessor order: Integer? + def order=: (Integer) -> Integer attr_accessor placeholder: String? - attr_accessor required: bool? + attr_reader required: bool? + + def required=: (bool) -> bool def initialize: ( - name: String, - ?id: String?, - ?order: Integer?, + ?id: String, + ?field_type: WhopSDK::Models::PlanUpdateParams::CustomField::field_type, + ?name: String, + ?order: Integer, ?placeholder: String?, - ?required: bool?, - ?field_type: :text + ?required: bool ) -> void def to_hash: -> { - field_type: :text, + id: String, + field_type: WhopSDK::Models::PlanUpdateParams::CustomField::field_type, name: String, - id: String?, - order: Integer?, + order: Integer, placeholder: String?, - required: bool? + required: bool } + + type field_type = :text + + module FieldType + extend WhopSDK::Internal::Type::Enum + + TEXT: :text + + def self?.values: -> ::Array[WhopSDK::Models::PlanUpdateParams::CustomField::field_type] + end end - type image = { id: String } + type image = { id: String, direct_upload_id: String } class Image < WhopSDK::Internal::Type::BaseModel - attr_accessor id: String + attr_reader id: String? + + def id=: (String) -> String + + attr_reader direct_upload_id: String? - def initialize: (id: String) -> void + def direct_upload_id=: (String) -> String - def to_hash: -> { id: String } + def initialize: (?id: String, ?direct_upload_id: String) -> void + + def to_hash: -> { id: String, direct_upload_id: String } end type payment_method_configuration = { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool? + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool } class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] + attr_reader disabled: ::Array[String]? + + def disabled=: (::Array[String]) -> ::Array[String] + + attr_reader enabled: ::Array[String]? + + def enabled=: (::Array[String]) -> ::Array[String] - attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] + attr_reader include_platform_defaults: bool? - attr_accessor include_platform_defaults: bool? + def include_platform_defaults=: (bool) -> bool def initialize: ( - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - ?include_platform_defaults: bool? + ?disabled: ::Array[String], + ?enabled: ::Array[String], + ?include_platform_defaults: bool ) -> void def to_hash: -> { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool? + disabled: ::Array[String], + enabled: ::Array[String], + include_platform_defaults: bool } end diff --git a/sig/whop_sdk/resources/plans.rbs b/sig/whop_sdk/resources/plans.rbs index 9c5f4f8b..872d9f2d 100644 --- a/sig/whop_sdk/resources/plans.rbs +++ b/sig/whop_sdk/resources/plans.rbs @@ -2,12 +2,12 @@ module WhopSDK module Resources class Plans def create: ( - company_id: String, product_id: String, ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, - ?checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, - ?currency: WhopSDK::Models::currency?, + ?checkout_styling: top?, + ?company_id: String, + ?currency: String, ?custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, ?description: String?, ?expiration_days: Integer?, @@ -15,19 +15,19 @@ module WhopSDK ?initial_price: Float?, ?internal_notes: String?, ?legacy_payment_method_controls: bool?, - ?metadata: ::Hash[Symbol, top]?, - ?override_tax_type: WhopSDK::Models::tax_type?, + ?metadata: top?, + ?override_tax_type: String, ?payment_method_configuration: WhopSDK::PlanCreateParams::PaymentMethodConfiguration?, - ?plan_type: WhopSDK::Models::plan_type?, - ?release_method: WhopSDK::Models::release_method?, + ?plan_type: String, + ?release_method: String, ?renewal_price: Float?, ?split_pay_required_payments: Integer?, ?stock: Integer?, - ?three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level?, + ?three_ds_level: WhopSDK::Models::PlanCreateParams::three_ds_level, ?title: String?, ?trial_period_days: Integer?, ?unlimited_stock: bool?, - ?visibility: WhopSDK::Models::visibility?, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Plan @@ -40,8 +40,8 @@ module WhopSDK String id, ?adaptive_pricing_enabled: bool?, ?billing_period: Integer?, - ?checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, - ?currency: WhopSDK::Models::currency?, + ?checkout_styling: top?, + ?currency: String, ?custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, ?description: String?, ?expiration_days: Integer?, @@ -49,36 +49,36 @@ module WhopSDK ?initial_price: Float?, ?internal_notes: String?, ?legacy_payment_method_controls: bool?, - ?metadata: ::Hash[Symbol, top]?, + ?metadata: top?, ?offer_cancel_discount: bool?, - ?override_tax_type: WhopSDK::Models::tax_type?, + ?override_tax_type: String, ?payment_method_configuration: WhopSDK::PlanUpdateParams::PaymentMethodConfiguration?, ?renewal_price: Float?, ?stock: Integer?, ?strike_through_initial_price: Float?, ?strike_through_renewal_price: Float?, - ?three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level?, + ?three_ds_level: WhopSDK::Models::PlanUpdateParams::three_ds_level, ?title: String?, ?trial_period_days: Integer?, ?unlimited_stock: bool?, - ?visibility: WhopSDK::Models::visibility?, + ?visibility: String, ?request_options: WhopSDK::request_opts ) -> WhopSDK::Plan def list: ( company_id: String, - ?after: String?, - ?before: String?, - ?created_after: Time?, - ?created_before: Time?, - ?direction: WhopSDK::Models::direction?, - ?first: Integer?, - ?last: Integer?, - ?order: WhopSDK::Models::PlanListParams::order?, - ?plan_types: ::Array[WhopSDK::Models::plan_type]?, - ?product_ids: ::Array[String]?, - ?release_methods: ::Array[WhopSDK::Models::release_method]?, - ?visibilities: ::Array[WhopSDK::Models::visibility_filter]?, + ?after: String, + ?before: String, + ?created_after: String, + ?created_before: String, + ?direction: WhopSDK::Models::PlanListParams::direction, + ?first: Integer, + ?last: Integer, + ?order: WhopSDK::Models::PlanListParams::order, + ?plan_types: ::Array[String], + ?product_ids: ::Array[String], + ?release_methods: ::Array[String], + ?visibilities: ::Array[String], ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::PlanListResponse] diff --git a/test/whop_sdk/resources/plans_test.rb b/test/whop_sdk/resources/plans_test.rb index c9d0a33e..09207eeb 100644 --- a/test/whop_sdk/resources/plans_test.rb +++ b/test/whop_sdk/resources/plans_test.rb @@ -6,7 +6,7 @@ class WhopSDK::Test::Resources::PlansTest < WhopSDK::Test::ResourceTest def test_create_required_params skip("Mock server tests are disabled") - response = @whop.plans.create(company_id: "biz_xxxxxxxxxxxxxx", product_id: "prod_xxxxxxxxxxxxx") + response = @whop.plans.create(product_id: "product_id") assert_pattern do response => WhopSDK::Plan @@ -16,34 +16,34 @@ def test_create_required_params response => { id: String, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, - billing_period: Integer | nil, + billing_period: Float | nil, collect_tax: WhopSDK::Internal::Type::Boolean, - company: WhopSDK::Plan::Company | nil, - created_at: Time, - currency: WhopSDK::Currency, - custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField]), + company: WhopSDK::Internal::Type::Unknown | nil, + created_at: String, + currency: WhopSDK::Plan::Currency, + custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), description: String | nil, - expiration_days: Integer | nil, + expiration_days: Float | nil, initial_price: Float, internal_notes: String | nil, - invoice: WhopSDK::Plan::Invoice | nil, - member_count: Integer | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - payment_method_configuration: WhopSDK::Plan::PaymentMethodConfiguration | nil, - plan_type: WhopSDK::PlanType, - product: WhopSDK::Plan::Product | nil, + invoice: WhopSDK::Internal::Type::Unknown | nil, + member_count: Float | nil, + metadata: WhopSDK::Internal::Type::Unknown | nil, + payment_method_configuration: WhopSDK::Internal::Type::Unknown | nil, + plan_type: WhopSDK::Plan::PlanType, + product: WhopSDK::Internal::Type::Unknown | nil, purchase_url: String, - release_method: WhopSDK::ReleaseMethod, + release_method: WhopSDK::Plan::ReleaseMethod, renewal_price: Float, - split_pay_required_payments: Integer | nil, - stock: Integer | nil, - tax_type: WhopSDK::TaxType, + split_pay_required_payments: Float | nil, + stock: Float | nil, + tax_type: String, three_ds_level: WhopSDK::Plan::ThreeDSLevel | nil, title: String | nil, - trial_period_days: Integer | nil, + trial_period_days: Float | nil, unlimited_stock: WhopSDK::Internal::Type::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility + updated_at: String, + visibility: WhopSDK::Plan::Visibility } end end @@ -51,7 +51,7 @@ def test_create_required_params def test_retrieve skip("Mock server tests are disabled") - response = @whop.plans.retrieve("plan_xxxxxxxxxxxxx") + response = @whop.plans.retrieve("id") assert_pattern do response => WhopSDK::Plan @@ -61,34 +61,34 @@ def test_retrieve response => { id: String, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, - billing_period: Integer | nil, + billing_period: Float | nil, collect_tax: WhopSDK::Internal::Type::Boolean, - company: WhopSDK::Plan::Company | nil, - created_at: Time, - currency: WhopSDK::Currency, - custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField]), + company: WhopSDK::Internal::Type::Unknown | nil, + created_at: String, + currency: WhopSDK::Plan::Currency, + custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), description: String | nil, - expiration_days: Integer | nil, + expiration_days: Float | nil, initial_price: Float, internal_notes: String | nil, - invoice: WhopSDK::Plan::Invoice | nil, - member_count: Integer | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - payment_method_configuration: WhopSDK::Plan::PaymentMethodConfiguration | nil, - plan_type: WhopSDK::PlanType, - product: WhopSDK::Plan::Product | nil, + invoice: WhopSDK::Internal::Type::Unknown | nil, + member_count: Float | nil, + metadata: WhopSDK::Internal::Type::Unknown | nil, + payment_method_configuration: WhopSDK::Internal::Type::Unknown | nil, + plan_type: WhopSDK::Plan::PlanType, + product: WhopSDK::Internal::Type::Unknown | nil, purchase_url: String, - release_method: WhopSDK::ReleaseMethod, + release_method: WhopSDK::Plan::ReleaseMethod, renewal_price: Float, - split_pay_required_payments: Integer | nil, - stock: Integer | nil, - tax_type: WhopSDK::TaxType, + split_pay_required_payments: Float | nil, + stock: Float | nil, + tax_type: String, three_ds_level: WhopSDK::Plan::ThreeDSLevel | nil, title: String | nil, - trial_period_days: Integer | nil, + trial_period_days: Float | nil, unlimited_stock: WhopSDK::Internal::Type::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility + updated_at: String, + visibility: WhopSDK::Plan::Visibility } end end @@ -96,7 +96,7 @@ def test_retrieve def test_update skip("Mock server tests are disabled") - response = @whop.plans.update("plan_xxxxxxxxxxxxx") + response = @whop.plans.update("id") assert_pattern do response => WhopSDK::Plan @@ -106,34 +106,34 @@ def test_update response => { id: String, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, - billing_period: Integer | nil, + billing_period: Float | nil, collect_tax: WhopSDK::Internal::Type::Boolean, - company: WhopSDK::Plan::Company | nil, - created_at: Time, - currency: WhopSDK::Currency, - custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField]), + company: WhopSDK::Internal::Type::Unknown | nil, + created_at: String, + currency: WhopSDK::Plan::Currency, + custom_fields: ^(WhopSDK::Internal::Type::ArrayOf[WhopSDK::Internal::Type::Unknown]), description: String | nil, - expiration_days: Integer | nil, + expiration_days: Float | nil, initial_price: Float, internal_notes: String | nil, - invoice: WhopSDK::Plan::Invoice | nil, - member_count: Integer | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - payment_method_configuration: WhopSDK::Plan::PaymentMethodConfiguration | nil, - plan_type: WhopSDK::PlanType, - product: WhopSDK::Plan::Product | nil, + invoice: WhopSDK::Internal::Type::Unknown | nil, + member_count: Float | nil, + metadata: WhopSDK::Internal::Type::Unknown | nil, + payment_method_configuration: WhopSDK::Internal::Type::Unknown | nil, + plan_type: WhopSDK::Plan::PlanType, + product: WhopSDK::Internal::Type::Unknown | nil, purchase_url: String, - release_method: WhopSDK::ReleaseMethod, + release_method: WhopSDK::Plan::ReleaseMethod, renewal_price: Float, - split_pay_required_payments: Integer | nil, - stock: Integer | nil, - tax_type: WhopSDK::TaxType, + split_pay_required_payments: Float | nil, + stock: Float | nil, + tax_type: String, three_ds_level: WhopSDK::Plan::ThreeDSLevel | nil, title: String | nil, - trial_period_days: Integer | nil, + trial_period_days: Float | nil, unlimited_stock: WhopSDK::Internal::Type::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility + updated_at: String, + visibility: WhopSDK::Plan::Visibility } end end @@ -141,7 +141,7 @@ def test_update def test_list_required_params skip("Mock server tests are disabled") - response = @whop.plans.list(company_id: "biz_xxxxxxxxxxxxxx") + response = @whop.plans.list(company_id: "company_id") assert_pattern do response => WhopSDK::Internal::CursorPage @@ -158,31 +158,31 @@ def test_list_required_params row => { id: String, adaptive_pricing_enabled: WhopSDK::Internal::Type::Boolean, - billing_period: Integer | nil, - company: WhopSDK::Models::PlanListResponse::Company | nil, - created_at: Time, - currency: WhopSDK::Currency, + billing_period: Float | nil, + company: WhopSDK::Internal::Type::Unknown | nil, + created_at: String, + currency: String, description: String | nil, - expiration_days: Integer | nil, + expiration_days: Float | nil, initial_price: Float, internal_notes: String | nil, - invoice: WhopSDK::Models::PlanListResponse::Invoice | nil, - member_count: Integer | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, - payment_method_configuration: WhopSDK::Models::PlanListResponse::PaymentMethodConfiguration | nil, - plan_type: WhopSDK::PlanType, - product: WhopSDK::Models::PlanListResponse::Product | nil, + invoice: WhopSDK::Internal::Type::Unknown | nil, + member_count: Float | nil, + metadata: WhopSDK::Internal::Type::Unknown | nil, + payment_method_configuration: WhopSDK::Internal::Type::Unknown | nil, + plan_type: String, + product: WhopSDK::Internal::Type::Unknown | nil, purchase_url: String, - release_method: WhopSDK::ReleaseMethod, + release_method: String, renewal_price: Float, - split_pay_required_payments: Integer | nil, - stock: Integer | nil, - three_ds_level: WhopSDK::Models::PlanListResponse::ThreeDSLevel | nil, + split_pay_required_payments: Float | nil, + stock: Float | nil, + three_ds_level: String | nil, title: String | nil, - trial_period_days: Integer | nil, + trial_period_days: Float | nil, unlimited_stock: WhopSDK::Internal::Type::Boolean, - updated_at: Time, - visibility: WhopSDK::Visibility + updated_at: String, + visibility: String } end end @@ -190,7 +190,7 @@ def test_list_required_params def test_delete skip("Mock server tests are disabled") - response = @whop.plans.delete("plan_xxxxxxxxxxxxx") + response = @whop.plans.delete("id") assert_pattern do response => WhopSDK::Internal::Type::Boolean From 841a7e24a4b26098671d1bc25ac2cad6a5c01616 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 10 Jun 2026 04:45:59 +0000 Subject: [PATCH 16/17] Add all-time date range to ads reporting Stainless-Generated-From: 4829ee9b476b4d730bb1335ffa66a7f9f0d5ad2d --- lib/whop_sdk/resources/ad_reports.rb | 9 ++++----- rbi/whop_sdk/models/ad_report_retrieve_response.rbi | 8 ++++---- rbi/whop_sdk/resources/ad_reports.rbi | 9 ++++----- sig/whop_sdk/models/granularities.rbs | 6 ++++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/whop_sdk/resources/ad_reports.rb b/lib/whop_sdk/resources/ad_reports.rb index 5a718b1b..97b8d117 100644 --- a/lib/whop_sdk/resources/ad_reports.rb +++ b/lib/whop_sdk/resources/ad_reports.rb @@ -8,11 +8,10 @@ class AdReports # {WhopSDK::Models::AdReportRetrieveParams} for more details. # # Performance report for a company, ad campaigns, ad groups, or ads. Always - # returns aggregate `summary` totals summed across the scope. Set `granularity` - # (`daily`/`hourly`) to additionally get a time series, or set `breakdown` - # (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the - # requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or - # `adIds` must be provided. + # returns aggregate `summary` totals summed across the scope. Set `granularity` to + # additionally get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) + # to additionally get per-entity rows inside the requested scope. Exactly one of + # `companyId`, `adCampaignIds`, `adGroupIds`, or `adIds` must be provided. # # Required permissions: # diff --git a/rbi/whop_sdk/models/ad_report_retrieve_response.rbi b/rbi/whop_sdk/models/ad_report_retrieve_response.rbi index f3264aa3..cdac00f6 100644 --- a/rbi/whop_sdk/models/ad_report_retrieve_response.rbi +++ b/rbi/whop_sdk/models/ad_report_retrieve_response.rbi @@ -225,7 +225,7 @@ module WhopSDK sig { returns(Integer) } attr_accessor :clicks - # The bucket size of this row (`daily` or `hourly`). + # The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). sig { returns(WhopSDK::Granularities::TaggedSymbol) } attr_accessor :granularity @@ -294,7 +294,7 @@ module WhopSDK bucket_start:, # Clicks in this bucket. clicks:, - # The bucket size of this row (`daily` or `hourly`). + # The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). granularity:, # Impressions in this bucket. impressions:, @@ -549,7 +549,7 @@ module WhopSDK sig { returns(Integer) } attr_accessor :clicks - # The bucket size of this row (`daily` or `hourly`). + # The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). sig { returns(WhopSDK::Granularities::TaggedSymbol) } attr_accessor :granularity @@ -618,7 +618,7 @@ module WhopSDK bucket_start:, # Clicks in this bucket. clicks:, - # The bucket size of this row (`daily` or `hourly`). + # The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). granularity:, # Impressions in this bucket. impressions:, diff --git a/rbi/whop_sdk/resources/ad_reports.rbi b/rbi/whop_sdk/resources/ad_reports.rbi index 82a26556..0f10ac7c 100644 --- a/rbi/whop_sdk/resources/ad_reports.rbi +++ b/rbi/whop_sdk/resources/ad_reports.rbi @@ -5,11 +5,10 @@ module WhopSDK # Ad reports class AdReports # Performance report for a company, ad campaigns, ad groups, or ads. Always - # returns aggregate `summary` totals summed across the scope. Set `granularity` - # (`daily`/`hourly`) to additionally get a time series, or set `breakdown` - # (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the - # requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or - # `adIds` must be provided. + # returns aggregate `summary` totals summed across the scope. Set `granularity` to + # additionally get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) + # to additionally get per-entity rows inside the requested scope. Exactly one of + # `companyId`, `adCampaignIds`, `adGroupIds`, or `adIds` must be provided. # # Required permissions: # diff --git a/sig/whop_sdk/models/granularities.rbs b/sig/whop_sdk/models/granularities.rbs index fbedee53..71e0dbdb 100644 --- a/sig/whop_sdk/models/granularities.rbs +++ b/sig/whop_sdk/models/granularities.rbs @@ -1,12 +1,14 @@ module WhopSDK module Models - type granularities = :daily | :hourly + type granularities = :hourly | :daily | :weekly | :monthly module Granularities extend WhopSDK::Internal::Type::Enum - DAILY: :daily HOURLY: :hourly + DAILY: :daily + WEEKLY: :weekly + MONTHLY: :monthly def self?.values: -> ::Array[WhopSDK::Models::granularities] end From 2ba4cbc031acb53f9914ccf32cd59ed9bffc6efc Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Wed, 10 Jun 2026 05:01:51 +0000 Subject: [PATCH 17/17] Track stablecoin withdrawals via the native financial-activity API Stainless-Generated-From: 5fbb4e0d1583764d4e06678d334ebeaff9b37809 --- .../financial_activity_list_response.rb | 88 ++++++++++- .../financial_activity_list_response.rbi | 139 +++++++++++++++++- .../financial_activity_list_response.rbs | 63 +++++++- 3 files changed, 282 insertions(+), 8 deletions(-) diff --git a/lib/whop_sdk/models/financial_activity_list_response.rb b/lib/whop_sdk/models/financial_activity_list_response.rb index 77bfd25d..12b5b2a9 100644 --- a/lib/whop_sdk/models/financial_activity_list_response.rb +++ b/lib/whop_sdk/models/financial_activity_list_response.rb @@ -31,6 +31,11 @@ class Data < WhopSDK::Internal::Type::BaseModel # @return [String] required :amount, String + # @!attribute created_at + # + # @return [Time, nil] + required :created_at, Time, nil?: true + # @!attribute currency # # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] @@ -63,11 +68,13 @@ class Data < WhopSDK::Internal::Type::BaseModel # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Source, nil] required :source, -> { WhopSDK::Models::FinancialActivityListResponse::Data::Source }, nil?: true - # @!method initialize(id:, amount:, currency:, line_type:, object:, posted_at:, resource:, source:) + # @!method initialize(id:, amount:, created_at:, currency:, line_type:, object:, posted_at:, resource:, source:) # @param id [String] # # @param amount [String] Signed amount in the currency's smallest precision units. # + # @param created_at [Time, nil] + # # @param currency [WhopSDK::Models::FinancialActivityListResponse::Data::Currency] # # @param line_type [String] @@ -542,9 +549,86 @@ class Source < WhopSDK::Internal::Type::BaseModel # @return [String] required :object, String - # @!method initialize(id:, object:) + # @!attribute created_at + # Withdrawal creation time as an ISO 8601 timestamp (withdrawal sources only; + # requires payout:withdrawal:read). + # + # @return [Time, nil] + optional :created_at, Time, nil?: true + + # @!attribute estimated_arrival + # Estimated arrival as an ISO 8601 timestamp (withdrawal sources only; requires + # payout:withdrawal:read). + # + # @return [Time, nil] + optional :estimated_arrival, Time, nil?: true + + # @!attribute payer_name + # Name of the entity processing the payout (withdrawal sources only; requires + # payout:withdrawal:read). + # + # @return [String, nil] + optional :payer_name, String, nil?: true + + # @!attribute payout_destination + # Payout destination display info (withdrawal sources only). + # + # @return [WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination, nil] + optional :payout_destination, + -> { WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination }, + nil?: true + + # @!attribute payout_token_nickname + # Saved payout destination nickname (withdrawal sources only). + # + # @return [String, nil] + optional :payout_token_nickname, String, nil?: true + + # @!attribute status + # Withdrawal lifecycle status (withdrawal sources only; requires + # payout:withdrawal:read). + # + # @return [String, nil] + optional :status, String, nil?: true + + # @!method initialize(id:, object:, created_at: nil, estimated_arrival: nil, payer_name: nil, payout_destination: nil, payout_token_nickname: nil, status: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::FinancialActivityListResponse::Data::Source} for more details. + # # @param id [String] + # # @param object [String] + # + # @param created_at [Time, nil] Withdrawal creation time as an ISO 8601 timestamp (withdrawal sources only; requ + # + # @param estimated_arrival [Time, nil] Estimated arrival as an ISO 8601 timestamp (withdrawal sources only; requires pa + # + # @param payer_name [String, nil] Name of the entity processing the payout (withdrawal sources only; requires payo + # + # @param payout_destination [WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination, nil] Payout destination display info (withdrawal sources only). + # + # @param payout_token_nickname [String, nil] Saved payout destination nickname (withdrawal sources only). + # + # @param status [String, nil] Withdrawal lifecycle status (withdrawal sources only; requires payout:withdrawal + + # @see WhopSDK::Models::FinancialActivityListResponse::Data::Source#payout_destination + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + # @!attribute icon_url + # + # @return [String, nil] + optional :icon_url, String, nil?: true + + # @!attribute payer_name + # + # @return [String, nil] + optional :payer_name, String, nil?: true + + # @!method initialize(icon_url: nil, payer_name: nil) + # Payout destination display info (withdrawal sources only). + # + # @param icon_url [String, nil] + # @param payer_name [String, nil] + end end end diff --git a/rbi/whop_sdk/models/financial_activity_list_response.rbi b/rbi/whop_sdk/models/financial_activity_list_response.rbi index e6db1b7d..fbc9af7d 100644 --- a/rbi/whop_sdk/models/financial_activity_list_response.rbi +++ b/rbi/whop_sdk/models/financial_activity_list_response.rbi @@ -68,6 +68,9 @@ module WhopSDK sig { returns(String) } attr_accessor :amount + sig { returns(T.nilable(Time)) } + attr_accessor :created_at + sig do returns( WhopSDK::Models::FinancialActivityListResponse::Data::Currency @@ -128,6 +131,7 @@ module WhopSDK params( id: String, amount: String, + created_at: T.nilable(Time), currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency::OrHash, line_type: String, @@ -154,6 +158,7 @@ module WhopSDK id:, # Signed amount in the currency's smallest precision units. amount:, + created_at:, currency:, line_type:, object:, @@ -168,6 +173,7 @@ module WhopSDK { id: String, amount: String, + created_at: T.nilable(Time), currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, line_type: String, @@ -1095,13 +1101,140 @@ module WhopSDK sig { returns(String) } attr_accessor :object - sig { params(id: String, object: String).returns(T.attached_class) } - def self.new(id:, object:) + # Withdrawal creation time as an ISO 8601 timestamp (withdrawal sources only; + # requires payout:withdrawal:read). + sig { returns(T.nilable(Time)) } + attr_accessor :created_at + + # Estimated arrival as an ISO 8601 timestamp (withdrawal sources only; requires + # payout:withdrawal:read). + sig { returns(T.nilable(Time)) } + attr_accessor :estimated_arrival + + # Name of the entity processing the payout (withdrawal sources only; requires + # payout:withdrawal:read). + sig { returns(T.nilable(String)) } + attr_accessor :payer_name + + # Payout destination display info (withdrawal sources only). + sig do + returns( + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination + ) + ) + end + attr_reader :payout_destination + + sig do + params( + payout_destination: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination::OrHash + ) + ).void + end + attr_writer :payout_destination + + # Saved payout destination nickname (withdrawal sources only). + sig { returns(T.nilable(String)) } + attr_accessor :payout_token_nickname + + # Withdrawal lifecycle status (withdrawal sources only; requires + # payout:withdrawal:read). + sig { returns(T.nilable(String)) } + attr_accessor :status + + sig do + params( + id: String, + object: String, + created_at: T.nilable(Time), + estimated_arrival: T.nilable(Time), + payer_name: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination::OrHash + ), + payout_token_nickname: T.nilable(String), + status: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + id:, + object:, + # Withdrawal creation time as an ISO 8601 timestamp (withdrawal sources only; + # requires payout:withdrawal:read). + created_at: nil, + # Estimated arrival as an ISO 8601 timestamp (withdrawal sources only; requires + # payout:withdrawal:read). + estimated_arrival: nil, + # Name of the entity processing the payout (withdrawal sources only; requires + # payout:withdrawal:read). + payer_name: nil, + # Payout destination display info (withdrawal sources only). + payout_destination: nil, + # Saved payout destination nickname (withdrawal sources only). + payout_token_nickname: nil, + # Withdrawal lifecycle status (withdrawal sources only; requires + # payout:withdrawal:read). + status: nil + ) end - sig { override.returns({ id: String, object: String }) } + sig do + override.returns( + { + id: String, + object: String, + created_at: T.nilable(Time), + estimated_arrival: T.nilable(Time), + payer_name: T.nilable(String), + payout_destination: + T.nilable( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination + ), + payout_token_nickname: T.nilable(String), + status: T.nilable(String) + } + ) + end def to_hash end + + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + sig { returns(T.nilable(String)) } + attr_accessor :payer_name + + # Payout destination display info (withdrawal sources only). + sig do + params( + icon_url: T.nilable(String), + payer_name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(icon_url: nil, payer_name: nil) + end + + sig do + override.returns( + { icon_url: T.nilable(String), payer_name: T.nilable(String) } + ) + end + def to_hash + end + end end end diff --git a/sig/whop_sdk/models/financial_activity_list_response.rbs b/sig/whop_sdk/models/financial_activity_list_response.rbs index 3a42b265..67046bda 100644 --- a/sig/whop_sdk/models/financial_activity_list_response.rbs +++ b/sig/whop_sdk/models/financial_activity_list_response.rbs @@ -25,6 +25,7 @@ module WhopSDK { id: String, amount: String, + created_at: Time?, currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, line_type: String, object: WhopSDK::Models::FinancialActivityListResponse::Data::object, @@ -38,6 +39,8 @@ module WhopSDK attr_accessor amount: String + attr_accessor created_at: Time? + attr_accessor currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency attr_accessor line_type: String @@ -53,6 +56,7 @@ module WhopSDK def initialize: ( id: String, amount: String, + created_at: Time?, currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, line_type: String, object: WhopSDK::Models::FinancialActivityListResponse::Data::object, @@ -64,6 +68,7 @@ module WhopSDK def to_hash: -> { id: String, amount: String, + created_at: Time?, currency: WhopSDK::Models::FinancialActivityListResponse::Data::Currency, line_type: String, object: WhopSDK::Models::FinancialActivityListResponse::Data::object, @@ -520,16 +525,68 @@ module WhopSDK def self?.variants: -> ::Array[WhopSDK::Models::FinancialActivityListResponse::Data::resource] end - type source = { id: String, object: String } + type source = + { + id: String, + object: String, + created_at: Time?, + estimated_arrival: Time?, + payer_name: String?, + payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination?, + payout_token_nickname: String?, + status: String? + } class Source < WhopSDK::Internal::Type::BaseModel attr_accessor id: String attr_accessor object: String - def initialize: (id: String, object: String) -> void + attr_accessor created_at: Time? + + attr_accessor estimated_arrival: Time? + + attr_accessor payer_name: String? + + attr_accessor payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination? + + attr_accessor payout_token_nickname: String? + + attr_accessor status: String? + + def initialize: ( + id: String, + object: String, + ?created_at: Time?, + ?estimated_arrival: Time?, + ?payer_name: String?, + ?payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination?, + ?payout_token_nickname: String?, + ?status: String? + ) -> void - def to_hash: -> { id: String, object: String } + def to_hash: -> { + id: String, + object: String, + created_at: Time?, + estimated_arrival: Time?, + payer_name: String?, + payout_destination: WhopSDK::Models::FinancialActivityListResponse::Data::Source::PayoutDestination?, + payout_token_nickname: String?, + status: String? + } + + type payout_destination = { icon_url: String?, payer_name: String? } + + class PayoutDestination < WhopSDK::Internal::Type::BaseModel + attr_accessor icon_url: String? + + attr_accessor payer_name: String? + + def initialize: (?icon_url: String?, ?payer_name: String?) -> void + + def to_hash: -> { icon_url: String?, payer_name: String? } + end end end